diff --git a/judge/runguard_test/runguard_test.sh b/judge/runguard_test/runguard_test.sh index 11cb753ea3e..db66a916c83 100755 --- a/judge/runguard_test/runguard_test.sh +++ b/judge/runguard_test/runguard_test.sh @@ -232,7 +232,7 @@ test_nprocs() { fi not_expect_stdout 16 not_expect_stdout 31 - expect_stderr "retry: Resource temporarily unavailable" + expect_stderr "Resource temporarily unavailable" } test_meta() { diff --git a/lib/libcgroup-3.1.0/.gitignore b/lib/libcgroup-3.1.0/.gitignore deleted file mode 100644 index 4f13bce0836..00000000000 --- a/lib/libcgroup-3.1.0/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/Makefile - -config.h -config.log -config.status -stamp-h1 - -libtool -libcgroup.pc - -**/.deps/ - -scripts/init.d/cgconfig -scripts/init.d/cgred diff --git a/lib/libcgroup-3.1.0/CONTRIBUTING.md b/lib/libcgroup-3.1.0/CONTRIBUTING.md deleted file mode 100644 index a77aa6d8f41..00000000000 --- a/lib/libcgroup-3.1.0/CONTRIBUTING.md +++ /dev/null @@ -1,184 +0,0 @@ -How to Contribute to the libcgroup Project -=============================================================================== -https://github.com/libcgroup/libcgroup - -This document outlines the steps to help you contribute to the libcgroup project. -As with the libcgroup code itself, the process is a work in progress. -Improvements and suggestions are welcome and encouraged. - -## Interacting with the Community - -> "When you are kind to others, it not only changes you, it changes the -> world." - Harold Kushner - -The libcgroup project strives to be an inclusive and welcoming place. -If you interact with the libcgroup project, we request that you treat others -with dignity and respect. Failure to do so will result in a warning. In -extreme cases, we reserve the right to block the individual from the project. - -Examples of inappropriate behavior includes: profane, abusive, or prejudicial -language directed at another person, vandalism (e.g. GitHub issue/PR "litter"), -or spam. - -## Test Your Code Using Existing Tests - -The libcgroup project utilizes unit and functional tests. These tests must -successfully pass prior to a commit being merged. - -You can run both the unit and functional tests with the following command: - - # make check - -You can invoke only the unit tests with the following commands: - - # cd tests/gunit - # make check - -If there are unit test failures, running the unit tests outside of the -automake framework will provide more information. - - # cd tests/gunit - # ./gtest - -You can invoke only the functional tests with the following commands: - - # cd tests/ftests - # make check - -Note that the functional tests can be run within a container or directly on -your system. For the containerized tests, libcgroup utilizes LXC/LXD -containers. If your system or distro doesn't support LXC/LXD, you can -utilize the continuous integration infrastructure to test your changes. A -successful continuous integration run is required for each pull request. - -Many tests can also be run outside of a container. Use caution with these -tests though, as they will modify your host's cgroup hierarchy. This could -significantly and negatively affect your system. - -We encourage utilizing a VM for libcgroup development work. The continuous -integration suite utilizes the latest Ubuntu LTS. - -To run the containerized tests only: - - # cd tests/ftests - # ./ftests.sh - -To run the non-containerized tests only: - - # cd tests/ftests - # ./ftests-nocontainer.sh - -After the run is complete, the ftests.sh.log and ftests-nocontainer.sh.log -contain the full debug log for each run. - -## Add New Tests for New Functionality - -The libcgroup project utilizes automated tests, code coverage, and continuous -integration to maintain a high level of code quality. Any pull requests that -add functionality or significantly change existing code should include -additional tests to verify the proper operation of the proposed changes. Note -that functional tests are preferred over unit tests. - -The continuous integration tools run the automated tests and automatically -gather code coverage numbers. Pull requests that cause the code coverage -numbers to decrease are strongly discouraged. - -## Explain Your Work - -At the top of every patch you should include a description of the problem you -are trying to solve, how you solved it, and why you chose the solution you -implemented. If you are submitting a bug fix, it is also incredibly helpful -if you can describe/include a reproducer for the problem in the description as -well as instructions on how to test for the bug and verify that it has been -fixed. - -## Sign Your Work - -The sign-off is a simple line at the end of the patch description, which -certifies that you wrote it or otherwise have the right to pass it on as an -open-source patch. The "Developer's Certificate of Origin" pledge is taken -from the Linux Kernel and the rules are pretty simple: - - Developer's Certificate of Origin 1.1 - - By making a contribution to this project, I certify that: - - (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - - (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - - (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -... then you just add a line to the bottom of your patch description, with -your real name, saying: - - Signed-off-by: Random J Developer - -You can add this to your commit description in `git` with `git commit -s` - -## Submitting Patches - -libcgroup was initially hosted on Sourceforge and at that time only accepted -patches via the mailing list. In 2018, libcgroup was moved to github and now -accepts patches via email or github pull request. Over time the libcgroup -project will likely fully transition to gitub pull requests and issues. - -### Post Your Patches Upstream - -The sections below explain how to contribute via either method. Please read -each step and perform all steps that apply to your chosen contribution method. - -### Submitting via Email - -Depending on how you decided to work with the libcgroup code base and what -tools you are using there are different ways to generate your patch(es). -However, regardless of what tools you use, you should always generate your -patches using the "unified" diff/patch format and the patches should always -apply to the libcgroup source tree using the following command from the top -directory of the libcgroup sources: - - # patch -p1 < changes.patch - -If you are not using git, stacked git (stgit), or some other tool which can -generate patch files for you automatically, you may find the following command -helpful in generating patches, where "libcgroup.orig/" is the unmodified -source code directory and "libcgroup/" is the source code directory with your -changes: - - # diff -purN libcgroup.orig/ libcgroup/ - -When in doubt please generate your patch and try applying it to an unmodified -copy of the libcgroup sources; if it fails for you, it will fail for the rest -of us. - -Finally, you will need to email your patches to the mailing list so they can -be reviewed and potentially merged into the main libcgroup repository. When -sending patches to the mailing list it is important to send your email in text -form, no HTML mail please, and ensure that your email client does not mangle -your patches. It should be possible to save your raw email to disk and apply -it directly to the libcgroup source code; if that fails then you likely have -a problem with your email client. When in doubt try a test first by sending -yourself an email with your patch and attempting to apply the emailed patch to -the libcgrup repository; if it fails for you, it will fail for the rest of -us trying to test your patch and include it in the main libcgroup repository. - -### Submitting via GitHub Pull Requests - -See [this guide](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) if you've never done this before. - diff --git a/lib/libcgroup-3.1.0/COPYING b/lib/libcgroup-3.1.0/COPYING deleted file mode 100644 index 1bf76215682..00000000000 --- a/lib/libcgroup-3.1.0/COPYING +++ /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/lib/libcgroup-3.1.0/INSTALL b/lib/libcgroup-3.1.0/INSTALL deleted file mode 100644 index d3c5b40a940..00000000000 --- a/lib/libcgroup-3.1.0/INSTALL +++ /dev/null @@ -1,237 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - -You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/lib/libcgroup-3.1.0/Makefile.am b/lib/libcgroup-3.1.0/Makefile.am deleted file mode 100644 index 277e7402209..00000000000 --- a/lib/libcgroup-3.1.0/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS= -I m4 -DIST_SUBDIRS = dist doc include scripts src tests samples -SUBDIRS = $(DIST_SUBDIRS) - -EXTRA_DIST = README_daemon libcgroup.doxyfile README_systemd CONTRIBUTING.md - -AM_DISTCHECK_CONFIGURE_FLAGS = --sysconfdir=/etc --localstatedir=/var \ - --enable-opaque-hierarchy="name=systemd" \ - --enable-python - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libcgroup.pc diff --git a/lib/libcgroup-3.1.0/Makefile.in b/lib/libcgroup-3.1.0/Makefile.in deleted file mode 100644 index c6c20ad7869..00000000000 --- a/lib/libcgroup-3.1.0/Makefile.in +++ /dev/null @@ -1,937 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = scripts/init.d/cgconfig scripts/init.d/cgred \ - include/libcgroup/init.h libcgroup.pc -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ - config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/libcgroup.pc.in $(top_srcdir)/build-aux/ar-lib \ - $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/missing \ - $(top_srcdir)/include/libcgroup/init.h.in \ - $(top_srcdir)/scripts/init.d/cgconfig.in \ - $(top_srcdir)/scripts/init.d/cgred.in COPYING INSTALL README \ - build-aux/ar-lib build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/ltmain.sh build-aux/missing build-aux/ylwrap -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 -GZIP_ENV = --best -DIST_TARGETS = dist-bzip2 dist-gzip -# Exists only to be overridden by the user if desired. -AM_DISTCHECK_DVI_TARGET = dvi -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I m4 -DIST_SUBDIRS = dist doc include scripts src tests samples -SUBDIRS = $(DIST_SUBDIRS) -EXTRA_DIST = README_daemon libcgroup.doxyfile README_systemd CONTRIBUTING.md -AM_DISTCHECK_CONFIGURE_FLAGS = --sysconfdir=/etc --localstatedir=/var \ - --enable-opaque-hierarchy="name=systemd" \ - --enable-python - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libcgroup.pc -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -scripts/init.d/cgconfig: $(top_builddir)/config.status $(top_srcdir)/scripts/init.d/cgconfig.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -scripts/init.d/cgred: $(top_builddir)/config.status $(top_srcdir)/scripts/init.d/cgred.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -include/libcgroup/init.h: $(top_builddir)/config.status $(top_srcdir)/include/libcgroup/init.h.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libcgroup.pc: $(top_builddir)/config.status $(srcdir)/libcgroup.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-zstd: distdir - tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - *.tar.zst*) \ - zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile $(DATA) config.h -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-pkgconfigDATA - -.MAKE: $(am__recursive_targets) all install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - clean-libtool cscope cscopelist-am ctags ctags-am dist \ - dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip dist-zstd distcheck distclean \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-pkgconfigDATA - -.PRECIOUS: Makefile - - -# 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/lib/libcgroup-3.1.0/README b/lib/libcgroup-3.1.0/README deleted file mode 100644 index 882c9ad22a1..00000000000 --- a/lib/libcgroup-3.1.0/README +++ /dev/null @@ -1,183 +0,0 @@ -Design -======== - -After cgroup system has taken shape, its time to have some basic tools -in user space which can enable a user to use the resource management -functionality effectively. - -One of the needed functionality is rule based placement of a task. In general, -there can be either uid or gid or exec based rules. Admin/root will -control/enforce uid/gid based rules and exec based rules can be defined by -user in a config file residing in user's home dir and fully controlled by user. - -uid/gid based rules will be defined in /etc/cgrules.conf config file and -this file will be managed by root. - -Basic idea is that to begin with provide facility to implement rules -based on uid and gid. So a hierarchy might look like as follows. - - /mnt/cgroup - | | - gid1 gid2 - | | - uid1 uid2 - | | - proj1 proj2 - - -Admin will write rules to control the resources among users. Then users -can manage their own cgroup at their own (proj1 and proj2) and control -the resources as they want. - -Following are the few methods using which tasks can be placed in right -cgroups. - -- Use pam_cgroup PAM plugin which will make sure users are placed in right - cgroup at login time and any tasks launch after login, will continue to run - in user's cgroup. - -- Use command line tool "cgexec" to launch the task in right cgroup. - -- Modify the program and use libcgroup provided APIs for placing a task - in right cgroup before doing exec(). - -- Use "cgclassify" tool to classify a already running task. - -- May be, a user space daemon can also be implemented which will listen to - kernel events and place the task in right group based on the rules. - This method involves few concerns. - - - Reliability of netlink socket. Messages can be dropped. - - Change the netlink with a cgroup controller which exports the - events. - - - Delay incurred since the event took place and task was actually placed - in right cgroup. - - - daemon will interfere with container's tasks which is not desired. - -HOWTO -===== - -Section 1: ----------- -To use "cgexec" to place the task in right cgroup. - -- make cgexec -- Run a task using cgexec. Following is the cgexec syntax. - - cgexec [-g :] command [arguments] - - Note: Cgroup controllers and path are optional. If user does not know the - right cgroup, cgexec will automatically place the task in right - cgroup based on /etc/cgrules.conf - -Example: - cgexec -g *:test1 ls - cgexec -g cpu,memory:test1 ls -l - cgexec -g cpu,memory:test1 -g swap:test2 ls -l - -Section 2 ---------- -To use "cgclassify" to place task in right cgroup. - -- make cgclassify -- Pick a task's pid to be classified, and run - cgclassify - -Example: --------- - cgclassify 2140 4325 - - Note: After classification check out whether tasks 2140 and 4325 - are in the right cgroup or not (Based on rules in /etc/cgrules.conf) - -Section 3: ----------- -To use a pam plugin which will automatically place the task in right -cgroup upon login. - -- Build pam_cgroup.so - make pam_cgroup.so -- Copy pam_cgroup.so to /lib/security/ -- Edit /etc/pam.d/su to make use of pam_cgroup.so session module upon - execution of su. - -example: - Add following line at the end of /etc/pam.d/su file - -session optional pam_cgroup.so - -- Now launch a shell for a user "xyz" using su and the resulting shell - should be running in the cgroup designated for the user as specified - by cgrules.conf - - ex. "su test1" - -Try similar things with other services like sshd. - -Note: pam_cgroup.so moves the service providing process in the right cgroup - and not the process which will be launched later. Due to parent child - relationship, yet to be forked/execed process will launch in right - group. - -Ex. Lets say user root does "su test1". In this case process "su" is the - one providing service (launching a shell) for user "test1". pam_cgroup.so - will move process "su" to the user "test1"'s cgroup (Decided by the uid - and gid of "test1"). Now once su forks/execs a shell for user test1, - final shell is effectively running in the cgroup it should have been - running based on /etc/cgrules.conf for user test1. - - -Section 4: ----------- -To use cgrulesengd which will move a task to right cgroup based on -rules in /etc/cgrules.conf do following. - -- build and install latest libcgroup.so -- build cgrulesengd - make cgrulesengd -- specify some uid/gid based rules in /etc/cgrules.conf -- Mount some controllers and create an hierarchy of cgroups (matching - your rules). -- Run cgrulesengd. - - ./cgrulesengd -- Launch some task or login as a user to the system. Daemon should automatically - place the task in right cgroup. - -FAQ -=== -Q. Why admin should not control "exec" based rules. -A. Unix file system provides access control only based on uid/gid. So - even if admin starts putting tasks based on uid/gid, it can't enforce - it. For example, consider following scenario. - - Lets say an admin creates following cgroup hierarchy. - - /container - | | - database browser - | | | | - user1 user2 user1 user2 - - Now admin wants to run all the database jobs under /container/database/ - and all the firefox jobs under /container/browser/. Based on which user - launched it, jobs should go in either user1 or user2 dir. - - Now assume that database subdir has to more cpu resources as compared to - browser subdir. Then a user, say user2, can always move his browser job - also to /container/database/user2 dir to get more cpu resources and - admin will not be able to control that. - - [Note: user2 will control what tasks can be added in /container/database/user2 - and will control what further subdirs can be created under user2 dir. Root - should not restrict the control to root only for practical purposes. Its - something like that till /container/database, admin controls the resources - and below that how resources are further subdivided among various projects - should be controlled by respective user]. - -In the light of above, it seems to make more sense that admin should enforce -rules only based on uid and gid. Probably later we can have a per user exec -based rules config file (~/.cgrules.conf), which can be parsed by cgrulesengd -and then jobs launched by user will be placed in right cgroup based on -combination of rules in /etc/cgrules.conf and ~/cgrules.conf. diff --git a/lib/libcgroup-3.1.0/README_daemon b/lib/libcgroup-3.1.0/README_daemon deleted file mode 100644 index 25f0d55075d..00000000000 --- a/lib/libcgroup-3.1.0/README_daemon +++ /dev/null @@ -1,182 +0,0 @@ -DESCRIPTION -=========== -The CGroup Rules Engine Daemon is a tool that will automatically place tasks -into the correct cgroup based on UID/GID events from the kernel. It will not -automatically classify tasks that are already running, but it will classify -any new tasks, and any tasks which change their UID/GID. Note that we use -the euid and egid, not the ruid and rgid. - -Unlike other tools, cgrulesengd caches the rules configuration in a data -structure (it's actually just a FIFO linked list) so that it doesn't need to -parse the configuration file more than once. This should be much faster than -parsing the rules for each UID/GID event. Eventually, this caching logic -should be part of libcgroup, so that any other program can take advantage of it -(and so that all programs are using the same table). The configuration can -be reloaded without stopping the daemon (more information below). - -WHY A DAEMON? -============= -A daemon is easy to use, and allows an administrator to ensure that all tasks -are classified into the correct cgroups without constantly monitoring the -system. The daemon is transparent to the users, and does not require any -modifications to existing userspace programs. Finally, the daemon can be -started and stopped at any time, including at boot time with other services. -Thus, sytem administrators can decide not to use the daemon if they choose. - -Most importantly, some programs create new users and/or run scripts, -threads, etc. as those users using suexec(). This call does not go through -PAM, so these scripts would continue running in the same cgroup as the parent -program. This behavior is likely not ideal, and the daemon would solve this -problem. - -Apache does this. Apache creates a user called 'apache' and uses setuid() to -launch tasks as that user. This does not go through PAM, so without a daemon, -these tasks would continue to run in the 'root' cgroup rather than in the -'apache' or 'webserver' cgroup. The daemon fixes this problem by catching the -setuid() call and moving the tasks into the correct cgroup. - -We would ask Apache to modify their software to interface with libcgroup, but -this solution is less than optimal because a lot of userspace software would -have to be changed, and some authors might intentionally not interact with -libcgroup, which could create an exploit. The daemon is a simple, transparent -solution. - -USING THE DAEMON -================ -The daemon can be used as a service with the cgred script, which is shipped -as scripts/init.d/cgred. This script should be installed as /etc/init.d/cgred -and used like any other service. To start the daemon, - /etc/init.d/cgred start -To stop it, - /etc/init.d/cgred stop -The restart (stop,start), condrestart (same as restart, but only if the daemon -was already started), and status (print whether the daemon is started or -stopped) commands are also supported. An additional command, "reload", allows -you to reload the configuration file without stopping the daemon. - /etc/init.d/cgred reload -The cgred script automatically loads configuration from /etc/sysconfig/cgred.conf, -which is shipped as samples/cgred.conf. See that file for more information. - -If you choose not to run the daemon as a service, the following options are -currently supported: - --nodaemon Do not run as a daemon - --nolog Write log output to stdout instead of a log file - --config [FILE] Read rules configuration from FILE instead of - /etc/cgrules.conf - -You can ask the daemon to reload the rules configuration by sending it SIGUSR2. -The easiest way to do this is with the 'kill' command: - kill -s SIGUSR2 [PID] - -You can ask the daemon to reload the templates configuration by sending it -SIGUSR1. The easiest way to do this is with the 'kill' command: - kill -s SIGUSR1 [PID] - -TESTING -======= -The program setuid (found in tests/setuid.c) can help you test the daemon. By -default, this program attempts to change its UID to root and then idles until -you kill it. You can change the default behavior to use a different UID, or -you can uncomment the second block of code to instead attempt to change the -GID. - -In order to make sure that everything works, I used the following rules: - sjo cpu default - cgtest cpu cgtest - % memory default - @cgroup cpu,memory cgtest - peter cpu test1 - % memory test2 - @root * default - * * default - -The users 'sjo' and 'cgtest' were normal users. 'peter' is not a user on the -system. The group 'cgroup' is a group containing sjo,root,cgtest as members, -and the group 'root' contains only root. The cgroups 'default' and 'cgtest' -exist, while 'test1' and 'test2' do not. Currently, the daemon does not check -for the existance of 'test1', though this would be easier to do once the -parsing and caching logic is moved into libcgroup. - -I ran the following tests, all of which were successful: - - set UID to sjo (should move cpu controller into default) - - set UID to root (should move cpu,memory controllers into cgtest) - - set UID to cgtest (should move cpu controller into cgtest, memory - controller into default) - - set GID to root (should move all controllers into default) - - set GID to cgroup (should move cpu, memory into cgtest) - - set GID to users (should move all controllers into default) - -The parsing logic will skip the 'peter' rule as well as its multi-line -components (in this case "% memory test2"), because the user does not exist. -This should work for group rules, too. Attempting to setuid() or setgid() to a -user/group that doesn't exist will just return an error and not generate a -kernel event of the PROC_EVENT_UID or PROC_EVENT_GID type, so the daemon won't -do anything for it. - -CONCERNS/ISSUES -=============== - - Netlink can be unreliable, and the daemon might miss an event if the buffer - is full. One possible solution is to have one or two files that the kernel - can queue UID/GID changes in, and have the daemon read those files whenever - they are updated. From testing, this does not actually appear to be a real - problem, but it could become one with faster machines. - - The daemon does not care for namespaces at all, which can cause conflicts - with containers. If a user places his tasks into exec-based cgroups (such - as 'network' and 'development'), the daemon will not realize this and will - simply place them into the user's cgroup (so, sjo/ instead of sjo/network/). - -CHANGELOG -========= -V9: - - Updated documentation, because it was very old and incorrect. - - Reverted the changes to cgexec and cgclassify. - - New API function: cgroup_change_cgroup_uid_gid_flags(). - - Deprecated cgroup_change_cgroup_uid_gid(). - - Rewrote some of the rule matching and execution logic in api.c to be - faster, and easier to read. - - Changes all negative return values to positive values. As a side effect, - cgroup_parse_rules() now returns -1 when we get a match and we are using - non-cached rules. - - Changes CGROUP_FUSECACHE to CGFLAG_USECACHE. - - Flags are now enumerated (cgflags), instead of #defines. - -V8: - - Moved the event-handling logic back into the daemon, where it should be. - - Changed cgroup_parse_rules() to work with cached rules or non-cached rules. - The other parsing function is no longer needed, and should be deprecated. - - Non-cached rules now work with the same structs as cached rules. - - Modified cgroup_change_cgroup_uid_gid() with a new 'flags' parameter. - Currently, the only flag is "CGROUP_FUSECACHE" to use the cached rules logic - (or not). - - Added cgroup_rules_loaded() boolean, to check whether the cached rules have - been loaded yet, and cgroup_init_rules_cache() to load them. - - Modified cgexec and cgclassify to work with the new - cgroup_change_cgroup_uid_gid(). - -V7: - - Moved parsing and caching logic into libcgroup. - - Added locking mechanisms around the list of rules. - - Cleaned up #includes in cgrulesegnd.[h,c]. - - Added notification if netlink receive queue overflows. - - Added logic to catch SIGINT in addition to SIGTERM. - - New API functions: - - cgroup_free_rule(struct cgroup_rule*) - - cgroup_free_rule_list(struct cgroup_rule_list*) - - cgroup_parse_rules(void) - - cgroup_print_rules_config(FILE*) - - cgroup_reload_cached_rules(void) - - cgroup_change_cgroup_event(struct proc_event*, int, FILE*) - -V6: - - Wrote new parsing logic, which is cleaner and simpler. - - Added cgred script to enable using the daemon as a service. - - Wrote caching logic to cache rules table. - - Added the ability to force a reload of the rules table with SIGUSR2 signal. - - Added two structures to libcgroup: cgre_rule and cgre_rules_list - - New API function: cgroup_reload_cached_rules, which reloads the rules table. - - Added logging capabilities (default log is /root/cgrulesengd.conf) - -TODO -==== - - Find a way to replace Netlink, or at least clean up that code. - - Find a solution to the namespace problem. diff --git a/lib/libcgroup-3.1.0/README_systemd b/lib/libcgroup-3.1.0/README_systemd deleted file mode 100644 index ac53b9909cb..00000000000 --- a/lib/libcgroup-3.1.0/README_systemd +++ /dev/null @@ -1,69 +0,0 @@ -Integration with systemd -======================== - -systemd is a system and service manager for Linux, compatible with SysV -and LSB init scripts. systemd heavily uses control groups to manage and control -services. - -Most of the libcgroup tools and APIs can be safely used on systems with systemd -without any problems. This document attempts to describe the configuration of -systemd and libcgroup so they can safely co-exist and mutually benefit each -other. - -References -========== -[1] http://www.freedesktop.org/wiki/Software/systemd -Systemd home page. - -[2] http://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups -This is the most useful document describing systemd expectations on applications -(incl. libcgroup tools). - - -Compilation -=========== -As stated in [2], libcgroup should not interact with the 'name=systemd' -hierarchy. Compile libcgroup with the --enable-opaque-hierarchy configure option -to do so: - -./configure --enable-opaque-hierarchy=name=systemd - -Consequently, the 'name=systemd' hierarchy will not be visible to libcgroup and -all of its tools. For example, the lscgroup command will not list systemd -cgroups. - -Start-up and services -==================== - -Systemd automatically mounts all available controllers on system boot ('cpu' and -'cpuacct' together in one hierarchy by default) and can automatically put -service processes into control groups with configured parameters — by default, -each service is automatically put into the 'cpu,cpuacct:/system/$service_name' -control group. The System Administrator has full control of parameters in each -control group and of which controllers are used. Consult systemd -documentation, mainly systemd.conf(5) and systemd.exec(5) man pages, for -details. - -In the vast majority of use cases, this behavior is sufficient and libcgroup -does not need to be used. - -For specific use cases, e.g. when a different tree of control groups is needed, -libcgroup provides cgconfig service. This service can create arbitrary control -group hierarchies. In this case, follow these steps: - -1. Set 'DefaultControllers=' in /etc/systemd/system.conf so that systemd does -not create control groups for services automatically. - -2. Prepare /etc/cgconfig.conf and enable the cgconfig service. The service will -parse the /etc/cgconfig.conf file during machine boot and create all control -groups which are defined in it. The service automatically sets '+t' ("sticky") -bit on the tasks files as recommended in [2]. - -3. For each service that should start in a specific control group, add the -following lines into its unit file: - After=cgconfig.service - ControlGroup= - -This ensures the service is started only after cgconfig creates the necessary -hierarchy for it. It also tells systemd which control group it should use to -start the service. diff --git a/lib/libcgroup-3.1.0/aclocal.m4 b/lib/libcgroup-3.1.0/aclocal.m4 deleted file mode 100644 index 30fb4607f90..00000000000 --- a/lib/libcgroup-3.1.0/aclocal.m4 +++ /dev/null @@ -1,1578 +0,0 @@ -# generated automatically by aclocal 1.16.5 -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Copyright (C) 2002-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.5], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.5])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# Copyright (C) 2011-2021 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_AR([ACT-IF-FAIL]) -# ------------------------- -# Try to determine the archiver interface, and trigger the ar-lib wrapper -# if it is needed. If the detection of archiver interface fails, run -# ACT-IF-FAIL (default is to abort configure with a proper error message). -AC_DEFUN([AM_PROG_AR], -[AC_BEFORE([$0], [LT_INIT])dnl -AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([ar-lib])dnl -AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) -: ${AR=ar} - -AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [AC_LANG_PUSH([C]) - am_cv_ar_interface=ar - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], - [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - ]) - AC_LANG_POP([C])]) - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - m4_default([$1], - [AC_MSG_ERROR([could not determine $AR interface])]) - ;; -esac -AC_SUBST([AR])dnl -]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE="gmake" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -m4_ifdef([_$0_ALREADY_INIT], - [m4_fatal([$0 expanded multiple times -]m4_defn([_$0_ALREADY_INIT]))], - [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi -AC_SUBST([CTAGS]) -if test -z "$ETAGS"; then - ETAGS=etags -fi -AC_SUBST([ETAGS]) -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi -AC_SUBST([CSCOPE]) - -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Copyright (C) 1998-2021 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_LEX -# ----------- -# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a -# "missing" invocation, for better error output. -AC_DEFUN([AM_PROG_LEX], -[AC_PREREQ([2.50])dnl -AC_REQUIRE([AM_MISSING_HAS_RUN])dnl -AC_REQUIRE([AC_PROG_LEX])dnl -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 1999-2021 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_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# --------------------------------------------------------------------------- -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. -# -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. -# -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). -# -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 2.0 are not - dnl supported. (2.0 was released on October 16, 2000). - m4_define_default([_AM_PYTHON_INTERPRETER_LIST], -[python python2 python3 dnl - python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl - python3.2 python3.1 python3.0 dnl - python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl - python2.0]) - - AC_ARG_VAR([PYTHON], [the Python interpreter]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version is >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([Python interpreter is too old])]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Although site.py simply uses - dnl sys.version[:3], printing that failed with Python 3.10, since the - dnl trailing zero was eliminated. So now we output just the major - dnl and minor version numbers, as numbers. Apparently the tertiary - dnl version is not of interest. - dnl - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[[:2]])"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl At times, e.g., when building shared libraries, you may want - dnl to know which OS platform Python thinks this is. - dnl - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - dnl emacs-page - dnl If --with-python-sys-prefix is given, use the values of sys.prefix - dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX - dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and - dnl ${exec_prefix} variables. - dnl - dnl The two are made distinct variables so they can be overridden if - dnl need be, although general consensus is that you shouldn't need - dnl this separation. - dnl - dnl Also allow directly setting the prefixes via configure options, - dnl overriding any default. - dnl - if test "x$prefix" = xNONE; then - am__usable_prefix=$ac_default_prefix - else - am__usable_prefix=$prefix - fi - - # Allow user to request using sys.* values from Python, - # instead of the GNU $prefix values. - AC_ARG_WITH([python-sys-prefix], - [AS_HELP_STRING([--with-python-sys-prefix], - [use Python's sys.prefix and sys.exec_prefix values])], - [am_use_python_sys=:], - [am_use_python_sys=false]) - - # Allow user to override whatever the default Python prefix is. - AC_ARG_WITH([python_prefix], - [AS_HELP_STRING([--with-python_prefix], - [override the default PYTHON_PREFIX])], - [am_python_prefix_subst=$withval - am_cv_python_prefix=$withval - AC_MSG_CHECKING([for explicit $am_display_PYTHON prefix]) - AC_MSG_RESULT([$am_cv_python_prefix])], - [ - if $am_use_python_sys; then - # using python sys.prefix value, not GNU - AC_CACHE_CHECK([for python default $am_display_PYTHON prefix], - [am_cv_python_prefix], - [am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`]) - - dnl If sys.prefix is a subdir of $prefix, replace the literal value of - dnl $prefix with a variable reference so it can be overridden. - case $am_cv_python_prefix in - $am__usable_prefix*) - am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` - am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` - ;; - *) - am_python_prefix_subst=$am_cv_python_prefix - ;; - esac - else # using GNU prefix value, not python sys.prefix - am_python_prefix_subst='${prefix}' - am_python_prefix=$am_python_prefix_subst - AC_MSG_CHECKING([for GNU default $am_display_PYTHON prefix]) - AC_MSG_RESULT([$am_python_prefix]) - fi]) - # Substituting python_prefix_subst value. - AC_SUBST([PYTHON_PREFIX], [$am_python_prefix_subst]) - - # emacs-page Now do it all over again for Python exec_prefix, but with yet - # another conditional: fall back to regular prefix if that was specified. - AC_ARG_WITH([python_exec_prefix], - [AS_HELP_STRING([--with-python_exec_prefix], - [override the default PYTHON_EXEC_PREFIX])], - [am_python_exec_prefix_subst=$withval - am_cv_python_exec_prefix=$withval - AC_MSG_CHECKING([for explicit $am_display_PYTHON exec_prefix]) - AC_MSG_RESULT([$am_cv_python_exec_prefix])], - [ - # no explicit --with-python_exec_prefix, but if - # --with-python_prefix was given, use its value for python_exec_prefix too. - AS_IF([test -n "$with_python_prefix"], - [am_python_exec_prefix_subst=$with_python_prefix - am_cv_python_exec_prefix=$with_python_prefix - AC_MSG_CHECKING([for python_prefix-given $am_display_PYTHON exec_prefix]) - AC_MSG_RESULT([$am_cv_python_exec_prefix])], - [ - # Set am__usable_exec_prefix whether using GNU or Python values, - # since we use that variable for pyexecdir. - if test "x$exec_prefix" = xNONE; then - am__usable_exec_prefix=$am__usable_prefix - else - am__usable_exec_prefix=$exec_prefix - fi - # - if $am_use_python_sys; then # using python sys.exec_prefix, not GNU - AC_CACHE_CHECK([for python default $am_display_PYTHON exec_prefix], - [am_cv_python_exec_prefix], - [am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`]) - dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the - dnl literal value of $exec_prefix with a variable reference so it can - dnl be overridden. - case $am_cv_python_exec_prefix in - $am__usable_exec_prefix*) - am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` - am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` - ;; - *) - am_python_exec_prefix_subst=$am_cv_python_exec_prefix - ;; - esac - else # using GNU $exec_prefix, not python sys.exec_prefix - am_python_exec_prefix_subst='${exec_prefix}' - am_python_exec_prefix=$am_python_exec_prefix_subst - AC_MSG_CHECKING([for GNU default $am_display_PYTHON exec_prefix]) - AC_MSG_RESULT([$am_python_exec_prefix]) - fi])]) - # Substituting python_exec_prefix_subst. - AC_SUBST([PYTHON_EXEC_PREFIX], [$am_python_exec_prefix_subst]) - - # Factor out some code duplication into this shell variable. - am_python_setup_sysconfig="\ -import sys -# Prefer sysconfig over distutils.sysconfig, for better compatibility -# with python 3.x. See automake bug#10227. -try: - import sysconfig -except ImportError: - can_use_sysconfig = 0 -else: - can_use_sysconfig = 1 -# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: -# -try: - from platform import python_implementation - if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': - can_use_sysconfig = 0 -except ImportError: - pass" - - dnl emacs-page Set up 4 directories: - - dnl 1. pythondir: where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. - dnl - AC_CACHE_CHECK([for $am_display_PYTHON script directory (pythondir)], - [am_cv_python_pythondir], - [if test "x$am_cv_python_prefix" = x; then - am_py_prefix=$am__usable_prefix - else - am_py_prefix=$am_cv_python_prefix - fi - am_cv_python_pythondir=`$PYTHON -c " -$am_python_setup_sysconfig -if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) -else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') -sys.stdout.write(sitedir)"` - # - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" - ;; - esac - ;; - esac - ]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - dnl - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) - - dnl 3. pyexecdir: directory for installing python extension modules - dnl (shared libraries). - dnl Query distutils for this directory. - dnl - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)], - [am_cv_python_pyexecdir], - [if test "x$am_cv_python_exec_prefix" = x; then - am_py_exec_prefix=$am__usable_exec_prefix - else - am_py_exec_prefix=$am_cv_python_exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " -$am_python_setup_sysconfig -if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) -else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') -sys.stdout.write(sitedir)"` - # - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" - ;; - esac - ;; - esac - ]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) - - dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE) - dnl - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) - - dnl Run any user-specified action. - $2 - fi -]) - - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(sys.hexversion < minverhex)" - AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2021 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-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/ax_code_coverage.m4]) -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) diff --git a/lib/libcgroup-3.1.0/build-aux/ar-lib b/lib/libcgroup-3.1.0/build-aux/ar-lib deleted file mode 100755 index c349042c3fa..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/ar-lib +++ /dev/null @@ -1,271 +0,0 @@ -#! /bin/sh -# Wrapper for Microsoft lib.exe - -me=ar-lib -scriptversion=2019-07-04.01; # UTC - -# Copyright (C) 2010-2021 Free Software Foundation, Inc. -# Written by Peter Rosin . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - - -# func_error message -func_error () -{ - echo "$me: $1" 1>&2 - exit 1 -} - -file_conv= - -# func_file_conv build_file -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN* | MSYS*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv in - mingw) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin | msys) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_at_file at_file operation archive -# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE -# for each of them. -# When interpreting the content of the @FILE, do NOT use func_file_conv, -# since the user would need to supply preconverted file names to -# binutils ar, at least for MinGW. -func_at_file () -{ - operation=$2 - archive=$3 - at_file_contents=`cat "$1"` - eval set x "$at_file_contents" - shift - - for member - do - $AR -NOLOGO $operation:"$member" "$archive" || exit $? - done -} - -case $1 in - '') - func_error "no command. Try '$0 --help' for more information." - ;; - -h | --h*) - cat <. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN* | MSYS*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/* | msys/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/config.guess b/lib/libcgroup-3.1.0/build-aux/config.guess deleted file mode 100755 index c7f17e8fb97..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/config.guess +++ /dev/null @@ -1,1768 +0,0 @@ -#!/usr/bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2022 Free Software Foundation, Inc. - -# shellcheck disable=SC2006,SC2268 # see below for rationale - -timestamp='2022-05-25' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess -# -# Please send patches to . - - -# The "shellcheck disable" line above the timestamp inhibits complaints -# about features and limitations of the classic Bourne shell that were -# superseded or lifted in POSIX. However, this script identifies a wide -# variety of pre-POSIX systems that do not have POSIX shells at all, and -# even some reasonably current systems (Solaris 10 as case-in-point) still -# have a pre-POSIX /bin/sh. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2022 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 - -# Just in case it came from the environment. -GUESS= - -# 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. - -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 - -set_cc_for_build() { - # prevent multiple calls if $tmp is already set - test "$tmp" && return 0 - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039,SC3028 - { 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" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD=$driver - 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 -} - -# 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 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case $UNAME_SYSTEM in -Linux|GNU|GNU/*) - LIBC=unknown - - set_cc_for_build - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #elif defined(__GLIBC__) - LIBC=gnu - #else - #include - /* First heuristic to detect musl libc. */ - #ifdef __DEFINED_va_list - LIBC=musl - #endif - #endif - EOF - cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - eval "$cc_set_libc" - - # Second heuristic to detect musl libc. - if [ "$LIBC" = unknown ] && - command -v ldd >/dev/null && - ldd --version 2>&1 | grep -q ^musl; then - LIBC=musl - fi - - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - if [ "$LIBC" = unknown ]; then - LIBC=gnu - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - echo unknown)` - case $UNAME_MACHINE_ARCH in - aarch64eb) machine=aarch64_be-unknown ;; - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown - ;; - *) machine=$UNAME_MACHINE_ARCH-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case $UNAME_MACHINE_ARCH in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case $UNAME_MACHINE_ARCH in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case $UNAME_VERSION in - Debian*) - release='-gnu' - ;; - *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - GUESS=$machine-${os}${release}${abi-} - ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE - ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE - ;; - *:SecBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE - ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE - ;; - *:MidnightBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE - ;; - *:ekkoBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE - ;; - *:SolidBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE - ;; - *:OS108:*:*) - GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE - ;; - macppc:MirBSD:*:*) - GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE - ;; - *:MirBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE - ;; - *:Sortix:*:*) - GUESS=$UNAME_MACHINE-unknown-sortix - ;; - *:Twizzler:*:*) - GUESS=$UNAME_MACHINE-unknown-twizzler - ;; - *:Redox:*:*) - GUESS=$UNAME_MACHINE-unknown-redox - ;; - mips:OSF1:*.*) - GUESS=mips-dec-osf1 - ;; - alpha:OSF1:*:*) - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - trap '' 0 - 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. - OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - GUESS=$UNAME_MACHINE-dec-osf$OSF_REL - ;; - Amiga*:UNIX_System_V:4.0:*) - GUESS=m68k-unknown-sysv4 - ;; - *:[Aa]miga[Oo][Ss]:*:*) - GUESS=$UNAME_MACHINE-unknown-amigaos - ;; - *:[Mm]orph[Oo][Ss]:*:*) - GUESS=$UNAME_MACHINE-unknown-morphos - ;; - *:OS/390:*:*) - GUESS=i370-ibm-openedition - ;; - *:z/VM:*:*) - GUESS=s390-ibm-zvmoe - ;; - *:OS400:*:*) - GUESS=powerpc-ibm-os400 - ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - GUESS=arm-acorn-riscix$UNAME_RELEASE - ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - GUESS=arm-unknown-riscos - ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - GUESS=hppa1.1-hitachi-hiuxmpp - ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - case `(/bin/universe) 2>/dev/null` in - att) GUESS=pyramid-pyramid-sysv3 ;; - *) GUESS=pyramid-pyramid-bsd ;; - esac - ;; - NILE*:*:*:dcosx) - GUESS=pyramid-pyramid-svr4 - ;; - DRS?6000:unix:4.0:6*) - GUESS=sparc-icl-nx6 - ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) GUESS=sparc-icl-nx7 ;; - esac - ;; - s390x:SunOS:*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL - ;; - sun4H:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-hal-solaris2$SUN_REL - ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-sun-solaris2$SUN_REL - ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - GUESS=i386-pc-auroraux$UNAME_RELEASE - ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - 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 test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=$SUN_ARCH-pc-solaris2$SUN_REL - ;; - 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. - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-sun-solaris3$SUN_REL - ;; - 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'. - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` - GUESS=sparc-sun-sunos$SUN_REL - ;; - sun3*:SunOS:*:*) - GUESS=m68k-sun-sunos$UNAME_RELEASE - ;; - 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) - GUESS=m68k-sun-sunos$UNAME_RELEASE - ;; - sun4) - GUESS=sparc-sun-sunos$UNAME_RELEASE - ;; - esac - ;; - aushp:SunOS:*:*) - GUESS=sparc-auspex-sunos$UNAME_RELEASE - ;; - # 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:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - GUESS=m68k-milan-mint$UNAME_RELEASE - ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - GUESS=m68k-hades-mint$UNAME_RELEASE - ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - GUESS=m68k-unknown-mint$UNAME_RELEASE - ;; - m68k:machten:*:*) - GUESS=m68k-apple-machten$UNAME_RELEASE - ;; - powerpc:machten:*:*) - GUESS=powerpc-apple-machten$UNAME_RELEASE - ;; - RISC*:Mach:*:*) - GUESS=mips-dec-mach_bsd4.3 - ;; - RISC*:ULTRIX:*:*) - GUESS=mips-dec-ultrix$UNAME_RELEASE - ;; - VAX*:ULTRIX*:*:*) - GUESS=vax-dec-ultrix$UNAME_RELEASE - ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - GUESS=clipper-intergraph-clix$UNAME_RELEASE - ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - 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; } - GUESS=mips-mips-riscos$UNAME_RELEASE - ;; - Motorola:PowerMAX_OS:*:*) - GUESS=powerpc-motorola-powermax - ;; - Motorola:*:4.3:PL8-*) - GUESS=powerpc-harris-powermax - ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - GUESS=powerpc-harris-powermax - ;; - Night_Hawk:Power_UNIX:*:*) - GUESS=powerpc-harris-powerunix - ;; - m88k:CX/UX:7*:*) - GUESS=m88k-harris-cxux7 - ;; - m88k:*:4*:R4*) - GUESS=m88k-motorola-sysv4 - ;; - m88k:*:3*:R3*) - GUESS=m88k-motorola-sysv3 - ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 - then - if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ - test "$TARGET_BINARY_INTERFACE"x = x - then - GUESS=m88k-dg-dgux$UNAME_RELEASE - else - GUESS=m88k-dg-dguxbcs$UNAME_RELEASE - fi - else - GUESS=i586-dg-dgux$UNAME_RELEASE - fi - ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - GUESS=m88k-dolphin-sysv3 - ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - GUESS=m88k-motorola-sysv3 - ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - GUESS=m88k-tektronix-sysv3 - ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - GUESS=m68k-tektronix-bsd - ;; - *:IRIX*:*:*) - IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` - GUESS=mips-sgi-irix$IRIX_REL - ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id - ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - GUESS=i386-ibm-aix - ;; - ia64:AIX:*:*) - if test -x /usr/bin/oslevel ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=$UNAME_VERSION.$UNAME_RELEASE - fi - GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV - ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - 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 - GUESS=$SYSTEM_NAME - else - GUESS=rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - GUESS=rs6000-ibm-aix3.2.4 - else - GUESS=rs6000-ibm-aix3.2 - fi - ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if test -x /usr/bin/lslpp ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=$UNAME_VERSION.$UNAME_RELEASE - fi - GUESS=$IBM_ARCH-ibm-aix$IBM_REV - ;; - *:AIX:*:*) - GUESS=rs6000-ibm-aix - ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - GUESS=romp-ibm-bsd4.4 - ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to - ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - GUESS=rs6000-bull-bosx - ;; - DPX/2?00:B.O.S.:*:*) - GUESS=m68k-bull-sysv3 - ;; - 9000/[34]??:4.3bsd:1.*:*) - GUESS=m68k-hp-bsd - ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - GUESS=m68k-hp-bsd4.4 - ;; - 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 test -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 test "$HP_ARCH" = ""; then - 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 test "$HP_ARCH" = hppa2.0w - then - 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 - GUESS=$HP_ARCH-hp-hpux$HPUX_REV - ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` - GUESS=ia64-hp-hpux$HPUX_REV - ;; - 3050*:HI-UX:*:*) - 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; } - GUESS=unknown-hitachi-hiuxwe2 - ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - GUESS=hppa1.1-hp-bsd - ;; - 9000/8??:4.3bsd:*:*) - GUESS=hppa1.0-hp-bsd - ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - GUESS=hppa1.0-hp-mpeix - ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - GUESS=hppa1.1-hp-osf - ;; - hp8??:OSF1:*:*) - GUESS=hppa1.0-hp-osf - ;; - i*86:OSF1:*:*) - if test -x /usr/sbin/sysversion ; then - GUESS=$UNAME_MACHINE-unknown-osf1mk - else - GUESS=$UNAME_MACHINE-unknown-osf1 - fi - ;; - parisc*:Lites*:*:*) - GUESS=hppa1.1-hp-lites - ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - GUESS=c1-convex-bsd - ;; - 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*:*) - GUESS=c34-convex-bsd - ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - GUESS=c38-convex-bsd - ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - GUESS=c4-convex-bsd - ;; - CRAY*Y-MP:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=ymp-cray-unicos$CRAY_REL - ;; - 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:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=t90-cray-unicos$CRAY_REL - ;; - CRAY*T3E:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=alphaev5-cray-unicosmk$CRAY_REL - ;; - CRAY*SV1:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=sv1-cray-unicos$CRAY_REL - ;; - *:UNICOS/mp:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=craynv-cray-unicosmp$CRAY_REL - ;; - 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/ /_/'` - GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} - ;; - 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/ /_/'` - GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} - ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE - ;; - sparc*:BSD/OS:*:*) - GUESS=sparc-unknown-bsdi$UNAME_RELEASE - ;; - *:BSD/OS:*:*) - GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE - ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi - else - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf - fi - ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case $UNAME_PROCESSOR in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL - ;; - i*:CYGWIN*:*) - GUESS=$UNAME_MACHINE-pc-cygwin - ;; - *:MINGW64*:*) - GUESS=$UNAME_MACHINE-pc-mingw64 - ;; - *:MINGW*:*) - GUESS=$UNAME_MACHINE-pc-mingw32 - ;; - *:MSYS*:*) - GUESS=$UNAME_MACHINE-pc-msys - ;; - i*:PW*:*) - GUESS=$UNAME_MACHINE-pc-pw32 - ;; - *:SerenityOS:*:*) - GUESS=$UNAME_MACHINE-pc-serenity - ;; - *:Interix*:*) - case $UNAME_MACHINE in - x86) - GUESS=i586-pc-interix$UNAME_RELEASE - ;; - authenticamd | genuineintel | EM64T) - GUESS=x86_64-unknown-interix$UNAME_RELEASE - ;; - IA64) - GUESS=ia64-unknown-interix$UNAME_RELEASE - ;; - esac ;; - i*:UWIN*:*) - GUESS=$UNAME_MACHINE-pc-uwin - ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - GUESS=x86_64-pc-cygwin - ;; - prep*:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=powerpcle-unknown-solaris2$SUN_REL - ;; - *:GNU:*:*) - # the GNU system - GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` - GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` - GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL - ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` - GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC - ;; - *:Minix:*:*) - GUESS=$UNAME_MACHINE-unknown-minix - ;; - aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - arm*:Linux:*:*) - set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi - else - GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf - fi - fi - ;; - avr32*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - cris:Linux:*:*) - GUESS=$UNAME_MACHINE-axis-linux-$LIBC - ;; - crisv32:Linux:*:*) - GUESS=$UNAME_MACHINE-axis-linux-$LIBC - ;; - e2k:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - frv:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - hexagon:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - i*86:Linux:*:*) - GUESS=$UNAME_MACHINE-pc-linux-$LIBC - ;; - ia64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - k1om:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - m32r*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - m68*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build - IS_GLIBC=0 - test x"${LIBC}" = xgnu && IS_GLIBC=1 - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef mips - #undef mipsel - #undef mips64 - #undef mips64el - #if ${IS_GLIBC} && defined(_ABI64) - LIBCABI=gnuabi64 - #else - #if ${IS_GLIBC} && defined(_ABIN32) - LIBCABI=gnuabin32 - #else - LIBCABI=${LIBC} - #endif - #endif - - #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa64r6 - #else - #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa32r6 - #else - #if defined(__mips64) - CPU=mips64 - #else - CPU=mips - #endif - #endif - #endif - - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - MIPS_ENDIAN=el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - MIPS_ENDIAN= - #else - MIPS_ENDIAN= - #endif - #endif -EOF - cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` - eval "$cc_set_vars" - test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } - ;; - mips64el:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - openrisc*:Linux:*:*) - GUESS=or1k-unknown-linux-$LIBC - ;; - or32:Linux:*:* | or1k*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - padre:Linux:*:*) - GUESS=sparc-unknown-linux-$LIBC - ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - GUESS=hppa64-unknown-linux-$LIBC - ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; - PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; - *) GUESS=hppa-unknown-linux-$LIBC ;; - esac - ;; - ppc64:Linux:*:*) - GUESS=powerpc64-unknown-linux-$LIBC - ;; - ppc:Linux:*:*) - GUESS=powerpc-unknown-linux-$LIBC - ;; - ppc64le:Linux:*:*) - GUESS=powerpc64le-unknown-linux-$LIBC - ;; - ppcle:Linux:*:*) - GUESS=powerpcle-unknown-linux-$LIBC - ;; - riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - s390:Linux:*:* | s390x:Linux:*:*) - GUESS=$UNAME_MACHINE-ibm-linux-$LIBC - ;; - sh64*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - sh*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - tile*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - vax:Linux:*:*) - GUESS=$UNAME_MACHINE-dec-linux-$LIBC - ;; - x86_64:Linux:*:*) - set_cc_for_build - CPU=$UNAME_MACHINE - LIBCABI=$LIBC - if test "$CC_FOR_BUILD" != no_compiler_found; then - ABI=64 - sed 's/^ //' << EOF > "$dummy.c" - #ifdef __i386__ - ABI=x86 - #else - #ifdef __ILP32__ - ABI=x32 - #endif - #endif -EOF - cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` - eval "$cc_set_abi" - case $ABI in - x86) CPU=i686 ;; - x32) LIBCABI=${LIBC}x32 ;; - esac - fi - GUESS=$CPU-pc-linux-$LIBCABI - ;; - xtensa*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - 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. - GUESS=i386-sequent-sysv4 - ;; - 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. - GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION - ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - GUESS=$UNAME_MACHINE-pc-os2-emx - ;; - i*86:XTS-300:*:STOP) - GUESS=$UNAME_MACHINE-unknown-stop - ;; - i*86:atheos:*:*) - GUESS=$UNAME_MACHINE-unknown-atheos - ;; - i*86:syllable:*:*) - GUESS=$UNAME_MACHINE-pc-syllable - ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - GUESS=i386-unknown-lynxos$UNAME_RELEASE - ;; - i*86:*DOS:*:*) - GUESS=$UNAME_MACHINE-pc-msdosdjgpp - ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL - else - GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL - fi - ;; - 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 - GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - ;; - 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 - GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL - else - GUESS=$UNAME_MACHINE-pc-sysv32 - fi - ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - GUESS=i586-pc-msdosdjgpp - ;; - Intel:Mach:3*:*) - GUESS=i386-pc-mach3 - ;; - paragon:*:*:*) - GUESS=i860-intel-osf1 - ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 - fi - ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - GUESS=m68010-convergent-sysv - ;; - mc68k:UNIX:SYSTEM5:3.51m) - GUESS=m68k-convergent-sysv - ;; - M680?0:D-NIX:5.3:*) - GUESS=m68k-diab-dnix - ;; - 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*:*) - GUESS=m68k-unknown-lynxos$UNAME_RELEASE - ;; - mc68030:UNIX_System_V:4.*:*) - GUESS=m68k-atari-sysv4 - ;; - TSUNAMI:LynxOS:2.*:*) - GUESS=sparc-unknown-lynxos$UNAME_RELEASE - ;; - rs6000:LynxOS:2.*:*) - GUESS=rs6000-unknown-lynxos$UNAME_RELEASE - ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - GUESS=powerpc-unknown-lynxos$UNAME_RELEASE - ;; - SM[BE]S:UNIX_SV:*:*) - GUESS=mips-dde-sysv$UNAME_RELEASE - ;; - RM*:ReliantUNIX-*:*:*) - GUESS=mips-sni-sysv4 - ;; - RM*:SINIX-*:*:*) - GUESS=mips-sni-sysv4 - ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - GUESS=$UNAME_MACHINE-sni-sysv4 - else - GUESS=ns32k-sni-sysv - fi - ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - GUESS=i586-unisys-sysv4 - ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - GUESS=hppa1.1-stratus-sysv4 - ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - GUESS=i860-stratus-sysv4 - ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - GUESS=$UNAME_MACHINE-stratus-vos - ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - GUESS=hppa1.1-stratus-vos - ;; - mc68*:A/UX:*:*) - GUESS=m68k-apple-aux$UNAME_RELEASE - ;; - news*:NEWS-OS:6*:*) - GUESS=mips-sony-newsos6 - ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if test -d /usr/nec; then - GUESS=mips-nec-sysv$UNAME_RELEASE - else - GUESS=mips-unknown-sysv$UNAME_RELEASE - fi - ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - GUESS=powerpc-be-beos - ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - GUESS=powerpc-apple-beos - ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - GUESS=i586-pc-beos - ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - GUESS=i586-pc-haiku - ;; - ppc:Haiku:*:*) # Haiku running on Apple PowerPC - GUESS=powerpc-apple-haiku - ;; - *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) - GUESS=$UNAME_MACHINE-unknown-haiku - ;; - SX-4:SUPER-UX:*:*) - GUESS=sx4-nec-superux$UNAME_RELEASE - ;; - SX-5:SUPER-UX:*:*) - GUESS=sx5-nec-superux$UNAME_RELEASE - ;; - SX-6:SUPER-UX:*:*) - GUESS=sx6-nec-superux$UNAME_RELEASE - ;; - SX-7:SUPER-UX:*:*) - GUESS=sx7-nec-superux$UNAME_RELEASE - ;; - SX-8:SUPER-UX:*:*) - GUESS=sx8-nec-superux$UNAME_RELEASE - ;; - SX-8R:SUPER-UX:*:*) - GUESS=sx8r-nec-superux$UNAME_RELEASE - ;; - SX-ACE:SUPER-UX:*:*) - GUESS=sxace-nec-superux$UNAME_RELEASE - ;; - Power*:Rhapsody:*:*) - GUESS=powerpc-apple-rhapsody$UNAME_RELEASE - ;; - *:Rhapsody:*:*) - GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE - ;; - arm64:Darwin:*:*) - GUESS=aarch64-apple-darwin$UNAME_RELEASE - ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - if command -v xcode-select > /dev/null 2> /dev/null && \ - ! xcode-select --print-path > /dev/null 2> /dev/null ; then - # Avoid executing cc if there is no toolchain installed as - # cc will be a stub that puts up a graphical alert - # prompting the user to install developer tools. - CC_FOR_BUILD=no_compiler_found - else - set_cc_for_build - fi - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # uname -m returns i386 or x86_64 - UNAME_PROCESSOR=$UNAME_MACHINE - fi - GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE - ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE - ;; - *:QNX:*:4*) - GUESS=i386-pc-qnx - ;; - NEO-*:NONSTOP_KERNEL:*:*) - GUESS=neo-tandem-nsk$UNAME_RELEASE - ;; - NSE-*:NONSTOP_KERNEL:*:*) - GUESS=nse-tandem-nsk$UNAME_RELEASE - ;; - NSR-*:NONSTOP_KERNEL:*:*) - GUESS=nsr-tandem-nsk$UNAME_RELEASE - ;; - NSV-*:NONSTOP_KERNEL:*:*) - GUESS=nsv-tandem-nsk$UNAME_RELEASE - ;; - NSX-*:NONSTOP_KERNEL:*:*) - GUESS=nsx-tandem-nsk$UNAME_RELEASE - ;; - *:NonStop-UX:*:*) - GUESS=mips-compaq-nonstopux - ;; - BS2000:POSIX*:*:*) - GUESS=bs2000-siemens-sysv - ;; - DS/*:UNIX_System_V:*:*) - GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE - ;; - *: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 - elif test "x${cputype-}" != x; then - UNAME_MACHINE=$cputype - fi - GUESS=$UNAME_MACHINE-unknown-plan9 - ;; - *:TOPS-10:*:*) - GUESS=pdp10-unknown-tops10 - ;; - *:TENEX:*:*) - GUESS=pdp10-unknown-tenex - ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - GUESS=pdp10-dec-tops20 - ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - GUESS=pdp10-xkl-tops20 - ;; - *:TOPS-20:*:*) - GUESS=pdp10-unknown-tops20 - ;; - *:ITS:*:*) - GUESS=pdp10-unknown-its - ;; - SEI:*:*:SEIUX) - GUESS=mips-sei-seiux$UNAME_RELEASE - ;; - *:DragonFly:*:*) - DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL - ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case $UNAME_MACHINE in - A*) GUESS=alpha-dec-vms ;; - I*) GUESS=ia64-dec-vms ;; - V*) GUESS=vax-dec-vms ;; - esac ;; - *:XENIX:*:SysV) - GUESS=i386-pc-xenix - ;; - i*86:skyos:*:*) - SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` - GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL - ;; - i*86:rdos:*:*) - GUESS=$UNAME_MACHINE-pc-rdos - ;; - i*86:Fiwix:*:*) - GUESS=$UNAME_MACHINE-pc-fiwix - ;; - *:AROS:*:*) - GUESS=$UNAME_MACHINE-unknown-aros - ;; - x86_64:VMkernel:*:*) - GUESS=$UNAME_MACHINE-unknown-esx - ;; - amd64:Isilon\ OneFS:*:*) - GUESS=x86_64-unknown-onefs - ;; - *:Unleashed:*:*) - GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE - ;; -esac - -# Do we have a guess based on uname results? -if test "x$GUESS" != x; then - echo "$GUESS" - exit -fi - -# No uname command or uname output not recognized. -set_cc_for_build -cat > "$dummy.c" < -#include -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#include -#if defined(_SIZE_T_) || defined(SIGLOST) -#include -#endif -#endif -#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 (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 -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname un; - uname (&un); - printf ("vax-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname *un; - uname (&un); - printf ("mips-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("mips-dec-ultrix\n"); exit (0); -#endif -#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; } - -echo "$0: unable to guess system type" >&2 - -case $UNAME_MACHINE:$UNAME_SYSTEM in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 <&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 -fi - -exit 1 - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/config.sub b/lib/libcgroup-3.1.0/build-aux/config.sub deleted file mode 100755 index b41da55df45..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/config.sub +++ /dev/null @@ -1,1890 +0,0 @@ -#!/usr/bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2022 Free Software Foundation, Inc. - -# shellcheck disable=SC2006,SC2268 # see below for rationale - -timestamp='2022-01-03' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -# The "shellcheck disable" line above the timestamp inhibits complaints -# about features and limitations of the classic Bourne shell that were -# superseded or lifted in POSIX. However, this script identifies a wide -# variety of pre-POSIX systems that do not have POSIX shells at all, and -# even some reasonably current systems (Solaris 10 as case-in-point) still -# have a pre-POSIX /bin/sh. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2022 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 ;; - - *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 - -# Split fields of configuration type -# shellcheck disable=SC2162 -saved_IFS=$IFS -IFS="-" read field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - basic_os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - basic_os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - basic_os=linux-android - ;; - *) - basic_machine=$field1-$field2 - basic_os=$field3 - ;; - esac - ;; - *-*) - # A lone config we happen to match not fitting any pattern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - basic_os= - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - basic_os=$field2 - ;; - zephyr*) - basic_machine=$field1-unknown - basic_os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | 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* | sim | cisco \ - | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - basic_os= - ;; - *) - basic_machine=$field1 - basic_os=$field2 - ;; - esac - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - basic_os=bsd - ;; - a29khif) - basic_machine=a29k-amd - basic_os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - basic_os=scout - ;; - alliant) - basic_machine=fx80-alliant - basic_os= - ;; - altos | altos3068) - basic_machine=m68k-altos - basic_os= - ;; - am29k) - basic_machine=a29k-none - basic_os=bsd - ;; - amdahl) - basic_machine=580-amdahl - basic_os=sysv - ;; - amiga) - basic_machine=m68k-unknown - basic_os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown - basic_os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - basic_os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - basic_os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - basic_os=bsd - ;; - aros) - basic_machine=i386-pc - basic_os=aros - ;; - aux) - basic_machine=m68k-apple - basic_os=aux - ;; - balance) - basic_machine=ns32k-sequent - basic_os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - basic_os=linux - ;; - cegcc) - basic_machine=arm-unknown - basic_os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; - cray) - basic_machine=j90-cray - basic_os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - basic_os= - ;; - da30) - basic_machine=m68k-da30 - basic_os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - basic_os= - ;; - delta88) - basic_machine=m88k-motorola - basic_os=sysv3 - ;; - dicos) - basic_machine=i686-pc - basic_os=dicos - ;; - djgpp) - basic_machine=i586-pc - basic_os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - basic_os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - basic_os=ose - ;; - gmicro) - basic_machine=tron-gmicro - basic_os=sysv - ;; - go32) - basic_machine=i386-pc - basic_os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - basic_os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - basic_os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - basic_os=hms - ;; - harris) - basic_machine=m88k-harris - basic_os=sysv3 - ;; - hp300 | hp300hpux) - basic_machine=m68k-hp - basic_os=hpux - ;; - hp300bsd) - basic_machine=m68k-hp - basic_os=bsd - ;; - hppaosf) - basic_machine=hppa1.1-hp - basic_os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - basic_os=proelf - ;; - i386mach) - basic_machine=i386-mach - basic_os=mach - ;; - isi68 | isi) - basic_machine=m68k-isi - basic_os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - basic_os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - basic_os=sysv - ;; - merlin) - basic_machine=ns32k-utek - basic_os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - basic_os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - basic_os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - basic_os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - basic_os=coff - ;; - morphos) - basic_machine=powerpc-unknown - basic_os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - basic_os=moxiebox - ;; - msdos) - basic_machine=i386-pc - basic_os=msdos - ;; - msys) - basic_machine=i686-pc - basic_os=msys - ;; - mvs) - basic_machine=i370-ibm - basic_os=mvs - ;; - nacl) - basic_machine=le32-unknown - basic_os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - basic_os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - basic_os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - basic_os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - basic_os=newsos - ;; - news1000) - basic_machine=m68030-sony - basic_os=newsos - ;; - necv70) - basic_machine=v70-nec - basic_os=sysv - ;; - nh3000) - basic_machine=m68k-harris - basic_os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - basic_os=cxux - ;; - nindy960) - basic_machine=i960-intel - basic_os=nindy - ;; - mon960) - basic_machine=i960-intel - basic_os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - basic_os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - basic_os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - basic_os=ose - ;; - os68k) - basic_machine=m68k-none - basic_os=os68k - ;; - paragon) - basic_machine=i860-intel - basic_os=osf - ;; - parisc) - basic_machine=hppa-unknown - basic_os=linux - ;; - psp) - basic_machine=mipsallegrexel-sony - basic_os=psp - ;; - pw32) - basic_machine=i586-unknown - basic_os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - basic_os=rdos - ;; - rdos32) - basic_machine=i386-pc - basic_os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - basic_os=coff - ;; - sa29200) - basic_machine=a29k-amd - basic_os=udi - ;; - sei) - basic_machine=mips-sei - basic_os=seiux - ;; - sequent) - basic_machine=i386-sequent - basic_os= - ;; - sps7) - basic_machine=m68k-bull - basic_os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - basic_os= - ;; - stratus) - basic_machine=i860-stratus - basic_os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - basic_os= - ;; - sun2os3) - basic_machine=m68000-sun - basic_os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - basic_os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - basic_os= - ;; - sun3os3) - basic_machine=m68k-sun - basic_os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - basic_os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - basic_os= - ;; - sun4os3) - basic_machine=sparc-sun - basic_os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - basic_os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - basic_os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - basic_os= - ;; - sv1) - basic_machine=sv1-cray - basic_os=unicos - ;; - symmetry) - basic_machine=i386-sequent - basic_os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - basic_os=unicos - ;; - t90) - basic_machine=t90-cray - basic_os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - basic_os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - basic_os=tpf - ;; - udi29k) - basic_machine=a29k-amd - basic_os=udi - ;; - ultra3) - basic_machine=a29k-nyu - basic_os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - basic_os=none - ;; - vaxv) - basic_machine=vax-dec - basic_os=sysv - ;; - vms) - basic_machine=vax-dec - basic_os=vms - ;; - vsta) - basic_machine=i386-pc - basic_os=vsta - ;; - vxworks960) - basic_machine=i960-wrs - basic_os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - basic_os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - basic_os=vxworks - ;; - xbox) - basic_machine=i686-pc - basic_os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - basic_os=unicos - ;; - *) - basic_machine=$1 - basic_os= - ;; - esac - ;; -esac - -# Decode 1-component or ad-hoc basic machines -case $basic_machine in - # 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) - cpu=hppa1.1 - vendor=winbond - ;; - op50n) - cpu=hppa1.1 - vendor=oki - ;; - op60c) - cpu=hppa1.1 - vendor=oki - ;; - ibm*) - cpu=i370 - vendor=ibm - ;; - orion105) - cpu=clipper - vendor=highlevel - ;; - mac | mpw | mac-mpw) - cpu=m68k - vendor=apple - ;; - pmac | pmac-mpw) - cpu=powerpc - vendor=apple - ;; - - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att - ;; - 3b*) - cpu=we32k - vendor=att - ;; - bluegene*) - cpu=powerpc - vendor=ibm - basic_os=cnk - ;; - decsystem10* | dec10*) - cpu=pdp10 - vendor=dec - basic_os=tops10 - ;; - decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - basic_os=tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - cpu=m68k - vendor=motorola - ;; - dpx2*) - cpu=m68k - vendor=bull - basic_os=sysv3 - ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore - ;; - elxsi) - cpu=elxsi - vendor=elxsi - basic_os=${basic_os:-bsd} - ;; - fx2800) - cpu=i860 - vendor=alliant - ;; - genix) - cpu=ns32k - vendor=ns - ;; - h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp - ;; - hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - i*86v32) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv32 - ;; - i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv4 - ;; - i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv - ;; - i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=solaris2 - ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - basic_os=${basic_os:-unicos} - ;; - iris | iris4d) - cpu=mips - vendor=sgi - case $basic_os in - irix*) - ;; - *) - basic_os=irix4 - ;; - esac - ;; - miniframe) - cpu=m68000 - vendor=convergent - ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - basic_os=mint - ;; - news-3600 | risc-news) - cpu=mips - vendor=sony - basic_os=newsos - ;; - next | m*-next) - cpu=m68k - vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac - ;; - np1) - cpu=np1 - vendor=gould - ;; - op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - basic_os=proelf - ;; - pa-hitachi) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - pbd) - cpu=sparc - vendor=tti - ;; - pbb) - cpu=m68k - vendor=tti - ;; - pc532) - cpu=ns32k - vendor=pc532 - ;; - pn) - cpu=pn - vendor=gould - ;; - power) - cpu=power - vendor=ibm - ;; - ps2) - cpu=i386 - vendor=ibm - ;; - rm[46]00) - cpu=mips - vendor=siemens - ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm - ;; - sde) - cpu=mipsisa32 - vendor=sde - basic_os=${basic_os:-elf} - ;; - simso-wrs) - cpu=sparclite - vendor=wrs - basic_os=vxworks - ;; - tower | tower-32) - cpu=m68k - vendor=ncr - ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu - ;; - w65) - cpu=w65 - vendor=wdc - ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - basic_os=proelf - ;; - none) - cpu=none - vendor=none - ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine - ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` - ;; - - *-*) - # shellcheck disable=SC2162 - saved_IFS=$IFS - IFS="-" read cpu vendor <&2 - exit 1 - ;; - esac - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec - ;; - commodore*) - vendor=cbm - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if test x$basic_os != x -then - -# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just -# set os. -case $basic_os in - gnu/linux*) - kernel=linux - os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` - ;; - os2-emx) - kernel=os2 - os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` - ;; - nto-qnx*) - kernel=nto - os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` - ;; - *-*) - # shellcheck disable=SC2162 - saved_IFS=$IFS - IFS="-" read kernel os <&2 - exit 1 - ;; -esac - -# As a final step for OS-related things, validate the OS-kernel combination -# (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) - ;; - uclinux-uclibc* ) - ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) - # These are just libc implementations, not actual OSes, and thus - # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 - exit 1 - ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) - ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) - ;; - nto-qnx*) - ;; - os2-emx) - ;; - *-eabi* | *-gnueabi*) - ;; - -*) - # Blank kernel with real OS is always fine. - ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 - exit 1 - ;; -esac - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) - case $cpu-$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 - ;; - *-clix*) - vendor=intergraph - ;; - *-mvs* | *-opened*) - vendor=ibm - ;; - *-os400*) - vendor=ibm - ;; - s390-* | s390x-*) - 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 - ;; -esac - -echo "$cpu-$vendor-${kernel:+$kernel-}$os" -exit - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/depcomp b/lib/libcgroup-3.1.0/build-aux/depcomp deleted file mode 100755 index 715e34311ed..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/install-sh b/lib/libcgroup-3.1.0/build-aux/install-sh deleted file mode 100755 index ec298b53740..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/install-sh +++ /dev/null @@ -1,541 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2020-11-14.01; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -# Create dirs (including intermediate dirs) using mode 755. -# This is like GNU 'install' as of coreutils 8.32 (2020). -mkdir_umask=22 - -backupsuffix= -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -p pass -p to $cpprog. - -s $stripprog installed files. - -S SUFFIX attempt to back up existing files, with suffix SUFFIX. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG - -By default, rm is invoked with -f; when overridden with RMPROG, -it's up to you to specify -f if you want it. - -If -S is not specified, no backups are attempted. - -Email bug reports to bug-automake@gnu.org. -Automake home page: https://www.gnu.org/software/automake/ -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -p) cpprog="$cpprog -p";; - - -s) stripcmd=$stripprog;; - - -S) backupsuffix="$2" - shift;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - # Don't chown directories that already exist. - if test $dstdir_status = 0; then - chowncmd="" - 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 "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # 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 - # The $RANDOM variable is not portable (e.g., dash). Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap ' - ret=$? - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null - exit $ret - ' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p'. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && - { test -z "$stripcmd" || { - # Create $dsttmp read-write so that cp doesn't create it read-only, - # which would cause strip to fail. - if test -z "$doit"; then - : >"$dsttmp" # No need to fork-exec 'touch'. - else - $doit touch "$dsttmp" - fi - } - } && - $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # If $backupsuffix is set, and the file being installed - # already exists, attempt a backup. Don't worry if it fails, - # e.g., if mv doesn't support -f. - if test -n "$backupsuffix" && test -f "$dst"; then - $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null - fi - - # 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 "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/ltmain.sh b/lib/libcgroup-3.1.0/build-aux/ltmain.sh deleted file mode 100644 index 49fcad1365c..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/ltmain.sh +++ /dev/null @@ -1,11429 +0,0 @@ -#! /usr/bin/env sh -## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2019-02-19.15 - -# libtool (GNU libtool) 2.4.7 -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4.7 -package_revision=2.4.7 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2019-02-19.15; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# This is free software. There is NO warranty; not even for -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# Copyright (C) 2004-2019, 2021 Bootstrap Authors -# -# This file is dual licensed under the terms of the MIT license -# , and GPL version 2 or later -# . You must apply one of -# these licenses when using or redistributing this software or any of -# the files within it. See the URLs above, or the file `LICENSE` -# included in the Bootstrap distribution for the full license texts. - -# Please report bugs or propose patches to: -# - - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: -# -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh -# -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - - -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## - -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! - -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac -fi - -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" - fi" -done -# These NLS vars are set unconditionally (bootstrap issue #24). Unset those -# in case the environment reset is needed later and the $save_* variant is not -# defined (see the code above). -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" - -# There are apparently some retarded systems that use ';' as a PATH separator! -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# func_unset VAR -# -------------- -# Portably unset VAR. -# In some shells, an 'unset VAR' statement leaves a non-zero return -# status if VAR is already unset, which might be problematic if the -# statement is used at the end of a function (thus poisoning its return -# value) or when 'set -e' is active (causing even a spurious abort of -# the script in this case). -func_unset () -{ - { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } -} - - -# Make sure CDPATH doesn't cause `cd` commands to output the target dir. -func_unset CDPATH - -# Make sure ${,E,F}GREP behave sanely. -func_unset GREP_OPTIONS - - -## ------------------------- ## -## Locate command utilities. ## -## ------------------------- ## - - -# func_executable_p FILE -# ---------------------- -# Check that FILE is an executable regular file. -func_executable_p () -{ - test -f "$1" && test -x "$1" -} - - -# func_path_progs PROGS_LIST CHECK_FUNC [PATH] -# -------------------------------------------- -# Search for either a program that responds to --version with output -# containing "GNU", or else returned by CHECK_FUNC otherwise, by -# trying all the directories in PATH with each of the elements of -# PROGS_LIST. -# -# CHECK_FUNC should accept the path to a candidate program, and -# set $func_check_prog_result if it truncates its output less than -# $_G_path_prog_max characters. -func_path_progs () -{ - _G_progs_list=$1 - _G_check_func=$2 - _G_PATH=${3-"$PATH"} - - _G_path_prog_max=0 - _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} - for _G_dir in $_G_PATH; do - IFS=$_G_save_IFS - test -z "$_G_dir" && _G_dir=. - for _G_prog_name in $_G_progs_list; do - for _exeext in '' .EXE; do - _G_path_prog=$_G_dir/$_G_prog_name$_exeext - func_executable_p "$_G_path_prog" || continue - case `"$_G_path_prog" --version 2>&1` in - *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; - *) $_G_check_func $_G_path_prog - func_path_progs_result=$func_check_prog_result - ;; - esac - $_G_path_prog_found && break 3 - done - done - done - IFS=$_G_save_IFS - test -z "$func_path_progs_result" && { - echo "no acceptable sed could be found in \$PATH" >&2 - exit 1 - } -} - - -# We want to be able to use the functions in this file before configure -# has figured out where the best binaries are kept, which means we have -# to search for them ourselves - except when the results are already set -# where we skip the searches. - -# Unless the user overrides by setting SED, search the path for either GNU -# sed, or the sed that truncates its output the least. -test -z "$SED" && { - _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for _G_i in 1 2 3 4 5 6 7; do - _G_sed_script=$_G_sed_script$nl$_G_sed_script - done - echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed - _G_sed_script= - - func_check_prog_sed () - { - _G_path_prog=$1 - - _G_count=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo '' >> conftest.nl - "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" - rm -f conftest.sed - SED=$func_path_progs_result -} - - -# Unless the user overrides by setting GREP, search the path for either GNU -# grep, or the grep that truncates its output the least. -test -z "$GREP" && { - func_check_prog_grep () - { - _G_path_prog=$1 - - _G_count=0 - _G_path_prog_max=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo 'GREP' >> conftest.nl - "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" - GREP=$func_path_progs_result -} - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. - -: ${CP="cp -f"} -: ${ECHO="printf %s\n"} -: ${EGREP="$GREP -E"} -: ${FGREP="$GREP -F"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} - - -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## - -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' - -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" - -# require_check_ifs_backslash -# --------------------------- -# Check if we can use backslash as IFS='\' separator, and set -# $check_ifs_backshlash_broken to ':' or 'false'. -require_check_ifs_backslash=func_require_check_ifs_backslash -func_require_check_ifs_backslash () -{ - _G_save_IFS=$IFS - IFS='\' - _G_check_ifs_backshlash='a\\b' - for _G_i in $_G_check_ifs_backshlash - do - case $_G_i in - a) - check_ifs_backshlash_broken=false - ;; - '') - break - ;; - *) - check_ifs_backshlash_broken=: - break - ;; - esac - done - IFS=$_G_save_IFS - require_check_ifs_backslash=: -} - - -## ----------------- ## -## Global variables. ## -## ----------------- ## - -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: - -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 - -# The name of this program. -progname=`$ECHO "$progpath" |$SED "$sed_basename"` - -# Make sure we have an absolute progpath for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` - progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname - ;; - *) - _G_IFS=$IFS - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS=$_G_IFS - test -x "$progdir/$progname" && break - done - IFS=$_G_IFS - test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname - ;; -esac - - -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. - -opt_dry_run=false -opt_quiet=false -opt_verbose=false - -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () -{ - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='' - tc_bold=''; tc_standout='' - tc_red=''; tc_green='' - tc_blue=''; tc_cyan='' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: -} - - -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_arg pretty "$2" - eval "$1+=\\ \$func_quote_arg_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_arg pretty "$2" - eval "$1=\$$1\\ \$func_quote_arg_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () -{ - $debug_cmd - - eval _G_current_value='`$ECHO $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` - - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac -} - - -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd - - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () -{ - $debug_cmd - - '"$_b"' -}' - - -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () -{ - $debug_cmd - - '"$_d"' -}' - - -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` - _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_portable EVAL ARG -# ---------------------------- -# Internal function to portably implement func_quote_arg. Note that we still -# keep attention to performance here so we as much as possible try to avoid -# calling sed binary (so far O(N) complexity as long as func_append is O(1)). -func_quote_portable () -{ - $debug_cmd - - $require_check_ifs_backslash - - func_quote_portable_result=$2 - - # one-time-loop (easy break) - while true - do - if $1; then - func_quote_portable_result=`$ECHO "$2" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` - break - fi - - # Quote for eval. - case $func_quote_portable_result in - *[\\\`\"\$]*) - # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string - # contains the shell wildcard characters. - case $check_ifs_backshlash_broken$func_quote_portable_result in - :*|*[\[\*\?]*) - func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ - | $SED "$sed_quote_subst"` - break - ;; - esac - - func_quote_portable_old_IFS=$IFS - for _G_char in '\' '`' '"' '$' - do - # STATE($1) PREV($2) SEPARATOR($3) - set start "" "" - func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy - IFS=$_G_char - for _G_part in $func_quote_portable_result - do - case $1 in - quote) - func_append func_quote_portable_result "$3$2" - set quote "$_G_part" "\\$_G_char" - ;; - start) - set first "" "" - func_quote_portable_result= - ;; - first) - set quote "$_G_part" "" - ;; - esac - done - done - IFS=$func_quote_portable_old_IFS - ;; - *) ;; - esac - break - done - - func_quote_portable_unquoted_result=$func_quote_portable_result - case $func_quote_portable_result in - # double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # many bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_portable_result=\"$func_quote_portable_result\" - ;; - esac -} - - -# func_quotefast_eval ARG -# ----------------------- -# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', -# but optimized for speed. Result is stored in $func_quotefast_eval. -if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then - printf -v _GL_test_printf_tilde %q '~' - if test '\~' = "$_GL_test_printf_tilde"; then - func_quotefast_eval () - { - printf -v func_quotefast_eval_result %q "$1" - } - else - # Broken older Bash implementations. Make those faster too if possible. - func_quotefast_eval () - { - case $1 in - '~'*) - func_quote_portable false "$1" - func_quotefast_eval_result=$func_quote_portable_result - ;; - *) - printf -v func_quotefast_eval_result %q "$1" - ;; - esac - } - fi -else - func_quotefast_eval () - { - func_quote_portable false "$1" - func_quotefast_eval_result=$func_quote_portable_result - } -fi - - -# func_quote_arg MODEs ARG -# ------------------------ -# Quote one ARG to be evaled later. MODEs argument may contain zero or more -# specifiers listed below separated by ',' character. This function returns two -# values: -# i) func_quote_arg_result -# double-quoted (when needed), suitable for a subsequent eval -# ii) func_quote_arg_unquoted_result -# has all characters that are still active within double -# quotes backslashified. Available only if 'unquoted' is specified. -# -# Available modes: -# ---------------- -# 'eval' (default) -# - escape shell special characters -# 'expand' -# - the same as 'eval'; but do not quote variable references -# 'pretty' -# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might -# be used later in func_quote to get output like: 'echo "a b"' instead -# of 'echo a\ b'. This is slower than default on some shells. -# 'unquoted' -# - produce also $func_quote_arg_unquoted_result which does not contain -# wrapping double-quotes. -# -# Examples for 'func_quote_arg pretty,unquoted string': -# -# string | *_result | *_unquoted_result -# ------------+-----------------------+------------------- -# " | \" | \" -# a b | "a b" | a b -# "a b" | "\"a b\"" | \"a b\" -# * | "*" | * -# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" -# -# Examples for 'func_quote_arg pretty,unquoted,expand string': -# -# string | *_result | *_unquoted_result -# --------------+---------------------+-------------------- -# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" -func_quote_arg () -{ - _G_quote_expand=false - case ,$1, in - *,expand,*) - _G_quote_expand=: - ;; - esac - - case ,$1, in - *,pretty,*|*,expand,*|*,unquoted,*) - func_quote_portable $_G_quote_expand "$2" - func_quote_arg_result=$func_quote_portable_result - func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result - ;; - *) - # Faster quote-for-eval for some shells. - func_quotefast_eval "$2" - func_quote_arg_result=$func_quotefast_eval_result - ;; - esac -} - - -# func_quote MODEs ARGs... -# ------------------------ -# Quote all ARGs to be evaled later and join them into single command. See -# func_quote_arg's description for more info. -func_quote () -{ - $debug_cmd - _G_func_quote_mode=$1 ; shift - func_quote_result= - while test 0 -lt $#; do - func_quote_arg "$_G_func_quote_mode" "$1" - if test -n "$func_quote_result"; then - func_append func_quote_result " $func_quote_arg_result" - else - func_append func_quote_result "$func_quote_arg_result" - fi - shift - done -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_arg pretty,expand "$_G_cmd" - eval "func_notquiet $func_quote_arg_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_arg expand,pretty "$_G_cmd" - eval "func_echo $func_quote_arg_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- -# Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. -func_warning () -{ - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - printf '%s\n%s\n' "$1" "$2" \ - | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n -} - -# func_lt_ver PREV CURR -# --------------------- -# Return true if PREV and CURR are in the correct order according to -# func_sort_ver, otherwise false. Use it like this: -# -# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." -func_lt_ver () -{ - $debug_cmd - - test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# This is free software. There is NO warranty; not even for -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# Copyright (C) 2010-2019, 2021 Bootstrap Authors -# -# This file is dual licensed under the terms of the MIT license -# , and GPL version 2 or later -# . You must apply one of -# these licenses when using or redistributing this software or any of -# the files within it. See the URLs above, or the file `LICENSE` -# included in the Bootstrap distribution for the full license texts. - -# Please report bugs or propose patches to: -# - -# Set a version string for this script. -scriptversion=2019-02-19.15; # UTC - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# Copyright'. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug in processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# in the main code. A hook is just a list of function names that can be -# run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of hook functions to be called by -# FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_propagate_result FUNC_NAME_A FUNC_NAME_B -# --------------------------------------------- -# If the *_result variable of FUNC_NAME_A _is set_, assign its value to -# *_result variable of FUNC_NAME_B. -func_propagate_result () -{ - $debug_cmd - - func_propagate_result_result=: - if eval "test \"\${${1}_result+set}\" = set" - then - eval "${2}_result=\$${1}_result" - else - func_propagate_result_result=false - fi -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It's assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook functions." ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - func_unset "${_G_hook}_result" - eval $_G_hook '${1+"$@"}' - func_propagate_result $_G_hook func_run_hooks - if $func_propagate_result_result; then - eval set dummy "$func_run_hooks_result"; shift - fi - done -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list from your hook function. You may remove -# or edit any options that you action, and then pass back the remaining -# unprocessed options in '_result', escaped -# suitably for 'eval'. -# -# The '_result' variable is automatically unset -# before your hook gets called; for best performance, only set the -# *_result variable when necessary (i.e. don't call the 'func_quote' -# function unnecessarily because it can be an expensive operation on some -# machines). -# -# Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# # No change in '$@' (ignored completely by this hook). Leave -# # my_options_prep_result variable intact. -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# args_changed=false -# -# # Note that, for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: -# args_changed=: -# ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# args_changed=: -# ;; -# *) # Make sure the first unrecognised option "$_G_opt" -# # is added back to "$@" in case we need it later, -# # if $args_changed was set to 'true'. -# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; -# esac -# done -# -# # Only call 'func_quote' here if we processed at least one argument. -# if $args_changed; then -# func_quote eval ${1+"$@"} -# my_silent_option_result=$func_quote_result -# fi -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll also need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options_finish [ARG]... -# ---------------------------- -# Finishing the option parse loop (call 'func_options' hooks ATM). -func_options_finish () -{ - $debug_cmd - - func_run_hooks func_options ${1+"$@"} - func_propagate_result func_run_hooks func_options_finish -} - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () -{ - $debug_cmd - - _G_options_quoted=false - - for my_func in options_prep parse_options validate_options options_finish - do - func_unset func_${my_func}_result - func_unset func_run_hooks_result - eval func_$my_func '${1+"$@"}' - func_propagate_result func_$my_func func_options - if $func_propagate_result_result; then - eval set dummy "$func_options_result"; shift - _G_options_quoted=: - fi - done - - $_G_options_quoted || { - # As we (func_options) are top-level options-parser function and - # nobody quoted "$@" for us yet, we need to do it explicitly for - # caller. - func_quote eval ${1+"$@"} - func_options_result=$func_quote_result - } -} - - -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propagate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before returning. -func_hookable func_options_prep -func_options_prep () -{ - $debug_cmd - - # Option defaults: - opt_verbose=false - opt_warning_types= - - func_run_hooks func_options_prep ${1+"$@"} - func_propagate_result func_run_hooks func_options_prep -} - - -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () -{ - $debug_cmd - - _G_parse_options_requote=false - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} - func_propagate_result func_run_hooks func_parse_options - if $func_propagate_result_result; then - eval set dummy "$func_parse_options_result"; shift - # Even though we may have changed "$@", we passed the "$@" array - # down into the hook and it quoted it for us (because we are in - # this if-branch). No need to quote it again. - _G_parse_options_requote=false - fi - - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break - - # We expect that one of the options parsed in this function matches - # and thus we remove _G_opt from "$@" and need to re-quote. - _G_match_parse_options=: - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" >&2 - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; - - --warnings|--warning|-W) - if test $# = 0 && func_missing_arg $_G_opt; then - _G_parse_options_requote=: - break - fi - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) _G_parse_options_requote=: ; break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift - _G_match_parse_options=false - break - ;; - esac - - if $_G_match_parse_options; then - _G_parse_options_requote=: - fi - done - - if $_G_parse_options_requote; then - # save modified positional parameters for caller - func_quote eval ${1+"$@"} - func_parse_options_result=$func_quote_result - fi -} - - -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () -{ - $debug_cmd - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - - func_run_hooks func_validate_options ${1+"$@"} - func_propagate_result func_run_hooks func_validate_options - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE -} - - - -## ----------------- ## -## Helper functions. ## -## ----------------- ## - -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. - - -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - eval \$ECHO \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - - -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message" - exit 0 -} - - -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $debug_cmd - - func_error "Missing argument for '$1'." - exit_cmd=exit -} - - -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables -# after splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - if test "x$func_split_equals_lhs" = "x$1"; then - func_split_equals_rhs= - fi - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs=" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals - - -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt - - -# func_usage -# ---------- -# Echo short help message to standard output and exit. -func_usage () -{ - $debug_cmd - - func_usage_message - $ECHO "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 -} - - -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$ECHO \""$usage_message"\" -} - - -# func_version -# ------------ -# Echo version message to standard output and exit. -# The version message is extracted from the calling file's header -# comments, with leading '# ' stripped: -# 1. First display the progname and version -# 2. Followed by the header comment line matching /^# Written by / -# 3. Then a blank line followed by the first following line matching -# /^# Copyright / -# 4. Immediately followed by any lines between the previous matches, -# except lines preceding the intervening completely blank line. -# For example, see the header comments of this file. -func_version () -{ - $debug_cmd - - printf '%s\n' "$progname $scriptversion" - $SED -n ' - /^# Written by /!b - s|^# ||; p; n - - :fwd2blnk - /./ { - n - b fwd2blnk - } - p; n - - :holdwrnt - s|^# || - s|^# *$|| - /^Copyright /!{ - /./H - n - b holdwrnt - } - - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - G - s|\(\n\)\n*|\1|g - p; q' < "$progpath" - - exit $? -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: - -# Set a version string. -scriptversion='(GNU libtool) 2.4.7' - - -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd - - $warning_func ${1+"$@"} -} - - -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" - -# Additional text appended to 'usage_message' in response to '--help'. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.7 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to . -GNU libtool home page: . -General help using GNU software: ." - exit 0 -} - - -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. - -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' - - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } - - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi - - -# func_fatal_configuration ARG... -# ------------------------------- -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." -} - - -# func_config -# ----------- -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - - -# func_features -# ------------- -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test yes = "$build_libtool_libs"; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test yes = "$build_old_libs"; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - - -# func_enable_tag TAGNAME -# ----------------------- -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname=$1 - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - - -# func_check_version_match -# ------------------------ -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - _G_rc_lt_options_prep=: - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - *) - _G_rc_lt_options_prep=false - ;; - esac - - if $_G_rc_lt_options_prep; then - # Pass back the list of options. - func_quote eval ${1+"$@"} - libtool_options_prep_result=$func_quote_result - fi -} -func_add_hook func_options_prep libtool_options_prep - - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () -{ - $debug_cmd - - _G_rc_lt_parse_options=false - - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_match_lt_parse_options=: - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"} ; shift - _G_match_lt_parse_options=false - break - ;; - esac - $_G_match_lt_parse_options && _G_rc_lt_parse_options=: - done - - if $_G_rc_lt_parse_options; then - # save modified positional parameters for caller - func_quote eval ${1+"$@"} - libtool_parse_options_result=$func_quote_result - fi -} -func_add_hook func_parse_options libtool_parse_options - - - -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () -{ - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi - - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" - - # Keeping compiler generated duplicates in $postdeps and $predeps is not - # harmful, and is necessary in a majority of systems that use it to satisfy - # symbol dependencies. - opt_duplicate_compiler_generated_deps=: - - $opt_help || { - # Sanity checks first: - func_check_version_match - - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } - - # Pass back the unparsed argument list - func_quote eval ${1+"$@"} - libtool_validate_options_result=$func_quote_result -} -func_add_hook func_validate_options libtool_validate_options - - -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift - - - -## ----------- ## -## Main. ## -## ----------- ## - -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' - -# Global variables. -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# func_generated_by_libtool -# True iff stdin has been generated by Libtool. This function is only -# a basic sanity check; it will hardly flush out determined imposters. -func_generated_by_libtool_p () -{ - $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case $lalib_p_line in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test yes = "$lalib_p" -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - test -f "$1" && - $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $debug_cmd - - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. -func_source () -{ - $debug_cmd - - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $debug_cmd - - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' - else - write_lobj=none - fi - - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $debug_cmd - - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $debug_cmd - - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $debug_cmd - - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $debug_cmd - - if test -z "$2" && test -n "$1"; then - func_error "Could not determine host file name corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result=$1 - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $debug_cmd - - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " '$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result=$3 - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $debug_cmd - - case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via '$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $debug_cmd - - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $debug_cmd - - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result=$1 -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via '$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $debug_cmd - - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $debug_cmd - - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result=$1 -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - -# func_mode_compile arg... -func_mode_compile () -{ - $debug_cmd - - # Get the compilation command and the source file. - base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg=$arg - arg_mode=normal - ;; - - target ) - libobj=$arg - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs=$IFS; IFS=, - for arg in $args; do - IFS=$save_ifs - func_append_quoted lastarg "$arg" - done - IFS=$save_ifs - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg=$srcfile - srcfile=$arg - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with '-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj=$func_basename_result - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from '$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_arg pretty "$libobj" - test "X$libobj" != "X$func_quote_arg_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test yes = "$build_old_libs"; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test warn = "$need_locks"; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_arg pretty "$srcfile" - qsrcfile=$func_quote_arg_result - - # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test no != "$pic_mode"; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test yes = "$compiler_c_o"; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test no != "$need_locks"; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking - -Wc,FLAG - -Xcompiler FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a 'standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to '-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE use a list of object files found in FILE to specify objects - -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wa,FLAG - -Xassembler FLAG pass linker-specific FLAG directly to the assembler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with '-') are ignored. - -Every other argument is treated as a filename. Files ending in '.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. - -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode '$opt_mode'" - ;; - esac - - echo - $ECHO "Try '$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test : = "$opt_help"; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | $SED -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - $SED '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $debug_cmd - - # The first argument is the command name. - cmd=$nonopt - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "'$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir=$func_dirname_result - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir=$func_dirname_result - ;; - - *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic=$magic - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file=$progdir/$program - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file=$progdir/$program - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd=\$cmd$args - fi -} - -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $debug_cmd - - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "'$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument '$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the '$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $debug_cmd - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then - # Aesthetically quote it. - func_quote_arg pretty "$nonopt" - install_prog="$func_quote_arg_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_arg pretty "$arg" - func_append install_prog "$func_quote_arg_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=false - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=: ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_arg pretty "$arg" - func_append install_prog " $func_quote_arg_result" - if test -n "$arg2"; then - func_quote_arg pretty "$arg2" - fi - func_append install_shared_prog " $func_quote_arg_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_arg pretty "$install_override_mode" - func_append install_shared_prog " -m $func_quote_arg_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "'$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir=$func_dirname_result - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking '$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname=$1 - shift - - srcname=$realname - test -n "$relink_command" && srcname=${realname}T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme=$stripme - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme= - ;; - esac - ;; - os2*) - case $realname in - *_dll.a) - tstripme= - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib=$destdir/$realname - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest=$destfile - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to '$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test yes = "$build_old_libs"; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext= - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=.exe - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" - - finalize=: - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test no = "$fast_install" && test -n "$relink_command"; then - $opt_dry_run || { - if $finalize; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_quiet || { - func_quote_arg expand,pretty "$relink_command" - eval "func_echo $func_quote_arg_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink '$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file=$outputname - else - func_warning "cannot relink '$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name=$func_basename_result - - # Set up the ranlib parameters. - oldlib=$destdir/$name - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test install = "$opt_mode" && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* External symbol declarations for the compiler. */\ -" - - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp - $opt_dry_run || { - $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" - func_basename "$dlprefile" - name=$func_basename_result - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ -" - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" - echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi - echo >> "$output_objdir/$my_dlsyms" "\ -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' - - # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for '$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $debug_cmd - - win32_libid_type=unknown - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s|.*|import| - p - q - } - }'` - ;; - esac - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $debug_cmd - - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $debug_cmd - - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result= - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $debug_cmd - - my_gentop=$1; shift - my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib=$func_basename_result - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" - cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result=$my_oldobjs -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - func_quote_arg pretty "$ECHO" - qECHO=$func_quote_arg_result - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=$qECHO - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test yes = "$fast_install"; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - \$ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* declarations of non-ANSI functions */ -#if defined __MINGW32__ -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined __CYGWIN__ -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined other_platform || defined ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined _MSC_VER -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined __CYGWIN__ -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined other platforms ... */ -#endif - -#if defined PATH_MAX -# define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ -} while (0) - -#if defined LT_DEBUGWRAPPER -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - size_t tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined HAVE_DOS_BASED_FILE_SYSTEM - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined HAVE_DOS_BASED_FILE_SYSTEM - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = (size_t) (q - p); - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (STREQ (str, pat)) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - size_t len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - size_t orig_value_len = strlen (orig_value); - size_t add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - size_t len = strlen (new_value); - while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[--len] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $debug_cmd - - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_suncc_cstd_abi -# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! -# Several compiler flags select an ABI that is incompatible with the -# Cstd library. Avoid specifying it if any are in CXXFLAGS. -func_suncc_cstd_abi () -{ - $debug_cmd - - case " $compile_command " in - *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) - suncc_use_cstd_abi=no - ;; - *) - suncc_use_cstd_abi=yes - ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $debug_cmd - - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - os2dllname= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=false - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module=$wl-single_module - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg=$1 - shift - func_quote_arg pretty,unquoted "$arg" - qarg=$func_quote_arg_unquoted_result - func_append libtool_args " $func_quote_arg_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir=$arg - prev= - continue - ;; - dlfiles|dlprefiles) - $preload || { - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=: - } - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test no = "$dlself"; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test dlprefiles = "$prev"; then - dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test dlfiles = "$prev"; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols=$arg - test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex=$arg - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - if test none != "$pic_object"; then - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - fi - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file '$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - os2dllname) - os2dllname=$arg - prev= - continue - ;; - precious_regex) - precious_files_regex=$arg - prev= - continue - ;; - release) - release=-$arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test rpath = "$prev"; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds=$arg - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xassembler) - func_append compiler_flags " -Xassembler $qarg" - prev= - func_append compile_command " -Xassembler $qarg" - func_append finalize_command " -Xassembler $qarg" - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg=$arg - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test X-export-symbols = "X$arg"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" - else - func_fatal_error "need path for '-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) - # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test X-lc = "X$arg" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue - ;; - esac - elif test X-lc_r = "X$arg"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -mllvm) - prev=mllvm - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. - -pthread) - case $host in - *solaris2*) ;; - *) - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - ;; - esac - continue - ;; - -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module=$wl-multi_module - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -os2dllname) - prev=os2dllname - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do - IFS=$save_ifs - func_quote_arg pretty "$flag" - func_append arg " $func_quote_arg_result" - func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" - func_append arg " $wl$func_quote_arg_result" - func_append compiler_flags " $wl$func_quote_arg_result" - func_append linker_flags " $func_quote_arg_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xassembler) - prev=xassembler - continue - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_arg pretty "$arg" - arg=$func_quote_arg_result - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # -fstack-protector* stack protector flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -specs=* GCC specs files - # -stdlib=* select c++ std lib with clang - # -fsanitize=* Clang/GCC memory and address sanitizer - # -fuse-ld=* Linker select flags for GCC - # -Wa,* Pass flags directly to the assembler - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) - func_quote_arg pretty "$arg" - arg=$func_quote_arg_result - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - -Z*) - if test os2 = "`expr $host : '.*\(os2\)'`"; then - # OS/2 uses -Zxxx to specify OS/2-specific options - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case $arg in - -Zlinker | -Zstack) - prev=xcompiler - ;; - esac - continue - else - # Otherwise treat like 'Some other compiler flag' below - func_quote_arg pretty "$arg" - arg=$func_quote_arg_result - fi - ;; - - # Some other compiler flag. - -* | +*) - func_quote_arg pretty "$arg" - arg=$func_quote_arg_result - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - test none = "$pic_object" || { - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - } - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test dlprefiles = "$prev"; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_arg pretty "$arg" - arg=$func_quote_arg_result - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" - - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - # Definition is injected by LT_CONFIG during libtool generation. - func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" - - func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test lib = "$linkmode"; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=false - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs=$tmp_deplibs - fi - - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs - deplibs= - fi - if test prog = "$linkmode"; then - case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test lib,dlpreopen = "$linkmode,$pass"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs=$dlprefiles - fi - if test dlopen = "$pass"; then - # Collect dlpreopened libraries - save_deplibs=$deplibs - deplibs= - fi - - for deplib in $libs; do - lib= - found=false - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test lib = "$linkmode"; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib=$searchdir/lib$name$search_ext - if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: - else - found=false - fi - break 2 - fi - done - done - if $found; then - # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll=$l - done - if test "X$ll" = "X$old_library"; then # only static version available - found=false - func_dirname "$lib" "" "." - ladir=$func_dirname_result - lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - ;; # -l - *.ltframework) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test conv = "$pass" && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - if test scan = "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "'-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test link = "$pass"; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=false - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: - fi - ;; - pass_all) - valid_a_lib=: - ;; - esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - fi - ;; - esac - continue - ;; - prog) - if test link != "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=: - continue - ;; - esac # case $deplib - - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir=$func_dirname_result - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test conv = "$pass"; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - elif test prog != "$linkmode" && test lib != "$linkmode"; 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 yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib=$l - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - - # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" - if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir - fi - ;; - esac - func_basename "$lib" - laname=$func_basename_result - - # Find the relevant object directory and library name. - if test yes = "$installed"; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir - else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir - fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" - fi - case $host in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test lib = "$linkmode"; then - deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test prog = "$linkmode" && test link != "$pass"; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if $linkalldeplibs; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test prog,link = "$linkmode,$pass"; then - if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then - # Make sure the rpath contains only unique directories. - case $temp_rpath: in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then - use_static_libs=no - fi - if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test no = "$installed"; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest - break - fi - done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then - echo - if test prog = "$linkmode"; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname=$1 - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname=$dlname - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc* | *os2*) - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - esac - eval soname=\"$soname_spec\" - else - soname=$realname - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot=$soname - func_basename "$soroot" - soname=$func_basename_result - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from '$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test prog = "$linkmode" || test relink != "$opt_mode"; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib - case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add=$dir/$old_library - fi - elif test -n "$old_library"; then - add=$dir/$old_library - fi - fi - esac - elif test no = "$hardcode_minus_L"; then - case $host in - *-*-sunos*) add_shlibpath=$dir ;; - esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test yes != "$lib_linked"; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test prog = "$linkmode"; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test prog = "$linkmode" || test relink = "$opt_mode"; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add=-l$name - elif test yes = "$hardcode_automatic"; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib - else - add=$libdir/$linklib - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - fi - - if test prog = "$linkmode"; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test prog = "$linkmode"; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test yes = "$build_libtool_libs"; then - # Not a shared library - if test pass_all != "$deplibs_check_method"; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test lib = "$linkmode"; then - if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs=$temp_deplibs - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test no != "$link_all_deplibs"; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path=$deplib ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" - path= - fi - fi - ;; - *) - path=-L$absdir/$objdir - ;; - esac - else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" - - path=-L$absdir - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test dlopen != "$pass"; then - test conv = "$pass" || { - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - } - - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" - else - vars=deplibs - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - - # Add Sun CC postdeps if required: - test CXX = "$tagname" && { - case $host_os in - linux*) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ C*) # Sun C++ 5.9 - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - - solaris*) - func_cc_basename "$CC" - case $func_cc_basename_result in - CC* | sunCC*) - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - esac - } - - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i= - ;; - esac - if test -n "$i"; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles - fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "'-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs=$output - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form 'libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" - - if test no != "$need_lib_prefix"; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" - - install_libdir=$1 - - oldlibs= - if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then - # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs=$IFS; IFS=: - set dummy $vinfo 0 0 0 - shift - IFS=$save_ifs - - test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major=$1 - number_minor=$2 - number_revision=$3 - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # that has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_revision - ;; - freebsd-aout|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_minor - lt_irix_increment=no - ;; - esac - ;; - no) - current=$1 - revision=$2 - age=$3 - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac - ;; - - freebsd-aout) - major=.$current - versuffix=.$current.$revision - ;; - - freebsd-elf | midnightbsd-elf) - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - irix | nonstopux) - if test no = "$lt_irix_increment"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring=$verstring_prefix$major.$revision - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test 0 -ne "$loop"; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring - done - - # Before this point, $major must not contain '.'. - major=.$major - versuffix=$major.$revision - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision - - # Add in all the interfaces that we are compatible with. - loop=$age - while test 0 -ne "$loop"; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring:$iface.0 - done - - # Make executables depend on our current version. - func_append verstring ":$current.0" - ;; - - qnx) - major=.$current - versuffix=.$current - ;; - - sco) - major=.$current - versuffix=.$current - ;; - - sunos) - major=.$current - versuffix=.$current.$revision - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - - *) - func_fatal_configuration "unknown library version type '$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring=0.0 - ;; - esac - if test no = "$need_version"; then - versuffix= - else - versuffix=.0.0 - fi - fi - - # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then - major= - versuffix= - verstring= - fi - - # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi - fi - else - # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag - fi - - fi - - func_generate_dlsyms "$libname" "$libname" : - func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= - - if test relink != "$opt_mode"; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test yes = "$build_libtool_libs"; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release= - versuffix= - major= - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib=$potent_lib - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= - ;; - esac - fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs= - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test none = "$deplibs_check_method"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test yes = "$droppeddeps"; then - if test yes = "$module"; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test no = "$allow_undefined"; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs=$new_libs - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test yes = "$hardcode_into_libs"; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname=$1 - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname=$realname - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib=$output_objdir/$realname - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols=$export_symbols - export_symbols= - always_export_symbols=yes - } - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' - for cmd1 in $cmds; do - IFS=$save_ifs - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test yes = "$try_normal_branch" \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=$output_objdir/$output_la.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs=$tmp_deplibs - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test : != "$skipped_export" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test yes = "$compiler_needs_object"; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test -z "$objlist" || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test 1 -eq "$k"; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-$k.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - } - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' - for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { - func_quote_arg expand,pretty "$cmd" - eval "func_echo $func_quote_arg_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - ${skipped_export-false} && { - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - } - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs=$IFS; IFS='~' - for cmd in $cmds; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { - func_quote_arg expand,pretty "$cmd" - eval "func_echo $func_quote_arg_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then - # On all known operating systems, these are identical. - dlname=$soname - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "'-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj=$output - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # if reload_cmds runs $LD directly, get rid of -Wl from - # whole_archive_flag_spec and hope we can get by with turning comma - # into space. - case $reload_cmds in - *\$LD[\ \$]*) wl= ;; - esac - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags - else - gentop=$output_objdir/${obj}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects - - # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - - output=$obj - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - test yes = "$build_libtool_libs" || { - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - } - - if test -n "$pic_flag" || test default != "$pic_mode"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output=$libobj - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "'-release' is ignored for programs" - - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs=$new_libs - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath=$rpath - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath=$rpath - - if test -n "$libobjs" && test yes = "$build_old_libs"; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" false - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=: - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false - ;; - *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false - ;; - *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false - fi - ;; - esac - $wrappers_required || { - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' - fi - - exit $exit_status - } - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test yes = "$no_install"; then - # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_arg pretty "$var_value" - relink_command="$var=$func_quote_arg_result; export $var; $relink_command" - fi - done - func_quote eval cd "`pwd`" - func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" - relink_command=$func_quote_arg_unquoted_result - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience - build_libtool_libs=no - ;; - *) - oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac - - if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase=$func_basename_result - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test -z "$oldobjs"; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_arg pretty,unquoted "$var_value" - relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - func_quote eval cd "`pwd`" - relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - func_quote_arg pretty,unquoted "$relink_command" - relink_command=$func_quote_arg_unquoted_result - if test yes = "$hardcode_automatic"; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test yes = "$installed"; then - if test -z "$install_libdir"; then - break - fi - output=$output_objdir/${outputname}i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name=$func_basename_result - func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs=$newdependency_libs - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles=$newdlprefiles - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles=$newdlprefiles - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that cannot go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $debug_cmd - - RM=$nonopt - files= - rmforce=false - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=: ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir - else - odir=$dir/$objdir - fi - func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir - - # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif $rmforce; then - continue - fi - - rmfiles=$file - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case $opt_mode in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test clean = "$opt_mode"; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the $objdir's in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi - -test -z "$opt_mode" && { - help=$generic_help - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/missing b/lib/libcgroup-3.1.0/build-aux/missing deleted file mode 100755 index 1fe1611f185..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/test-driver b/lib/libcgroup-3.1.0/build-aux/test-driver deleted file mode 100755 index be73b80adf9..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/test-driver +++ /dev/null @@ -1,153 +0,0 @@ -#! /bin/sh -# test-driver - basic testsuite driver script. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 2011-2021 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -usage_error () -{ - echo "$0: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat <"$log_file" -"$@" >>"$log_file" 2>&1 -estatus=$? - -if test $enable_hard_errors = no && test $estatus -eq 99; then - tweaked_estatus=1 -else - tweaked_estatus=$estatus -fi - -case $tweaked_estatus:$expect_failure in - 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; - 0:*) col=$grn res=PASS recheck=no gcopy=no;; - 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; - 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; - *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; - *:*) col=$red res=FAIL recheck=yes gcopy=yes;; -esac - -# Report the test outcome and exit status in the logs, so that one can -# know whether the test passed or failed simply by looking at the '.log' -# file, without the need of also peaking into the corresponding '.trs' -# file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>"$log_file" - -# Report outcome to console. -echo "${col}${res}${std}: $test_name" - -# Register the test result, and other relevant metadata. -echo ":test-result: $res" > $trs_file -echo ":global-test-result: $res" >> $trs_file -echo ":recheck: $recheck" >> $trs_file -echo ":copy-in-global-log: $gcopy" >> $trs_file - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/build-aux/ylwrap b/lib/libcgroup-3.1.0/build-aux/ylwrap deleted file mode 100755 index e8ec109fa26..00000000000 --- a/lib/libcgroup-3.1.0/build-aux/ylwrap +++ /dev/null @@ -1,247 +0,0 @@ -#! /bin/sh -# ylwrap - wrapper for lex/yacc invocations. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -get_dirname () -{ - case $1 in - */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; - # Otherwise, we want the empty string (not "."). - esac -} - -# guard FILE -# ---------- -# The CPP macro used to guard inclusion of FILE. -guard () -{ - printf '%s\n' "$1" \ - | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ - -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ - -e 's/__*/_/g' -} - -# quote_for_sed [STRING] -# ---------------------- -# Return STRING (or stdin) quoted to be used as a sed pattern. -quote_for_sed () -{ - case $# in - 0) cat;; - 1) printf '%s\n' "$1";; - esac \ - | sed -e 's|[][\\.*]|\\&|g' -} - -case "$1" in - '') - echo "$0: No files given. Try '$0 --help' for more information." 1>&2 - exit 1 - ;; - --basedir) - basedir=$2 - shift 2 - ;; - -h|--h*) - cat <<\EOF -Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... - -Wrapper for lex/yacc invocations, renaming files as desired. - - INPUT is the input file - OUTPUT is one file PROG generates - DESIRED is the file we actually want instead of OUTPUT - PROGRAM is program to run - ARGS are passed to PROG - -Any number of OUTPUT,DESIRED pairs may be used. - -Report bugs to . -EOF - exit $? - ;; - -v|--v*) - echo "ylwrap $scriptversion" - exit $? - ;; -esac - - -# The input. -input=$1 -shift -# We'll later need for a correct munging of "#line" directives. -input_sub_rx=`get_dirname "$input" | quote_for_sed` -case $input in - [\\/]* | ?:[\\/]*) - # Absolute path; do nothing. - ;; - *) - # Relative path. Make it absolute. - input=`pwd`/$input - ;; -esac -input_rx=`get_dirname "$input" | quote_for_sed` - -# Since DOS filename conventions don't allow two dots, -# the DOS version of Bison writes out y_tab.c instead of y.tab.c -# and y_tab.h instead of y.tab.h. Test to see if this is the case. -y_tab_nodot=false -if test -f y_tab.c || test -f y_tab.h; then - y_tab_nodot=true -fi - -# The parser itself, the first file, is the destination of the .y.c -# rule in the Makefile. -parser=$1 - -# A sed program to s/FROM/TO/g for all the FROM/TO so that, for -# instance, we rename #include "y.tab.h" into #include "parse.h" -# during the conversion from y.tab.c to parse.c. -sed_fix_filenames= - -# Also rename header guards, as Bison 2.7 for instance uses its header -# guard in its implementation file. -sed_fix_header_guards= - -while test $# -ne 0; do - if test x"$1" = x"--"; then - shift - break - fi - from=$1 - # Handle y_tab.c and y_tab.h output by DOS - if $y_tab_nodot; then - case $from in - "y.tab.c") from=y_tab.c;; - "y.tab.h") from=y_tab.h;; - esac - fi - shift - to=$1 - shift - sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" - sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" -done - -# The program to run. -prog=$1 -shift -# Make any relative path in $prog absolute. -case $prog in - [\\/]* | ?:[\\/]*) ;; - *[\\/]*) prog=`pwd`/$prog ;; -esac - -dirname=ylwrap$$ -do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' -trap "ret=129; $do_exit" 1 -trap "ret=130; $do_exit" 2 -trap "ret=141; $do_exit" 13 -trap "ret=143; $do_exit" 15 -mkdir $dirname || exit 1 - -cd $dirname - -case $# in - 0) "$prog" "$input" ;; - *) "$prog" "$@" "$input" ;; -esac -ret=$? - -if test $ret -eq 0; then - for from in * - do - to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` - if test -f "$from"; then - # If $2 is an absolute path name, then just use that, - # otherwise prepend '../'. - case $to in - [\\/]* | ?:[\\/]*) target=$to;; - *) target=../$to;; - esac - - # Do not overwrite unchanged header files to avoid useless - # recompilations. Always update the parser itself: it is the - # destination of the .y.c rule in the Makefile. Divert the - # output of all other files to a temporary file so we can - # compare them to existing versions. - if test $from != $parser; then - realtarget=$target - target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` - fi - - # Munge "#line" or "#" directives. Don't let the resulting - # debug information point at an absolute srcdir. Use the real - # output file name, not yy.lex.c for instance. Adjust the - # include guards too. - sed -e "/^#/!b" \ - -e "s|$input_rx|$input_sub_rx|" \ - -e "$sed_fix_filenames" \ - -e "$sed_fix_header_guards" \ - "$from" >"$target" || ret=$? - - # Check whether files must be updated. - if test "$from" != "$parser"; then - if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then - echo "$to is unchanged" - rm -f "$target" - else - echo "updating $to" - mv -f "$target" "$realtarget" - fi - fi - else - # A missing file is only an error for the parser. This is a - # blatant hack to let us support using "yacc -d". If -d is not - # specified, don't fail when the header file is "missing". - if test "$from" = "$parser"; then - ret=1 - fi - fi - done -fi - -# Remove the directory. -cd .. -rm -rf $dirname - -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/lib/libcgroup-3.1.0/config.h.in b/lib/libcgroup-3.1.0/config.h.in deleted file mode 100644 index a26397bdae5..00000000000 --- a/lib/libcgroup-3.1.0/config.h.in +++ /dev/null @@ -1,190 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Cgrulesengd socket path */ -#undef CGRULE_CGRED_SOCKET_PATH - -/* Python bindings build flag. */ -#undef ENABLE_PYTHON - -/* Define to 1 if your system has a working `chown' function. */ -#undef HAVE_CHOWN - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `getmntent' function. */ -#undef HAVE_GETMNTENT - -/* Define to 1 if you have the `hasmntopt' function. */ -#undef HAVE_HASMNTOPT - -/* 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 `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have the header file. */ -#undef HAVE_MNTENT_H - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the header file. */ -#undef HAVE_SECURITY_PAM_EXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SECURITY_PAM_MODULES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SECURITY_PAM_MODUTIL_H - -/* 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_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define if you have `strerror_r'. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MOUNT_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#undef LT_OBJDIR - -/* Define to ignore specific hierarchy. */ -#undef OPAQUE_HIERARCHY - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ -#undef YYTEXT_POINTER - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `int' if doesn't define. */ -#undef gid_t - -/* 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 the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define as a signed integer type capable of holding a process identifier. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `int' if doesn't define. */ -#undef uid_t diff --git a/lib/libcgroup-3.1.0/configure b/lib/libcgroup-3.1.0/configure deleted file mode 100755 index 3a79da0d0ba..00000000000 --- a/lib/libcgroup-3.1.0/configure +++ /dev/null @@ -1,23756 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libcgroup 3.1.0. -# -# -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 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 -as_nop=: -if test ${ZSH_VERSION+y} && (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 $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; 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 - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - 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 - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (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 \$as_nop - 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 \$as_nop - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : - as_have_required=yes -else $as_nop - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : - -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : - break 2 -fi -fi - done;; - esac - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi - - - if test "x$CONFIG_SHELL" != x -then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." - else - printf "%s\n" "$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_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# 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=`printf "%s\n" "$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 || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - 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_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# 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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$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 || -printf "%s\n" 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" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -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 - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='libcgroup' -PACKAGE_TARNAME='libcgroup' -PACKAGE_VERSION='3.1.0' -PACKAGE_STRING='libcgroup 3.1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_c_list= -ac_unique_file="src" -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -CODE_COVERAGE_RULES -CODE_COVERAGE_LDFLAGS -CODE_COVERAGE_LIBS -CODE_COVERAGE_CXXFLAGS -CODE_COVERAGE_CFLAGS -CODE_COVERAGE_CPPFLAGS -GENHTML -LCOV -GCOV -CODE_COVERAGE_ENABLED -CODE_COVERAGE_ENABLED_FALSE -CODE_COVERAGE_ENABLED_TRUE -LIBOBJS -CPP -LEXLIB -LEX_OUTPUT_ROOT -LEX -REALLY_YACC -YFLAGS -YACC -CXXCPP -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX -WITH_SAMPLES_FALSE -WITH_SAMPLES_TRUE -WITH_TESTS_FALSE -WITH_TESTS_TRUE -pamlibdir -WITH_INITSCRIPT_INSTALL_FALSE -WITH_INITSCRIPT_INSTALL_TRUE -WITH_SYSTEMD_FALSE -WITH_SYSTEMD_TRUE -ENABLE_PYTHON_FALSE -ENABLE_PYTHON_TRUE -pkgpyexecdir -pyexecdir -pkgpythondir -pythondir -PYTHON_EXEC_PREFIX -PYTHON_PREFIX -PYTHON_PLATFORM -PYTHON_VERSION -PYTHON -WITH_DAEMON_FALSE -WITH_DAEMON_TRUE -WITH_PAM_FALSE -WITH_PAM_TRUE -WITH_TOOLS_FALSE -WITH_TOOLS_TRUE -LT_SYS_LIBRARY_PATH -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -DLLTOOL -OBJDUMP -FILECMD -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -ac_ct_AR -AR -LIBRARY_VERSION_RELEASE -LIBRARY_VERSION_MINOR -LIBRARY_VERSION_MAJOR -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -CSCOPE -ETAGS -CTAGS -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -enable_shared -enable_static -with_pic -enable_fast_install -with_aix_soname -with_gnu_ld -with_sysroot -enable_libtool_lock -enable_tools -enable_pam -enable_daemon -enable_python -with_python_sys_prefix -with_python_prefix -with_python_exec_prefix -enable_systemd -enable_initscript_install -enable_cgred_socket -enable_pam_module_dir -enable_opaque_hierarchy -enable_tests -enable_samples -with_gcov -enable_code_coverage -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -LT_SYS_LIBRARY_PATH -PYTHON -CXX -CXXFLAGS -CCC -CXXCPP -YACC -YFLAGS -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' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - 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=`printf "%s\n" "$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=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$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=`printf "%s\n" "$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. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$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" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" 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 libcgroup 3.1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/libcgroup] - --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 libcgroup 3.1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-tools compile libcgroup tools [default=yes] - --enable-pam compile libcgroup PAM module [default=yes] - --enable-daemon compile libcgroup daemon [default=yes] - --enable-python build the python bindings, requires cython - --enable-systemd enable systemd support [default=yes] - --enable-initscript-install - install init scripts [default=no] - --enable-cgred-socket=PATH - specify location of cgrulesengd communication socket - (default=/var/run/cgred.socket) - --enable-pam-module-dir=PATH - specify location of libcgroup PAM module - (default=$libdir/security) - --enable-opaque-hierarchy=NAME - specify name of a hierarchy which libcgroup should - ignore, e.g. name=systemd (default=none) - --enable-tests compile libcgroup tests [default=yes] - --enable-samples compile libcgroup samples C programs [default=no] - --enable-code-coverage Whether to enable code coverage support - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). - --with-python-sys-prefix - use Python's sys.prefix and sys.exec_prefix values - --with-python_prefix override the default PYTHON_PREFIX - --with-python_exec_prefix - override the default PYTHON_EXEC_PREFIX - --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). - -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 - LT_SYS_LIBRARY_PATH - User-defined run-time library search path. - PYTHON the Python interpreter - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. - 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 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$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 configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - 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 - printf "%s\n" "$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 -libcgroup configure 3.1.0 -generated by GNU Autoconf 2.71 - -Copyright (C) 2021 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 conftest.beam - 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\"" -printf "%s\n" "$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 - printf "%s\n" "$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_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam 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\"" -printf "%s\n" "$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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ - -#include -#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 (void) -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} 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 conftest.beam - 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\"" -printf "%s\n" "$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 - printf "%s\n" "$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_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$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 - printf "%s\n" "$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_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam 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\"" -printf "%s\n" "$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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -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 (void) -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# 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\"" -printf "%s\n" "$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 - printf "%s\n" "$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_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -printf %s "checking for int$2_t... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main (void) -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main (void) -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no" -then : - -else $as_nop - break -fi - done -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_intX_t - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to run 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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_check_decl -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - -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 libcgroup $as_me 3.1.0, which was -generated by GNU Autoconf 2.71. Invocation command line was - - $ $0$ac_configure_args_raw - -_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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "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=`printf "%s\n" "$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=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$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 - - printf "%s\n" "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$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 - -printf "%s\n" "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" -else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -fi - -for ac_site_file in $ac_site_files -do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*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 do not provoke an error unfortunately, instead are silently treated - as an "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 is necessary to write \x00 == 0 to get something - that is 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 **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - - -# Auxiliary files required by this configure script. -ac_aux_files="config.guess config.sub ltmain.sh compile ar-lib missing install-sh" - -# Locations in which to look for auxiliary files. -ac_aux_dir_candidates="${srcdir}/build-aux" - -# Search for a directory containing all of the required auxiliary files, -# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. -# If we don't find one directory that contains all the files we need, -# we report the set of missing files from the *first* directory in -# $ac_aux_dir_candidates and give up. -ac_missing_aux_files="" -ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in $ac_aux_dir_candidates -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 - ac_aux_dir_found=yes - ac_install_sh= - for ac_aux in $ac_aux_files - do - # As a special case, if "install-sh" is required, that requirement - # can be satisfied by any of "install-sh", "install.sh", or "shtool", - # and $ac_install_sh is set appropriately for whichever one is found. - if test x"$ac_aux" = x"install-sh" - then - if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 - ac_install_sh="${as_dir}install-sh -c" - elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 - ac_install_sh="${as_dir}install.sh -c" - elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 - ac_install_sh="${as_dir}shtool install -c" - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} install-sh" - else - break - fi - fi - else - if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" - else - break - fi - fi - fi - done - if test "$ac_aux_dir_found" = yes; then - ac_aux_dir="$as_dir" - break - fi - ac_first_candidate=false - - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$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. -if test -f "${ac_aux_dir}config.guess"; then - ac_config_guess="$SHELL ${ac_aux_dir}config.guess" -fi -if test -f "${ac_aux_dir}config.sub"; then - ac_config_sub="$SHELL ${ac_aux_dir}config.sub" -fi -if test -f "$ac_aux_dir/configure"; then - ac_configure="$SHELL ${ac_aux_dir}configure" -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,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$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=`printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-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 - - - - - - -am__api_version='1.16' - - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - # Account for fact that we put trailing slashes in our PATH walk. -case $as_dir in #(( - ./ | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test ${ac_cv_path_install+y}; 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$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' - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -printf %s "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` - - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - - - if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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" - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 -printf %s "checking for a race-free mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test ${ac_cv_path_mkdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue - case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test ${ac_cv_path_mkdir+y}; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -printf "%s\n" "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval test \${ac_cv_prog_make_${ac_make}_set+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - SET_MAKE= -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -printf %s "checking whether $am_make supports nested variables... " >&6; } -if test ${am_cv_make_support_nested_variables+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='libcgroup' - VERSION='3.1.0' - - -printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h - - -printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi - -if test -z "$ETAGS"; then - ETAGS=etags -fi - -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -printf %s "checking whether $am_make supports nested variables... " >&6; } -if test ${am_cv_make_support_nested_variables+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - - -# set library version, soname is libcgroup.so.MAJOR -LIBRARY_VERSION_MAJOR=3 - -LIBRARY_VERSION_MINOR=1 - -LIBRARY_VERSION_RELEASE=0 - - -# we do not want static libraries -#AC_DISABLE_STATIC - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -printf "%s\n" "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test ${enable_dependency_tracking+y} -then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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. -printf "%s\n" "$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 -version; 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\"" -printf "%s\n" "$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 - printf "%s\n" "$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 (void) -{ - - ; - 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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$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+y} && 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 $as_nop - ac_file='' -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$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_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$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 (void) -{ -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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$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 - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$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_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; 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 -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_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 conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -printf %s "checking whether $CC understands -c and -o together... " >&6; } -if test ${am_cv_prog_cc_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CC_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -printf "%s\n" "$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 - - - - - if test -n "$ac_tool_prefix"; then - for ac_prog in ar lib "link -lib" - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar lib "link -lib" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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} - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -printf %s "checking the archiver ($AR) interface... " >&6; } -if test ${am_cv_ar_interface+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - - am_cv_ar_interface=ar - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int some_variable = 0; -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -printf "%s\n" "$am_cv_ar_interface" >&6; } - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - as_fn_error $? "could not determine $AR interface" "$LINENO" 5 - ;; -esac - -case `pwd` in - *\ * | *\ *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.7' -macro_revision='2.4.7' - - - - - - - - - - - - - - -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 - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -printf %s "checking build system type... " >&6; } -if test ${ac_cv_build+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$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 - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -printf %s "checking host system type... " >&6; } -if test ${ac_cv_host+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$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 - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -printf %s "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*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -printf "%s\n" "printf" >&6; } ;; - print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -printf "%s\n" "print -r" >&6; } ;; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -printf "%s\n" "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in sed gsed - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -printf %s "checking for fgrep... " >&6; } -if test ${ac_cv_path_FGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in fgrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -printf "%s\n" "$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+y} -then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -printf %s "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -printf %s "checking for GNU ld... " >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -printf %s "checking for non-GNU ld... " >&6; } -fi -if test ${lt_cv_path_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -printf %s "checking if the linker ($LD) is GNU ld... " >&6; } -if test ${lt_cv_prog_gnu_ld+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test ${lt_cv_path_NM+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -printf "%s\n" "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DUMPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -printf "%s\n" "$DUMPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DUMPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -printf "%s\n" "$ac_ct_DUMPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -printf %s "checking the name lister ($NM) interface... " >&6; } -if test ${lt_cv_nm_interface+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -printf "%s\n" "$lt_cv_nm_interface" >&6; } - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -printf %s "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -printf "%s\n" "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -printf %s "checking the maximum length of command line arguments... " >&6; } -if test ${lt_cv_sys_max_cmd_len+y} -then : - printf %s "(cached) " >&6 -else $as_nop - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -printf %s "checking how to convert $build file names to $host format... " >&6; } -if test ${lt_cv_to_host_file_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -printf %s "checking how to convert $build file names to toolchain format... " >&6; } -if test ${lt_cv_to_tool_file_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - #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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -printf %s "checking for $LD option to reload object files... " >&6; } -if test ${lt_cv_ld_reload_flag+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. -set dummy ${ac_tool_prefix}file; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_FILECMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$FILECMD"; then - ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FILECMD="${ac_tool_prefix}file" - printf "%s\n" "$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 -FILECMD=$ac_cv_prog_FILECMD -if test -n "$FILECMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 -printf "%s\n" "$FILECMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_FILECMD"; then - ac_ct_FILECMD=$FILECMD - # Extract the first word of "file", so it can be a program name with args. -set dummy file; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_FILECMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_FILECMD"; then - ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_FILECMD="file" - printf "%s\n" "$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_FILECMD=$ac_cv_prog_ac_ct_FILECMD -if test -n "$ac_ct_FILECMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 -printf "%s\n" "$ac_ct_FILECMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_FILECMD" = x; then - FILECMD=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - FILECMD=$ac_ct_FILECMD - fi -else - FILECMD="$ac_cv_prog_FILECMD" -fi - - - - - - - -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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -printf "%s\n" "$OBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -printf "%s\n" "$ac_ct_OBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -printf %s "checking how to recognize dependent libraries... " >&6; } -if test ${lt_cv_deplibs_check_method+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='$FILECMD -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly* | midnightbsd*) - 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=$FILECMD - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=$FILECMD - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - 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=$FILECMD - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$ac_ct_DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -printf %s "checking how to associate runtime and link libraries... " >&6; } -if test ${lt_cv_sharedlib_from_linklib_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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} - - - - - - -# Use ARFLAGS variable as AR's operation code to sync the variable naming with -# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have -# higher priority because thats what people were doing historically (setting -# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS -# variable obsoleted/removed. - -test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} -lt_ar_flags=$AR_FLAGS - - - - - - -# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override -# by AR_FLAGS because that was never working and AR_FLAGS is about to die. - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -printf %s "checking for archiver @FILE support... " >&6; } -if test ${lt_cv_ar_at_file+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -printf "%s\n" "$lt_cv_ar_at_file" >&6; } - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -printf %s "checking command to parse $NM output from $compiler object... " >&6; } -if test ${lt_cv_sys_global_symbol_pipe+y} -then : - printf %s "(cached) " >&6 -else $as_nop - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++ or ICC, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$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=$? - printf "%s\n" "$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 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -printf "%s\n" "failed" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -printf "%s\n" "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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -printf %s "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test ${with_sysroot+y} -then : - withval=$with_sysroot; -else $as_nop - with_sysroot=no -fi - - -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -printf "%s\n" "$with_sysroot" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -printf "%s\n" "${lt_sysroot:-no}" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -printf %s "checking for a working dd... " >&6; } -if test ${ac_cv_path_lt_DD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -if test -z "$lt_DD"; then - ac_path_lt_DD_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in dd - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_lt_DD" || continue -if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi - $ac_path_lt_DD_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_lt_DD"; then - : - fi -else - ac_cv_path_lt_DD=$lt_DD -fi - -rm -f conftest.i conftest2.i conftest.out -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -printf "%s\n" "$ac_cv_path_lt_DD" >&6; } - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -printf %s "checking how to truncate binary pipes... " >&6; } -if test ${lt_cv_truncate_bin+y} -then : - printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -printf "%s\n" "$lt_cv_truncate_bin" >&6; } - - - - - - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - -# Check whether --enable-libtool-lock was given. -if test ${enable_libtool_lock+y} -then : - enableval=$enable_libtool_lock; -fi - -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `$FILECMD conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `$FILECMD conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `$FILECMD conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `$FILECMD conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `$FILECMD conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -printf %s "checking whether the C compiler needs -belf... " >&6; } -if test ${lt_cv_cc_needs_belf+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `$FILECMD conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MANIFEST_TOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -printf "%s\n" "$MANIFEST_TOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if test ${lt_cv_path_mainfest_tool+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DSYMUTIL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -printf "%s\n" "$DSYMUTIL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_NMEDIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -printf "%s\n" "$NMEDIT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_NMEDIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -printf "%s\n" "$ac_ct_NMEDIT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LIPO+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -printf "%s\n" "$LIPO" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_LIPO+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -printf "%s\n" "$ac_ct_LIPO" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -printf "%s\n" "$OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -printf "%s\n" "$ac_ct_OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL64+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -printf "%s\n" "$OTOOL64" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL64+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -printf "%s\n" "$ac_ct_OTOOL64" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -printf %s "checking for -single_module linker flag... " >&6; } -if test ${lt_cv_apple_cc_single_mod+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -printf %s "checking for -exported_symbols_list linker flag... " >&6; } -if test ${lt_cv_ld_exported_symbols_list+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -printf %s "checking for -force_load linker flag... " >&6; } -if test ${lt_cv_ld_force_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 $AR_FLAGS libconftest.a conftest.o" >&5 - $AR $AR_FLAGS libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -printf "%s\n" "$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*) - case $MACOSX_DEPLOYMENT_TARGET,$host in - 10.[012],*|,*powerpc*-darwin[5-8]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes -then : - printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h - -fi - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test ${enable_shared+y} -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 $as_nop - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test ${enable_static+y} -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 $as_nop - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test ${with_pic+y} -then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else $as_nop - pic_mode=default -fi - - - - - - - - - # Check whether --enable-fast-install was given. -if test ${enable_fast_install+y} -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 $as_nop - enable_fast_install=yes -fi - - - - - - - - - shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[5-9]*,yes) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -printf %s "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test ${with_aix_soname+y} -then : - withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix -fi - - with_aix_soname=$lt_cv_with_aix_soname -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -printf "%s\n" "$with_aix_soname" >&6; } - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -printf %s "checking for objdir... " >&6; } -if test ${lt_cv_objdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -printf "%s\n" "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC and -# ICC, which need '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -printf %s "checking for ${ac_tool_prefix}file... " >&6; } -if test ${lt_cv_path_MAGIC_CMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -printf %s "checking for file... " >&6; } -if test ${lt_cv_path_MAGIC_CMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC=$CC -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test ${lt_cv_prog_compiler_rtti_exceptions+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test yes = "$GCC"; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - lt_prog_compiler_pic='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -printf %s "checking for $compiler option to produce PIC... " >&6; } -if test ${lt_cv_prog_compiler_pic+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test ${lt_cv_prog_compiler_pic_works+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works"; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test ${lt_cv_prog_compiler_static_works+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works"; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -printf %s "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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -printf "%s\n" "$hard_links" >&6; } - if test no = "$hard_links"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -printf "%s\n" "$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 - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++ or Intel C++ Compiler. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - 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 yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - file_list_spec='@' - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - export_dynamic_flag_spec='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test no = "$ld_shlibs"; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct=no - hardcode_direct_absolute=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath_+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath_+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++ or Intel C++ Compiler. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl* | icl*) - # Native MSVC or ICC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC and ICC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly* | midnightbsd*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -printf %s "checking if $CC understands -b... " >&6; } -if test ${lt_cv_prog_compiler__b+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } - -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if test ${lt_cv_irix_exported_symbol+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 $as_nop - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - ld_shlibs=yes - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - file_list_spec='@' - ;; - - osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' - ;; - esac - fi - fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -printf "%s\n" "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -printf %s "checking whether -lc should be explicitly linked in... " >&6; } -if test ${lt_cv_archive_cmds_need_lc+y} -then : - printf %s "(cached) " >&6 -else $as_nop - $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=$? - printf "%s\n" "$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=$? - printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -printf %s "checking dynamic linker characteristics... " >&6; } - -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl* | *,icl*) - # Native MSVC or ICC - 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 and ICC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly* | midnightbsd*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test ${lt_cv_shlibpath_overrides_runpath+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - 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.beam \ - 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" - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$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 # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -printf "%s\n" "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -printf %s "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -printf "%s\n" "$hardcode_action" >&6; } - -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes -then : - lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -printf %s "checking for shl_load in -ldld... " >&6; } -if test ${ac_cv_lib_dld_shl_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ -char shl_load (); -int -main (void) -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes -then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes -then : - lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -printf %s "checking for dlopen in -lsvld... " >&6; } -if test ${ac_cv_lib_svld_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -printf %s "checking for dld_link in -ldld... " >&6; } -if test ${ac_cv_lib_dld_dld_link+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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. */ -char dld_link (); -int -main (void) -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes -then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -printf %s "checking whether a program can dlopen itself... " >&6; } -if test ${lt_cv_dlopen_self+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -printf "%s\n" "$lt_cv_dlopen_self" >&6; } - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -printf %s "checking whether a statically linked program can dlopen itself... " >&6; } -if test ${lt_cv_dlopen_self_static+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -printf "%s\n" "$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= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -printf %s "checking whether stripping libraries is possible... " >&6; } -if test -z "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -else - if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - old_striplib="$STRIP --strip-debug" - striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - case $host_os in - darwin*) - # FIXME - insert some real tests, host_os isn't really good enough - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - ;; - freebsd*) - if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then - old_striplib="$STRIP --strip-debug" - striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; - esac - fi -fi - - - - - - - - - - - - - # Report what library types will actually be built - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -printf %s "checking if libtool supports shared libraries... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -printf "%s\n" "$can_build_shared" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -printf %s "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -printf "%s\n" "$enable_shared" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -printf %s "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -printf "%s\n" "$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_config_headers="$ac_config_headers config.h" - - -# Process command line options -# Check whether --enable-tools was given. -if test ${enable_tools+y} -then : - enableval=$enable_tools; - if test "x$enableval" = xno; then - with_tools=false - else - with_tools=true - fi - -else $as_nop - with_tools=true -fi - - if test x$with_tools = xtrue; then - WITH_TOOLS_TRUE= - WITH_TOOLS_FALSE='#' -else - WITH_TOOLS_TRUE='#' - WITH_TOOLS_FALSE= -fi - - -# Check whether --enable-pam was given. -if test ${enable_pam+y} -then : - enableval=$enable_pam; - if test "x$enableval" = xno; then - with_pam=false - else - with_pam=true - fi - -else $as_nop - with_pam=true -fi - - if test x$with_pam = xtrue; then - WITH_PAM_TRUE= - WITH_PAM_FALSE='#' -else - WITH_PAM_TRUE='#' - WITH_PAM_FALSE= -fi - - -# Check whether --enable-daemon was given. -if test ${enable_daemon+y} -then : - enableval=$enable_daemon; - if test "x$enableval" = xno; then - with_daemon=false - else - with_daemon=true - fi - -else $as_nop - with_daemon=true -fi - - if test x$with_daemon = xtrue; then - WITH_DAEMON_TRUE= - WITH_DAEMON_FALSE='#' -else - WITH_DAEMON_TRUE='#' - WITH_DAEMON_FALSE= -fi - - -# Check whether --enable-python was given. -if test ${enable_python+y} -then : - enableval=$enable_python; -fi - -if test "$enable_python" = yes -then : - - # cython version check - if test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 29 -then : - - as_fn_error $? "python bindings require cython 0.29 or higher" "$LINENO" 5 - -fi - - - - - - - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3" >&5 -printf %s "checking whether $PYTHON version is >= 3... " >&6; } - prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '3'.split('.'))) + [0, 0, 0] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] -sys.exit(sys.hexversion < minverhex)" - if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 - ($PYTHON -c "$prog") >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - as_fn_error $? "Python interpreter is too old" "$LINENO" 5 -fi - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3" >&5 -printf %s "checking for a Python interpreter with version >= 3... " >&6; } -if test ${am_cv_pathless_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - for am_cv_pathless_PYTHON in python python2 python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do - test "$am_cv_pathless_PYTHON" = none && break - prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '3'.split('.'))) + [0, 0, 0] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] -sys.exit(sys.hexversion < minverhex)" - if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 - ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -then : - break -fi - done -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 -printf "%s\n" "$am_cv_pathless_PYTHON" >&6; } - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. -set dummy $am_cv_pathless_PYTHON; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - - - if test "$PYTHON" = :; then - as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 - else - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 -printf %s "checking for $am_display_PYTHON version... " >&6; } -if test ${am_cv_python_version+y} -then : - printf %s "(cached) " >&6 -else $as_nop - am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[:2])"` -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 -printf "%s\n" "$am_cv_python_version" >&6; } - PYTHON_VERSION=$am_cv_python_version - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 -printf %s "checking for $am_display_PYTHON platform... " >&6; } -if test ${am_cv_python_platform+y} -then : - printf %s "(cached) " >&6 -else $as_nop - am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 -printf "%s\n" "$am_cv_python_platform" >&6; } - PYTHON_PLATFORM=$am_cv_python_platform - - - if test "x$prefix" = xNONE; then - am__usable_prefix=$ac_default_prefix - else - am__usable_prefix=$prefix - fi - - # Allow user to request using sys.* values from Python, - # instead of the GNU $prefix values. - -# Check whether --with-python-sys-prefix was given. -if test ${with_python_sys_prefix+y} -then : - withval=$with_python_sys_prefix; am_use_python_sys=: -else $as_nop - am_use_python_sys=false -fi - - - # Allow user to override whatever the default Python prefix is. - -# Check whether --with-python_prefix was given. -if test ${with_python_prefix+y} -then : - withval=$with_python_prefix; am_python_prefix_subst=$withval - am_cv_python_prefix=$withval - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 -printf %s "checking for explicit $am_display_PYTHON prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 -printf "%s\n" "$am_cv_python_prefix" >&6; } -else $as_nop - - if $am_use_python_sys; then - # using python sys.prefix value, not GNU - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 -printf %s "checking for python default $am_display_PYTHON prefix... " >&6; } -if test ${am_cv_python_prefix+y} -then : - printf %s "(cached) " >&6 -else $as_nop - am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 -printf "%s\n" "$am_cv_python_prefix" >&6; } - - case $am_cv_python_prefix in - $am__usable_prefix*) - am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` - am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` - ;; - *) - am_python_prefix_subst=$am_cv_python_prefix - ;; - esac - else # using GNU prefix value, not python sys.prefix - am_python_prefix_subst='${prefix}' - am_python_prefix=$am_python_prefix_subst - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 -printf %s "checking for GNU default $am_display_PYTHON prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 -printf "%s\n" "$am_python_prefix" >&6; } - fi -fi - - # Substituting python_prefix_subst value. - PYTHON_PREFIX=$am_python_prefix_subst - - - # emacs-page Now do it all over again for Python exec_prefix, but with yet - # another conditional: fall back to regular prefix if that was specified. - -# Check whether --with-python_exec_prefix was given. -if test ${with_python_exec_prefix+y} -then : - withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval - am_cv_python_exec_prefix=$withval - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 -printf %s "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 -printf "%s\n" "$am_cv_python_exec_prefix" >&6; } -else $as_nop - - # no explicit --with-python_exec_prefix, but if - # --with-python_prefix was given, use its value for python_exec_prefix too. - if test -n "$with_python_prefix" -then : - am_python_exec_prefix_subst=$with_python_prefix - am_cv_python_exec_prefix=$with_python_prefix - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 -printf %s "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 -printf "%s\n" "$am_cv_python_exec_prefix" >&6; } -else $as_nop - - # Set am__usable_exec_prefix whether using GNU or Python values, - # since we use that variable for pyexecdir. - if test "x$exec_prefix" = xNONE; then - am__usable_exec_prefix=$am__usable_prefix - else - am__usable_exec_prefix=$exec_prefix - fi - # - if $am_use_python_sys; then # using python sys.exec_prefix, not GNU - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 -printf %s "checking for python default $am_display_PYTHON exec_prefix... " >&6; } -if test ${am_cv_python_exec_prefix+y} -then : - printf %s "(cached) " >&6 -else $as_nop - am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 -printf "%s\n" "$am_cv_python_exec_prefix" >&6; } - case $am_cv_python_exec_prefix in - $am__usable_exec_prefix*) - am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` - am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` - ;; - *) - am_python_exec_prefix_subst=$am_cv_python_exec_prefix - ;; - esac - else # using GNU $exec_prefix, not python sys.exec_prefix - am_python_exec_prefix_subst='${exec_prefix}' - am_python_exec_prefix=$am_python_exec_prefix_subst - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 -printf %s "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 -printf "%s\n" "$am_python_exec_prefix" >&6; } - fi -fi -fi - - # Substituting python_exec_prefix_subst. - PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst - - - # Factor out some code duplication into this shell variable. - am_python_setup_sysconfig="\ -import sys -# Prefer sysconfig over distutils.sysconfig, for better compatibility -# with python 3.x. See automake bug#10227. -try: - import sysconfig -except ImportError: - can_use_sysconfig = 0 -else: - can_use_sysconfig = 1 -# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: -# -try: - from platform import python_implementation - if python_implementation() == 'CPython' and sys.version[:3] == '2.7': - can_use_sysconfig = 0 -except ImportError: - pass" - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 -printf %s "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } -if test ${am_cv_python_pythondir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "x$am_cv_python_prefix" = x; then - am_py_prefix=$am__usable_prefix - else - am_py_prefix=$am_cv_python_prefix - fi - am_cv_python_pythondir=`$PYTHON -c " -$am_python_setup_sysconfig -if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) -else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') -sys.stdout.write(sitedir)"` - # - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" - ;; - esac - ;; - esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 -printf "%s\n" "$am_cv_python_pythondir" >&6; } - pythondir=$am_cv_python_pythondir - - - pkgpythondir=\${pythondir}/$PACKAGE - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 -printf %s "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } -if test ${am_cv_python_pyexecdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "x$am_cv_python_exec_prefix" = x; then - am_py_exec_prefix=$am__usable_exec_prefix - else - am_py_exec_prefix=$am_cv_python_exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " -$am_python_setup_sysconfig -if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) -else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') -sys.stdout.write(sitedir)"` - # - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" - ;; - esac - ;; - esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 -printf "%s\n" "$am_cv_python_pyexecdir" >&6; } - pyexecdir=$am_cv_python_pyexecdir - - - pkgpyexecdir=\${pyexecdir}/$PACKAGE - - - - fi - - -fi - if test "$enable_python" = yes; then - ENABLE_PYTHON_TRUE= - ENABLE_PYTHON_FALSE='#' -else - ENABLE_PYTHON_TRUE='#' - ENABLE_PYTHON_FALSE= -fi - - -printf "%s\n" "#define ENABLE_PYTHON $(test \"$enable_python\" = yes && echo 1 || echo 0)" >>confdefs.h - - -# Check whether --enable-systemd was given. -if test ${enable_systemd+y} -then : - enableval=$enable_systemd; - if test "x$enableval" = xno; then - with_systemd=false - else - with_systemd=true - fi - -else $as_nop - with_systemd=true -fi - - if test x$with_systemd = xtrue; then - WITH_SYSTEMD_TRUE= - WITH_SYSTEMD_FALSE='#' -else - WITH_SYSTEMD_TRUE='#' - WITH_SYSTEMD_FALSE= -fi - - -# Check whether --enable-initscript-install was given. -if test ${enable_initscript_install+y} -then : - enableval=$enable_initscript_install; - if test "x$enableval" = xno; then - with_initscript_install=false - else - with_initscript_install=true - fi - -else $as_nop - with_initscript_install=false -fi - - if test x$with_initscript_install = xtrue; then - WITH_INITSCRIPT_INSTALL_TRUE= - WITH_INITSCRIPT_INSTALL_FALSE='#' -else - WITH_INITSCRIPT_INSTALL_TRUE='#' - WITH_INITSCRIPT_INSTALL_FALSE= -fi - - -socket_path="/var/run/cgred.socket" -# Check whether --enable-cgred-socket was given. -if test ${enable_cgred_socket+y} -then : - enableval=$enable_cgred_socket; - if test "x$enableval" = xno -o "x$enableval" = xyes; then - as_fn_error $? "Provide valid path with --enable-cgred-socket option." "$LINENO" 5 - else - socket_path="$enableval" - fi - -fi - - -printf "%s\n" "#define CGRULE_CGRED_SOCKET_PATH \"$socket_path\"" >>confdefs.h - - -pam_module_dir="$libdir/security" -# Check whether --enable-pam-module-dir was given. -if test ${enable_pam_module_dir+y} -then : - enableval=$enable_pam_module_dir; - if test "x$enableval" = xno -o "x$enableval" = xyes; then - as_fn_error $? "Provide valid path with --enable-pam-module-dir option." "$LINENO" 5 - else - pam_module_dir="$enableval" - fi - -fi - -pamlibdir="$pam_module_dir" - - -# Check whether --enable-opaque-hierarchy was given. -if test ${enable_opaque_hierarchy+y} -then : - enableval=$enable_opaque_hierarchy; - if test "x$enableval" = xno -o "x$enableval" = xyes; then - as_fn_error $? "Provide name of a hierarchy." "$LINENO" 5 - else - -printf "%s\n" "#define OPAQUE_HIERARCHY \"$enableval\"" >>confdefs.h - - fi - -fi - - -# Check whether --enable-tests was given. -if test ${enable_tests+y} -then : - enableval=$enable_tests; - if test "x$enableval" = xno; then - with_tests=false - else - with_tests=true - fi - -else $as_nop - with_tests=true -fi - - if test x$with_tests = xtrue; then - WITH_TESTS_TRUE= - WITH_TESTS_FALSE='#' -else - WITH_TESTS_TRUE='#' - WITH_TESTS_FALSE= -fi - - -# Check whether --enable-samples was given. -if test ${enable_samples+y} -then : - enableval=$enable_samples; - if test "x$enableval" = xno; then - with_samples=false - else - with_samples=true - fi - -else $as_nop - with_samples=false -fi - - if test x$with_samples = xtrue; then - WITH_SAMPLES_TRUE= - WITH_SAMPLES_FALSE='#' -else - WITH_SAMPLES_TRUE='#' - WITH_SAMPLES_FALSE= -fi - - -# Checks for programs. - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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. -printf "%s\n" "$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\"" -printf "%s\n" "$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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; 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_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -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 - -depcc="$CXX" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CXX_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - - - -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 no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -printf %s "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test ${ac_cv_prog_CXXCPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CXX needs to be expanded - for CXXCPP in "$CXX -E" cpp /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. - # 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. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # 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 $as_nop - # 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -printf "%s\n" "$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. - # 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. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # 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 $as_nop - # 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_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -compiler_needs_object_CXX=no -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_direct_absolute_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test yes = "$GXX"; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - - if test yes = "$GXX"; then - # Set up default GNU C++ configuration - - - -# Check whether --with-gnu-ld was given. -if test ${with_gnu_ld+y} -then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -printf %s "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -printf %s "checking for GNU ld... " >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -printf %s "checking for non-GNU ld... " >&6; } -fi -if test ${lt_cv_path_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -printf %s "checking if the linker ($LD) is GNU ld... " >&6; } -if test ${lt_cv_prog_gnu_ld+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='$wl' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct_CXX=no - hardcode_direct_absolute_CXX=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec_CXX='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - no_undefined_flag_CXX='-bernotok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath__CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath__CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' $wl-bernotok' - allow_undefined_flag_CXX=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl* | ,icl* | no,icl*) - # Native MSVC or ICC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='$wl--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - - - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - if test yes != "$lt_cv_apple_cc_single_mod"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" - fi - - else - ld_shlibs_CXX=no - fi - - ;; - - os2*) - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_minus_L_CXX=yes - allow_undefined_flag_CXX=unsupported - shrext_cmds=.dll - archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes_CXX=yes - file_list_spec_CXX='@' - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - - freebsd* | dragonfly* | midnightbsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - - hpux9*) - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='$wl-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='$wl-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object_CXX=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='$wl-E' - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac - - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes,no = "$GXX,$with_gnu_ld"; then - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - no_undefined_flag_CXX=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='$wl-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='$wl-z,text' - allow_undefined_flag_CXX='$wl-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -printf "%s\n" "$ld_shlibs_CXX" >&6; } - test no = "$ld_shlibs_CXX" && can_build_shared=no - - GCC_CXX=$GXX - LD_CXX=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF - - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX=$prev$p - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX=$prev$p - else - postdeps_CXX="${postdeps_CXX} $prev$p" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test no = "$pre_test_object_deps_done"; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX=$p - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX=$p - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - - - # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - lt_prog_compiler_pic_CXX='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static_CXX='$wl-static' - ;; - esac - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly* | midnightbsd*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -printf %s "checking for $compiler option to produce PIC... " >&6; } -if test ${lt_cv_prog_compiler_pic_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if test ${lt_cv_prog_compiler_pic_works_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test ${lt_cv_prog_compiler_static_works_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then - : -else - lt_prog_compiler_static_CXX= -fi - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -printf %s "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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -printf "%s\n" "$hard_links" >&6; } - if test no = "$hard_links"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -printf "%s\n" "$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 - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl* | icl*) - exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -printf "%s\n" "$ld_shlibs_CXX" >&6; } -test no = "$ld_shlibs_CXX" && can_build_shared=no - -with_gnu_ld_CXX=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -printf %s "checking whether -lc should be explicitly linked in... " >&6; } -if test ${lt_cv_archive_cmds_need_lc_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - $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=$? - printf "%s\n" "$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=$? - printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -printf %s "checking dynamic linker characteristics... " >&6; } - -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl* | *,icl*) - # Native MSVC or ICC - 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 and ICC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly* | midnightbsd*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test ${lt_cv_shlibpath_overrides_runpath+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - 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.beam \ - 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" - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$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 # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -printf "%s\n" "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -printf %s "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test yes = "$hardcode_automatic_CXX"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct_CXX" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && - test no != "$hardcode_minus_L_CXX"; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -printf "%s\n" "$hardcode_action_CXX" >&6; } - -if test relink = "$hardcode_action_CXX" || - test yes = "$inherit_rpath_CXX"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$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 - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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. -printf "%s\n" "$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 -version; 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\"" -printf "%s\n" "$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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - 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.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; 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 -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_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 conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -printf %s "checking whether $CC understands -c and -o together... " >&6; } -if test ${am_cv_prog_cc_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CC_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -printf "%s\n" "$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 - - -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_YACC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_YACC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -printf "%s\n" "$YACC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -if test "$YACC" = yacc; then - # Extract the first word of "yacc", so it can be a program name with args. -set dummy yacc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_REALLY_YACC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$REALLY_YACC"; then - ac_cv_prog_REALLY_YACC="$REALLY_YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_REALLY_YACC="yacc" - printf "%s\n" "$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 -REALLY_YACC=$ac_cv_prog_REALLY_YACC -if test -n "$REALLY_YACC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $REALLY_YACC" >&5 -printf "%s\n" "$REALLY_YACC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test "$REALLY_YACC" = ""; then - as_fn_error $? "This program cannot be built unless a version of yacc is installed." "$LINENO" 5 - fi -fi -for ac_prog in flex lex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LEX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -printf "%s\n" "$LEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$LEX" && break -done -test -n "$LEX" || LEX=":" - - if test "x$LEX" != "x:"; then - cat >conftest.l <<_ACEOF -%{ -#ifdef __cplusplus -extern "C" -#endif -int yywrap(void); -%} -%% -a { ECHO; } -b { REJECT; } -c { yymore (); } -d { yyless (1); } -e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ -#ifdef __cplusplus - yyless ((yyinput () != 0)); -#else - yyless ((input () != 0)); -#endif - } -f { unput (yytext[0]); } -. { BEGIN INITIAL; } -%% -#ifdef YYTEXT_POINTER -extern char *yytext; -#endif -int -yywrap (void) -{ - return 1; -} -int -main (void) -{ - return ! yylex (); -} -_ACEOF -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 -printf %s "checking for lex output file root... " >&6; } -if test ${ac_cv_prog_lex_root+y} -then : - printf %s "(cached) " >&6 -else $as_nop - -ac_cv_prog_lex_root=unknown -{ { ac_try="$LEX conftest.l" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$LEX conftest.l") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -printf "%s\n" "$ac_cv_prog_lex_root" >&6; } -if test "$ac_cv_prog_lex_root" = unknown -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 -printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} - LEX=: LEXLIB= -fi -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -if test ${LEXLIB+y} -then : - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 -printf %s "checking for lex library... " >&6; } -if test ${ac_cv_lib_lex+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ac_save_LIBS="$LIBS" - ac_found=false - for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do - case $ac_cv_lib_lex in #( - 'none needed') : - ;; #( - 'not found') : - break ;; #( - *) : - LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( - *) : - ;; -esac - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_found=: -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - if $ac_found; then - break - fi - done - LIBS="$ac_save_LIBS" - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -printf "%s\n" "$ac_cv_lib_lex" >&6; } - if test "$ac_cv_lib_lex" = 'not found' -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 -printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} - LEX=: LEXLIB= -elif test "$ac_cv_lib_lex" = 'none needed' -then : - LEXLIB='' -else $as_nop - LEXLIB=$ac_cv_lib_lex -fi - ac_save_LIBS="$LIBS" - LIBS= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing yywrap" >&5 -printf %s "checking for library containing yywrap... " >&6; } -if test ${ac_cv_search_yywrap+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$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. */ -char yywrap (); -int -main (void) -{ -return yywrap (); - ; - return 0; -} -_ACEOF -for ac_lib in '' fl l -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_yywrap=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_yywrap+y} -then : - break -fi -done -if test ${ac_cv_search_yywrap+y} -then : - -else $as_nop - ac_cv_search_yywrap=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yywrap" >&5 -printf "%s\n" "$ac_cv_search_yywrap" >&6; } -ac_res=$ac_cv_search_yywrap -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - LEXLIB="$LIBS" -fi - - LIBS="$ac_save_LIBS" -fi - - -if test "$LEX" != : -then : - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 -printf %s "checking whether yytext is a pointer... " >&6; } -if test ${ac_cv_prog_lex_yytext_pointer+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define YYTEXT_POINTER 1 -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_lex_yytext_pointer=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } -if test $ac_cv_prog_lex_yytext_pointer = yes; then - -printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h - -fi - -fi -rm -f conftest.l $LEX_OUTPUT_ROOT.c - -fi -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi -if test "$LEX" != flex; then - as_fn_error $? "This program cannot be built unless flex is installed." "$LINENO" 5 -fi - - -# Checks for header files. -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -printf %s "checking for $ac_hdr that defines DIR... " >&6; } -if eval test \${$as_ac_Header+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main (void) -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes" -then : - cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -printf %s "checking for library containing opendir... " >&6; } -if test ${ac_cv_search_opendir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$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. */ -char opendir (); -int -main (void) -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_opendir+y} -then : - break -fi -done -if test ${ac_cv_search_opendir+y} -then : - -else $as_nop - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -printf "%s\n" "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -printf %s "checking for library containing opendir... " >&6; } -if test ${ac_cv_search_opendir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$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. */ -char opendir (); -int -main (void) -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_opendir+y} -then : - break -fi -done -if test ${ac_cv_search_opendir+y} -then : - -else $as_nop - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -printf "%s\n" "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes -then : - printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_mntent_h" = xyes -then : - printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes -then : - printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = xyes -then : - printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mount_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MOUNT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes -then : - printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h - -fi - - -# Checks for typedefs, structures, and compiler characteristics. -ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes -then : - -printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } -if test ${ac_cv_header_stdbool_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; - - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ - - #if !true - #error "'true' is not true" - #endif - #if true != 1 - #error "'true' is not equal to 1" - #endif - char b[true == 1 ? 1 : -1]; - char c[true]; - - #if false - #error "'false' is not false" - #endif - #if false != 0 - #error "'false' is not equal to 0" - #endif - char d[false == 0 ? 1 : -1]; - - enum { e = false, f = true, g = false * true, h = true * 256 }; - - char i[(bool) 0.5 == true ? 1 : -1]; - char j[(bool) 0.0 == false ? 1 : -1]; - char k[sizeof (bool) > 0 ? 1 : -1]; - - struct sb { bool s: 1; bool t; } s; - char l[sizeof s.t > 0 ? 1 : -1]; - - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - bool m[h]; - char n[sizeof m == h * sizeof m[0] ? 1 : -1]; - char o[-1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - bool p = true; - bool *pp = &p; - - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif - - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; - - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; - - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif - -int -main (void) -{ - - bool ps = &s; - *pp |= p; - *pp |= ! p; - - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif - - /* Refer to every declared value, so they cannot be - discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } - -if test $ac_cv_header_stdbool_h = yes; then - -printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -printf %s "checking for an ANSI C-conforming const... " >&6; } -if test ${ac_cv_c_const+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* 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}; - /* IBM 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 sort of thing. */ - char tx; - char *t = &tx; - 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; - } - { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; 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 $as_nop - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -printf "%s\n" "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -printf "%s\n" "#define const /**/" >>confdefs.h - -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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "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+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. - # 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. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # 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 $as_nop - # 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$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. - # 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. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # 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 $as_nop - # 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_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$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 - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : - ac_cv_type_uid_t=yes -else $as_nop - ac_cv_type_uid_t=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -printf "%s\n" "#define uid_t int" >>confdefs.h - - -printf "%s\n" "#define gid_t int" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -printf %s "checking for inline... " >&6; } -if test ${ac_cv_c_inline+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 (void) {return 0; } -$ac_kw foo_t foo (void) {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.beam conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -printf "%s\n" "$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_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h -;; -esac - - - ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif - -int -main (void) -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - - -fi - - - -# Checks for library functions. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 -printf %s "checking for working chown... " >&6; } -if test ${ac_cv_func_chown_works+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_chown_works=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_chown_works=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -#include - -int -main (void) -{ - char *f = "conftest.chown"; - struct stat before, after; - - if (creat (f, 0600) < 0) - return 1; - if (stat (f, &before) < 0) - return 1; - if (chown (f, (uid_t) -1, (gid_t) -1) == -1) - return 1; - if (stat (f, &after) < 0) - return 1; - return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - ac_cv_func_chown_works=yes -else $as_nop - ac_cv_func_chown_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -rm -f conftest.chown - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 -printf "%s\n" "$ac_cv_func_chown_works" >&6; } -if test $ac_cv_func_chown_works = yes; then - -printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h - -fi - -# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, -# -lseq on Dynix/PTX, -lgen on Unixware. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 -printf %s "checking for library containing getmntent... " >&6; } -if test ${ac_cv_search_getmntent+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$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. */ -char getmntent (); -int -main (void) -{ -return getmntent (); - ; - return 0; -} -_ACEOF -for ac_lib in '' sun seq gen -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_getmntent=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_getmntent+y} -then : - break -fi -done -if test ${ac_cv_search_getmntent+y} -then : - -else $as_nop - ac_cv_search_getmntent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 -printf "%s\n" "$ac_cv_search_getmntent" >&6; } -ac_res=$ac_cv_search_getmntent -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ac_cv_func_getmntent=yes - -printf "%s\n" "#define HAVE_GETMNTENT 1" >>confdefs.h - -else $as_nop - ac_cv_func_getmntent=no -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -printf %s "checking for GNU libc compatible malloc... " >&6; } -if test ${ac_cv_func_malloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main (void) -{ -void *p = malloc (0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - ac_cv_func_malloc_0_nonnull=yes -else $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes -then : - -printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h - -else $as_nop - printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 -printf %s "checking for GNU libc compatible realloc... " >&6; } -if test ${ac_cv_func_realloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_realloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_realloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main (void) -{ -void *p = realloc (0, 0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - ac_cv_func_realloc_0_nonnull=yes -else $as_nop - ac_cv_func_realloc_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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes -then : - -printf "%s\n" "#define HAVE_REALLOC 1" >>confdefs.h - -else $as_nop - printf "%s\n" "#define HAVE_REALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -printf "%s\n" "#define realloc rpl_realloc" >>confdefs.h - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 -printf %s "checking whether lstat correctly handles trailing slash... " >&6; } -if test ${ac_cv_func_lstat_dereferences_slashed_symlink+y} -then : - printf %s "(cached) " >&6 -else $as_nop - 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 : - case "$host_os" in # (( - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_lstat_dereferences_slashed_symlink=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_lstat_dereferences_slashed_symlink=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main (void) -{ -struct stat sbuf; - /* Linux will dereference the symlink and fail, as required by POSIX. - 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 $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -printf "%s\n" "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } - -test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && - -printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h - - -if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then - case " $LIBOBJS " in - *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" - ;; -esac - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 -printf %s "checking whether stat accepts an empty string... " >&6; } -if test ${ac_cv_func_stat_empty_string_bug+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - ac_cv_func_stat_empty_string_bug=yes -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main (void) -{ -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 $as_nop - 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 -printf "%s\n" "$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 - - -printf "%s\n" "#define HAVE_STAT_EMPTY_STRING_BUG 1" >>confdefs.h - -fi - -ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent" -if test "x$ac_cv_func_getmntent" = xyes -then : - printf "%s\n" "#define HAVE_GETMNTENT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "hasmntopt" "ac_cv_func_hasmntopt" -if test "x$ac_cv_func_hasmntopt" = xyes -then : - printf "%s\n" "#define HAVE_HASMNTOPT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes -then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" -if test "x$ac_cv_func_mkdir" = xyes -then : - printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" -if test "x$ac_cv_func_rmdir" = xyes -then : - printf "%s\n" "#define HAVE_RMDIR 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" -if test "x$ac_cv_func_strdup" = xyes -then : - printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h - -fi - - -orig_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -D_GNU_SOURCE" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac - -ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strerror_r" = xyes -then : - ac_have_decl=1 -else $as_nop - ac_have_decl=0 -fi -printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h - - -if test $ac_cv_have_decl_strerror_r = yes; then - # For backward compatibility's sake, define HAVE_STRERROR_R. - # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well - # as AC_CHECK_DECLS_ONCE.) - -printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -printf %s "checking whether strerror_r returns char *... " >&6; } -if test ${ac_cv_func_strerror_r_char_p+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - return !p || x; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then - -printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h - -fi - -CFLAGS="$orig_CFLAGS" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing fts_open" >&5 -printf %s "checking for library containing fts_open... " >&6; } -if test ${ac_cv_search_fts_open+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$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. */ -char fts_open (); -int -main (void) -{ -return fts_open (); - ; - return 0; -} -_ACEOF -for ac_lib in '' fts -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_fts_open=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_fts_open+y} -then : - break -fi -done -if test ${ac_cv_search_fts_open+y} -then : - -else $as_nop - ac_cv_search_fts_open=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fts_open" >&5 -printf "%s\n" "$ac_cv_search_fts_open" >&6; } -ac_res=$ac_cv_search_fts_open -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else $as_nop - as_fn_error $? "Unable to find the fts_open() function" "$LINENO" 5 -fi - - -if test x$with_pam = xtrue; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pam_syslog in -lpam" >&5 -printf %s "checking for pam_syslog in -lpam... " >&6; } -if test ${ac_cv_lib_pam_pam_syslog+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpam $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. */ -char pam_syslog (); -int -main (void) -{ -return pam_syslog (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pam_pam_syslog=yes -else $as_nop - ac_cv_lib_pam_pam_syslog=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_syslog" >&5 -printf "%s\n" "$ac_cv_lib_pam_pam_syslog" >&6; } -if test "x$ac_cv_lib_pam_pam_syslog" = xyes -then : - - : - -else $as_nop - as_fn_error $? "Cannot compile PAM module without libpam!" "$LINENO" 5 -fi - - - for ac_header in security/pam_modules.h security/pam_modutil.h security/pam_ext.h -do : - as_ac_Header=`printf "%s\n" "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 `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else $as_nop - as_fn_error $? "Cannot compile PAM module without necessary - header files!" "$LINENO" 5 -fi - -done -fi - - - - - # allow to override gcov location - -# Check whether --with-gcov was given. -if test ${with_gcov+y} -then : - withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov -else $as_nop - _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov -fi - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 -printf %s "checking whether to build with code coverage support... " >&6; } - # Check whether --enable-code-coverage was given. -if test ${enable_code_coverage+y} -then : - enableval=$enable_code_coverage; -else $as_nop - enable_code_coverage=no -fi - - - if test x$enable_code_coverage = xyes; then - CODE_COVERAGE_ENABLED_TRUE= - CODE_COVERAGE_ENABLED_FALSE='#' -else - CODE_COVERAGE_ENABLED_TRUE='#' - CODE_COVERAGE_ENABLED_FALSE= -fi - - CODE_COVERAGE_ENABLED=$enable_code_coverage - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 -printf "%s\n" "$enable_code_coverage" >&6; } - - if test "$enable_code_coverage" = "yes" -then : - - # check for gcov - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_GCOV+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - printf "%s\n" "$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 -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -printf "%s\n" "$GCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GCOV"; then - ac_ct_GCOV=$GCOV - # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_GCOV+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_GCOV"; then - ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - printf "%s\n" "$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_GCOV=$ac_cv_prog_ac_ct_GCOV -if test -n "$ac_ct_GCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 -printf "%s\n" "$ac_ct_GCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_GCOV" = x; then - GCOV=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GCOV=$ac_ct_GCOV - fi -else - GCOV="$ac_cv_prog_GCOV" -fi - - if test "X$GCOV" = "X:" -then : - as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 -fi - - - if test "$GCC" = "no" -then : - - as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 - -fi - - # Extract the first word of "lcov", so it can be a program name with args. -set dummy lcov; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LCOV+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$LCOV"; then - ac_cv_prog_LCOV="$LCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LCOV="lcov" - printf "%s\n" "$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 -LCOV=$ac_cv_prog_LCOV -if test -n "$LCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 -printf "%s\n" "$LCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - # Extract the first word of "genhtml", so it can be a program name with args. -set dummy genhtml; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_GENHTML+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$GENHTML"; then - ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_GENHTML="genhtml" - printf "%s\n" "$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 -GENHTML=$ac_cv_prog_GENHTML -if test -n "$GENHTML"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 -printf "%s\n" "$GENHTML" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - - if test -z "$LCOV" -then : - - as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 - -fi - - if test -z "$GENHTML" -then : - - as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 - -fi - - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LIBS="-lgcov" - CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" - - - - - - - - CODE_COVERAGE_RULES_CHECK=' - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -' - CODE_COVERAGE_RULES_CAPTURE=' - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -' - CODE_COVERAGE_RULES_CLEAN=' -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -' - -else $as_nop - - CODE_COVERAGE_RULES_CHECK=' - @echo "Need to reconfigure with --enable-code-coverage" -' - CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" - CODE_COVERAGE_RULES_CLEAN='' - -fi - -CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# Multiple directories may be specified, separated by whitespace. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, -# set to 0 to disable it and leave empty to stay with the default. -# (Default: empty) -# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov -# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov -# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the -# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov -# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering -# lcov instance. (Default: empty) -# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov -# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the -# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(top_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage -CODE_COVERAGE_BRANCH_COVERAGE ?= -CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= -CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ -$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) -CODE_COVERAGE_IGNORE_PATTERN ?= - -code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) -code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ - $(CODE_COVERAGE_OUTPUT_FILE); -code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) -code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ - $(CODE_COVERAGE_IGNORE_PATTERN); -code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) -code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); -code_coverage_quiet = $(code_coverage_quiet_$(V)) -code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) -code_coverage_quiet_0 = --quiet - -# sanitizes the test-name: replaces with underscores: dashes and dots -code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) - -# Use recursive makes in order to ignore errors during check -check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -'"$CODE_COVERAGE_RULES_CLEAN"' - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -' - - - - - -ac_config_files="$ac_config_files Makefile src/Makefile src/daemon/Makefile src/tools/Makefile src/pam/Makefile src/python/Makefile scripts/Makefile scripts/init.d/cgconfig scripts/init.d/cgred tests/Makefile tests/ftests/Makefile tests/gunit/Makefile samples/Makefile samples/c/Makefile samples/cmdline/Makefile samples/config/Makefile samples/python/Makefile include/Makefile include/libcgroup/init.h doc/Makefile doc/man/Makefile dist/Makefile libcgroup.pc" - -ac_config_files="$ac_config_files dist/libcgroup.spec:dist/libcgroup.spec.in" - -CFLAGS="$CFLAGS -Wall" -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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$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+y} || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$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 - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -printf %s "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 -printf "%s\n" "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TOOLS_TRUE}" && test -z "${WITH_TOOLS_FALSE}"; then - as_fn_error $? "conditional \"WITH_TOOLS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PAM_TRUE}" && test -z "${WITH_PAM_FALSE}"; then - as_fn_error $? "conditional \"WITH_PAM\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_DAEMON_TRUE}" && test -z "${WITH_DAEMON_FALSE}"; then - as_fn_error $? "conditional \"WITH_DAEMON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_PYTHON_TRUE}" && test -z "${ENABLE_PYTHON_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_SYSTEMD_TRUE}" && test -z "${WITH_SYSTEMD_FALSE}"; then - as_fn_error $? "conditional \"WITH_SYSTEMD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_INITSCRIPT_INSTALL_TRUE}" && test -z "${WITH_INITSCRIPT_INSTALL_FALSE}"; then - as_fn_error $? "conditional \"WITH_INITSCRIPT_INSTALL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TESTS_TRUE}" && test -z "${WITH_TESTS_FALSE}"; then - as_fn_error $? "conditional \"WITH_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_SAMPLES_TRUE}" && test -z "${WITH_SAMPLES_FALSE}"; then - as_fn_error $? "conditional \"WITH_SAMPLES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then - as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" 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" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$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 -as_nop=: -if test ${ZSH_VERSION+y} && (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 $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; 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 - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - 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 - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - - -# 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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$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_nop - 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_nop - 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 || -printf "%s\n" 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 - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -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 - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$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 || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by libcgroup $as_me 3.1.0, which was -generated by GNU Autoconf 2.71. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' -ac_cs_version="\\ -libcgroup config.status 3.1.0 -configured by $0, generated by GNU Autoconf 2.71, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2021 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$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 ) - printf "%s\n" "$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 - \printf "%s\n" "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 - printf "%s\n" "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -FILECMD='`$ECHO "$FILECMD" | $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"`' -lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' -configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -FILECMD \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ -nm_file_list_spec \ -lt_cv_truncate_bin \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib \ -compiler_lib_search_dirs \ -predep_objects \ -postdep_objects \ -predeps \ -postdeps \ -compiler_lib_search_path \ -LD_CXX \ -reload_flag_CXX \ -compiler_CXX \ -lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ -lt_prog_compiler_wl_CXX \ -lt_prog_compiler_static_CXX \ -lt_cv_prog_compiler_c_o_CXX \ -export_dynamic_flag_spec_CXX \ -whole_archive_flag_spec_CXX \ -compiler_needs_object_CXX \ -with_gnu_ld_CXX \ -allow_undefined_flag_CXX \ -no_undefined_flag_CXX \ -hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_separator_CXX \ -exclude_expsyms_CXX \ -include_expsyms_CXX \ -file_list_spec_CXX \ -compiler_lib_search_dirs_CXX \ -predep_objects_CXX \ -postdep_objects_CXX \ -predeps_CXX \ -postdeps_CXX \ -compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -configure_time_dlsearch_path \ -configure_time_lt_sys_library_path \ -reload_cmds_CXX \ -old_archive_cmds_CXX \ -old_archive_from_new_cmds_CXX \ -old_archive_from_expsyms_cmds_CXX \ -archive_cmds_CXX \ -archive_expsym_cmds_CXX \ -module_cmds_CXX \ -module_expsym_cmds_CXX \ -export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' - -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile' - - - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/daemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/daemon/Makefile" ;; - "src/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;; - "src/pam/Makefile") CONFIG_FILES="$CONFIG_FILES src/pam/Makefile" ;; - "src/python/Makefile") CONFIG_FILES="$CONFIG_FILES src/python/Makefile" ;; - "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; - "scripts/init.d/cgconfig") CONFIG_FILES="$CONFIG_FILES scripts/init.d/cgconfig" ;; - "scripts/init.d/cgred") CONFIG_FILES="$CONFIG_FILES scripts/init.d/cgred" ;; - "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; - "tests/ftests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ftests/Makefile" ;; - "tests/gunit/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gunit/Makefile" ;; - "samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;; - "samples/c/Makefile") CONFIG_FILES="$CONFIG_FILES samples/c/Makefile" ;; - "samples/cmdline/Makefile") CONFIG_FILES="$CONFIG_FILES samples/cmdline/Makefile" ;; - "samples/config/Makefile") CONFIG_FILES="$CONFIG_FILES samples/config/Makefile" ;; - "samples/python/Makefile") CONFIG_FILES="$CONFIG_FILES samples/python/Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "include/libcgroup/init.h") CONFIG_FILES="$CONFIG_FILES include/libcgroup/init.h" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "doc/man/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; - "dist/Makefile") CONFIG_FILES="$CONFIG_FILES dist/Makefile" ;; - "libcgroup.pc") CONFIG_FILES="$CONFIG_FILES libcgroup.pc" ;; - "dist/libcgroup.spec") CONFIG_FILES="$CONFIG_FILES dist/libcgroup.spec:dist/libcgroup.spec.in" ;; - - *) 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+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$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 '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$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 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" 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) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE=\"gmake\" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# 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. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# The names of the tagged configurations supported by this script. -available_tags='CXX ' - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shared archive member basename,for filename based shared library versioning on AIX. -shared_archive_member_spec=$shared_archive_member_spec - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# A file(cmd) program that detects file types. -FILECMD=$lt_FILECMD - -# 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 (by configure). -lt_ar_flags=$lt_ar_flags - -# Flags to create an archive. -AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and where our libraries should be installed. -lt_sysroot=$lt_sysroot - -# Command to truncate a binary pipe. -lt_truncate_bin=$lt_lt_cv_truncate_bin - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Detected run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path - -# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. -configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects -postdep_objects=$lt_postdep_objects -predeps=$lt_predeps -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - - -ltmain=$ac_aux_dir/ltmain.sh - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - $SED '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_CXX - -# A language specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU compiler? -with_gcc=$GCC_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_CXX - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_CXX - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute_CXX - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_CXX - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_CXX - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_CXX - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_CXX -postdep_objects=$lt_postdep_objects_CXX -predeps=$lt_predeps_CXX -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# ### END LIBTOOL TAG CONFIG: CXX -_LT_EOF - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/lib/libcgroup-3.1.0/configure.ac b/lib/libcgroup-3.1.0/configure.ac deleted file mode 100644 index 341a5756c42..00000000000 --- a/lib/libcgroup-3.1.0/configure.ac +++ /dev/null @@ -1,266 +0,0 @@ -# -*- Autoconf -*- -# SPDX-License-Identifier: LGPL-2.1-only -# Process this file with autoconf to produce a configure script. -# -# Copyright International Business Machines Corp. 2008 -# -# Authors: Balbir Singh -# -AC_PREREQ([2.69]) - -# In following section update all occurences of version, including soname -AC_INIT([libcgroup],[3.1.0]) - -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIRS([m4]) - -AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects]) - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -# set library version, soname is libcgroup.so.MAJOR -AC_SUBST(LIBRARY_VERSION_MAJOR, 3) -AC_SUBST(LIBRARY_VERSION_MINOR, 1) -AC_SUBST(LIBRARY_VERSION_RELEASE, 0) - -# we do not want static libraries -#AC_DISABLE_STATIC - -AM_PROG_AR -LT_INIT - -AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADER([config.h]) - -# Process command line options -AC_ARG_ENABLE([tools], - [AS_HELP_STRING([--enable-tools],[compile libcgroup tools [default=yes]])], - [ - if test "x$enableval" = xno; then - with_tools=false - else - with_tools=true - fi - ], - [with_tools=true]) -AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue]) - -AC_ARG_ENABLE([pam], - [AS_HELP_STRING([--enable-pam],[compile libcgroup PAM module [default=yes]])], - [ - if test "x$enableval" = xno; then - with_pam=false - else - with_pam=true - fi - ], - [with_pam=true]) -AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue]) - -AC_ARG_ENABLE([daemon], - [AS_HELP_STRING([--enable-daemon],[compile libcgroup daemon [default=yes]])], - [ - if test "x$enableval" = xno; then - with_daemon=false - else - with_daemon=true - fi - ], - [with_daemon=true]) -AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue]) - -AC_ARG_ENABLE([python], - [AS_HELP_STRING([--enable-python], - [build the python bindings, requires cython])]) -AS_IF([test "$enable_python" = yes], [ - # cython version check - AS_IF([test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 29], [ - AC_MSG_ERROR([python bindings require cython 0.29 or higher]) - ]) - AM_PATH_PYTHON([3]) -]) -AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes]) -AC_DEFINE_UNQUOTED([ENABLE_PYTHON], - [$(test "$enable_python" = yes && echo 1 || echo 0)], - [Python bindings build flag.]) - -AC_ARG_ENABLE([systemd], - [AS_HELP_STRING([--enable-systemd],[enable systemd support [default=yes]])], - [ - if test "x$enableval" = xno; then - with_systemd=false - else - with_systemd=true - fi - ], - [with_systemd=true]) -AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd = xtrue]) - -AC_ARG_ENABLE([initscript-install], - [AS_HELP_STRING([--enable-initscript-install],[install init scripts [default=no]])], - [ - if test "x$enableval" = xno; then - with_initscript_install=false - else - with_initscript_install=true - fi - ], - [with_initscript_install=false]) -AM_CONDITIONAL([WITH_INITSCRIPT_INSTALL], [test x$with_initscript_install = xtrue]) - -socket_path="/var/run/cgred.socket" -AC_ARG_ENABLE([cgred-socket], - [AS_HELP_STRING([--enable-cgred-socket=PATH],[specify location of cgrulesengd communication socket - (default=/var/run/cgred.socket)])], - [ - if test "x$enableval" = xno -o "x$enableval" = xyes; then - AC_MSG_ERROR([Provide valid path with --enable-cgred-socket option.]) - else - socket_path="$enableval" - fi - ], []) -AC_DEFINE_UNQUOTED([CGRULE_CGRED_SOCKET_PATH],"$socket_path", [Cgrulesengd socket path]) - -pam_module_dir="$libdir/security" -AC_ARG_ENABLE([pam-module-dir], - [AS_HELP_STRING([--enable-pam-module-dir=PATH],[specify location of libcgroup PAM module - (default=$libdir/security)])], - [ - if test "x$enableval" = xno -o "x$enableval" = xyes; then - AC_MSG_ERROR([Provide valid path with --enable-pam-module-dir option.]) - else - pam_module_dir="$enableval" - fi - ], []) -AC_SUBST([pamlibdir],"$pam_module_dir") - -AC_ARG_ENABLE([opaque-hierarchy], - [AS_HELP_STRING([--enable-opaque-hierarchy=NAME],[specify name of a hierarchy which libcgroup should ignore, e.g. name=systemd - (default=none)])], - [ - if test "x$enableval" = xno -o "x$enableval" = xyes; then - AC_MSG_ERROR([Provide name of a hierarchy.]) - else - AC_DEFINE_UNQUOTED([OPAQUE_HIERARCHY], "$enableval", - [Define to ignore specific hierarchy.]) - fi - ], []) - -AC_ARG_ENABLE([tests], - [AS_HELP_STRING([--enable-tests],[compile libcgroup tests [default=yes]])], - [ - if test "x$enableval" = xno; then - with_tests=false - else - with_tests=true - fi - ], - [with_tests=true]) -AM_CONDITIONAL([WITH_TESTS], [test x$with_tests = xtrue]) - -AC_ARG_ENABLE([samples], - [AS_HELP_STRING([--enable-samples],[compile libcgroup samples C programs [default=no]])], - [ - if test "x$enableval" = xno; then - with_samples=false - else - with_samples=true - fi - ], - [with_samples=false]) -AM_CONDITIONAL([WITH_SAMPLES], [test x$with_samples = xtrue]) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_YACC -if test "$YACC" = yacc; then - AC_CHECK_PROG([REALLY_YACC], [yacc], [yacc]) - if test "$REALLY_YACC" = ""; then - AC_MSG_ERROR([This program cannot be built unless a version of yacc is installed.]) - fi -fi -AM_PROG_LEX -if test "$LEX" != flex; then - AC_MSG_ERROR([This program cannot be built unless flex is installed.]) -fi -LT_INIT - -# Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([limits.h mntent.h stdlib.h string.h sys/mount.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_TYPE_UID_T -AC_C_INLINE -AC_TYPE_INT64_T -AC_TYPE_PID_T - -# Checks for library functions. -AC_FUNC_CHOWN -AC_FUNC_GETMNTENT -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_FUNC_STAT -AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) - -orig_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -D_GNU_SOURCE" -AC_FUNC_STRERROR_R -CFLAGS="$orig_CFLAGS" - -AC_SEARCH_LIBS( - [fts_open], - [fts], - [], - [AC_MSG_ERROR([Unable to find the fts_open() function])]) - -if test x$with_pam = xtrue; then - AC_CHECK_LIB( - [pam], - [pam_syslog], - [ - dnl Override the default behavior of AC_CHECK_LIB, - dnl we don't want -lpam in LIBS. - : - ], - [AC_MSG_ERROR([Cannot compile PAM module without libpam!])]) - - AC_CHECK_HEADERS( - [security/pam_modules.h security/pam_modutil.h security/pam_ext.h], - [], - [AC_MSG_ERROR([Cannot compile PAM module without necessary - header files!])]) -fi - -AX_CODE_COVERAGE - -AC_CONFIG_FILES([Makefile - src/Makefile - src/daemon/Makefile - src/tools/Makefile - src/pam/Makefile - src/python/Makefile - scripts/Makefile - scripts/init.d/cgconfig - scripts/init.d/cgred - tests/Makefile - tests/ftests/Makefile - tests/gunit/Makefile - samples/Makefile - samples/c/Makefile - samples/cmdline/Makefile - samples/config/Makefile - samples/python/Makefile - include/Makefile - include/libcgroup/init.h - doc/Makefile - doc/man/Makefile - dist/Makefile - libcgroup.pc]) -AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in]) -CFLAGS="$CFLAGS -Wall" -AC_OUTPUT diff --git a/lib/libcgroup-3.1.0/dist/Makefile.am b/lib/libcgroup-3.1.0/dist/Makefile.am deleted file mode 100644 index 346b8b8a6fc..00000000000 --- a/lib/libcgroup-3.1.0/dist/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = libcgroup.spec diff --git a/lib/libcgroup-3.1.0/dist/Makefile.in b/lib/libcgroup-3.1.0/dist/Makefile.in deleted file mode 100644 index 5223222890e..00000000000 --- a/lib/libcgroup-3.1.0/dist/Makefile.in +++ /dev/null @@ -1,477 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = dist -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libcgroup.spec -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libcgroup.spec.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = libcgroup.spec -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign dist/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign dist/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -libcgroup.spec: $(top_builddir)/config.status $(srcdir)/libcgroup.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f 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-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# 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/lib/libcgroup-3.1.0/dist/libcgroup.spec b/lib/libcgroup-3.1.0/dist/libcgroup.spec deleted file mode 100644 index 25c42fb678b..00000000000 --- a/lib/libcgroup-3.1.0/dist/libcgroup.spec +++ /dev/null @@ -1,168 +0,0 @@ -%define soversion 3.1.0 -%define soversion_major 3 - -Name: libcgroup -Summary: Tools and libraries to control and monitor control groups -Group: System Environment/Libraries -Version: 3.1.0 -Release: 1%{?dist} -License: LGPLv2+ -URL: http://libcg.sourceforge.net/ -Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: pam-devel -BuildRequires: byacc -BuildRequires: flex -BuildRequires: coreutils -Requires(pre): shadow-utils -Requires(post): chkconfig, /sbin/service -Requires(preun): /sbin/chkconfig - -%description -Control groups infrastructure. The tools and library help manipulate, control, -administrate and monitor control groups and the associated controllers. - -%package pam -Summary: A Pluggable Authentication Module for libcgroup -Group: System Environment/Base -Requires: libcgroup = %{version}-%{release} - -%description pam -Linux-PAM module, which allows administrators to classify the user's login -processes to pre-configured control group. - -%package devel -Summary: Development libraries to develop applications that utilize control groups -Group: Development/Libraries -Requires: libcgroup = %{version}-%{release} - -%description devel -It provides API to create/delete and modify cgroup nodes. It will also in the -future allow creation of persistent configuration for control groups and -provide scripts to manage that configuration. - -%prep -%setup -q - -%build -%configure --bindir=/bin --sbindir=/sbin --libdir=%{_libdir} --enable-initscript-install --enable-pam-module-dir=/%{_lib}/security - -make %{?_smp_mflags} - - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install - -# install config files -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig -cp samples/config/cgred.conf $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgred.conf -cp samples/config/cgconfig.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgconfig -cp samples/config/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf -cp samples/config/cgrules.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgrules.conf -cp samples/config/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgsnapshot_blacklist.conf - -# sanitize pam module, we need only pam_cgroup.so -mv -f $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so -rm -f $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so.* - -# move the libraries to / -mkdir -p $RPM_BUILD_ROOT/%{_lib} -mv -f $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_lib} -rm -f $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so.%{soversion_major} -ln -sf libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.%{soversion_major} -ln -sf ../../%{_lib}/libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la - -%clean -rm -rf $RPM_BUILD_ROOT - -%pre -getent group cgred >/dev/null || groupadd cgred - -%post -/sbin/ldconfig -/sbin/chkconfig --add cgred -/sbin/chkconfig --add cgconfig - -%preun -if [ $1 = 0 ]; then - /sbin/service cgred stop > /dev/null 2>&1 || : - /sbin/service cgconfig stop > /dev/null 2>&1 || : - /sbin/chkconfig --del cgconfig - /sbin/chkconfig --del cgred -fi - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/sysconfig/cgred.conf -%config(noreplace) %{_sysconfdir}/sysconfig/cgconfig -%config(noreplace) %{_sysconfdir}/cgconfig.conf -%config(noreplace) %{_sysconfdir}/cgrules.conf -%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf -/%{_lib}/libcgroup.so.* -%attr(2755, root, cgred) /bin/cgexec -/bin/cgclassify -/bin/cgcreate -/bin/cgget -/bin/cgset -/bin/cgdelete -/bin/lscgroup -/bin/lssubsys -/sbin/cgconfigparser -/sbin/cgrulesengd -/bin/cgsnapshot -%attr(0644, root, root) %{_mandir}/man1/* -%attr(0644, root, root) %{_mandir}/man5/* -%attr(0644, root, root) %{_mandir}/man8/* -%attr(0755,root,root) %{_initrddir}/cgconfig -%attr(0755,root,root) %{_initrddir}/cgred - -%doc COPYING INSTALL README_daemon - -%files pam -%defattr(-,root,root,-) -%attr(0755,root,root) /%{_lib}/security/pam_cgroup.so -%doc COPYING INSTALL - -%files devel -%defattr(-,root,root,-) -%{_includedir}/libcgroup.h -%{_includedir}/libcgroup/*.h -%{_libdir}/libcgroup.* -/%{_libdir}/pkgconfig/libcgroup.pc -%doc COPYING INSTALL - - -%changelog -* Tue Nov 2 2010 Jan Safranek 0.37.rc1-1 -- Add cgsnapshot -* Thu Feb 18 2010 Dhaval Giani 0.36.rc1-1 -- Add pkgconfig file -* Tue Jan 19 2010 Balbir Singh 0.35.1 -- Integrate Jan's fixes for distributing cgget and initscripts -* Thu Oct 22 2009 Jan Safranek 0.34-1 -- Update to latest upstream -- Split PAM module to separate subpackage -* Tue Feb 24 2009 Balbir Singh 0.33-1 -- Update to 0.33, spec file changes to add Makefiles and pam_cgroup module -* Fri Oct 10 2008 Dhaval Giani 0.32-1 -- Update to latest upstream -* Thu Sep 11 2008 Dhaval Giani 0.31-1 -- Update to latest upstream -* Sat Aug 2 2008 Dhaval Giani 0.1c-3 -- Change release to fix broken upgrade path -* Wed Jun 11 2008 Dhaval Giani 0.1c-1 -- Update to latest upstream version -* Tue Jun 3 2008 Balbir Singh 0.1b-3 -- Add post and postun. Also fix Requires for devel to depend on base n-v-r -* Sat May 31 2008 Balbir Singh 0.1b-2 -- Fix makeinstall, Source0 and URL (review comments from Tom) -* Mon May 26 2008 Balbir Singh 0.1b-1 -- Add a generatable spec file -* Tue May 20 2008 Balbir Singh 0.1-1 -- Get the spec file to work -* Tue May 20 2008 Dhaval Giani 0.01-1 -- The first version of libcg diff --git a/lib/libcgroup-3.1.0/dist/libcgroup.spec.in b/lib/libcgroup-3.1.0/dist/libcgroup.spec.in deleted file mode 100644 index bb53efefec0..00000000000 --- a/lib/libcgroup-3.1.0/dist/libcgroup.spec.in +++ /dev/null @@ -1,168 +0,0 @@ -%define soversion @LIBRARY_VERSION_MAJOR@.@LIBRARY_VERSION_MINOR@.@LIBRARY_VERSION_RELEASE@ -%define soversion_major @LIBRARY_VERSION_MAJOR@ - -Name: libcgroup -Summary: Tools and libraries to control and monitor control groups -Group: System Environment/Libraries -Version: @PACKAGE_VERSION@ -Release: 1%{?dist} -License: LGPLv2+ -URL: http://libcg.sourceforge.net/ -Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: pam-devel -BuildRequires: byacc -BuildRequires: flex -BuildRequires: coreutils -Requires(pre): shadow-utils -Requires(post): chkconfig, /sbin/service -Requires(preun): /sbin/chkconfig - -%description -Control groups infrastructure. The tools and library help manipulate, control, -administrate and monitor control groups and the associated controllers. - -%package pam -Summary: A Pluggable Authentication Module for libcgroup -Group: System Environment/Base -Requires: libcgroup = %{version}-%{release} - -%description pam -Linux-PAM module, which allows administrators to classify the user's login -processes to pre-configured control group. - -%package devel -Summary: Development libraries to develop applications that utilize control groups -Group: Development/Libraries -Requires: libcgroup = %{version}-%{release} - -%description devel -It provides API to create/delete and modify cgroup nodes. It will also in the -future allow creation of persistent configuration for control groups and -provide scripts to manage that configuration. - -%prep -%setup -q - -%build -%configure --bindir=/bin --sbindir=/sbin --libdir=%{_libdir} --enable-initscript-install --enable-pam-module-dir=/%{_lib}/security - -make %{?_smp_mflags} - - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install - -# install config files -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig -cp samples/config/cgred.conf $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgred.conf -cp samples/config/cgconfig.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgconfig -cp samples/config/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf -cp samples/config/cgrules.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgrules.conf -cp samples/config/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgsnapshot_blacklist.conf - -# sanitize pam module, we need only pam_cgroup.so -mv -f $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so -rm -f $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so.* - -# move the libraries to / -mkdir -p $RPM_BUILD_ROOT/%{_lib} -mv -f $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_lib} -rm -f $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so.%{soversion_major} -ln -sf libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.%{soversion_major} -ln -sf ../../%{_lib}/libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la - -%clean -rm -rf $RPM_BUILD_ROOT - -%pre -getent group cgred >/dev/null || groupadd cgred - -%post -/sbin/ldconfig -/sbin/chkconfig --add cgred -/sbin/chkconfig --add cgconfig - -%preun -if [ $1 = 0 ]; then - /sbin/service cgred stop > /dev/null 2>&1 || : - /sbin/service cgconfig stop > /dev/null 2>&1 || : - /sbin/chkconfig --del cgconfig - /sbin/chkconfig --del cgred -fi - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/sysconfig/cgred.conf -%config(noreplace) %{_sysconfdir}/sysconfig/cgconfig -%config(noreplace) %{_sysconfdir}/cgconfig.conf -%config(noreplace) %{_sysconfdir}/cgrules.conf -%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf -/%{_lib}/libcgroup.so.* -%attr(2755, root, cgred) /bin/cgexec -/bin/cgclassify -/bin/cgcreate -/bin/cgget -/bin/cgset -/bin/cgdelete -/bin/lscgroup -/bin/lssubsys -/sbin/cgconfigparser -/sbin/cgrulesengd -/bin/cgsnapshot -%attr(0644, root, root) %{_mandir}/man1/* -%attr(0644, root, root) %{_mandir}/man5/* -%attr(0644, root, root) %{_mandir}/man8/* -%attr(0755,root,root) %{_initrddir}/cgconfig -%attr(0755,root,root) %{_initrddir}/cgred - -%doc COPYING INSTALL README_daemon - -%files pam -%defattr(-,root,root,-) -%attr(0755,root,root) /%{_lib}/security/pam_cgroup.so -%doc COPYING INSTALL - -%files devel -%defattr(-,root,root,-) -%{_includedir}/libcgroup.h -%{_includedir}/libcgroup/*.h -%{_libdir}/libcgroup.* -/%{_libdir}/pkgconfig/libcgroup.pc -%doc COPYING INSTALL - - -%changelog -* Tue Nov 2 2010 Jan Safranek 0.37.rc1-1 -- Add cgsnapshot -* Thu Feb 18 2010 Dhaval Giani 0.36.rc1-1 -- Add pkgconfig file -* Tue Jan 19 2010 Balbir Singh 0.35.1 -- Integrate Jan's fixes for distributing cgget and initscripts -* Thu Oct 22 2009 Jan Safranek 0.34-1 -- Update to latest upstream -- Split PAM module to separate subpackage -* Tue Feb 24 2009 Balbir Singh 0.33-1 -- Update to 0.33, spec file changes to add Makefiles and pam_cgroup module -* Fri Oct 10 2008 Dhaval Giani 0.32-1 -- Update to latest upstream -* Thu Sep 11 2008 Dhaval Giani 0.31-1 -- Update to latest upstream -* Sat Aug 2 2008 Dhaval Giani 0.1c-3 -- Change release to fix broken upgrade path -* Wed Jun 11 2008 Dhaval Giani 0.1c-1 -- Update to latest upstream version -* Tue Jun 3 2008 Balbir Singh 0.1b-3 -- Add post and postun. Also fix Requires for devel to depend on base n-v-r -* Sat May 31 2008 Balbir Singh 0.1b-2 -- Fix makeinstall, Source0 and URL (review comments from Tom) -* Mon May 26 2008 Balbir Singh 0.1b-1 -- Add a generatable spec file -* Tue May 20 2008 Balbir Singh 0.1-1 -- Get the spec file to work -* Tue May 20 2008 Dhaval Giani 0.01-1 -- The first version of libcg diff --git a/lib/libcgroup-3.1.0/doc/Makefile.am b/lib/libcgroup-3.1.0/doc/Makefile.am deleted file mode 100644 index e4396141203..00000000000 --- a/lib/libcgroup-3.1.0/doc/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -DIST_SUBDIRS = man -SUBDIRS = $(DIST_SUBDIRS) - diff --git a/lib/libcgroup-3.1.0/doc/Makefile.in b/lib/libcgroup-3.1.0/doc/Makefile.in deleted file mode 100644 index 06eee978f2c..00000000000 --- a/lib/libcgroup-3.1.0/doc/Makefile.in +++ /dev/null @@ -1,653 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = doc -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir distdir-am -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -DIST_SUBDIRS = man -SUBDIRS = $(DIST_SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/doc/man/Makefile.am b/lib/libcgroup-3.1.0/doc/man/Makefile.am deleted file mode 100644 index 13cc0062ade..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -man_MANS = cgclassify.1 cgconfig.conf.5 cgconfigparser.8 cgexec.1 \ - cgred.conf.5 cgrules.conf.5 cgrulesengd.8 cgcreate.1 cgset.1 \ - cgget.1 cgdelete.1 lssubsys.1 lscgroup.1 cgsnapshot.1 \ - cgxget.1 cgxset.1 - -EXTRA_DIST = $(man_MANS) - diff --git a/lib/libcgroup-3.1.0/doc/man/Makefile.in b/lib/libcgroup-3.1.0/doc/man/Makefile.in deleted file mode 100644 index 81a4e7160d6..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/Makefile.in +++ /dev/null @@ -1,650 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = doc/man -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -man1dir = $(mandir)/man1 -am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ - "$(DESTDIR)$(man8dir)" -man5dir = $(mandir)/man5 -man8dir = $(mandir)/man8 -NROFF = nroff -MANS = $(man_MANS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -man_MANS = cgclassify.1 cgconfig.conf.5 cgconfigparser.8 cgexec.1 \ - cgred.conf.5 cgrules.conf.5 cgrulesengd.8 cgcreate.1 cgset.1 \ - cgget.1 cgdelete.1 lssubsys.1 lscgroup.1 cgsnapshot.1 \ - cgxget.1 cgxset.1 - -EXTRA_DIST = $(man_MANS) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/man/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man1: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man1dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.1[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) -install-man5: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man5dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.5[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ - done; } - -uninstall-man5: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man5dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.5[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) -install-man8: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man8dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.8[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ - done; } - -uninstall-man8: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man8dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.8[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(MANS) -installdirs: - for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-man - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man1 install-man5 install-man8 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-man - -uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-man1 install-man5 install-man8 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-man uninstall-man1 uninstall-man5 \ - uninstall-man8 - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/doc/man/cgclassify.1 b/lib/libcgroup-3.1.0/doc/man/cgclassify.1 deleted file mode 100644 index 950145d05a9..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgclassify.1 +++ /dev/null @@ -1,93 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Varekova . - -.TH CGCLASSIFY 1 2009-03-15 "Linux" "libcgroup Manual" -.SH NAME -cgclassify \- move running task(s) to given cgroups - -.SH SYNOPSIS -\fBcgclassify\fR [\fB-b\fR] [\fB-g\fR <\fIcontrollers>:] [--sticky | --cancel-sticky] <\fIpidlist\fR> - -.SH DESCRIPTION -this command moves processes defined by the list -of processes -(\fBpidlist\fR) -to the given control groups. - -The pids in the pidlist are separated by spaces - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B -g : -defines the control groups where the task will be moved. -\fBcontrollers\fR is a list of controllers and -\fBpath\fR is the relative path to control groups -in the given controllers list. - -This flag can be used multiple times to -define multiple pairs of lists of controllers -and relative paths. -Instead of the list of all mounted controllers, -the wildcard \fB*\fR can be used. - -If this option is not used then -\fBcgclassify\fR will automatically move the task to a -control group based on \fB/etc/cgrules.conf\fR. - -.TP -.B -r -Replaces systemd scope's idle process with the -\fBfirst process\fR of the list of process (\fBpidlist\fR). - -.TP -.B --sticky -If this option is used, the daemon of service cgred (cgrulesengd process) -does not change both the specified \fBpidlist\fR and their children tasks. -Without this option, the daemon does not change the specified \fBpidlist\fR -but it automatically changes their child tasks to the right cgroup based on -\fB/etc/cgrules.conf\fR. - -.TP -.B --cancel-sticky -If this option is used, the daemon of service cgred (cgrulesengd process) -can automatically change both the specified \fBpidlist\fR and their child -tasks to the right cgroup based on \fB/etc/cgrules.conf\fR. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH FILES -.TP -.B /etc/cgrules.conf -default libcgroup configuration file -.TP -.B /etc/cgrules.d -default libcgroup configuration files directory - -.SH EXAMPLES -.TP -.B cgclassify -g cpu:student 1234 -moves process with pid number 1234 to control group student in cpu hierarchy. - -.TP -.B cgclassify 1234 -moves process with pid number 1234 to control groups based on -\fB/etc/cgrules.conf\fR configuration file. - -.TP -.B cgclassify --sticky -g cpu:/student 1234 -moves process with pid number 1234 to control group student in cpu hierarchy. -The daemon of service cgred does not change cgroups of pid 1234 and its children -(based on \fB/etc/cgrules.conf\fR). - -.SH SEE ALSO -cgrules.conf (5), cgexec (1) - diff --git a/lib/libcgroup-3.1.0/doc/man/cgconfig.conf.5 b/lib/libcgroup-3.1.0/doc/man/cgconfig.conf.5 deleted file mode 100644 index 8673bb0cfec..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgconfig.conf.5 +++ /dev/null @@ -1,824 +0,0 @@ -.TH CGCONFIG.CONF 5 -.\"*********************************** -.SH NAME -cgconfig.conf \- libcgroup configuration file -.\"*********************************** -.SH DESCRIPTION -.B "cgconfig.conf" -is a configuration file used by -.B libcgroup -to define control groups, their parameters and their mount points. -The file consists of -.I mount -, -.I group -and -.I default -sections. These sections can be in arbitrary order and all of them are -optional. Any line starting with '#' is considered a comment line and -is ignored. -.LP -.I mount -section has this form: -.RS -.nf -.ft B -.sp -mount { -.RS -.ft B - = ; -.I "..." -.RE -.ft B -} -.ft R -.fi -.RE - -.TP -.B controller -Name of the kernel subsystem. The list of subsystems supported by the kernel -can be found in -.I /proc/cgroups -file. Named hierarchy can be specified as controller -\fB"name="\fR. Do not forget to use double quotes around -this controller name (see examples below). Apart from named hierarchy, -additional mount options may be specified by putting the controller and -the options in quotes. Options supported are \fB nosuid, noexec\fR and\fB nodev\fR. - -.B Libcgroup -merges all subsystems mounted to the same directory (see -Example 1) and the directory is mounted only once. - -.TP -.B path -The directory path where the group hierarchy associated to a given -controller shall be mounted. The directory is created -automatically on cgconfig service startup if it does not exist and -is deleted on service shutdown. -.LP - -If no -.I mount -section is specified, no controllers are mounted. - -.I group -section has this form: -.RS -.nf -.ft B -.sp -group { -.RS -.ft B -[permissions] - { -.RS -.ft B - = ; -.I "..." -.RE -.ft B -} -.I "..." -.RE -.ft B -} -.ft R -.fi -.RE - -.TP -.B name -Name of the control group. It can contain only characters, which are -allowed for directory names. -The groups form a tree, i.e. a control group can contain zero or more -subgroups. Subgroups can be specified using '/' delimiter. - -The root control group is always created automatically in all hierarchies -and it is the base of the group hierarchy. It can be explicitly specified in -.B cgconfig.conf -by using '.' as group name. This can be used e.g. to set its permissions, -as shown in Example 6. - -When the parent control group of a subgroup is not specified -it is created automatically. - -.TP -.B permissions -Permissions of the given control group on mounted filesystem. -.I root -has always permission to do anything with the control group. -Permissions have the following syntax: -.RS 17 -.ft B -.nf -perm { -.RS -.ft B -task { -.RS -.ft B -uid = ; -gid = ; -fperm = -.RE -} -admin { -.RS -uid = ; -gid = ; -dperm = -fperm = -.RE -} -.RE -} -.fi -.RE -.ft R - -.RS -.TP 17 -.B "task user/group" -Name of the user and the group, which own the -.I tasks -file of the control group. Given fperm then specify the file permissions. -Please note that the given value is not used as was specified. Instead, -current file owner permissions are used as a "umask" for group and others -permissions. For example if fperm = 777 then both group and others will get -the same permissions as the file owner. -.TP 17 -.B "admin user/group" -Name of the user and the group which own the rest of control group's -files. Given fperm and dperm control file and directory permissions. -Again, the given value is masked by the file/directory owner permissions. -.LP -Permissions are only apply to the enclosing control group and are not -inherited by subgroups. If there is no -.B perm -section in the control group definition, -.I root:root -is the owner of all files and default file permissions are preserved if -fperm resp. dperm are not specified. -.RE -.TP -.B controller -Name of the kernel subsystem. -The section can be -empty, default kernel parameters will be used in this case. By -specifying -.B controller -the control group and all its parents are controlled by the specific -subsystem. One control group can be controlled by multiple subsystems, -even if the subsystems are mounted on different directories. Each -control group must be controlled by at least one subsystem, so that -.B libcgroup -knows in which hierarchies the control group should be created. - -The parameters of the given controller can be modified in the following -section enclosed in brackets. -.RS -.TP -.B param name -Name of the file to set. Each controller can have zero or more -parameters. -.TP -.B param value -Value which should be written to the file when the control group is -created. If it is enclosed in double quotes `"', it can contain spaces -and other special characters. -.RE - -If no -.I group -section is specified, no groups are created. - -.I default -section has this form: -.RS -.nf -.ft B -.sp -default { -.RS -.ft B -perm { -.RS -.ft B -task { -.RS -.ft B -uid = ; -gid = ; -fperm = -.RE -} -admin { -.RS -uid = ; -gid = ; -dperm = -fperm = -.RE -} -.RE -} -.RE -} -.ft R -.fi -.RE - -Content of the -.B perm -section has the same form as in -.I group -section. The permissions defined here specify owner and permissions of -groups and files of all groups, which do not have explicitly specified -their permissions in their -.I group -section. - -.I template -section has the same structure as -.B group -section. Template name uses the same templates string as -.B cgrules.conf -destination tag (see (\fBcgrules.conf\fR (5)). -Template definition is used as a control group definition for rules in -\fBcgrules.conf\fR (5) with the same destination name. -Templates does not use -.B default -section settings. - -.I /etc/cgconfig.d/ -directory can be used for additional configuration files. cgrulesengd searches this directory for additional templates. - -.\"********************************************" -.SH EXAMPLES -.LP -.SS Example 1 -.LP -The configuration file: -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpu; -.RE -} -.fi -.RE - -creates the hierarchy controlled by two subsystems with no groups -inside. It corresponds to the following operations: -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mount -t cgroup -o cpu,cpuacct cpu /mnt/cgroups/cpu -.fi -.RE - -.SS Example 2 -.LP -The configuration file: -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -"name=scheduler" = /mnt/cgroups/cpu; -"name=noctrl" = /mnt/cgroups/noctrl; -.RE -} - -group daemons { -.RS -cpu { -.RS -cpu.shares = "1000"; -.RE -} -.RE -} -group test { -.RS -"name=noctrl" { -} -.RE -} -.RE -.fi -creates two hierarchies. One hierarchy named \fBscheduler\fR controlled by cpu -subsystem, with group \fBdaemons\fR inside. Second hierarchy is named -\fBnoctrl\fR without any controller, with group \fBtest\fR. It corresponds to -following operations: -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mount -t cgroup -o cpu,name=scheduler cpu /mnt/cgroups/cpu -mount -t cgroup -o none,name=noctrl none /mnt/cgroups/noctrl - -mkdir /mnt/cgroups/cpu/daemons -echo 1000 > /mnt/cgroups/cpu/daemons/www/cpu.shares - -mkdir /mnt/cgroups/noctrl/tests -.fi -.RE - -The -.I daemons -group is created automatically when its first subgroup is -created. All its parameters have the default value and only root can -access group's files. -.LP -Since both -.I cpuacct -and -.I cpu -subsystems are mounted to the same directory, all -groups are implicitly controlled also by -.I cpuacct -subsystem, even if there is no -.I cpuacct -section in any of the groups. -.RE - -.SS Example 3 -.LP -The configuration file: -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpu; -.RE -} - -group daemons/www { -.RS -perm { -.RS -task { -.RS -uid = root; -gid = webmaster; -fperm = 770; -.RE -} -admin { -.RS -uid = root; -gid = root; -dperm = 775; -fperm = 744; -.RE -} -.RE -} -cpu { -.RS -cpu.shares = "1000"; -.RE -} -.RE -} - -group daemons/ftp { -.RS -perm { -.RS -task { -.RS -uid = root; -gid = ftpmaster; -fperm = 774; -.RE -} -admin { -.RS -uid = root; -gid = root; -dperm = 755; -fperm = 700; -.RE -} -.RE -} -cpu { -.RS -cpu.shares = "500"; -.RE -} -.RE -} -.RE -.fi -creates the hierarchy controlled by two subsystems with one group and -two subgroups inside, setting one parameter. -It corresponds to the following operations (except for file permissions -which are little bit trickier to emulate via chmod): - -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mount -t cgroup -o cpu,cpuacct cpu /mnt/cgroups/cpu - -mkdir /mnt/cgroups/cpu/daemons - -mkdir /mnt/cgroups/cpu/daemons/www -chown root:root /mnt/cgroups/cpu/daemons/www/* -chown root:webmaster /mnt/cgroups/cpu/daemons/www/tasks -echo 1000 > /mnt/cgroups/cpu/daemons/www/cpu.shares - - # + chmod the files so the result looks like: - # ls -la /mnt/cgroups/cpu/daemons/www/ - # admin.dperm = 755: - # drwxr-xr-x. 2 root webmaster 0 Jun 16 11:51 . - # - # admin.fperm = 744: - # --w-------. 1 root webmaster 0 Jun 16 11:51 cgroup.event_control - # -r--r--r--. 1 root webmaster 0 Jun 16 11:51 cgroup.procs - # -r--r--r--. 1 root webmaster 0 Jun 16 11:51 cpuacct.stat - # -rw-r--r--. 1 root webmaster 0 Jun 16 11:51 cpuacct.usage - # -r--r--r--. 1 root webmaster 0 Jun 16 11:51 cpuacct.usage_percpu - # -rw-r--r--. 1 root webmaster 0 Jun 16 11:51 cpu.rt_period_us - # -rw-r--r--. 1 root webmaster 0 Jun 16 11:51 cpu.rt_runtime_us - # -rw-r--r--. 1 root webmaster 0 Jun 16 11:51 cpu.shares - # -rw-r--r--. 1 root webmaster 0 Jun 16 11:51 notify_on_release - # - # tasks.fperm = 770 - # -rw-rw----. 1 root webmaster 0 Jun 16 11:51 tasks - - -mkdir /mnt/cgroups/cpu/daemons/ftp -chown root:root /mnt/cgroups/cpu/daemons/ftp/* -chown root:ftpmaster /mnt/cgroups/cpu/daemons/ftp/tasks -echo 500 > /mnt/cgroups/cpu/daemons/ftp/cpu.shares - - # + chmod the files so the result looks like: - # ls -la /mnt/cgroups/cpu/daemons/ftp/ - # admin.dperm = 755: - # drwxr-xr-x. 2 root ftpmaster 0 Jun 16 11:51 . - # - # admin.fperm = 700: - # --w-------. 1 root ftpmaster 0 Jun 16 11:51 cgroup.event_control - # -r--------. 1 root ftpmaster 0 Jun 16 11:51 cgroup.procs - # -r--------. 1 root ftpmaster 0 Jun 16 11:51 cpuacct.stat - # -rw-------. 1 root ftpmaster 0 Jun 16 11:51 cpuacct.usage - # -r--------. 1 root ftpmaster 0 Jun 16 11:51 cpuacct.usage_percpu - # -rw-------. 1 root ftpmaster 0 Jun 16 11:51 cpu.rt_period_us - # -rw-------. 1 root ftpmaster 0 Jun 16 11:51 cpu.rt_runtime_us - # -rw-------. 1 root ftpmaster 0 Jun 16 11:51 cpu.shares - # -rw-------. 1 root ftpmaster 0 Jun 16 11:51 notify_on_release - # - # tasks.fperm = 774: - # -rw-rw-r--. 1 root ftpmaster 0 Jun 16 11:51 tasks - -.fi -.RE - -The -.I daemons -group is created automatically when its first subgroup is -created. All its parameters have the default value and only root can -access the group's files. -.LP -Since both -.I cpuacct -and -.I cpu -subsystems are mounted to the same directory, all -groups are implicitly also controlled by the -.I cpuacct -subsystem, even if there is no -.I cpuacct -section in any of the groups. -.RE - -.SS Example 4 -.LP -The configuration file: - -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpuacct; -.RE -} - -group daemons { -.RS -cpuacct{ -} -cpu { -} -.RE -} -.fi -.RE -creates two hierarchies and one common group in both of them. -It corresponds to the following operations: -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mkdir /mnt/cgroups/cpuacct -mount -t cgroup -o cpu cpu /mnt/cgroups/cpu -mount -t cgroup -o cpuacct cpuacct /mnt/cgroups/cpuacct - -mkdir /mnt/cgroups/cpu/daemons -mkdir /mnt/cgroups/cpuacct/daemons -.fi -.RE - -In fact there are two groups created. One in the -.I cpuacct -hierarchy, the second in the -.I cpu -hierarchy. These two groups have nothing in common and can -contain different subgroups and different tasks. - -.SS Example 5 -.LP - -The configuration file: - -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpuacct; -.RE -} - -group daemons { -.RS -cpuacct{ -} -.RE -} - -group daemons/www { -.RS -cpu { -.RS -cpu.shares = "1000"; -.RE -} -.RE -} - -group daemons/ftp { -.RS -cpu { -.RS -cpu.shares = "500"; -.RE -} -.RE -} -.fi -.RE -creates two hierarchies with few groups inside. One of the groups -is created in both hierarchies. - -It corresponds to the following operations: -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mkdir /mnt/cgroups/cpuacct -mount -t cgroup -o cpu cpu /mnt/cgroups/cpu -mount -t cgroup -o cpuacct cpuacct /mnt/cgroups/cpuacct - -mkdir /mnt/cgroups/cpuacct/daemons -mkdir /mnt/cgroups/cpu/daemons -mkdir /mnt/cgroups/cpu/daemons/www -echo 1000 > /mnt/cgroups/cpu/daemons/www/cpu.shares -mkdir /mnt/cgroups/cpu/daemons/ftp -echo 500 > /mnt/cgroups/cpu/daemons/ftp/cpu.shares -.fi -.RE -Group -.I daemons -is created in both hierarchies. In the -.I cpuacct -hierarchy the group is explicitly mentioned in the configuration -file. In the -.I cpu -hierarchy the group is created implicitly when -.I www -is created there. These two groups have nothing in common, for example -they do not share processes and subgroups. Groups -.I www -and -.I ftp -are created only in the -.I cpu -hierarchy and are not controlled by the -.I cpuacct -subsystem. - -.SS Example 6 -.LP -The configuration file: -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpu; -.RE -} - -group . { -.RS -perm { -.RS -task { -.RS -uid = root; -gid = operator; -.RE -} -admin { -.RS -uid = root; -gid = operator; -.RE -} -.RE -} -cpu { -} -.RE -} - -group daemons { -.RS -perm { -.RS -task { -.RS -uid = root; -gid = daemonmaster; -.RE -} -admin { -.RS -uid = root; -gid = operator; -.RE -} -.RE -} -cpu { -} -.RE -} -.RE -.fi -creates the hierarchy controlled by two subsystems with one group having some -special permissions. -It corresponds to the following operations: -.LP -.RS -.nf -mkdir /mnt/cgroups/cpu -mount -t cgroup -o cpu,cpuacct cpu /mnt/cgroups/cpu - -chown root:operator /mnt/cgroups/cpu/* -chown root:operator /mnt/cgroups/cpu/tasks - -mkdir /mnt/cgroups/cpu/daemons -chown root:operator /mnt/cgroups/cpu/daemons/* -chown root:daemonmaster /mnt/cgroups/cpu/daemons/tasks -.fi -.RE - -Users which are members of the -.I operator -group are allowed to administer the control groups, i.e. create new control -groups and move processes between these groups without having root -privileges. - -Members of the -.I daemonmaster -group can move processes to the -.I daemons -control group, but they can not move the process out of the group. Only the -.I operator -or root can do that. - -.SS Example 7 -.LP -The configuration file: - -.LP -.RS -.nf -mount { -.RS -cpu = /mnt/cgroups/cpu; -cpuacct = /mnt/cgroups/cpuacct; -.RE -} - -group students { -.RS -cpuacct{ -} -cpu { -} -.RE -} - -template students/%u { -.RS -cpuacct{ -} -cpu { -} -.RE -} - -mkdir /mnt/cgroups/cpu/daemons -mkdir /mnt/cgroups/cpuacct/daemons -.fi -.RE - -The situation is the similar as in Example 4. The only difference is template, -which is used if some rule uses "/students/%u" as a destination. - -.SS Example 8 -.LP -The configuration file: - -.LP -.RS -.nf -mount { -.RS -"cpu,nodev,nosuid,noexec" = /mnt/cgroups/cpu; -.RE -} - -.fi -.RE - -This is the same as -mount -t cgroup cgroup -o nodev,nosuid,noexec,cpu /mnt/cgroups/cpu -It mounts the cpu controller with MS_NODEV, MS_NOSUID and MS_NOEXEC -options passed. - - -.SH RECOMMENDATIONS -.SS Keep hierarchies separated -Having multiple hierarchies is perfectly valid and can be useful -in various scenarios. To keeps things clean, do not -create one group in multiple hierarchies. Examples 4 and 5 show -how unreadable and confusing it can be, especially when reading -somebody elses configuration file. - -.SS Explicit is better than implicit -.B libcgroup -can implicitly create groups which are needed for the creation of -configured subgroups. This may be useful and save some typing in -simple scenarios. When it comes to multiple hierarchies, it's -better to explicitly specify all groups and all controllers -related to them. - -.SH FILES -.TP -.B /etc/cgconfig.conf -default libcgroup configuration file -.TP -.B /etc/cgconfig.d/ -default libcgroup configuration files directory - -.SH SEE ALSO -cgconfigparser (8) - -.SH BUGS -Parameter values must be single strings without spaces. -Parsing of quoted strings is not implemented. - -.SH - diff --git a/lib/libcgroup-3.1.0/doc/man/cgconfigparser.8 b/lib/libcgroup-3.1.0/doc/man/cgconfigparser.8 deleted file mode 100644 index 8fff95f450b..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgconfigparser.8 +++ /dev/null @@ -1,92 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Varekova . - -.TH CGCONFIGPARSER 8 2009-03-16 "Linux" "libcgroup Manual" -.SH NAME - -cgconfigparser \- setup control group file system - -.SH SYNOPSIS -\fBcgconfigparser\fR [\fB-h\fR] [\fB-l\fR \fI\fR] [\fB-L\fR \fI\fR] [...] - -.SH OPTIONS -.TP -.B -h, --help -Displays help. -.TP -.B -l, --load=FILE -Parses the control groups configuration file -Sets up the control group file system -defined by the configuration file and mounts -mount points defined by the configuration file. -The format of the file is described in -\fBcgconfig.conf\fR. This option can be used multiple times and can be mixed -with \fB-L\fR option. - -.TP -.B -L, --load-directory=DIR -Finds all files in given directory and parses them in alphabetical order -like they were specified by \fB-l\fR option. This option can be used -multiple times and can be mixed with \fB-l\fR option. - -.TP -.B -a : -defines the default owner of the -rest of the defined control group’s files. These users are -allowed to set subsystem parameters and create subgroups. -The default value is the same as has the parent cgroup. - -.TP -.B -d, --dperm=mode -sets the default permissions of a control groups directory. -The permissions needs to be specified as octal numbers e.g. -\fB-d 775\fR. - -.TP -.B -f, --fperm=mode -sets the default permissions of the control group files. -The permissions needs to be specified as octal numbers e.g. -\fB-f 775\fR. -The value is not used as given because the current owner's -permissions are used as an umask (so 777 will set group and -others permissions to the owners permissions). - -.TP -.B -s, --tperm=mode -sets the default permissions of the control group tasks files. -The permissions needs to be specified as octal numbers e.g. -\fB-f 775\fR. -The value is not used as given because the current owner's -permissions are used as an umask (so 777 will set group and -others permissions to the owners permissions). - -.TP -.B -t : -defines the default owner of tasks file of the defined control -group. I.e. this user and members -of this group have write access to the file. - -.LP - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH FILES -.TP -.B /etc/cgconfig.conf -default libcgroup configuration file -.TP -.B /etc/cgconfig.d/ -default libcgroup configuration files directory - -.SH EXAMPLES -.TP -.B cgconfigparser -l /etc/cgconfig.conf -setup control group file system based on \fB/etc/cgconfig.conf\fR configuration file - - -.SH SEE ALSO -cgconfig.conf (5) diff --git a/lib/libcgroup-3.1.0/doc/man/cgcreate.1 b/lib/libcgroup-3.1.0/doc/man/cgcreate.1 deleted file mode 100644 index 6d924849d14..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgcreate.1 +++ /dev/null @@ -1,113 +0,0 @@ -.\" Written by Ivana Hutarova Varekova - -.TH CGCREATE 1 2009-03-15 "Linux" "libcgroup Manual" -.SH NAME -cgcreate \- create new cgroup(s) - -.SH SYNOPSIS -\fBcgcreate\fR [\fB-h\fR] [\fB-b\fR] [\fB-c\fR] -[\fB-t\fR <\fItuid>:] [\fB-a\fR <\fIagid>:] -[\fB-f\fR mode] [\fB-d\fR mode] -[\fB-s\fR mode] \fB-g\fR <\fIcontrollers>: [\fB-g\fR ...] - -.SH DESCRIPTION -The command creates new cgroup(s) defined by the options -\fB-g\fR. - -.TP -.B -a : -defines the name of the user and the group which own the -rest of the defined control group’s files. These users are -allowed to set subsystem parameters and create subgroups. -The default value is the same as has the parent cgroup. - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B -c, --scope -creates a new systemd scope. The cgroup name provided after the -\fB-g\fR flag must be of the form -\fB.slice/.scope\fR. If the slice -does not exist, systemd will create it. Libcgroup will place an -idle process in the scope's cgroup.procs file unless the \fB-p\fR -flag is provided. - -.TP -.B -d, --dperm=mode -sets the permissions of a control groups directory. -The permissions needs to be specified as octal numbers e.g. -\fB-d 775\fR. - -.TP -.B -f, --fperm=mode -sets the permissions of the control groups parameters. -The permissions needs to be specified as octal numbers e.g. -\fB-f 775\fR. -The value is not used as given because the current owner's -permissions are used as an umask (so 777 will set group and -others permissions to the owners permissions). - -.TP -.B -g : -defines control groups to be added. -\fBcontrollers\fR is a list of controllers. Character "*" can be used -as a shortcut for "all mounted controllers". -\fBpath\fR is the relative path to control groups -in the given controllers list. This option can be specified -multiple times. - -.TP -.B -h, --help -display this help and exit - -.TP -.B -p, --pid=pid -moves the provided \fBpid\fR into the -\fB.slice/.scope\fR. Must be used in -conjunction with \fB-c\fR. - -.TP -.B -s, --tperm=mode -sets the permissions of the control group tasks file. -The permissions needs to be specified as octal numbers e.g. -\fB-s 775\fR. -The value is not used as given because the current owner's -permissions are used as an umask (so 777 will set group and -others permissions to the owners permissions). - -.TP -.B -S, --setdefault -sets the scope specified via the \fB-c\fR option as the default -libcgroup scope. This default scope is used by libcgroup tools -to build up the cgroup path. See the \fB-b\fR option. - -.TP -.B -t : -defines the name of the user and the group, which owns tasks -file of the defined control group. I.e. this user and members -of this group have write access to the file. -The default value is the same as has the parent cgroup. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH EXAMPLES -.TP -.B cgcreate -g *:student devices:teacher -create control group student in all mounted hierarchies and create -control group teacher in hierarchy containing controller devices. - - - - -.SH SEE ALSO -cgrules.conf (5) -cgexec (1) -cgclassify (1) diff --git a/lib/libcgroup-3.1.0/doc/man/cgdelete.1 b/lib/libcgroup-3.1.0/doc/man/cgdelete.1 deleted file mode 100644 index ffd0126daef..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgdelete.1 +++ /dev/null @@ -1,51 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Jan Safranek - -.TH CGDELETE 1 2009-10-26 "Linux" "libcgroup Manual" -.SH NAME - -cgdelete \- remove control group(s) - -.SH SYNOPSIS -\fBcgdelete\fR [\fB-h\fR] [\fB-r\fR] [\fB-b\fR] [[\fB-g\fR] -<\fIcontrollers\fR>:\fI] ... - -.SH DESCRIPTION -The \fBcgdelete\fR -program removes all specified control groups. - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B [-g] : -Defines the control group to delete. Multiple control groups may be -specified. -.B -g -is optional. - -.TP -.B -h, --help -Display this help and exit. - -.TP -.B -r, --recursive -Recursively remove all subgroups. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH EXAMPLES -.TP -.B cgdelete -g cpu,devices:/test -remove control group test from hierarchies containing cpu and device controllers - - -.SH SEE ALSO -cgcreate (1), lscgroup (1) diff --git a/lib/libcgroup-3.1.0/doc/man/cgexec.1 b/lib/libcgroup-3.1.0/doc/man/cgexec.1 deleted file mode 100644 index 1024a79a0ec..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgexec.1 +++ /dev/null @@ -1,106 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Varekova - -.TH CGEXEC 1 2009-03-15 "Linux" "libcgroup Manual" -.SH NAME - -cgexec \- run the task in given control groups - -.SH SYNOPSIS -\fBcgexec\fR [\fB-h\fR] [\fB-b\fR] [\fB-g\fR <\fIcontrollers>:] [--sticky] \fBcommand\fR [\fIarguments\fR] - -.SH DESCRIPTION -The \fBcgexec\fR -program executes the task \fBcommand\fR -with arguments \fBarguments\fR in the given control groups. - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B -g : -defines the control groups in which the task will be run. -\fBcontrollers\fR is a list of controllers and -\fBpath\fR is the relative path to control groups -in the given controllers list. - -This flag can be used multiple times to -define multiple pairs of lists of controllers -and relative paths. -Instead of the list of all mounted controllers, -the wildcard \fBb"*b"\fR can be used. - -If this option is not used, -\fBcgexec\fR will automatically place the task in the right -cgroup based on \fB/etc/cgrules.conf\fR. - -If \fB/etc/cgrules.conf\fR configuration file is used, there can be used -template names. Then the control group name contains -a template in destination tag (see \fBcgrules.conf\fR (5)) -and if the cgroup does not exist in execution time, -it is created, based on \fB/etc/cgconfig.conf\fR specification. -If the specifications are not present the group is created with the default -kernel values. - -.TP -.B -h, --help -Display this help and exit. - -.TP -.B -r -Replaces systemd scope's idle process with the task \fBcommand\fR. - -.TP -.B --sticky -If running the task \fBcommand\fR with this option, the daemon of -service cgred (cgrulesengd process) does not change both the task -of the \fBcommand\fR and the child tasks. Without this option, -the daemon does not change the task of the \fBcommand\fR but it -changes the child tasks to the right cgroup based on -\fB/etc/cgrules.conf\fR automatically. - -.LP - -.SH EXAMPLES - -.nf -.ft B -cgexec -g *:test1 ls -.ft R -.fi -runs command \fBls\fR in control group test1 -in all mounted controllers. - -.nf -.ft B -cgexec -g cpu,memory:test1 ls -l -.ft R -.fi -runs command \fBls -l\fR in control group test1 -in controllers cpu and memory. - -.nf -.ft B -cgexec -g cpu,memory:test1 -g swap:test2 ls -l -.ft R -.fi -runs command \fBls -l\fR in control group test1 -in controllers cpu and memory and control group -test2 in controller swap. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH FILES -.TP -.B /etc/cgrules.conf -default libcgroup configuration file - -.SH SEE ALSO -cgrules.conf (5) diff --git a/lib/libcgroup-3.1.0/doc/man/cgget.1 b/lib/libcgroup-3.1.0/doc/man/cgget.1 deleted file mode 100644 index bba60682f9e..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgget.1 +++ /dev/null @@ -1,115 +0,0 @@ -.\" Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. -.\" Written by Jan Safranek - -.TH CGGET 1 2010-01-18 "Linux" "libcgroup Manual" -.SH NAME - -cgget \- print parameter(s) of given group(s) - -.SH SYNOPSIS -\fBcgget\fR [\fB-n\fR] [\fB-v\fR] [\fB-m\fR] [\fB-b\fR] [\fB-r\fR <\fIname\fR>] -[\fB-g\fR <\fIcontroller\fR>] [\fB-a\fR] <\fBpath\fR> ... -.br -\fBcgget\fR [\fB-n\fR] [\fB-v\fR] [\fB-m\fR] [\fB-b\fR] [\fB-r\fR <\fIname\fR>] -\fB-g\fR <\fIcontroller\fR>:<\fBpath\fR> ... - -.SH DESCRIPTION -Prints the parameter(s) of input cgroup(s). -If neither controller nor variable are specified, -the values of all possible variables are displayed. - -.TP -.B -is the name of the cgroup which should be read. -This parameter can be used multiple times. - -.TP -.B -a, --all -print the variables for all controllers which consist in the given cgroup - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B -c -displays the controllers and their versions. -This option can be used along with -m option. - -.TP -.B -g -defines controllers whose values should be displayed. -This option can be used multiple times. - -.TP -.B -g : -defines control groups whose values should be displayed. -This option can be used multiple times. - -.TP -.B -h, --help -display help and exit - -.TP -.B -m -displays the current control groups setup mode. The control groups can be set up in one of three modes, -legacy (cgroup v1 only), unified (cgroup v2 only) or hybrid (cgroup v1/v2). - -.TP -.B -n -do not print headers, i.e. names of groups. - -.TP -.B -r, --variable -defines parameter to display. -This option can be used multiple times. - - -.TP -.B -v, --values-only -print only values, not parameter names. - -.SH EXAMPLES -.nf -$ cgget -r cpuset.cpus -r cpuset.mems first second -first: -cpuset.cpus=0-1 -cpuset.mems=0 - -second: -cpuset.cpus=0 -cpuset.mems=0 - -$ cgget -n -r cpuset.cpus -r cpuset.mems first second -cpuset.cpus=0-1 -cpuset.mems=0 -cpuset.cpus=0 -cpuset.mems=0 - -$ cgget -nv -r cpuset.cpus -r cpuset.mems first second -0-1 -0 -0 -0 - -$ cgget -n -g cpu / -cpu.rt_period_us=1000000 -cpu.rt_runtime_us=950000 -cpu.shares=1024 - -$ cgget -m -Unified Mode (Cgroup v2 only). - -.fi - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH SEE ALSO -cgrules.conf (1), cgcreate (1), cgget (1) - diff --git a/lib/libcgroup-3.1.0/doc/man/cgred.conf.5 b/lib/libcgroup-3.1.0/doc/man/cgred.conf.5 deleted file mode 100644 index 63b031d3f16..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgred.conf.5 +++ /dev/null @@ -1,49 +0,0 @@ -.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Varekova . - -.TH CGRED.CONF 5 2009-03-16 "Linux" "libcgroup Manual" -.SH NAME -cgred.conf \- libcgroup configuration file -.SH DESCRIPTION -\fBcgred.conf\fR is cgred service configuration file. -In this file there could be defined several internal values. -Defining anything else in this file will cause the -CGroup Rules Daemon program to fail. -.TP - -\fBCONFIG_FILE\fR -specifies the configuration file for cgred service - -.TP -\fBLOG_FILE\fR -variable specifies the file to which logs will be written -(by default they are not sent to a file but to syslog) - -.TP -\fBNODAEMON\fR -if it is equal to "--nodaemon" then -run cgred in non-daemon mode - -.TP -\fBLOG\fR -define the verbosity of logging. Accepted values are '-v', '-vv', '-q' -and '--nolog'. -.LP - - -.SH FILES -.LP -.PD .1v -.TP 20 -.B /etc/cgred.conf -.TP -default libcgroup configuration file -.PD . - -.SH SEE ALSO -cgrules.conf (5), -cgconfig.conf (5), cgrules.d (5) - - - - diff --git a/lib/libcgroup-3.1.0/doc/man/cgrules.conf.5 b/lib/libcgroup-3.1.0/doc/man/cgrules.conf.5 deleted file mode 100644 index 1971b5cb8da..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgrules.conf.5 +++ /dev/null @@ -1,165 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Varekova - -.TH CGRULES.CONF 5 2009-03-10 "Linux" "libcgroup Manual" -.SH NAME -cgrules.conf \- libcgroup configuration file -.SH DESCRIPTION -.B "cgrules.conf" -configuration file is used by -.B libcgroups -to define control groups to which a process belongs. - - -The file contains a list of rules which assign to a defined group/user a control -group in a subsystem (or control groups in subsystems). - -Rules have two formats: - -.in +4n -.nf - -.fi -.nf -: -.fi -.in - -Where: - -.I user -can be: -.nf - - a user name - - a group name with @group syntax - - the wildcard '*', for any user or group - - '%', which is equivalent to "ditto" (useful for - multi-line rules where different cgroups need to be - specified for various hierarchies for a single user) -.fi - -.I process name -is optional and it can be: -.nf - - a process name - - a full command path of a process -.fi - -.I controllers -can be: -.nf - - comma separated controller names (no spaces) or - - * (for all mounted controllers) -.fi - -.I destination -can be: -.nf - - path relative to the controller hierarchy (ex. pgrp1/gid1/uid1) - - following strings called "\fBtemplates\fR" and will get expanded - - %u username, uid if name resolving fails - %U uid - %g group name, gid if name resolving fails - %G gid - %p process name, pid if name not available - %P pid - - '\\' can be used to escape '%' -.fi -First rule which matches the criteria will be executed. - -Any text starting with '#' is considered as a start of comment line and is -ignored. - -If the -.I destination -contains -.B template -string, the control group can be created on-fly. In time when some process wants -to use the template rule which leads to control group (see -\fBcgexec\fR (1)) and the control group does not exist, the group is created. The -template control group parameters can be specified in -.B cgconfig.conf -configuration file. See (\fBcgconfig.conf\fR (5)). -If the template definition is not found there created group have default -kernel setting. - -To create a hierarchy of configuration files, use \fB/etc/cgrules.d\fR directory. - -.SH EXAMPLES -.nf -student devices /usergroup/students -.fi -Student's processes in the 'devices' subsystem belong to the control -group /usergroup/students. - -.nf -student:cp devices /usergroup/students/cp -.fi -When student executes 'cp' command, the processes in the 'devices' subsystem -belong to the control group /usergroup/students/cp. - -.nf -@admin * admingroup/ -.fi -Processes started by anybody from admin group no matter in what subsystem belong -to the control group admingroup/. - -.nf -peter cpu test1/ -% memory test2/ -.fi -The first line says Peter's task for cpu controller belongs to test1 control -group. The second one says Peter's tasks for memory controller belong to test2/ -control group. - -.nf -* * default/ -.fi -All processes in any subsystem belong to the control group default/. Since -the earliest matched rule is applied, it makes sense to have this line -at the end of the list. It will put a task which was not mentioned in the -previous rules to default/ control group. - -.nf -@students cpu,cpuacct students/%u -.fi -Processes in cpu and cpuacct subsystems started by anybody from students group -belong to group students/name. Where "name" is user name of owner of the -process. - - - -.SH FILES -.LP -.PD .1v -.TP 20 -.B /etc/cgrules.conf -.RS 6 -default libcgroup configuration file -.RE -.TP 20 -.B /etc/cgrules.d -.RS 6 -default libcgroup configuration files directory -.RE -.PD - - -.SH SEE ALSO -cgconfig.conf (5), cgclassify (1), cgred.conf (5), cgrules.d (5) - -.SH BUGS - - - - - - - - - - - - diff --git a/lib/libcgroup-3.1.0/doc/man/cgrulesengd.8 b/lib/libcgroup-3.1.0/doc/man/cgrulesengd.8 deleted file mode 100644 index cf45611853d..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgrulesengd.8 +++ /dev/null @@ -1,84 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Jan Safranek . -.TH CGRULESENGD 8 2009-02-18 "Linux" "libcgroup Manual" -.SH NAME -cgrulesengd \- control group rules daemon - -.SH SYNOPSIS -\fBcgrulesengd\fR [options] - -.SH DESCRIPTION -\fBcgrulesengd\fR is a daemon, which distributes processes to control groups. When -any process changes its effective UID or GID, \fBcgrulesengd\fR inspects the list -of rules loaded from the \fIcgrules.conf\fR file and files in \fIcgrules.d\fR -(see \fBcgrules.d\fR (5) for potential conflicts) directory -and moves the process to the appropriate control group. - -The list of rules is read during the daemon startup and cached in the daemon's memory. -The daemon reloads the list of rules when it receives SIGUSR2 signal. -The daemon reloads the list of templates when it receives SIGUSR1 signal. - -The daemon opens a standard unix socket to receive 'sticky' requests from \fBcgexec\fR. - -.SH OPTIONS -.TP -.B -h|--help -Display help. -.TP -.B -f |--logfile= -Write log messages to the given log file. When '-' is used as , log messages -are written to the standard output. If '\fB-f\fR' and '\fB-s\fR' are used together, -the logs are sent to both destinations. - -.TP -.B -s[facility]|--syslog=[facility] -Write log messages to syslog. The default facility is DAEMON. If '\fB-f\fR' -and '\fB-s\fR' are used together, the logs are sent to both destinations. -.TP -.B -n|--nodaemon -Don't fork the daemon, stay in the foreground. -.TP -.B -v|--verbose -Display more log messages. This option can be used three times to enable more -verbose log messages. -.TP -.B -q|--quiet -Display less log messages. -.TP -.B -Q|--nolog -Disable logging. -.TP -.B -d|--debug -Equivalent to '-nvvvf -', i.e. don't fork the daemon, display all log messages and -write them to the standard output. -.TP -.B -u |--socket-user= -.B -g |--socket-group= -Set the owner of cgrulesengd socket. Assumes that \fBcgexec\fR runs with proper -suid permissions so it can write to the socket when \fBcgexec\fR --sticky is used. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH FILES -.TP -.B /etc/cgrules.conf -default libcgroup configuration file - -.TP -.B /etc/cgrules.d -default libcgroup configuration files directory - -.TP -.B /etc/cgconfig.conf -default templates file - -.TP -.B /etc/cgconfig.d -default templates directory - -.SH SEE ALSO -cgrules.conf (5), cgrules.d (5) diff --git a/lib/libcgroup-3.1.0/doc/man/cgset.1 b/lib/libcgroup-3.1.0/doc/man/cgset.1 deleted file mode 100644 index 91561773487..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgset.1 +++ /dev/null @@ -1,57 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Hutarova Varekova - -.TH CGSET 1 2009-03-15 "Linux" "libcgroup Manual" -.SH NAME - -cgset \- set the parameters of given cgroup(s) - -.SH SYNOPSIS -\fBcgset\fR [\fB-b\fR] [\fB-r\fR <\fIname=value\fR>] <\fBcgroup_path\fR> ... -.br -\fBcgset\fR [\fB-b\fR] \fB--copy-from\fR <\fIsource_cgroup_path\fR> <\fBcgroup_path\fR> ... - -.SH DESCRIPTION -Set the parameters of input cgroups. - -.TP -.B -is the name of the cgroup which should be changed. -This parameter can be used multiple times. - -.TP -.B -b -ignores the default systemd delegated hierarchy path and -constructs the path of the control groups relative to the -cgroup root hierarchy. - -.TP -.B -r -defines the name of the file to set and -the value which should be written to that file. -This parameter can be used multiple times. - -.TP -.B --copy-from -defines the name of the cgroup whose parameters will be -copied to the input cgroup. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH EXAMPLES -.TP -.B cgset -r cpuset.cpus=0-1 student -set variable cpus in control group student (controller cpuset) to 0-1 - -.TP -.B cgset --copy-from group1/ group2/ -copy all parameters of group group1 to group group2 -(for all path where both cgroups are defined) - - -.SH SEE ALSO -cgrules.conf (1), cgcreate (1), cgget (1) diff --git a/lib/libcgroup-3.1.0/doc/man/cgsnapshot.1 b/lib/libcgroup-3.1.0/doc/man/cgsnapshot.1 deleted file mode 100644 index 22de6161574..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgsnapshot.1 +++ /dev/null @@ -1,113 +0,0 @@ -.\" Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Hutarova Varekova - -.TH CGSNAPSHOT 1 2010-07-28 "Linux" "libcgroup Manual" -.SH NAME - -cgsnapshot \- generate the configuration file for given controllers - -.SH SYNOPSIS -\fBcgsnapshot\fR [\fB-h\fR] [\fB-s\fR] [\fB-t\fR] [\fB-b\fR \fIfile\fR] -[\fB-w\fR \fIfile\fR] [\fB-f\fR \fIoutput_file\fR] [\fBcontroller\fR] [...] - -.SH DESCRIPTION -\fBcgsnapshot\fR -generates the cgconfig compatible configuration file -for the given controllers. -If no controller is set, then -cgsnapshot shows all mounted hierarchies. -The output is in the same format as the -.B cgconfig.conf -configuration file. - -.TP -.B -b file -Display only variables from the denylist. -The default location of the denylist is -.B /etc/cgsnapshot_denylist.conf. -This list contains all variables which should be ignored by the -.B cgsnapshot -. -If the variable is denylisted, it will not be displayed. -If it is not present on the denylist, the allowlist -is checked. - -.TP -.B -h, --help -display this help and exit - -.TP -.B -f, --file -Redirect the output to output_file - - -.TP -.B -s, --silent -Ignore all warnings - -.TP -.B -t, --strict -Do not display the variables which are not on the allowlist - - -.TP -.B -w file -Set the denylist configuration file. -This list contains all variables which should be displayed by -.B cgsnapshot -. -If the variable is not denylisted, the allowlist is checked. -If the variable is on the allowlist, it is displayed by -.B cgsnapshot -. -If the variable is not on the allowlist, -the variable is displayed and a warning message is produced. -By default the allowlist is not used. - -The warning message can be omitted using the -.B -s, --silent -flag. -If the -.B -t, --strict -flag is used, the variable which is not on the allowlist is -not displayed. - -.TP -.B controller -defines the controller whose hierarchies will be -output - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH FILES -.TP -.B /etc/cgsnapshot_denylist.conf -default denylist - -.TP -.B /etc/cgsnapshot_allowlist.conf -default allowlist - -.TP -.B /etc/cgconfig.conf -default libcgroup configuration file - -.SH EXAMPLES -.TP -.B cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot -create configuration file which contains all mounted controllers and all -control groups which are on the actual system - -.TP -.B cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot cpu -create configuration file which contains hierarchy containing cpu controller and all its -control groups on the actual system - - - -.SH SEE ALSO -cgconfig.conf (5) diff --git a/lib/libcgroup-3.1.0/doc/man/cgxget.1 b/lib/libcgroup-3.1.0/doc/man/cgxget.1 deleted file mode 100644 index b06adaef34e..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgxget.1 +++ /dev/null @@ -1,127 +0,0 @@ -.TH CGXGET 1 2022-08-03 "Linux" "libcgroup Manual" -.SH NAME - -cgxget \- print parameter(s) of given group(s) - -.SH SYNOPSIS -\fBcgxget\fR [\fB-1\fR] [\fB-2\fR] [\fB-i\fR] [\fB-n\fR] [\fB-v\fR] [\fB-b\fR] [\fB-r\fR <\fIname\fR>] -[\fB-g\fR <\fIcontroller\fR>] [\fB-a\fR] <\fBpath\fR> ... -.br -\fBcgxget\fR [\fB-1\fR] [\fB-2\fR] [\fB-i\fR] [\fB-n\fR] [\fB-v\fR] [\fB-b\fR] [\fB-r\fR <\fIname\fR>] -\fB-g\fR <\fIcontroller\fR>:<\fBpath\fR> ... - -.SH DESCRIPTION -Prints the parameter(s) of input cgroup(s). -If neither controller nor variable are specified, -the values of all possible variables are displayed. -When the request's cgroup version differs from the system's cgroup version, \fBcgxget\fR will -attempt to translate from one version to the other. -If the request version and the system's version are the same, no translation is done and -\fBcgxget\fR will behave like \fBcgget\fR. -If no version is specified by the user (either [\fB-1\fR] or [\fB-2\fR]), the behavior is -undefined. - -.TP -.B -is the name of the cgroup which should be read. -This parameter can be used multiple times. - -.TP -.B -1, --v1 -data in/out of \fBcgxget\fR is in cgroup v1 format. -In this mode, the user will provide values in cgroup v1 format and receive values in v1 format. -format. -If the system is running in cgroup v2 mode, libcgroup will convert the data as necessary - -.TP -.B -2, --v2 -data in/out of \fBcgxget\fR is in cgroup v2 format. -In this mode, the user will provide values in cgroup v2 format and receive values in v2 format. -If the system is running in cgroup v1 mode, libcgroup will convert the data as necessary - -.TP -.B -a, --all -print the variables for all controllers which consist in the given cgroup - -.TP -.B -b -ignores the default systemd delegated hierarchy path and constructs the path of the control groups -relative to the cgroup root hierarchy. - -.TP -.B -g -defines controllers whose values should be displayed. -This option can be used multiple times. - -.TP -.B -g : -defines control groups whose values should be displayed. -This option can be used multiple times. - -.TP -.B -h, --help -display help and exit - -.TP -.B -i, --ignore-unmappable -ignore errors for values that cannot be converted from v1 to v2 or vice versa - -.TP -.B -n -do not print headers, i.e. names of groups. - -.TP -.B -r, --variable -defines parameter to display. -This option can be used multiple times. - - -.TP -.B -v, --values-only -print only values, not parameter names. - -.SH EXAMPLES -.nf -$ cgxget -1 -r cpuset.cpus -r cpuset.mems first second -first: -cpuset.cpus=0-1 -cpuset.mems=0 - -second: -cpuset.cpus=0 -cpuset.mems=0 - -$ cgxget -1 -n -r cpuset.cpus -r cpuset.mems first second -cpuset.cpus=0-1 -cpuset.mems=0 -cpuset.cpus=0 -cpuset.mems=0 - -$ cgxget -1 -nv -r cpuset.cpus -r cpuset.mems first second -0-1 -0 -0 -0 - -$ cgxget -1 -n -g cpu / -cpu.rt_period_us=1000000 -cpu.rt_runtime_us=950000 -cpu.shares=1024 - -$ cgxget -2 -r cpu.max first -first: -cpu.max: max 100000 - -.fi - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH AUTHOR -Tom Hromatka - -.SH SEE ALSO -cgrules.conf (1), cgcreate (1), cgget (1), cgset (1), cgxset (1) diff --git a/lib/libcgroup-3.1.0/doc/man/cgxset.1 b/lib/libcgroup-3.1.0/doc/man/cgxset.1 deleted file mode 100644 index cb384513f02..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/cgxset.1 +++ /dev/null @@ -1,81 +0,0 @@ -.TH CGXSET 1 2022-08-03 "Linux" "libcgroup Manual" -.SH NAME - -cgxset \- set the parameters of given cgroup(s) - -.SH SYNOPSIS -\fBcgxset\fR [\fB-1\fR] [\fB-2\fR] [\fB-i\fR] [\fB-b\fR] [\fB-r\fR <\fIname=value\fR>] <\fBcgroup_path\fR> ... -.br -\fBcgxset\fR [\fB-b\fR] \fB--copy-from\fR <\fIsource_cgroup_path\fR> <\fBcgroup_path\fR> ... - -.SH DESCRIPTION -Set the parameters of input cgroups. -When the request's cgroup version differs from the system's cgroup version, \fBcgxset\fR will -attempt to translate from one version to the other. -If the request version and the system's version are the same, no translation is done and -\fBcgxset\fR will behave like \fBcgset\fR. -If no version is specified by the user (either [\fB-1\fR] or [\fB-2\fR]) and the [\fB-r\fR] flag -is specified, the behavior is undefined. -\fB--copy-from\fR does not require the cgroup version to be specified. - -.TP -.B -is the name of the cgroup which should be changed. -This parameter can be used multiple times. - -.TP -.B -1, --v1 -data in/out of \fBcgxset\fR is in cgroup v1 format. -In this mode, the user will provide values in cgroup v1 format and receive values in v1 format. -format. -If the system is running in cgroup v2 mode, libcgroup will convert the data as necessary - -.TP -.B -2, --v2 -data in/out of \fBcgxset\fR is in cgroup v2 format. -In this mode, the user will provide values in cgroup v2 format and receive values in v2 format. -If the system is running in cgroup v1 mode, libcgroup will convert the data as necessary - -.TP -.B -b -ignores the default systemd delegated hierarchy path and constructs the path of the control groups -relative to the cgroup root hierarchy. - -.TP -.B -i, --ignore-unmappable -ignore errors for values that cannot be converted from v1 to v2 or vice versa - -.TP -.B -r -defines the name of the file to set and -the value which should be written to that file. -This parameter can be used multiple times. - -.TP -.B --copy-from -defines the name of the cgroup whose parameters will be -copied to the input cgroup. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH EXAMPLES -.TP -.B cgxset -1 -r cpuset.cpus=0-1 student -set variable cpus in control group student (controller cpuset) to 0-1 - -.TP -.B cgxset -2 -r cpu.weight=42 first -set variable weight in control group first (controller cpu) to 42 - -.TP -.B cgxset --copy-from group1/ group2/ -copy all parameters of group group1 to group group2 -(for all path where both cgroups are defined) - - -.SH SEE ALSO -cgrules.conf (1), cgcreate (1), cgget (1), cgset (1), cgxget (1) diff --git a/lib/libcgroup-3.1.0/doc/man/lscgroup.1 b/lib/libcgroup-3.1.0/doc/man/lscgroup.1 deleted file mode 100644 index af4ab6b32b8..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/lscgroup.1 +++ /dev/null @@ -1,49 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Hutarova Varekova - -.TH LSCGROUP 1 2009-11-05 "Linux" "libcgroup Manual" -.SH NAME - -lscgroup \- list all cgroups - -.SH SYNOPSIS -\fBlscgroup\fR [[\fB-g\fR] <\fIcontrollers>:] [...] -.br -\fBlscgroup\fR [\fB-h|--help\fR] - -.SH DESCRIPTION -List all/chosen cgroups. - -.TP -.B : -defines the control groups whose subgroups will be shown. -If this parameter is not used, the command will -list all existing cgroups. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.SH EXAMPLES -.TP -.B lscgroup -g cpu:/ -list all cgroups which are in hierarchy containing cpu controller - -.TP -.B lscgroup -g cpu:/student -list all cgroups which are in hierarchy containing cpu controller -in subgroup student - -.TP -.B lscgroup -list all cgroups which in all hierarchies - -.SH NOTES -.TP -lscgroup is currently supported on cgroups v1 only. - -.SH SEE ALSO -lssubsys (1), cgcreate (1), cgdelete (1), -cgconfig.conf (5) diff --git a/lib/libcgroup-3.1.0/doc/man/lssubsys.1 b/lib/libcgroup-3.1.0/doc/man/lssubsys.1 deleted file mode 100644 index 1c49445e068..00000000000 --- a/lib/libcgroup-3.1.0/doc/man/lssubsys.1 +++ /dev/null @@ -1,101 +0,0 @@ -.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -.\" Written by Ivana Hutarova Varekova - -.TH LSSUBSYS 1 2009-11-05 "Linux" "libcgroup Manual" -.SH NAME - -lssubsys \- list hierarchies containing given subsystem - -.SH SYNOPSIS -\fBlssubsys\fR [\fB-m|--mount-points\fR] [\fB-M|--all-mount-points\fR] -[\fIcontroller\fR] [...] -.br -\fBlssubsys\fR [\fB-m|--mount-points\fR] [\fB-M|--all-mount-points\fR] -[\fB-i|--hierarchies\fR] [\fB-a|--all\fR] -.br -\fBlssubsys\fR [\fB-h|--help\fR] - -.SH DESCRIPTION -\fBlssubsys\fR list the hierarchies containing -the given subsystem(s). If no subsystem is defined, it -displays all mounted hierarchies. - -.TP -.B controller -defines the subsystem whose hierarchy is shown. -If this parameter is not used, the command will -list all mounted subsystems. - -.TP -.B -m, --mount-points -Display mount points. Only the first mount points of shown hierarchies are displayed. - -.TP -.B -M, --all-mount-points -Display mount points. All mount points of shown hierarchies are displayed, each on -separate line. - -.TP -.B -a, --all -Display all subsystems (including unmounted ones). - -.TP -.B -i, --hierarchies -Display the attached hierarchy number if the subsystem is in a hierarchy. -If the option -.B -m -is also used, the hierarchy number is shown only for unmounted hierarchies. - -.TP -.B -h, --help -Display help and exit. - -.SH EXAMPLE -The command -.B lssubsys -am -lists all subsystems which are present in the system, -mounted ones will be shown with their mount point: -.RS -.nf -$ lssubsys -am -ns -cpuset -cpu,devices -cpuacct /cgroup/cpuacct -memory /cgroup/memory -freezer /cgroup/freezer -net_cls /cgroup/net_cls -.fi -.RE -.LP -The command -.B lssubsys -ami -lists all subsystems which are present in the system, -mounted subsystems are listed with their mount points, -unmounted ones which are in a hierarchy are listed with their hierarchy number: -.RS -.nf -$ lssubsys -ami -ns -cpuset 5 -cpu,devices 6 -cpuacct /cgroup/cpuacct -memory /cgroup/memory -freezer /cgroup/freezer -net_cls /cgroup/net_cls -.fi - -.SH NOTES -.TP -lssubsys is currently supported on cgroups v1 only. - -.SH ENVIRONMENT VARIABLES -.TP -.B CGROUP_LOGLEVEL -controls verbosity of the tool. Allowed values are \fBDEBUG\fR, -\fBINFO\fR, \fBWARNING\fR or \fBERROR\fR. - -.RE -.SH SEE ALSO -lscgroup (1), cgcreate (1), cgdelete (1), -cgconfig.conf (5) diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-death-test.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-death-test.h deleted file mode 100644 index 957a69c6a9e..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-death-test.h +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for death tests. It is -// #included by gtest.h so a user doesn't need to include this -// directly. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ - -#include "gtest/internal/gtest-death-test-internal.h" - -namespace testing { - -// This flag controls the style of death tests. Valid values are "threadsafe", -// meaning that the death test child process will re-execute the test binary -// from the start, running only a single death test, or "fast", -// meaning that the child process will execute the test logic immediately -// after forking. -GTEST_DECLARE_string_(death_test_style); - -#if GTEST_HAS_DEATH_TEST - -namespace internal { - -// Returns a Boolean value indicating whether the caller is currently -// executing in the context of the death test child process. Tools such as -// Valgrind heap checkers may need this to modify their behavior in death -// tests. IMPORTANT: This is an internal utility. Using it may break the -// implementation of death tests. User code MUST NOT use it. -GTEST_API_ bool InDeathTestChild(); - -} // namespace internal - -// The following macros are useful for writing death tests. - -// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is -// executed: -// -// 1. It generates a warning if there is more than one active -// thread. This is because it's safe to fork() or clone() only -// when there is a single thread. -// -// 2. The parent process clone()s a sub-process and runs the death -// test in it; the sub-process exits with code 0 at the end of the -// death test, if it hasn't exited already. -// -// 3. The parent process waits for the sub-process to terminate. -// -// 4. The parent process checks the exit code and error message of -// the sub-process. -// -// Examples: -// -// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); -// for (int i = 0; i < 5; i++) { -// EXPECT_DEATH(server.ProcessRequest(i), -// "Invalid request .* in ProcessRequest()") -// << "Failed to die on request " << i; -// } -// -// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); -// -// bool KilledBySIGHUP(int exit_code) { -// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; -// } -// -// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); -// -// On the regular expressions used in death tests: -// -// On POSIX-compliant systems (*nix), we use the library, -// which uses the POSIX extended regex syntax. -// -// On other platforms (e.g. Windows), we only support a simple regex -// syntax implemented as part of Google Test. This limited -// implementation should be enough most of the time when writing -// death tests; though it lacks many features you can find in PCRE -// or POSIX extended regex syntax. For example, we don't support -// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and -// repetition count ("x{5,7}"), among others. -// -// Below is the syntax that we do support. We chose it to be a -// subset of both PCRE and POSIX extended regex, so it's easy to -// learn wherever you come from. In the following: 'A' denotes a -// literal character, period (.), or a single \\ escape sequence; -// 'x' and 'y' denote regular expressions; 'm' and 'n' are for -// natural numbers. -// -// c matches any literal character c -// \\d matches any decimal digit -// \\D matches any character that's not a decimal digit -// \\f matches \f -// \\n matches \n -// \\r matches \r -// \\s matches any ASCII whitespace, including \n -// \\S matches any character that's not a whitespace -// \\t matches \t -// \\v matches \v -// \\w matches any letter, _, or decimal digit -// \\W matches any character that \\w doesn't match -// \\c matches any literal character c, which must be a punctuation -// . matches any single character except \n -// A? matches 0 or 1 occurrences of A -// A* matches 0 or many occurrences of A -// A+ matches 1 or many occurrences of A -// ^ matches the beginning of a string (not that of each line) -// $ matches the end of a string (not that of each line) -// xy matches x followed by y -// -// If you accidentally use PCRE or POSIX extended regex features -// not implemented by us, you will get a run-time failure. In that -// case, please try to rewrite your regular expression within the -// above syntax. -// -// This implementation is *not* meant to be as highly tuned or robust -// as a compiled regex library, but should perform well enough for a -// death test, which already incurs significant overhead by launching -// a child process. -// -// Known caveats: -// -// A "threadsafe" style death test obtains the path to the test -// program from argv[0] and re-executes it in the sub-process. For -// simplicity, the current implementation doesn't search the PATH -// when launching the sub-process. This means that the user must -// invoke the test program via a path that contains at least one -// path separator (e.g. path/to/foo_test and -// /absolute/path/to/bar_test are fine, but foo_test is not). This -// is rarely a problem as people usually don't put the test binary -// directory in PATH. -// -// TODO(wan@google.com): make thread-safe death tests search the PATH. - -// Asserts that a given statement causes the program to exit, with an -// integer exit status that satisfies predicate, and emitting error output -// that matches regex. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) - -// Like ASSERT_EXIT, but continues on to successive tests in the -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) - -// Asserts that a given statement causes the program to exit, either by -// explicitly exiting with a nonzero exit code or being killed by a -// signal, and emitting error output that matches regex. -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Like ASSERT_DEATH, but continues on to successive tests in the -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: - -// Tests that an exit code describes a normal exit with a given exit code. -class GTEST_API_ ExitedWithCode { - public: - explicit ExitedWithCode(int exit_code); - bool operator()(int exit_status) const; - private: - // No implementation - assignment is unsupported. - void operator=(const ExitedWithCode& other); - - const int exit_code_; -}; - -# if !GTEST_OS_WINDOWS -// Tests that an exit code describes an exit due to termination by a -// given signal. -class GTEST_API_ KilledBySignal { - public: - explicit KilledBySignal(int signum); - bool operator()(int exit_status) const; - private: - const int signum_; -}; -# endif // !GTEST_OS_WINDOWS - -// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. -// The death testing framework causes this to have interesting semantics, -// since the sideeffects of the call are only visible in opt mode, and not -// in debug mode. -// -// In practice, this can be used to test functions that utilize the -// LOG(DFATAL) macro using the following style: -// -// int DieInDebugOr12(int* sideeffect) { -// if (sideeffect) { -// *sideeffect = 12; -// } -// LOG(DFATAL) << "death"; -// return 12; -// } -// -// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { -// int sideeffect = 0; -// // Only asserts in dbg. -// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); -// -// #ifdef NDEBUG -// // opt-mode has sideeffect visible. -// EXPECT_EQ(12, sideeffect); -// #else -// // dbg-mode no visible sideeffect. -// EXPECT_EQ(0, sideeffect); -// #endif -// } -// -// This will assert that DieInDebugReturn12InOpt() crashes in debug -// mode, usually due to a DCHECK or LOG(DFATAL), but returns the -// appropriate fallback value (12 in this case) in opt mode. If you -// need to test that a function has appropriate side-effects in opt -// mode, include assertions against the side-effects. A general -// pattern for this is: -// -// EXPECT_DEBUG_DEATH({ -// // Side-effects here will have an effect after this statement in -// // opt mode, but none in debug mode. -// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); -// }, "death"); -// -# ifdef NDEBUG - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# else - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - EXPECT_DEATH(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - ASSERT_DEATH(statement, regex) - -# endif // NDEBUG for EXPECT_DEBUG_DEATH -#endif // GTEST_HAS_DEATH_TEST - -// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and -// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if -// death tests are supported; otherwise they just issue a warning. This is -// useful when you are combining death test assertions with normal test -// assertions in one test. -#if GTEST_HAS_DEATH_TEST -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - EXPECT_DEATH(statement, regex) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - ASSERT_DEATH(statement, regex) -#else -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) -#endif - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-message.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-message.h deleted file mode 100644 index fe879bca792..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-message.h +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the Message class. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! - -#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ - -#include - -#include "gtest/internal/gtest-port.h" - -// Ensures that there is at least one operator<< in the global namespace. -// See Message& operator<<(...) below for why. -void operator<<(const testing::internal::Secret&, int); - -namespace testing { - -// The Message class works like an ostream repeater. -// -// Typical usage: -// -// 1. You stream a bunch of values to a Message object. -// It will remember the text in a stringstream. -// 2. Then you stream the Message object to an ostream. -// This causes the text in the Message to be streamed -// to the ostream. -// -// For example; -// -// testing::Message foo; -// foo << 1 << " != " << 2; -// std::cout << foo; -// -// will print "1 != 2". -// -// Message is not intended to be inherited from. In particular, its -// destructor is not virtual. -// -// Note that stringstream behaves differently in gcc and in MSVC. You -// can stream a NULL char pointer to it in the former, but not in the -// latter (it causes an access violation if you do). The Message -// class hides this difference by treating a NULL char pointer as -// "(null)". -class GTEST_API_ Message { - private: - // The type of basic IO manipulators (endl, ends, and flush) for - // narrow streams. - typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); - - public: - // Constructs an empty Message. - Message(); - - // Copy constructor. - Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT - *ss_ << msg.GetString(); - } - - // Constructs a Message from a C-string. - explicit Message(const char* str) : ss_(new ::std::stringstream) { - *ss_ << str; - } - -#if GTEST_OS_SYMBIAN - // Streams a value (either a pointer or not) to this object. - template - inline Message& operator <<(const T& value) { - StreamHelper(typename internal::is_pointer::type(), value); - return *this; - } -#else - // Streams a non-pointer value to this object. - template - inline Message& operator <<(const T& val) { - // Some libraries overload << for STL containers. These - // overloads are defined in the global namespace instead of ::std. - // - // C++'s symbol lookup rule (i.e. Koenig lookup) says that these - // overloads are visible in either the std namespace or the global - // namespace, but not other namespaces, including the testing - // namespace which Google Test's Message class is in. - // - // To allow STL containers (and other types that has a << operator - // defined in the global namespace) to be used in Google Test - // assertions, testing::Message must access the custom << operator - // from the global namespace. With this using declaration, - // overloads of << defined in the global namespace and those - // visible via Koenig lookup are both exposed in this function. - using ::operator <<; - *ss_ << val; - return *this; - } - - // Streams a pointer value to this object. - // - // This function is an overload of the previous one. When you - // stream a pointer to a Message, this definition will be used as it - // is more specialized. (The C++ Standard, section - // [temp.func.order].) If you stream a non-pointer, then the - // previous definition will be used. - // - // The reason for this overload is that streaming a NULL pointer to - // ostream is undefined behavior. Depending on the compiler, you - // may get "0", "(nil)", "(null)", or an access violation. To - // ensure consistent result across compilers, we always treat NULL - // as "(null)". - template - inline Message& operator <<(T* const& pointer) { // NOLINT - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - return *this; - } -#endif // GTEST_OS_SYMBIAN - - // Since the basic IO manipulators are overloaded for both narrow - // and wide streams, we have to provide this specialized definition - // of operator <<, even though its body is the same as the - // templatized version above. Without this definition, streaming - // endl or other basic IO manipulators to Message will confuse the - // compiler. - Message& operator <<(BasicNarrowIoManip val) { - *ss_ << val; - return *this; - } - - // Instead of 1/0, we want to see true/false for bool values. - Message& operator <<(bool b) { - return *this << (b ? "true" : "false"); - } - - // These two overloads allow streaming a wide C string to a Message - // using the UTF-8 encoding. - Message& operator <<(const wchar_t* wide_c_str); - Message& operator <<(wchar_t* wide_c_str); - -#if GTEST_HAS_STD_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::std::wstring& wstr); -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::wstring& wstr); -#endif // GTEST_HAS_GLOBAL_WSTRING - - // Gets the text streamed to this object so far as an std::string. - // Each '\0' character in the buffer is replaced with "\\0". - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - std::string GetString() const; - - private: - -#if GTEST_OS_SYMBIAN - // These are needed as the Nokia Symbian Compiler cannot decide between - // const T& and const T* in a function template. The Nokia compiler _can_ - // decide between class template specializations for T and T*, so a - // tr1::type_traits-like is_pointer works, and we can overload on that. - template - inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - } - template - inline void StreamHelper(internal::false_type /*is_pointer*/, - const T& value) { - // See the comments in Message& operator <<(const T&) above for why - // we need this using statement. - using ::operator <<; - *ss_ << value; - } -#endif // GTEST_OS_SYMBIAN - - // We'll hold the text streamed to this object here. - const internal::scoped_ptr< ::std::stringstream> ss_; - - // We declare (but don't implement) this to prevent the compiler - // from implementing the assignment operator. - void operator=(const Message&); -}; - -// Streams a Message to an ostream. -inline std::ostream& operator <<(std::ostream& os, const Message& sb) { - return os << sb.GetString(); -} - -namespace internal { - -// Converts a streamable value to an std::string. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". -template -std::string StreamableToString(const T& streamable) { - return (Message() << streamable).GetString(); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h deleted file mode 100644 index 038f9ba79eb..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h +++ /dev/null @@ -1,1444 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-param-test.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: vladl@google.com (Vlad Losev) -// -// Macros and functions for implementing parameterized tests -// in Google C++ Testing Framework (Google Test) -// -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ - - -// Value-parameterized tests allow you to test your code with different -// parameters without writing multiple copies of the same test. -// -// Here is how you use value-parameterized tests: - -#if 0 - -// To write value-parameterized tests, first you should define a fixture -// class. It is usually derived from testing::TestWithParam (see below for -// another inheritance scheme that's sometimes useful in more complicated -// class hierarchies), where the type of your parameter values. -// TestWithParam is itself derived from testing::Test. T can be any -// copyable type. If it's a raw pointer, you are responsible for managing the -// lifespan of the pointed values. - -class FooTest : public ::testing::TestWithParam { - // You can implement all the usual class fixture members here. -}; - -// Then, use the TEST_P macro to define as many parameterized tests -// for this fixture as you want. The _P suffix is for "parameterized" -// or "pattern", whichever you prefer to think. - -TEST_P(FooTest, DoesBlah) { - // Inside a test, access the test parameter with the GetParam() method - // of the TestWithParam class: - EXPECT_TRUE(foo.Blah(GetParam())); - ... -} - -TEST_P(FooTest, HasBlahBlah) { - ... -} - -// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test -// case with any set of parameters you want. Google Test defines a number -// of functions for generating test parameters. They return what we call -// (surprise!) parameter generators. Here is a summary of them, which -// are all in the testing namespace: -// -// -// Range(begin, end [, step]) - Yields values {begin, begin+step, -// begin+step+step, ...}. The values do not -// include end. step defaults to 1. -// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. -// ValuesIn(container) - Yields values from a C-style array, an STL -// ValuesIn(begin,end) container, or an iterator range [begin, end). -// Bool() - Yields sequence {false, true}. -// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product -// for the math savvy) of the values generated -// by the N generators. -// -// For more details, see comments at the definitions of these functions below -// in this file. -// -// The following statement will instantiate tests from the FooTest test case -// each with parameter values "meeny", "miny", and "moe". - -INSTANTIATE_TEST_CASE_P(InstantiationName, - FooTest, - Values("meeny", "miny", "moe")); - -// To distinguish different instances of the pattern, (yes, you -// can instantiate it more then once) the first argument to the -// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the -// actual test case name. Remember to pick unique prefixes for different -// instantiations. The tests from the instantiation above will have -// these names: -// -// * InstantiationName/FooTest.DoesBlah/0 for "meeny" -// * InstantiationName/FooTest.DoesBlah/1 for "miny" -// * InstantiationName/FooTest.DoesBlah/2 for "moe" -// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" -// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" -// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" -// -// You can use these names in --gtest_filter. -// -// This statement will instantiate all tests from FooTest again, each -// with parameter values "cat" and "dog": - -const char* pets[] = {"cat", "dog"}; -INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); - -// The tests from the instantiation above will have these names: -// -// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" -// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" -// -// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests -// in the given test case, whether their definitions come before or -// AFTER the INSTANTIATE_TEST_CASE_P statement. -// -// Please also note that generator expressions (including parameters to the -// generators) are evaluated in InitGoogleTest(), after main() has started. -// This allows the user on one hand, to adjust generator parameters in order -// to dynamically determine a set of tests to run and on the other hand, -// give the user a chance to inspect the generated tests with Google Test -// reflection API before RUN_ALL_TESTS() is executed. -// -// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc -// for more examples. -// -// In the future, we plan to publish the API for defining new parameter -// generators. But for now this interface remains part of the internal -// implementation and is subject to change. -// -// -// A parameterized test fixture must be derived from testing::Test and from -// testing::WithParamInterface, where T is the type of the parameter -// values. Inheriting from TestWithParam satisfies that requirement because -// TestWithParam inherits from both Test and WithParamInterface. In more -// complicated hierarchies, however, it is occasionally useful to inherit -// separately from Test and WithParamInterface. For example: - -class BaseTest : public ::testing::Test { - // You can inherit all the usual members for a non-parameterized test - // fixture here. -}; - -class DerivedTest : public BaseTest, public ::testing::WithParamInterface { - // The usual test fixture members go here too. -}; - -TEST_F(BaseTest, HasFoo) { - // This is an ordinary non-parameterized test. -} - -TEST_P(DerivedTest, DoesBlah) { - // GetParam works just the same here as if you inherit from TestWithParam. - EXPECT_TRUE(foo.Blah(GetParam())); -} - -#endif // 0 - -#include "gtest/internal/gtest-port.h" - -#if !GTEST_OS_SYMBIAN -# include -#endif - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-param-util-generated.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Functions producing parameter generators. -// -// Google Test uses these generators to produce parameters for value- -// parameterized tests. When a parameterized test case is instantiated -// with a particular generator, Google Test creates and runs tests -// for each element in the sequence produced by the generator. -// -// In the following sample, tests from test case FooTest are instantiated -// each three times with parameter values 3, 5, and 8: -// -// class FooTest : public TestWithParam { ... }; -// -// TEST_P(FooTest, TestThis) { -// } -// TEST_P(FooTest, TestThat) { -// } -// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); -// - -// Range() returns generators providing sequences of values in a range. -// -// Synopsis: -// Range(start, end) -// - returns a generator producing a sequence of values {start, start+1, -// start+2, ..., }. -// Range(start, end, step) -// - returns a generator producing a sequence of values {start, start+step, -// start+step+step, ..., }. -// Notes: -// * The generated sequences never include end. For example, Range(1, 5) -// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) -// returns a generator producing {1, 3, 5, 7}. -// * start and end must have the same type. That type may be any integral or -// floating-point type or a user defined type satisfying these conditions: -// * It must be assignable (have operator=() defined). -// * It must have operator+() (operator+(int-compatible type) for -// two-operand version). -// * It must have operator<() defined. -// Elements in the resulting sequences will also have that type. -// * Condition start < end must be satisfied in order for resulting sequences -// to contain any elements. -// -template -internal::ParamGenerator Range(T start, T end, IncrementT step) { - return internal::ParamGenerator( - new internal::RangeGenerator(start, end, step)); -} - -template -internal::ParamGenerator Range(T start, T end) { - return Range(start, end, 1); -} - -// ValuesIn() function allows generation of tests with parameters coming from -// a container. -// -// Synopsis: -// ValuesIn(const T (&array)[N]) -// - returns a generator producing sequences with elements from -// a C-style array. -// ValuesIn(const Container& container) -// - returns a generator producing sequences with elements from -// an STL-style container. -// ValuesIn(Iterator begin, Iterator end) -// - returns a generator producing sequences with elements from -// a range [begin, end) defined by a pair of STL-style iterators. These -// iterators can also be plain C pointers. -// -// Please note that ValuesIn copies the values from the containers -// passed in and keeps them to generate tests in RUN_ALL_TESTS(). -// -// Examples: -// -// This instantiates tests from test case StringTest -// each with C-string values of "foo", "bar", and "baz": -// -// const char* strings[] = {"foo", "bar", "baz"}; -// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); -// -// This instantiates tests from test case StlStringTest -// each with STL strings with values "a" and "b": -// -// ::std::vector< ::std::string> GetParameterStrings() { -// ::std::vector< ::std::string> v; -// v.push_back("a"); -// v.push_back("b"); -// return v; -// } -// -// INSTANTIATE_TEST_CASE_P(CharSequence, -// StlStringTest, -// ValuesIn(GetParameterStrings())); -// -// -// This will also instantiate tests from CharTest -// each with parameter values 'a' and 'b': -// -// ::std::list GetParameterChars() { -// ::std::list list; -// list.push_back('a'); -// list.push_back('b'); -// return list; -// } -// ::std::list l = GetParameterChars(); -// INSTANTIATE_TEST_CASE_P(CharSequence2, -// CharTest, -// ValuesIn(l.begin(), l.end())); -// -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end) { - typedef typename ::testing::internal::IteratorTraits - ::value_type ParamType; - return internal::ParamGenerator( - new internal::ValuesInIteratorRangeGenerator(begin, end)); -} - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]) { - return ValuesIn(array, array + N); -} - -template -internal::ParamGenerator ValuesIn( - const Container& container) { - return ValuesIn(container.begin(), container.end()); -} - -// Values() allows generating tests from explicitly specified list of -// parameters. -// -// Synopsis: -// Values(T v1, T v2, ..., T vN) -// - returns a generator producing sequences with elements v1, v2, ..., vN. -// -// For example, this instantiates tests from test case BarTest each -// with values "one", "two", and "three": -// -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); -// -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. -// The exact type of values will depend on the type of parameter in BazTest. -// -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// -// Currently, Values() supports from 1 to 50 parameters. -// -template -internal::ValueArray1 Values(T1 v1) { - return internal::ValueArray1(v1); -} - -template -internal::ValueArray2 Values(T1 v1, T2 v2) { - return internal::ValueArray2(v1, v2); -} - -template -internal::ValueArray3 Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3(v1, v2, v3); -} - -template -internal::ValueArray4 Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4(v1, v2, v3, v4); -} - -template -internal::ValueArray5 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5(v1, v2, v3, v4, v5); -} - -template -internal::ValueArray6 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6(v1, v2, v3, v4, v5, v6); -} - -template -internal::ValueArray7 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7(v1, v2, v3, v4, v5, - v6, v7); -} - -template -internal::ValueArray8 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template -internal::ValueArray9 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template -internal::ValueArray10 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template -internal::ValueArray11 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template -internal::ValueArray12 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template -internal::ValueArray13 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template -internal::ValueArray14 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template -internal::ValueArray15 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template -internal::ValueArray16 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template -internal::ValueArray17 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template -internal::ValueArray18 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template -internal::ValueArray19 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template -internal::ValueArray20 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template -internal::ValueArray21 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template -internal::ValueArray22 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template -internal::ValueArray23 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template -internal::ValueArray24 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template -internal::ValueArray25 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template -internal::ValueArray26 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template -internal::ValueArray27 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template -internal::ValueArray28 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template -internal::ValueArray29 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template -internal::ValueArray30 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template -internal::ValueArray31 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template -internal::ValueArray32 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template -internal::ValueArray33 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template -internal::ValueArray34 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template -internal::ValueArray35 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template -internal::ValueArray36 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template -internal::ValueArray37 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template -internal::ValueArray38 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template -internal::ValueArray39 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template -internal::ValueArray40 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template -internal::ValueArray41 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template -internal::ValueArray42 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template -internal::ValueArray43 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template -internal::ValueArray44 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template -internal::ValueArray45 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template -internal::ValueArray46 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template -internal::ValueArray47 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template -internal::ValueArray48 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template -internal::ValueArray49 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template -internal::ValueArray50 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); -} - -// Bool() allows generating tests with parameters in a set of (false, true). -// -// Synopsis: -// Bool() -// - returns a generator producing sequences with elements {false, true}. -// -// It is useful when testing code that depends on Boolean flags. Combinations -// of multiple flags can be tested when several Bool()'s are combined using -// Combine() function. -// -// In the following example all tests in the test case FlagDependentTest -// will be instantiated twice with parameters false and true. -// -// class FlagDependentTest : public testing::TestWithParam { -// virtual void SetUp() { -// external_flag = GetParam(); -// } -// } -// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); -// -inline internal::ParamGenerator Bool() { - return Values(false, true); -} - -# if GTEST_HAS_COMBINE -// Combine() allows the user to combine two or more sequences to produce -// values of a Cartesian product of those sequences' elements. -// -// Synopsis: -// Combine(gen1, gen2, ..., genN) -// - returns a generator producing sequences with elements coming from -// the Cartesian product of elements from the sequences generated by -// gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple where T1, T2, ..., TN are the types -// of elements from sequences produces by gen1, gen2, ..., genN. -// -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. -// -// Example: -// -// This will instantiate tests in test case AnimalTest each one with -// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), -// tuple("dog", BLACK), and tuple("dog", WHITE): -// -// enum Color { BLACK, GRAY, WHITE }; -// class AnimalTest -// : public testing::TestWithParam > {...}; -// -// TEST_P(AnimalTest, AnimalLooksNice) {...} -// -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); -// -// This will instantiate tests in FlagDependentTest with all variations of two -// Boolean flags: -// -// class FlagDependentTest -// : public testing::TestWithParam > { -// virtual void SetUp() { -// // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); -// } -// }; -// -// TEST_P(FlagDependentTest, TestFeature1) { -// // Test your code using external_flag_1 and external_flag_2 here. -// } -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); -// -template -internal::CartesianProductHolder2 Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2( - g1, g2); -} - -template -internal::CartesianProductHolder3 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3( - g1, g2, g3); -} - -template -internal::CartesianProductHolder4 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4( - g1, g2, g3, g4); -} - -template -internal::CartesianProductHolder5 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5( - g1, g2, g3, g4, g5); -} - -template -internal::CartesianProductHolder6 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6( - g1, g2, g3, g4, g5, g6); -} - -template -internal::CartesianProductHolder7 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7( - g1, g2, g3, g4, g5, g6, g7); -} - -template -internal::CartesianProductHolder8 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template -internal::CartesianProductHolder9 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template -internal::CartesianProductHolder10 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(\ - test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user -// to specify a function or functor that generates custom test name suffixes -// based on the test parameters. The function should accept one argument of -// type testing::TestParamInfo, and return std::string. -// -// testing::PrintToStringParamName is a builtin test suffix generator that -// returns the value of testing::PrintToString(GetParam()). It does not work -// for std::string or C strings. -// -// Note: test names must be non-empty, unique, and may only contain ASCII -// alphanumeric characters or underscore. - -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ - ::testing::internal::ParamGenerator \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ - const ::testing::TestParamInfo& info) { \ - return ::testing::internal::GetParamNameGen \ - (__VA_ARGS__)(info); \ - } \ - int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - >est_##prefix##test_case_name##_EvalGenerateName_, \ - __FILE__, __LINE__) - -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h.pump b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h.pump deleted file mode 100644 index 3078d6d2a19..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-param-test.h.pump +++ /dev/null @@ -1,510 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 50 $$ Maximum length of Values arguments we want to support. -$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: vladl@google.com (Vlad Losev) -// -// Macros and functions for implementing parameterized tests -// in Google C++ Testing Framework (Google Test) -// -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ - - -// Value-parameterized tests allow you to test your code with different -// parameters without writing multiple copies of the same test. -// -// Here is how you use value-parameterized tests: - -#if 0 - -// To write value-parameterized tests, first you should define a fixture -// class. It is usually derived from testing::TestWithParam (see below for -// another inheritance scheme that's sometimes useful in more complicated -// class hierarchies), where the type of your parameter values. -// TestWithParam is itself derived from testing::Test. T can be any -// copyable type. If it's a raw pointer, you are responsible for managing the -// lifespan of the pointed values. - -class FooTest : public ::testing::TestWithParam { - // You can implement all the usual class fixture members here. -}; - -// Then, use the TEST_P macro to define as many parameterized tests -// for this fixture as you want. The _P suffix is for "parameterized" -// or "pattern", whichever you prefer to think. - -TEST_P(FooTest, DoesBlah) { - // Inside a test, access the test parameter with the GetParam() method - // of the TestWithParam class: - EXPECT_TRUE(foo.Blah(GetParam())); - ... -} - -TEST_P(FooTest, HasBlahBlah) { - ... -} - -// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test -// case with any set of parameters you want. Google Test defines a number -// of functions for generating test parameters. They return what we call -// (surprise!) parameter generators. Here is a summary of them, which -// are all in the testing namespace: -// -// -// Range(begin, end [, step]) - Yields values {begin, begin+step, -// begin+step+step, ...}. The values do not -// include end. step defaults to 1. -// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. -// ValuesIn(container) - Yields values from a C-style array, an STL -// ValuesIn(begin,end) container, or an iterator range [begin, end). -// Bool() - Yields sequence {false, true}. -// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product -// for the math savvy) of the values generated -// by the N generators. -// -// For more details, see comments at the definitions of these functions below -// in this file. -// -// The following statement will instantiate tests from the FooTest test case -// each with parameter values "meeny", "miny", and "moe". - -INSTANTIATE_TEST_CASE_P(InstantiationName, - FooTest, - Values("meeny", "miny", "moe")); - -// To distinguish different instances of the pattern, (yes, you -// can instantiate it more then once) the first argument to the -// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the -// actual test case name. Remember to pick unique prefixes for different -// instantiations. The tests from the instantiation above will have -// these names: -// -// * InstantiationName/FooTest.DoesBlah/0 for "meeny" -// * InstantiationName/FooTest.DoesBlah/1 for "miny" -// * InstantiationName/FooTest.DoesBlah/2 for "moe" -// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" -// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" -// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" -// -// You can use these names in --gtest_filter. -// -// This statement will instantiate all tests from FooTest again, each -// with parameter values "cat" and "dog": - -const char* pets[] = {"cat", "dog"}; -INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); - -// The tests from the instantiation above will have these names: -// -// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" -// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" -// -// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests -// in the given test case, whether their definitions come before or -// AFTER the INSTANTIATE_TEST_CASE_P statement. -// -// Please also note that generator expressions (including parameters to the -// generators) are evaluated in InitGoogleTest(), after main() has started. -// This allows the user on one hand, to adjust generator parameters in order -// to dynamically determine a set of tests to run and on the other hand, -// give the user a chance to inspect the generated tests with Google Test -// reflection API before RUN_ALL_TESTS() is executed. -// -// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc -// for more examples. -// -// In the future, we plan to publish the API for defining new parameter -// generators. But for now this interface remains part of the internal -// implementation and is subject to change. -// -// -// A parameterized test fixture must be derived from testing::Test and from -// testing::WithParamInterface, where T is the type of the parameter -// values. Inheriting from TestWithParam satisfies that requirement because -// TestWithParam inherits from both Test and WithParamInterface. In more -// complicated hierarchies, however, it is occasionally useful to inherit -// separately from Test and WithParamInterface. For example: - -class BaseTest : public ::testing::Test { - // You can inherit all the usual members for a non-parameterized test - // fixture here. -}; - -class DerivedTest : public BaseTest, public ::testing::WithParamInterface { - // The usual test fixture members go here too. -}; - -TEST_F(BaseTest, HasFoo) { - // This is an ordinary non-parameterized test. -} - -TEST_P(DerivedTest, DoesBlah) { - // GetParam works just the same here as if you inherit from TestWithParam. - EXPECT_TRUE(foo.Blah(GetParam())); -} - -#endif // 0 - -#include "gtest/internal/gtest-port.h" - -#if !GTEST_OS_SYMBIAN -# include -#endif - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-param-util-generated.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Functions producing parameter generators. -// -// Google Test uses these generators to produce parameters for value- -// parameterized tests. When a parameterized test case is instantiated -// with a particular generator, Google Test creates and runs tests -// for each element in the sequence produced by the generator. -// -// In the following sample, tests from test case FooTest are instantiated -// each three times with parameter values 3, 5, and 8: -// -// class FooTest : public TestWithParam { ... }; -// -// TEST_P(FooTest, TestThis) { -// } -// TEST_P(FooTest, TestThat) { -// } -// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); -// - -// Range() returns generators providing sequences of values in a range. -// -// Synopsis: -// Range(start, end) -// - returns a generator producing a sequence of values {start, start+1, -// start+2, ..., }. -// Range(start, end, step) -// - returns a generator producing a sequence of values {start, start+step, -// start+step+step, ..., }. -// Notes: -// * The generated sequences never include end. For example, Range(1, 5) -// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) -// returns a generator producing {1, 3, 5, 7}. -// * start and end must have the same type. That type may be any integral or -// floating-point type or a user defined type satisfying these conditions: -// * It must be assignable (have operator=() defined). -// * It must have operator+() (operator+(int-compatible type) for -// two-operand version). -// * It must have operator<() defined. -// Elements in the resulting sequences will also have that type. -// * Condition start < end must be satisfied in order for resulting sequences -// to contain any elements. -// -template -internal::ParamGenerator Range(T start, T end, IncrementT step) { - return internal::ParamGenerator( - new internal::RangeGenerator(start, end, step)); -} - -template -internal::ParamGenerator Range(T start, T end) { - return Range(start, end, 1); -} - -// ValuesIn() function allows generation of tests with parameters coming from -// a container. -// -// Synopsis: -// ValuesIn(const T (&array)[N]) -// - returns a generator producing sequences with elements from -// a C-style array. -// ValuesIn(const Container& container) -// - returns a generator producing sequences with elements from -// an STL-style container. -// ValuesIn(Iterator begin, Iterator end) -// - returns a generator producing sequences with elements from -// a range [begin, end) defined by a pair of STL-style iterators. These -// iterators can also be plain C pointers. -// -// Please note that ValuesIn copies the values from the containers -// passed in and keeps them to generate tests in RUN_ALL_TESTS(). -// -// Examples: -// -// This instantiates tests from test case StringTest -// each with C-string values of "foo", "bar", and "baz": -// -// const char* strings[] = {"foo", "bar", "baz"}; -// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); -// -// This instantiates tests from test case StlStringTest -// each with STL strings with values "a" and "b": -// -// ::std::vector< ::std::string> GetParameterStrings() { -// ::std::vector< ::std::string> v; -// v.push_back("a"); -// v.push_back("b"); -// return v; -// } -// -// INSTANTIATE_TEST_CASE_P(CharSequence, -// StlStringTest, -// ValuesIn(GetParameterStrings())); -// -// -// This will also instantiate tests from CharTest -// each with parameter values 'a' and 'b': -// -// ::std::list GetParameterChars() { -// ::std::list list; -// list.push_back('a'); -// list.push_back('b'); -// return list; -// } -// ::std::list l = GetParameterChars(); -// INSTANTIATE_TEST_CASE_P(CharSequence2, -// CharTest, -// ValuesIn(l.begin(), l.end())); -// -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end) { - typedef typename ::testing::internal::IteratorTraits - ::value_type ParamType; - return internal::ParamGenerator( - new internal::ValuesInIteratorRangeGenerator(begin, end)); -} - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]) { - return ValuesIn(array, array + N); -} - -template -internal::ParamGenerator ValuesIn( - const Container& container) { - return ValuesIn(container.begin(), container.end()); -} - -// Values() allows generating tests from explicitly specified list of -// parameters. -// -// Synopsis: -// Values(T v1, T v2, ..., T vN) -// - returns a generator producing sequences with elements v1, v2, ..., vN. -// -// For example, this instantiates tests from test case BarTest each -// with values "one", "two", and "three": -// -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); -// -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. -// The exact type of values will depend on the type of parameter in BazTest. -// -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// -// Currently, Values() supports from 1 to $n parameters. -// -$range i 1..n -$for i [[ -$range j 1..i - -template <$for j, [[typename T$j]]> -internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) { - return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]); -} - -]] - -// Bool() allows generating tests with parameters in a set of (false, true). -// -// Synopsis: -// Bool() -// - returns a generator producing sequences with elements {false, true}. -// -// It is useful when testing code that depends on Boolean flags. Combinations -// of multiple flags can be tested when several Bool()'s are combined using -// Combine() function. -// -// In the following example all tests in the test case FlagDependentTest -// will be instantiated twice with parameters false and true. -// -// class FlagDependentTest : public testing::TestWithParam { -// virtual void SetUp() { -// external_flag = GetParam(); -// } -// } -// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); -// -inline internal::ParamGenerator Bool() { - return Values(false, true); -} - -# if GTEST_HAS_COMBINE -// Combine() allows the user to combine two or more sequences to produce -// values of a Cartesian product of those sequences' elements. -// -// Synopsis: -// Combine(gen1, gen2, ..., genN) -// - returns a generator producing sequences with elements coming from -// the Cartesian product of elements from the sequences generated by -// gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple where T1, T2, ..., TN are the types -// of elements from sequences produces by gen1, gen2, ..., genN. -// -// Combine can have up to $maxtuple arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. -// -// Example: -// -// This will instantiate tests in test case AnimalTest each one with -// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), -// tuple("dog", BLACK), and tuple("dog", WHITE): -// -// enum Color { BLACK, GRAY, WHITE }; -// class AnimalTest -// : public testing::TestWithParam > {...}; -// -// TEST_P(AnimalTest, AnimalLooksNice) {...} -// -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); -// -// This will instantiate tests in FlagDependentTest with all variations of two -// Boolean flags: -// -// class FlagDependentTest -// : public testing::TestWithParam > { -// virtual void SetUp() { -// // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); -// } -// }; -// -// TEST_P(FlagDependentTest, TestFeature1) { -// // Test your code using external_flag_1 and external_flag_2 here. -// } -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); -// -$range i 2..maxtuple -$for i [[ -$range j 1..i - -template <$for j, [[typename Generator$j]]> -internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine( - $for j, [[const Generator$j& g$j]]) { - return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>( - $for j, [[g$j]]); -} - -]] -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(\ - test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user -// to specify a function or functor that generates custom test name suffixes -// based on the test parameters. The function should accept one argument of -// type testing::TestParamInfo, and return std::string. -// -// testing::PrintToStringParamName is a builtin test suffix generator that -// returns the value of testing::PrintToString(GetParam()). -// -// Note: test names must be non-empty, unique, and may only contain ASCII -// alphanumeric characters or underscore. Because PrintToString adds quotes -// to std::string and C strings, it won't work for these types. - -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ - ::testing::internal::ParamGenerator \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ - const ::testing::TestParamInfo& info) { \ - return ::testing::internal::GetParamNameGen \ - (__VA_ARGS__)(info); \ - } \ - int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, \ - ::testing::internal::CodeLocation(\ - __FILE__, __LINE__))->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - >est_##prefix##test_case_name##_EvalGenerateName_, \ - __FILE__, __LINE__) - -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-printers.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-printers.h deleted file mode 100644 index 8a33164cb38..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-printers.h +++ /dev/null @@ -1,993 +0,0 @@ -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Google Test - The Google C++ Testing Framework -// -// This file implements a universal value printer that can print a -// value of any type T: -// -// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); -// -// A user can teach this function how to print a class type T by -// defining either operator<<() or PrintTo() in the namespace that -// defines T. More specifically, the FIRST defined function in the -// following list will be used (assuming T is defined in namespace -// foo): -// -// 1. foo::PrintTo(const T&, ostream*) -// 2. operator<<(ostream&, const T&) defined in either foo or the -// global namespace. -// -// If none of the above is defined, it will print the debug string of -// the value if it is a protocol buffer, or print the raw bytes in the -// value otherwise. -// -// To aid debugging: when T is a reference type, the address of the -// value is also printed; when T is a (const) char pointer, both the -// pointer value and the NUL-terminated string it points to are -// printed. -// -// We also provide some convenient wrappers: -// -// // Prints a value to a string. For a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// std::string ::testing::PrintToString(const T& value); -// -// // Prints a value tersely: for a reference type, the referenced -// // value (but not the address) is printed; for a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); -// -// // Prints value using the type inferred by the compiler. The difference -// // from UniversalTersePrint() is that this function prints both the -// // pointer and the NUL-terminated string for a (const or not) char pointer. -// void ::testing::internal::UniversalPrint(const T& value, ostream*); -// -// // Prints the fields of a tuple tersely to a string vector, one -// // element for each field. Tuple support must be enabled in -// // gtest-port.h. -// std::vector UniversalTersePrintTupleFieldsToStrings( -// const Tuple& value); -// -// Known limitation: -// -// The print primitives print the elements of an STL-style container -// using the compiler-inferred type of *iter where iter is a -// const_iterator of the container. When const_iterator is an input -// iterator but not a forward iterator, this inferred type may not -// match value_type, and the print output may be incorrect. In -// practice, this is rarely a problem as for most containers -// const_iterator is a forward iterator. We'll fix this if there's an -// actual need for it. Note that this fix cannot rely on value_type -// being defined as many user-defined container types don't have -// value_type. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#include // NOLINT -#include -#include -#include -#include -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-internal.h" - -#if GTEST_HAS_STD_TUPLE_ -# include -#endif - -namespace testing { - -// Definitions in the 'internal' and 'internal2' name spaces are -// subject to change without notice. DO NOT USE THEM IN USER CODE! -namespace internal2 { - -// Prints the given number of bytes in the given object to the given -// ostream. -GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, - size_t count, - ::std::ostream* os); - -// For selecting which printer to use when a given type has neither << -// nor PrintTo(). -enum TypeKind { - kProtobuf, // a protobuf type - kConvertibleToInteger, // a type implicitly convertible to BiggestInt - // (e.g. a named or unnamed enum type) - kOtherType // anything else -}; - -// TypeWithoutFormatter::PrintValue(value, os) is called -// by the universal printer to print a value of type T when neither -// operator<< nor PrintTo() is defined for T, where kTypeKind is the -// "kind" of T as defined by enum TypeKind. -template -class TypeWithoutFormatter { - public: - // This default version is called when kTypeKind is kOtherType. - static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast(&value), - sizeof(value), os); - } -}; - -// We print a protobuf using its ShortDebugString() when the string -// doesn't exceed this many characters; otherwise we print it using -// DebugString() for better readability. -const size_t kProtobufOneLinerMaxLength = 50; - -template -class TypeWithoutFormatter { - public: - static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); - *os << ("<" + pretty_str + ">"); - } -}; - -template -class TypeWithoutFormatter { - public: - // Since T has no << operator or PrintTo() but can be implicitly - // converted to BiggestInt, we print it as a BiggestInt. - // - // Most likely T is an enum type (either named or unnamed), in which - // case printing it as an integer is the desired behavior. In case - // T is not an enum, printing it as an integer is the best we can do - // given that it has no user-defined printer. - static void PrintValue(const T& value, ::std::ostream* os) { - const internal::BiggestInt kBigInt = value; - *os << kBigInt; - } -}; - -// Prints the given value to the given ostream. If the value is a -// protocol message, its debug string is printed; if it's an enum or -// of a type implicitly convertible to BiggestInt, it's printed as an -// integer; otherwise the bytes in the value are printed. This is -// what UniversalPrinter::Print() does when it knows nothing about -// type T and T has neither << operator nor PrintTo(). -// -// A user can override this behavior for a class type Foo by defining -// a << operator in the namespace where Foo is defined. -// -// We put this operator in namespace 'internal2' instead of 'internal' -// to simplify the implementation, as much code in 'internal' needs to -// use << in STL, which would conflict with our own << were it defined -// in 'internal'. -// -// Note that this operator<< takes a generic std::basic_ostream type instead of the more restricted std::ostream. If -// we define it to take an std::ostream instead, we'll get an -// "ambiguous overloads" compiler error when trying to print a type -// Foo that supports streaming to std::basic_ostream, as the compiler cannot tell whether -// operator<<(std::ostream&, const T&) or -// operator<<(std::basic_stream, const Foo&) is more -// specific. -template -::std::basic_ostream& operator<<( - ::std::basic_ostream& os, const T& x) { - TypeWithoutFormatter::value ? kProtobuf : - internal::ImplicitlyConvertible::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); - return os; -} - -} // namespace internal2 -} // namespace testing - -// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up -// magic needed for implementing UniversalPrinter won't work. -namespace testing_internal { - -// Used to print a value that is not an STL-style container when the -// user doesn't define PrintTo() for it. -template -void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { - // With the following statement, during unqualified name lookup, - // testing::internal2::operator<< appears as if it was declared in - // the nearest enclosing namespace that contains both - // ::testing_internal and ::testing::internal2, i.e. the global - // namespace. For more details, refer to the C++ Standard section - // 7.3.4-1 [namespace.udir]. This allows us to fall back onto - // testing::internal2::operator<< in case T doesn't come with a << - // operator. - // - // We cannot write 'using ::testing::internal2::operator<<;', which - // gcc 3.3 fails to compile due to a compiler bug. - using namespace ::testing::internal2; // NOLINT - - // Assuming T is defined in namespace foo, in the next statement, - // the compiler will consider all of: - // - // 1. foo::operator<< (thanks to Koenig look-up), - // 2. ::operator<< (as the current namespace is enclosed in ::), - // 3. testing::internal2::operator<< (thanks to the using statement above). - // - // The operator<< whose type matches T best will be picked. - // - // We deliberately allow #2 to be a candidate, as sometimes it's - // impossible to define #1 (e.g. when foo is ::std, defining - // anything in it is undefined behavior unless you are a compiler - // vendor.). - *os << value; -} - -} // namespace testing_internal - -namespace testing { -namespace internal { - -// FormatForComparison::Format(value) formats a -// value of type ToPrint that is an operand of a comparison assertion -// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in -// the comparison, and is used to help determine the best way to -// format the value. In particular, when the value is a C string -// (char pointer) and the other operand is an STL string object, we -// want to format the C string as a string, since we know it is -// compared by value with the string object. If the value is a char -// pointer but the other operand is not an STL string object, we don't -// know whether the pointer is supposed to point to a NUL-terminated -// string, and thus want to print it as a pointer to be safe. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// The default case. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint& value) { - return ::testing::PrintToString(value); - } -}; - -// Array. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint* value) { - return FormatForComparison::Format(value); - } -}; - -// By default, print C string as pointers to be safe, as we don't know -// whether they actually point to a NUL-terminated string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \ - template \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(static_cast(value)); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_ - -// If a C string is compared with an STL string object, we know it's meant -// to point to a NUL-terminated string, and thus can print it as a string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \ - template <> \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(value); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string); - -#if GTEST_HAS_GLOBAL_STRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string); -#endif - -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring); -#endif - -#if GTEST_HAS_STD_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring); -#endif - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_ - -// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) -// operand to be used in a failure message. The type (but not value) -// of the other operand may affect the format. This allows us to -// print a char* as a raw pointer when it is compared against another -// char* or void*, and print it as a C string when it is compared -// against an std::string object, for example. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -std::string FormatForComparisonFailureMessage( - const T1& value, const T2& /* other_operand */) { - return FormatForComparison::Format(value); -} - -// UniversalPrinter::Print(value, ostream_ptr) prints the given -// value to the given ostream. The caller must ensure that -// 'ostream_ptr' is not NULL, or the behavior is undefined. -// -// We define UniversalPrinter as a class template (as opposed to a -// function template), as we need to partially specialize it for -// reference types, which cannot be done with function templates. -template -class UniversalPrinter; - -template -void UniversalPrint(const T& value, ::std::ostream* os); - -// Used to print an STL-style container when the user doesn't define -// a PrintTo() for it. -template -void DefaultPrintTo(IsContainer /* dummy */, - false_type /* is not a pointer */, - const C& container, ::std::ostream* os) { - const size_t kMaxCount = 32; // The maximum number of elements to print. - *os << '{'; - size_t count = 0; - for (typename C::const_iterator it = container.begin(); - it != container.end(); ++it, ++count) { - if (count > 0) { - *os << ','; - if (count == kMaxCount) { // Enough has been printed. - *os << " ..."; - break; - } - } - *os << ' '; - // We cannot call PrintTo(*it, os) here as PrintTo() doesn't - // handle *it being a native array. - internal::UniversalPrint(*it, os); - } - - if (count > 0) { - *os << ' '; - } - *os << '}'; -} - -// Used to print a pointer that is neither a char pointer nor a member -// pointer, when the user doesn't define PrintTo() for it. (A member -// variable pointer or member function pointer doesn't really point to -// a location in the address space. Their representation is -// implementation-defined. Therefore they will be printed as raw -// bytes.) -template -void DefaultPrintTo(IsNotContainer /* dummy */, - true_type /* is a pointer */, - T* p, ::std::ostream* os) { - if (p == NULL) { - *os << "NULL"; - } else { - // C++ doesn't allow casting from a function pointer to any object - // pointer. - // - // IsTrue() silences warnings: "Condition is always true", - // "unreachable code". - if (IsTrue(ImplicitlyConvertible::value)) { - // T is not a function type. We just call << to print p, - // relying on ADL to pick up user-defined << for their pointer - // types, if any. - *os << p; - } else { - // T is a function type, so '*os << p' doesn't do what we want - // (it just prints p as bool). We want to print p as a const - // void*. However, we cannot cast it to const void* directly, - // even using reinterpret_cast, as earlier versions of gcc - // (e.g. 3.4.5) cannot compile the cast when p is a function - // pointer. Casting to UInt64 first solves the problem. - *os << reinterpret_cast( - reinterpret_cast(p)); - } - } -} - -// Used to print a non-container, non-pointer value when the user -// doesn't define PrintTo() for it. -template -void DefaultPrintTo(IsNotContainer /* dummy */, - false_type /* is not a pointer */, - const T& value, ::std::ostream* os) { - ::testing_internal::DefaultPrintNonContainerTo(value, os); -} - -// Prints the given value using the << operator if it has one; -// otherwise prints the bytes in it. This is what -// UniversalPrinter::Print() does when PrintTo() is not specialized -// or overloaded for type T. -// -// A user can override this behavior for a class type Foo by defining -// an overload of PrintTo() in the namespace where Foo is defined. We -// give the user this option as sometimes defining a << operator for -// Foo is not desirable (e.g. the coding style may prevent doing it, -// or there is already a << operator but it doesn't do what the user -// wants). -template -void PrintTo(const T& value, ::std::ostream* os) { - // DefaultPrintTo() is overloaded. The type of its first two - // arguments determine which version will be picked. If T is an - // STL-style container, the version for container will be called; if - // T is a pointer, the pointer version will be called; otherwise the - // generic version will be called. - // - // Note that we check for container types here, prior to we check - // for protocol message types in our operator<<. The rationale is: - // - // For protocol messages, we want to give people a chance to - // override Google Mock's format by defining a PrintTo() or - // operator<<. For STL containers, other formats can be - // incompatible with Google Mock's format for the container - // elements; therefore we check for container types here to ensure - // that our format is used. - // - // The second argument of DefaultPrintTo() is needed to bypass a bug - // in Symbian's C++ compiler that prevents it from picking the right - // overload between: - // - // PrintTo(const T& x, ...); - // PrintTo(T* x, ...); - DefaultPrintTo(IsContainerTest(0), is_pointer(), value, os); -} - -// The following list of PrintTo() overloads tells -// UniversalPrinter::Print() how to print standard types (built-in -// types, strings, plain arrays, and pointers). - -// Overloads for various char types. -GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); -GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); -inline void PrintTo(char c, ::std::ostream* os) { - // When printing a plain char, we always treat it as unsigned. This - // way, the output won't be affected by whether the compiler thinks - // char is signed or not. - PrintTo(static_cast(c), os); -} - -// Overloads for other simple built-in types. -inline void PrintTo(bool x, ::std::ostream* os) { - *os << (x ? "true" : "false"); -} - -// Overload for wchar_t type. -// Prints a wchar_t as a symbol if it is printable or as its internal -// code otherwise and also as its decimal code (except for L'\0'). -// The L'\0' char is printed as "L'\\0'". The decimal code is printed -// as signed integer when wchar_t is implemented by the compiler -// as a signed type and is printed as an unsigned integer when wchar_t -// is implemented as an unsigned type. -GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); - -// Overloads for C strings. -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// signed/unsigned char is often used for representing binary data, so -// we print pointers to it as void* to be safe. -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// MSVC can be configured to define wchar_t as a typedef of unsigned -// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native -// type. When wchar_t is a typedef, defining an overload for const -// wchar_t* would cause unsigned short* be printed as a wide string, -// possibly causing invalid memory accesses. -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) -// Overloads for wide C strings -GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); -inline void PrintTo(wchar_t* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -#endif - -// Overload for C arrays. Multi-dimensional arrays are printed -// properly. - -// Prints the given number of elements in an array, without printing -// the curly braces. -template -void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { - UniversalPrint(a[0], os); - for (size_t i = 1; i != count; i++) { - *os << ", "; - UniversalPrint(a[i], os); - } -} - -// Overloads for ::string and ::std::string. -#if GTEST_HAS_GLOBAL_STRING -GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); -inline void PrintTo(const ::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_STRING - -GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); -inline void PrintTo(const ::std::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} - -// Overloads for ::wstring and ::std::wstring. -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os); -#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ - -#if GTEST_HAS_TR1_TUPLE -// Overload for ::std::tr1::tuple. Needed for printing function arguments, -// which are packed as tuples. - -// Overloaded PrintTo() for tuples of various arities. We support -// tuples of up-to 10 fields. The following implementation works -// regardless of whether tr1::tuple is implemented using the -// non-standard variadic template feature or not. - -inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo( - const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} -#endif // GTEST_HAS_TR1_TUPLE - -#if GTEST_HAS_STD_TUPLE_ -template -void PrintTo(const ::std::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} -#endif // GTEST_HAS_STD_TUPLE_ - -// Overload for std::pair. -template -void PrintTo(const ::std::pair& value, ::std::ostream* os) { - *os << '('; - // We cannot use UniversalPrint(value.first, os) here, as T1 may be - // a reference type. The same for printing value.second. - UniversalPrinter::Print(value.first, os); - *os << ", "; - UniversalPrinter::Print(value.second, os); - *os << ')'; -} - -// Implements printing a non-reference type T by letting the compiler -// pick the right overload of PrintTo() for T. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180) - - // Note: we deliberately don't call this PrintTo(), as that name - // conflicts with ::testing::internal::PrintTo in the body of the - // function. - static void Print(const T& value, ::std::ostream* os) { - // By default, ::testing::internal::PrintTo() is used for printing - // the value. - // - // Thanks to Koenig look-up, if T is a class and has its own - // PrintTo() function defined in its namespace, that function will - // be visible here. Since it is more specific than the generic ones - // in ::testing::internal, it will be picked by the compiler in the - // following statement - exactly what we want. - PrintTo(value, os); - } - - GTEST_DISABLE_MSC_WARNINGS_POP_() -}; - -// UniversalPrintArray(begin, len, os) prints an array of 'len' -// elements, starting at address 'begin'. -template -void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { - if (len == 0) { - *os << "{}"; - } else { - *os << "{ "; - const size_t kThreshold = 18; - const size_t kChunkSize = 8; - // If the array has more than kThreshold elements, we'll have to - // omit some details by printing only the first and the last - // kChunkSize elements. - // TODO(wan@google.com): let the user control the threshold using a flag. - if (len <= kThreshold) { - PrintRawArrayTo(begin, len, os); - } else { - PrintRawArrayTo(begin, kChunkSize, os); - *os << ", ..., "; - PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); - } - *os << " }"; - } -} -// This overload prints a (const) char array compactly. -GTEST_API_ void UniversalPrintArray( - const char* begin, size_t len, ::std::ostream* os); - -// This overload prints a (const) wchar_t array compactly. -GTEST_API_ void UniversalPrintArray( - const wchar_t* begin, size_t len, ::std::ostream* os); - -// Implements printing an array type T[N]. -template -class UniversalPrinter { - public: - // Prints the given array, omitting some elements when there are too - // many. - static void Print(const T (&a)[N], ::std::ostream* os) { - UniversalPrintArray(a, N, os); - } -}; - -// Implements printing a reference type T&. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180) - - static void Print(const T& value, ::std::ostream* os) { - // Prints the address of the value. We use reinterpret_cast here - // as static_cast doesn't compile when T is a function type. - *os << "@" << reinterpret_cast(&value) << " "; - - // Then prints the value itself. - UniversalPrint(value, os); - } - - GTEST_DISABLE_MSC_WARNINGS_POP_() -}; - -// Prints a value tersely: for a reference type, the referenced value -// (but not the address) is printed; for a (const) char pointer, the -// NUL-terminated string (but not the pointer) is printed. - -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T (&value)[N], ::std::ostream* os) { - UniversalPrinter::Print(value, os); - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(const char* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(string(str), os); - } - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(char* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -#if GTEST_HAS_STD_WSTRING -template <> -class UniversalTersePrinter { - public: - static void Print(const wchar_t* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(::std::wstring(str), os); - } - } -}; -#endif - -template <> -class UniversalTersePrinter { - public: - static void Print(wchar_t* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -template -void UniversalTersePrint(const T& value, ::std::ostream* os) { - UniversalTersePrinter::Print(value, os); -} - -// Prints a value using the type inferred by the compiler. The -// difference between this and UniversalTersePrint() is that for a -// (const) char pointer, this prints both the pointer and the -// NUL-terminated string. -template -void UniversalPrint(const T& value, ::std::ostream* os) { - // A workarond for the bug in VC++ 7.1 that prevents us from instantiating - // UniversalPrinter with T directly. - typedef T T1; - UniversalPrinter::Print(value, os); -} - -typedef ::std::vector Strings; - -// TuplePolicy must provide: -// - tuple_size -// size of tuple TupleT. -// - get(const TupleT& t) -// static function extracting element I of tuple TupleT. -// - tuple_element::type -// type of element I of tuple TupleT. -template -struct TuplePolicy; - -#if GTEST_HAS_TR1_TUPLE -template -struct TuplePolicy { - typedef TupleT Tuple; - static const size_t tuple_size = ::std::tr1::tuple_size::value; - - template - struct tuple_element : ::std::tr1::tuple_element {}; - - template - static typename AddReference< - const typename ::std::tr1::tuple_element::type>::type get( - const Tuple& tuple) { - return ::std::tr1::get(tuple); - } -}; -template -const size_t TuplePolicy::tuple_size; -#endif // GTEST_HAS_TR1_TUPLE - -#if GTEST_HAS_STD_TUPLE_ -template -struct TuplePolicy< ::std::tuple > { - typedef ::std::tuple Tuple; - static const size_t tuple_size = ::std::tuple_size::value; - - template - struct tuple_element : ::std::tuple_element {}; - - template - static const typename ::std::tuple_element::type& get( - const Tuple& tuple) { - return ::std::get(tuple); - } -}; -template -const size_t TuplePolicy< ::std::tuple >::tuple_size; -#endif // GTEST_HAS_STD_TUPLE_ - -#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ -// This helper template allows PrintTo() for tuples and -// UniversalTersePrintTupleFieldsToStrings() to be defined by -// induction on the number of tuple fields. The idea is that -// TuplePrefixPrinter::PrintPrefixTo(t, os) prints the first N -// fields in tuple t, and can be defined in terms of -// TuplePrefixPrinter. -// -// The inductive case. -template -struct TuplePrefixPrinter { - // Prints the first N fields of a tuple. - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - TuplePrefixPrinter::PrintPrefixTo(t, os); - GTEST_INTENTIONAL_CONST_COND_PUSH_() - if (N > 1) { - GTEST_INTENTIONAL_CONST_COND_POP_() - *os << ", "; - } - UniversalPrinter< - typename TuplePolicy::template tuple_element::type> - ::Print(TuplePolicy::template get(t), os); - } - - // Tersely prints the first N fields of a tuple to a string vector, - // one element for each field. - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); - ::std::stringstream ss; - UniversalTersePrint(TuplePolicy::template get(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Base case. -template <> -struct TuplePrefixPrinter<0> { - template - static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} - - template - static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} -}; - -// Helper function for printing a tuple. -// Tuple must be either std::tr1::tuple or std::tuple type. -template -void PrintTupleTo(const Tuple& t, ::std::ostream* os) { - *os << "("; - TuplePrefixPrinter::tuple_size>::PrintPrefixTo(t, os); - *os << ")"; -} - -// Prints the fields of a tuple tersely to a string vector, one -// element for each field. See the comment before -// UniversalTersePrint() for how we define "tersely". -template -Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { - Strings result; - TuplePrefixPrinter::tuple_size>:: - TersePrintPrefixToStrings(value, &result); - return result; -} -#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ - -} // namespace internal - -template -::std::string PrintToString(const T& value) { - ::std::stringstream ss; - internal::UniversalTersePrinter::Print(value, &ss); - return ss.str(); -} - -} // namespace testing - -// Include any custom printer added by the local installation. -// We must include this header at the end to make sure it can use the -// declarations from this file. -#include "gtest/internal/custom/gtest-printers.h" - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-spi.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-spi.h deleted file mode 100644 index f63fa9a1b2a..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-spi.h +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Utilities for testing Google Test itself and code that uses Google Test -// (e.g. frameworks built on top of Google Test). - -#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ -#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ - -#include "gtest/gtest.h" - -namespace testing { - -// This helper class can be used to mock out Google Test failure reporting -// so that we can test Google Test or code that builds on Google Test. -// -// An object of this class appends a TestPartResult object to the -// TestPartResultArray object given in the constructor whenever a Google Test -// failure is reported. It can either intercept only failures that are -// generated in the same thread that created this object or it can intercept -// all generated failures. The scope of this mock object can be controlled with -// the second argument to the two arguments constructor. -class GTEST_API_ ScopedFakeTestPartResultReporter - : public TestPartResultReporterInterface { - public: - // The two possible mocking modes of this object. - enum InterceptMode { - INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. - INTERCEPT_ALL_THREADS // Intercepts all failures. - }; - - // The c'tor sets this object as the test part result reporter used - // by Google Test. The 'result' parameter specifies where to report the - // results. This reporter will only catch failures generated in the current - // thread. DEPRECATED - explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); - - // Same as above, but you can choose the interception scope of this object. - ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, - TestPartResultArray* result); - - // The d'tor restores the previous test part result reporter. - virtual ~ScopedFakeTestPartResultReporter(); - - // Appends the TestPartResult object to the TestPartResultArray - // received in the constructor. - // - // This method is from the TestPartResultReporterInterface - // interface. - virtual void ReportTestPartResult(const TestPartResult& result); - private: - void Init(); - - const InterceptMode intercept_mode_; - TestPartResultReporterInterface* old_reporter_; - TestPartResultArray* const result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); -}; - -namespace internal { - -// A helper class for implementing EXPECT_FATAL_FAILURE() and -// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given -// TestPartResultArray contains exactly one failure that has the given -// type and contains the given substring. If that's not the case, a -// non-fatal failure will be generated. -class GTEST_API_ SingleFailureChecker { - public: - // The constructor remembers the arguments. - SingleFailureChecker(const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr); - ~SingleFailureChecker(); - private: - const TestPartResultArray* const results_; - const TestPartResult::Type type_; - const string substr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); -}; - -} // namespace internal - -} // namespace testing - -// A set of macros for testing Google Test assertions or code that's expected -// to generate Google Test fatal failures. It verifies that the given -// statement will cause exactly one fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_FATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - 'statement' cannot reference local non-static variables or -// non-static members of the current object. -// - 'statement' cannot return a value. -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. The AcceptsMacroThatExpandsToUnprotectedComma test in -// gtest_unittest.cc will fail to compile if we do that. -#define EXPECT_FATAL_FAILURE(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ALL_THREADS, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -// A macro for testing Google Test assertions or code that's expected to -// generate Google Test non-fatal failures. It asserts that the given -// statement will cause exactly one non-fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// 'statement' is allowed to reference local variables and members of -// the current object. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. If we do that, the code won't compile when the user gives -// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that -// expands to code containing an unprotected comma. The -// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc -// catches that. -// -// For the same reason, we have to write -// if (::testing::internal::AlwaysTrue()) { statement; } -// instead of -// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) -// to avoid an MSVC warning on unreachable code. -#define EXPECT_NONFATAL_FAILURE(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \ - >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-test-part.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-test-part.h deleted file mode 100644 index 77eb844839d..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-test-part.h +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: mheule@google.com (Markus Heule) -// - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ - -#include -#include -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-string.h" - -namespace testing { - -// A copyable object representing the result of a test part (i.e. an -// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). -// -// Don't inherit from TestPartResult as its destructor is not virtual. -class GTEST_API_ TestPartResult { - public: - // The possible outcomes of a test part (i.e. an assertion or an - // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). - enum Type { - kSuccess, // Succeeded. - kNonFatalFailure, // Failed but the test can continue. - kFatalFailure // Failed and the test should be terminated. - }; - - // C'tor. TestPartResult does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestPartResult object. - TestPartResult(Type a_type, - const char* a_file_name, - int a_line_number, - const char* a_message) - : type_(a_type), - file_name_(a_file_name == NULL ? "" : a_file_name), - line_number_(a_line_number), - summary_(ExtractSummary(a_message)), - message_(a_message) { - } - - // Gets the outcome of the test part. - Type type() const { return type_; } - - // Gets the name of the source file where the test part took place, or - // NULL if it's unknown. - const char* file_name() const { - return file_name_.empty() ? NULL : file_name_.c_str(); - } - - // Gets the line in the source file where the test part took place, - // or -1 if it's unknown. - int line_number() const { return line_number_; } - - // Gets the summary of the failure message. - const char* summary() const { return summary_.c_str(); } - - // Gets the message associated with the test part. - const char* message() const { return message_.c_str(); } - - // Returns true iff the test part passed. - bool passed() const { return type_ == kSuccess; } - - // Returns true iff the test part failed. - bool failed() const { return type_ != kSuccess; } - - // Returns true iff the test part non-fatally failed. - bool nonfatally_failed() const { return type_ == kNonFatalFailure; } - - // Returns true iff the test part fatally failed. - bool fatally_failed() const { return type_ == kFatalFailure; } - - private: - Type type_; - - // Gets the summary of the failure message by omitting the stack - // trace in it. - static std::string ExtractSummary(const char* message); - - // The name of the source file where the test part took place, or - // "" if the source file is unknown. - std::string file_name_; - // The line in the source file where the test part took place, or -1 - // if the line number is unknown. - int line_number_; - std::string summary_; // The test failure summary. - std::string message_; // The test failure message. -}; - -// Prints a TestPartResult object. -std::ostream& operator<<(std::ostream& os, const TestPartResult& result); - -// An array of TestPartResult objects. -// -// Don't inherit from TestPartResultArray as its destructor is not -// virtual. -class GTEST_API_ TestPartResultArray { - public: - TestPartResultArray() {} - - // Appends the given TestPartResult to the array. - void Append(const TestPartResult& result); - - // Returns the TestPartResult at the given index (0-based). - const TestPartResult& GetTestPartResult(int index) const; - - // Returns the number of TestPartResult objects in the array. - int size() const; - - private: - std::vector array_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); -}; - -// This interface knows how to report a test part result. -class TestPartResultReporterInterface { - public: - virtual ~TestPartResultReporterInterface() {} - - virtual void ReportTestPartResult(const TestPartResult& result) = 0; -}; - -namespace internal { - -// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a -// statement generates new fatal failures. To do so it registers itself as the -// current test part result reporter. Besides checking if fatal failures were -// reported, it only delegates the reporting to the former result reporter. -// The original result reporter is restored in the destructor. -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -class GTEST_API_ HasNewFatalFailureHelper - : public TestPartResultReporterInterface { - public: - HasNewFatalFailureHelper(); - virtual ~HasNewFatalFailureHelper(); - virtual void ReportTestPartResult(const TestPartResult& result); - bool has_new_fatal_failure() const { return has_new_fatal_failure_; } - private: - bool has_new_fatal_failure_; - TestPartResultReporterInterface* original_reporter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); -}; - -} // namespace internal - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-typed-test.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-typed-test.h deleted file mode 100644 index 5f69d5678ea..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest-typed-test.h +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// This header implements typed tests and type-parameterized tests. - -// Typed (aka type-driven) tests repeat the same test for types in a -// list. You must know which types you want to test with when writing -// typed tests. Here's how you do it: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - public: - ... - typedef std::list List; - static T shared_; - T value_; -}; - -// Next, associate a list of types with the test case, which will be -// repeated for each type in the list. The typedef is necessary for -// the macro to parse correctly. -typedef testing::Types MyTypes; -TYPED_TEST_CASE(FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// TYPED_TEST_CASE(FooTest, int); - -// Then, use TYPED_TEST() instead of TEST_F() to define as many typed -// tests for this test case as you want. -TYPED_TEST(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - // Since we are inside a derived class template, C++ requires use to - // visit the members of FooTest via 'this'. - TypeParam n = this->value_; - - // To visit static members of the fixture, add the TestFixture:: - // prefix. - n += TestFixture::shared_; - - // To refer to typedefs in the fixture, add the "typename - // TestFixture::" prefix. - typename TestFixture::List values; - values.push_back(n); - ... -} - -TYPED_TEST(FooTest, HasPropertyA) { ... } - -#endif // 0 - -// Type-parameterized tests are abstract test patterns parameterized -// by a type. Compared with typed tests, type-parameterized tests -// allow you to define the test pattern without knowing what the type -// parameters are. The defined pattern can be instantiated with -// different types any number of times, in any number of translation -// units. -// -// If you are designing an interface or concept, you can define a -// suite of type-parameterized tests to verify properties that any -// valid implementation of the interface/concept should have. Then, -// each implementation can easily instantiate the test suite to verify -// that it conforms to the requirements, without having to write -// similar tests repeatedly. Here's an example: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - ... -}; - -// Next, declare that you will define a type-parameterized test case -// (the _P suffix is for "parameterized" or "pattern", whichever you -// prefer): -TYPED_TEST_CASE_P(FooTest); - -// Then, use TYPED_TEST_P() to define as many type-parameterized tests -// for this type-parameterized test case as you want. -TYPED_TEST_P(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - TypeParam n = 0; - ... -} - -TYPED_TEST_P(FooTest, HasPropertyA) { ... } - -// Now the tricky part: you need to register all test patterns before -// you can instantiate them. The first argument of the macro is the -// test case name; the rest are the names of the tests in this test -// case. -REGISTER_TYPED_TEST_CASE_P(FooTest, - DoesBlah, HasPropertyA); - -// Finally, you are free to instantiate the pattern with the types you -// want. If you put the above code in a header file, you can #include -// it in multiple C++ source files and instantiate it multiple times. -// -// To distinguish different instances of the pattern, the first -// argument to the INSTANTIATE_* macro is a prefix that will be added -// to the actual test case name. Remember to pick unique prefixes for -// different instances. -typedef testing::Types MyTypes; -INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); - -#endif // 0 - -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-type-util.h" - -// Implements typed tests. - -#if GTEST_HAS_TYPED_TEST - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the typedef for the type parameters of the -// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) - -# define TYPED_TEST(CaseName, TestName) \ - template \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - #CaseName, #TestName, 0); \ - template \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)::TestBody() - -#endif // GTEST_HAS_TYPED_TEST - -// Implements type-parameterized tests. - -#if GTEST_HAS_TYPED_TEST_P - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the namespace name that the type-parameterized tests for -// the given type-parameterized test case are defined in. The exact -// name of the namespace is subject to change without notice. -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the variable used to remember the names of -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. -// -// Expands to the name of the variable used to remember the names of -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ - -// The variables defined in the type-parameterized test macros are -// static as typically these macros are used in a .h file that can be -// #included in multiple translation units linked together. -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) - -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template \ - class TestName : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName::TestBody() - -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase::type>::Register(\ - #Prefix, \ - ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - >EST_TYPED_TEST_CASE_P_STATE_(CaseName), \ - #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) - -#endif // GTEST_HAS_TYPED_TEST_P - -#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest.h deleted file mode 100644 index f846c5bd669..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest.h +++ /dev/null @@ -1,2236 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for Google Test. It should be -// included by any test program that uses Google Test. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! -// -// Acknowledgment: Google Test borrowed the idea of automatic test -// registration from Barthelemy Dagenais' (barthelemy@prologique.com) -// easyUnit framework. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_H_ - -#include -#include -#include - -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-string.h" -#include "gtest/gtest-death-test.h" -#include "gtest/gtest-message.h" -#include "gtest/gtest-param-test.h" -#include "gtest/gtest-printers.h" -#include "gtest/gtest_prod.h" -#include "gtest/gtest-test-part.h" -#include "gtest/gtest-typed-test.h" - -// Depending on the platform, different string classes are available. -// On Linux, in addition to ::std::string, Google also makes use of -// class ::string, which has the same interface as ::std::string, but -// has a different implementation. -// -// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that -// ::string is available AND is a distinct type to ::std::string, or -// define it to 0 to indicate otherwise. -// -// If ::std::string and ::string are the same class on your platform -// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0. -// -// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined -// heuristically. - -namespace testing { - -// Declares the flags. - -// This flag temporary enables the disabled tests. -GTEST_DECLARE_bool_(also_run_disabled_tests); - -// This flag brings the debugger on an assertion failure. -GTEST_DECLARE_bool_(break_on_failure); - -// This flag controls whether Google Test catches all test-thrown exceptions -// and logs them as failures. -GTEST_DECLARE_bool_(catch_exceptions); - -// This flag enables using colors in terminal output. Available values are -// "yes" to enable colors, "no" (disable colors), or "auto" (the default) -// to let Google Test decide. -GTEST_DECLARE_string_(color); - -// This flag sets up the filter to select by name using a glob pattern -// the tests to run. If the filter is not given all tests are executed. -GTEST_DECLARE_string_(filter); - -// This flag causes the Google Test to list tests. None of the tests listed -// are actually run if the flag is provided. -GTEST_DECLARE_bool_(list_tests); - -// This flag controls whether Google Test emits a detailed XML report to a file -// in addition to its normal textual output. -GTEST_DECLARE_string_(output); - -// This flags control whether Google Test prints the elapsed time for each -// test. -GTEST_DECLARE_bool_(print_time); - -// This flag specifies the random number seed. -GTEST_DECLARE_int32_(random_seed); - -// This flag sets how many times the tests are repeated. The default value -// is 1. If the value is -1 the tests are repeating forever. -GTEST_DECLARE_int32_(repeat); - -// This flag controls whether Google Test includes Google Test internal -// stack frames in failure stack traces. -GTEST_DECLARE_bool_(show_internal_stack_frames); - -// When this flag is specified, tests' order is randomized on every iteration. -GTEST_DECLARE_bool_(shuffle); - -// This flag specifies the maximum number of stack frames to be -// printed in a failure message. -GTEST_DECLARE_int32_(stack_trace_depth); - -// When this flag is specified, a failed assertion will throw an -// exception if exceptions are enabled, or exit the program with a -// non-zero code otherwise. -GTEST_DECLARE_bool_(throw_on_failure); - -// When this flag is set with a "host:port" string, on supported -// platforms test results are streamed to the specified port on -// the specified host machine. -GTEST_DECLARE_string_(stream_result_to); - -// The upper limit for valid stack trace depths. -const int kMaxStackTraceDepth = 100; - -namespace internal { - -class AssertHelper; -class DefaultGlobalTestPartResultReporter; -class ExecDeathTest; -class NoExecDeathTest; -class FinalSuccessChecker; -class GTestFlagSaver; -class StreamingListenerTest; -class TestResultAccessor; -class TestEventListenersAccessor; -class TestEventRepeater; -class UnitTestRecordPropertyTestHelper; -class WindowsDeathTest; -class UnitTestImpl* GetUnitTestImpl(); -void ReportFailureInUnknownLocation(TestPartResult::Type result_type, - const std::string& message); - -} // namespace internal - -// The friend relationship of some of these classes is cyclic. -// If we don't forward declare them the compiler might confuse the classes -// in friendship clauses with same named classes on the scope. -class Test; -class TestCase; -class TestInfo; -class UnitTest; - -// A class for indicating whether an assertion was successful. When -// the assertion wasn't successful, the AssertionResult object -// remembers a non-empty message that describes how it failed. -// -// To create an instance of this class, use one of the factory functions -// (AssertionSuccess() and AssertionFailure()). -// -// This class is useful for two purposes: -// 1. Defining predicate functions to be used with Boolean test assertions -// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts -// 2. Defining predicate-format functions to be -// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). -// -// For example, if you define IsEven predicate: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) -// will print the message -// -// Value of: IsEven(Fib(5)) -// Actual: false (5 is odd) -// Expected: true -// -// instead of a more opaque -// -// Value of: IsEven(Fib(5)) -// Actual: false -// Expected: true -// -// in case IsEven is a simple Boolean predicate. -// -// If you expect your predicate to be reused and want to support informative -// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up -// about half as often as positive ones in our tests), supply messages for -// both success and failure cases: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess() << n << " is even"; -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print -// -// Value of: IsEven(Fib(6)) -// Actual: true (8 is even) -// Expected: false -// -// NB: Predicates that support negative Boolean assertions have reduced -// performance in positive ones so be careful not to use them in tests -// that have lots (tens of thousands) of positive Boolean assertions. -// -// To use this class with EXPECT_PRED_FORMAT assertions such as: -// -// // Verifies that Foo() returns an even number. -// EXPECT_PRED_FORMAT1(IsEven, Foo()); -// -// you need to define: -// -// testing::AssertionResult IsEven(const char* expr, int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() -// << "Expected: " << expr << " is even\n Actual: it's " << n; -// } -// -// If Foo() returns 5, you will see the following message: -// -// Expected: Foo() is even -// Actual: it's 5 -// -class GTEST_API_ AssertionResult { - public: - // Copy constructor. - // Used in EXPECT_TRUE/FALSE(assertion_result). - AssertionResult(const AssertionResult& other); - - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */) - - // Used in the EXPECT_TRUE/FALSE(bool_expression). - // - // T must be contextually convertible to bool. - // - // The second parameter prevents this overload from being considered if - // the argument is implicitly convertible to AssertionResult. In that case - // we want AssertionResult's copy constructor to be used. - template - explicit AssertionResult( - const T& success, - typename internal::EnableIf< - !internal::ImplicitlyConvertible::value>::type* - /*enabler*/ = NULL) - : success_(success) {} - - GTEST_DISABLE_MSC_WARNINGS_POP_() - - // Assignment operator. - AssertionResult& operator=(AssertionResult other) { - swap(other); - return *this; - } - - // Returns true iff the assertion succeeded. - operator bool() const { return success_; } // NOLINT - - // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. - AssertionResult operator!() const; - - // Returns the text streamed into this AssertionResult. Test assertions - // use it when they fail (i.e., the predicate's outcome doesn't match the - // assertion's expectation). When nothing has been streamed into the - // object, returns an empty string. - const char* message() const { - return message_.get() != NULL ? message_->c_str() : ""; - } - // TODO(vladl@google.com): Remove this after making sure no clients use it. - // Deprecated; please use message() instead. - const char* failure_message() const { return message(); } - - // Streams a custom failure message into this object. - template AssertionResult& operator<<(const T& value) { - AppendMessage(Message() << value); - return *this; - } - - // Allows streaming basic output manipulators such as endl or flush into - // this object. - AssertionResult& operator<<( - ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { - AppendMessage(Message() << basic_manipulator); - return *this; - } - - private: - // Appends the contents of message to message_. - void AppendMessage(const Message& a_message) { - if (message_.get() == NULL) - message_.reset(new ::std::string); - message_->append(a_message.GetString().c_str()); - } - - // Swap the contents of this AssertionResult with other. - void swap(AssertionResult& other); - - // Stores result of the assertion predicate. - bool success_; - // Stores the message describing the condition in case the expectation - // construct is not satisfied with the predicate's outcome. - // Referenced via a pointer to avoid taking too much stack frame space - // with test assertions. - internal::scoped_ptr< ::std::string> message_; -}; - -// Makes a successful assertion result. -GTEST_API_ AssertionResult AssertionSuccess(); - -// Makes a failed assertion result. -GTEST_API_ AssertionResult AssertionFailure(); - -// Makes a failed assertion result with the given failure message. -// Deprecated; use AssertionFailure() << msg. -GTEST_API_ AssertionResult AssertionFailure(const Message& msg); - -// The abstract class that all tests inherit from. -// -// In Google Test, a unit test program contains one or many TestCases, and -// each TestCase contains one or many Tests. -// -// When you define a test using the TEST macro, you don't need to -// explicitly derive from Test - the TEST macro automatically does -// this for you. -// -// The only time you derive from Test is when defining a test fixture -// to be used a TEST_F. For example: -// -// class FooTest : public testing::Test { -// protected: -// void SetUp() override { ... } -// void TearDown() override { ... } -// ... -// }; -// -// TEST_F(FooTest, Bar) { ... } -// TEST_F(FooTest, Baz) { ... } -// -// Test is not copyable. -class GTEST_API_ Test { - public: - friend class TestInfo; - - // Defines types for pointers to functions that set up and tear down - // a test case. - typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; - typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; - - // The d'tor is virtual as we intend to inherit from Test. - virtual ~Test(); - - // Sets up the stuff shared by all tests in this test case. - // - // Google Test will call Foo::SetUpTestCase() before running the first - // test in test case Foo. Hence a sub-class can define its own - // SetUpTestCase() method to shadow the one defined in the super - // class. - static void SetUpTestCase() {} - - // Tears down the stuff shared by all tests in this test case. - // - // Google Test will call Foo::TearDownTestCase() after running the last - // test in test case Foo. Hence a sub-class can define its own - // TearDownTestCase() method to shadow the one defined in the super - // class. - static void TearDownTestCase() {} - - // Returns true iff the current test has a fatal failure. - static bool HasFatalFailure(); - - // Returns true iff the current test has a non-fatal failure. - static bool HasNonfatalFailure(); - - // Returns true iff the current test has a (either fatal or - // non-fatal) failure. - static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } - - // Logs a property for the current test, test case, or for the entire - // invocation of the test program when used outside of the context of a - // test case. Only the last value for a given key is remembered. These - // are public static so they can be called from utility functions that are - // not members of the test fixture. Calls to RecordProperty made during - // lifespan of the test (from the moment its constructor starts to the - // moment its destructor finishes) will be output in XML as attributes of - // the element. Properties recorded from fixture's - // SetUpTestCase or TearDownTestCase are logged as attributes of the - // corresponding element. Calls to RecordProperty made in the - // global context (before or after invocation of RUN_ALL_TESTS and from - // SetUp/TearDown method of Environment objects registered with Google - // Test) will be output as attributes of the element. - static void RecordProperty(const std::string& key, const std::string& value); - static void RecordProperty(const std::string& key, int value); - - protected: - // Creates a Test object. - Test(); - - // Sets up the test fixture. - virtual void SetUp(); - - // Tears down the test fixture. - virtual void TearDown(); - - private: - // Returns true iff the current test has the same fixture class as - // the first test in the current test case. - static bool HasSameFixtureClass(); - - // Runs the test after the test fixture has been set up. - // - // A sub-class must implement this to define the test logic. - // - // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. - // Instead, use the TEST or TEST_F macro. - virtual void TestBody() = 0; - - // Sets up, executes, and tears down the test. - void Run(); - - // Deletes self. We deliberately pick an unusual name for this - // internal method to avoid clashing with names used in user TESTs. - void DeleteSelf_() { delete this; } - - const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_; - - // Often a user misspells SetUp() as Setup() and spends a long time - // wondering why it is never called by Google Test. The declaration of - // the following method is solely for catching such an error at - // compile time: - // - // - The return type is deliberately chosen to be not void, so it - // will be a conflict if void Setup() is declared in the user's - // test fixture. - // - // - This method is private, so it will be another compiler error - // if the method is called from the user's test fixture. - // - // DO NOT OVERRIDE THIS FUNCTION. - // - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } - - // We disallow copying Tests. - GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); -}; - -typedef internal::TimeInMillis TimeInMillis; - -// A copyable object representing a user specified test property which can be -// output as a key/value string pair. -// -// Don't inherit from TestProperty as its destructor is not virtual. -class TestProperty { - public: - // C'tor. TestProperty does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestProperty object. - TestProperty(const std::string& a_key, const std::string& a_value) : - key_(a_key), value_(a_value) { - } - - // Gets the user supplied key. - const char* key() const { - return key_.c_str(); - } - - // Gets the user supplied value. - const char* value() const { - return value_.c_str(); - } - - // Sets a new value, overriding the one supplied in the constructor. - void SetValue(const std::string& new_value) { - value_ = new_value; - } - - private: - // The key supplied by the user. - std::string key_; - // The value supplied by the user. - std::string value_; -}; - -// The result of a single Test. This includes a list of -// TestPartResults, a list of TestProperties, a count of how many -// death tests there are in the Test, and how much time it took to run -// the Test. -// -// TestResult is not copyable. -class GTEST_API_ TestResult { - public: - // Creates an empty TestResult. - TestResult(); - - // D'tor. Do not inherit from TestResult. - ~TestResult(); - - // Gets the number of all test parts. This is the sum of the number - // of successful test parts and the number of failed test parts. - int total_part_count() const; - - // Returns the number of the test properties. - int test_property_count() const; - - // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } - - // Returns true iff the test failed. - bool Failed() const; - - // Returns true iff the test fatally failed. - bool HasFatalFailure() const; - - // Returns true iff the test has a non-fatal failure. - bool HasNonfatalFailure() const; - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test part result among all the results. i can range - // from 0 to test_property_count() - 1. If i is not in that range, aborts - // the program. - const TestPartResult& GetTestPartResult(int i) const; - - // Returns the i-th test property. i can range from 0 to - // test_property_count() - 1. If i is not in that range, aborts the - // program. - const TestProperty& GetTestProperty(int i) const; - - private: - friend class TestInfo; - friend class TestCase; - friend class UnitTest; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::ExecDeathTest; - friend class internal::TestResultAccessor; - friend class internal::UnitTestImpl; - friend class internal::WindowsDeathTest; - - // Gets the vector of TestPartResults. - const std::vector& test_part_results() const { - return test_part_results_; - } - - // Gets the vector of TestProperties. - const std::vector& test_properties() const { - return test_properties_; - } - - // Sets the elapsed time. - void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } - - // Adds a test property to the list. The property is validated and may add - // a non-fatal failure if invalid (e.g., if it conflicts with reserved - // key names). If a property is already recorded for the same key, the - // value will be updated, rather than storing multiple values for the same - // key. xml_element specifies the element for which the property is being - // recorded and is used for validation. - void RecordProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a failure if the key is a reserved attribute of Google Test - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a test part result to the list. - void AddTestPartResult(const TestPartResult& test_part_result); - - // Returns the death test count. - int death_test_count() const { return death_test_count_; } - - // Increments the death test count, returning the new count. - int increment_death_test_count() { return ++death_test_count_; } - - // Clears the test part results. - void ClearTestPartResults(); - - // Clears the object. - void Clear(); - - // Protects mutable state of the property vector and of owned - // properties, whose values may be updated. - internal::Mutex test_properites_mutex_; - - // The vector of TestPartResults - std::vector test_part_results_; - // The vector of TestProperties - std::vector test_properties_; - // Running count of death tests. - int death_test_count_; - // The elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - - // We disallow copying TestResult. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); -}; // class TestResult - -// A TestInfo object stores the following information about a test: -// -// Test case name -// Test name -// Whether the test should be run -// A function pointer that creates the test object when invoked -// Test result -// -// The constructor of TestInfo registers itself with the UnitTest -// singleton such that the RUN_ALL_TESTS() macro knows which tests to -// run. -class GTEST_API_ TestInfo { - public: - // Destructs a TestInfo object. This function is not virtual, so - // don't inherit from TestInfo. - ~TestInfo(); - - // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } - - // Returns the test name. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a typed - // or a type-parameterized test. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns the text representation of the value parameter, or NULL if this - // is not a value-parameterized test. - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; - } - - // Returns the file name where this test is defined. - const char* file() const { return location_.file.c_str(); } - - // Returns the line where this test is defined. - int line() const { return location_.line; } - - // Returns true if this test should run, that is if the test is not - // disabled (or it is disabled but the also_run_disabled_tests flag has - // been specified) and its full name matches the user-specified filter. - // - // Google Test allows the user to filter the tests by their full names. - // The full name of a test Bar in test case Foo is defined as - // "Foo.Bar". Only the tests that match the filter will run. - // - // A filter is a colon-separated list of glob (not regex) patterns, - // optionally followed by a '-' and a colon-separated list of - // negative patterns (tests to exclude). A test is run if it - // matches one of the positive patterns and does not match any of - // the negative patterns. - // - // For example, *A*:Foo.* is a filter that matches any string that - // contains the character 'A' or starts with "Foo.". - bool should_run() const { return should_run_; } - - // Returns true iff this test will appear in the XML report. - bool is_reportable() const { - // For now, the XML report includes all tests matching the filter. - // In the future, we may trim tests that are excluded because of - // sharding. - return matches_filter_; - } - - // Returns the result of the test. - const TestResult* result() const { return &result_; } - - private: -#if GTEST_HAS_DEATH_TEST - friend class internal::DefaultDeathTestFactory; -#endif // GTEST_HAS_DEATH_TEST - friend class Test; - friend class TestCase; - friend class internal::UnitTestImpl; - friend class internal::StreamingListenerTest; - friend TestInfo* internal::MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - internal::CodeLocation code_location, - internal::TypeId fixture_class_id, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - internal::TestFactoryBase* factory); - - // Constructs a TestInfo object. The newly constructed instance assumes - // ownership of the factory object. - TestInfo(const std::string& test_case_name, - const std::string& name, - const char* a_type_param, // NULL if not a type-parameterized test - const char* a_value_param, // NULL if not a value-parameterized test - internal::CodeLocation a_code_location, - internal::TypeId fixture_class_id, - internal::TestFactoryBase* factory); - - // Increments the number of death tests encountered in this test so - // far. - int increment_death_test_count() { - return result_.increment_death_test_count(); - } - - // Creates the test object, runs it, records its result, and then - // deletes it. - void Run(); - - static void ClearTestResult(TestInfo* test_info) { - test_info->result_.Clear(); - } - - // These fields are immutable properties of the test. - const std::string test_case_name_; // Test case name - const std::string name_; // Test name - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // Text representation of the value parameter, or NULL if this is not a - // value-parameterized test. - const internal::scoped_ptr value_param_; - internal::CodeLocation location_; - const internal::TypeId fixture_class_id_; // ID of the test fixture class - bool should_run_; // True iff this test should run - bool is_disabled_; // True iff this test is disabled - bool matches_filter_; // True if this test matches the - // user-specified filter. - internal::TestFactoryBase* const factory_; // The factory that creates - // the test object - - // This field is mutable and needs to be reset before running the - // test for the second time. - TestResult result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); -}; - -// A test case, which consists of a vector of TestInfos. -// -// TestCase is not copyable. -class GTEST_API_ TestCase { - public: - // Creates a TestCase with the given name. - // - // TestCase does NOT have a default constructor. Always use this - // constructor to create a TestCase object. - // - // Arguments: - // - // name: name of the test case - // a_type_param: the name of the test's type parameter, or NULL if - // this is not a type-parameterized test. - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase(const char* name, const char* a_type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); - - // Destructor of TestCase. - virtual ~TestCase(); - - // Gets the name of the TestCase. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a - // type-parameterized test case. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns true if any test in this test case should run. - bool should_run() const { return should_run_; } - - // Gets the number of successful tests in this test case. - int successful_test_count() const; - - // Gets the number of failed tests in this test case. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests in this test case. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Get the number of tests in this test case that should run. - int test_to_run_count() const; - - // Gets the number of all tests in this test case. - int total_test_count() const; - - // Returns true iff the test case passed. - bool Passed() const { return !Failed(); } - - // Returns true iff the test case failed. - bool Failed() const { return failed_test_count() > 0; } - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - const TestInfo* GetTestInfo(int i) const; - - // Returns the TestResult that holds test properties recorded during - // execution of SetUpTestCase and TearDownTestCase. - const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; } - - private: - friend class Test; - friend class internal::UnitTestImpl; - - // Gets the (mutable) vector of TestInfos in this TestCase. - std::vector& test_info_list() { return test_info_list_; } - - // Gets the (immutable) vector of TestInfos in this TestCase. - const std::vector& test_info_list() const { - return test_info_list_; - } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - TestInfo* GetMutableTestInfo(int i); - - // Sets the should_run member. - void set_should_run(bool should) { should_run_ = should; } - - // Adds a TestInfo to this test case. Will delete the TestInfo upon - // destruction of the TestCase object. - void AddTestInfo(TestInfo * test_info); - - // Clears the results of all tests in this test case. - void ClearResult(); - - // Clears the results of all tests in the given test case. - static void ClearTestCaseResult(TestCase* test_case) { - test_case->ClearResult(); - } - - // Runs every test in this TestCase. - void Run(); - - // Runs SetUpTestCase() for this TestCase. This wrapper is needed - // for catching exceptions thrown from SetUpTestCase(). - void RunSetUpTestCase() { (*set_up_tc_)(); } - - // Runs TearDownTestCase() for this TestCase. This wrapper is - // needed for catching exceptions thrown from TearDownTestCase(). - void RunTearDownTestCase() { (*tear_down_tc_)(); } - - // Returns true iff test passed. - static bool TestPassed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Passed(); - } - - // Returns true iff test failed. - static bool TestFailed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Failed(); - } - - // Returns true iff the test is disabled and will be reported in the XML - // report. - static bool TestReportableDisabled(const TestInfo* test_info) { - return test_info->is_reportable() && test_info->is_disabled_; - } - - // Returns true iff test is disabled. - static bool TestDisabled(const TestInfo* test_info) { - return test_info->is_disabled_; - } - - // Returns true iff this test will appear in the XML report. - static bool TestReportable(const TestInfo* test_info) { - return test_info->is_reportable(); - } - - // Returns true if the given test should run. - static bool ShouldRunTest(const TestInfo* test_info) { - return test_info->should_run(); - } - - // Shuffles the tests in this test case. - void ShuffleTests(internal::Random* random); - - // Restores the test order to before the first shuffle. - void UnshuffleTests(); - - // Name of the test case. - std::string name_; - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // The vector of TestInfos in their original order. It owns the - // elements in the vector. - std::vector test_info_list_; - // Provides a level of indirection for the test list to allow easy - // shuffling and restoring the test order. The i-th element in this - // vector is the index of the i-th test in the shuffled test list. - std::vector test_indices_; - // Pointer to the function that sets up the test case. - Test::SetUpTestCaseFunc set_up_tc_; - // Pointer to the function that tears down the test case. - Test::TearDownTestCaseFunc tear_down_tc_; - // True iff any test in this test case should run. - bool should_run_; - // Elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - // Holds test properties recorded during execution of SetUpTestCase and - // TearDownTestCase. - TestResult ad_hoc_test_result_; - - // We disallow copying TestCases. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); -}; - -// An Environment object is capable of setting up and tearing down an -// environment. You should subclass this to define your own -// environment(s). -// -// An Environment object does the set-up and tear-down in virtual -// methods SetUp() and TearDown() instead of the constructor and the -// destructor, as: -// -// 1. You cannot safely throw from a destructor. This is a problem -// as in some cases Google Test is used where exceptions are enabled, and -// we may want to implement ASSERT_* using exceptions where they are -// available. -// 2. You cannot use ASSERT_* directly in a constructor or -// destructor. -class Environment { - public: - // The d'tor is virtual as we need to subclass Environment. - virtual ~Environment() {} - - // Override this to define how to set up the environment. - virtual void SetUp() {} - - // Override this to define how to tear down the environment. - virtual void TearDown() {} - private: - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } -}; - -// The interface for tracing execution of tests. The methods are organized in -// the order the corresponding events are fired. -class TestEventListener { - public: - virtual ~TestEventListener() {} - - // Fired before any test activity starts. - virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; - - // Fired before each iteration of tests starts. There may be more than - // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration - // index, starting from 0. - virtual void OnTestIterationStart(const UnitTest& unit_test, - int iteration) = 0; - - // Fired before environment set-up for each iteration of tests starts. - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; - - // Fired after environment set-up for each iteration of tests ends. - virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; - - // Fired before the test case starts. - virtual void OnTestCaseStart(const TestCase& test_case) = 0; - - // Fired before the test starts. - virtual void OnTestStart(const TestInfo& test_info) = 0; - - // Fired after a failed assertion or a SUCCEED() invocation. - virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; - - // Fired after the test ends. - virtual void OnTestEnd(const TestInfo& test_info) = 0; - - // Fired after the test case ends. - virtual void OnTestCaseEnd(const TestCase& test_case) = 0; - - // Fired before environment tear-down for each iteration of tests starts. - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; - - // Fired after environment tear-down for each iteration of tests ends. - virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; - - // Fired after each iteration of tests finishes. - virtual void OnTestIterationEnd(const UnitTest& unit_test, - int iteration) = 0; - - // Fired after all test activities have ended. - virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; -}; - -// The convenience class for users who need to override just one or two -// methods and are not concerned that a possible change to a signature of -// the methods they override will not be caught during the build. For -// comments about each method please see the definition of TestEventListener -// above. -class EmptyTestEventListener : public TestEventListener { - public: - virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} -}; - -// TestEventListeners lets users add listeners to track events in Google Test. -class GTEST_API_ TestEventListeners { - public: - TestEventListeners(); - ~TestEventListeners(); - - // Appends an event listener to the end of the list. Google Test assumes - // the ownership of the listener (i.e. it will delete the listener when - // the test program finishes). - void Append(TestEventListener* listener); - - // Removes the given event listener from the list and returns it. It then - // becomes the caller's responsibility to delete the listener. Returns - // NULL if the listener is not found in the list. - TestEventListener* Release(TestEventListener* listener); - - // Returns the standard listener responsible for the default console - // output. Can be removed from the listeners list to shut down default - // console output. Note that removing this object from the listener list - // with Release transfers its ownership to the caller and makes this - // function return NULL the next time. - TestEventListener* default_result_printer() const { - return default_result_printer_; - } - - // Returns the standard listener responsible for the default XML output - // controlled by the --gtest_output=xml flag. Can be removed from the - // listeners list by users who want to shut down the default XML output - // controlled by this flag and substitute it with custom one. Note that - // removing this object from the listener list with Release transfers its - // ownership to the caller and makes this function return NULL the next - // time. - TestEventListener* default_xml_generator() const { - return default_xml_generator_; - } - - private: - friend class TestCase; - friend class TestInfo; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::NoExecDeathTest; - friend class internal::TestEventListenersAccessor; - friend class internal::UnitTestImpl; - - // Returns repeater that broadcasts the TestEventListener events to all - // subscribers. - TestEventListener* repeater(); - - // Sets the default_result_printer attribute to the provided listener. - // The listener is also added to the listener list and previous - // default_result_printer is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultResultPrinter(TestEventListener* listener); - - // Sets the default_xml_generator attribute to the provided listener. The - // listener is also added to the listener list and previous - // default_xml_generator is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultXmlGenerator(TestEventListener* listener); - - // Controls whether events will be forwarded by the repeater to the - // listeners in the list. - bool EventForwardingEnabled() const; - void SuppressEventForwarding(); - - // The actual list of listeners. - internal::TestEventRepeater* repeater_; - // Listener responsible for the standard result output. - TestEventListener* default_result_printer_; - // Listener responsible for the creation of the XML output file. - TestEventListener* default_xml_generator_; - - // We disallow copying TestEventListeners. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); -}; - -// A UnitTest consists of a vector of TestCases. -// -// This is a singleton class. The only instance of UnitTest is -// created when UnitTest::GetInstance() is first called. This -// instance is never deleted. -// -// UnitTest is not copyable. -// -// This class is thread-safe as long as the methods are called -// according to their specification. -class GTEST_API_ UnitTest { - public: - // Gets the singleton UnitTest object. The first time this method - // is called, a UnitTest object is constructed and returned. - // Consecutive calls will return the same object. - static UnitTest* GetInstance(); - - // Runs all tests in this UnitTest object and prints the result. - // Returns 0 if successful, or 1 otherwise. - // - // This method can only be called from the main thread. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - int Run() GTEST_MUST_USE_RESULT_; - - // Returns the working directory when the first TEST() or TEST_F() - // was executed. The UnitTest object owns the string. - const char* original_working_dir() const; - - // Returns the TestCase object for the test that's currently running, - // or NULL if no test is running. - const TestCase* current_test_case() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the TestInfo object for the test that's currently running, - // or NULL if no test is running. - const TestInfo* current_test_info() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the random seed used at the start of the current test run. - int random_seed() const; - -#if GTEST_HAS_PARAM_TEST - // Returns the ParameterizedTestCaseRegistry object used to keep track of - // value-parameterized tests and instantiate and register them. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - internal::ParameterizedTestCaseRegistry& parameterized_test_registry() - GTEST_LOCK_EXCLUDED_(mutex_); -#endif // GTEST_HAS_PARAM_TEST - - // Gets the number of successful test cases. - int successful_test_case_count() const; - - // Gets the number of failed test cases. - int failed_test_case_count() const; - - // Gets the number of all test cases. - int total_test_case_count() const; - - // Gets the number of all test cases that contain at least one test - // that should run. - int test_case_to_run_count() const; - - // Gets the number of successful tests. - int successful_test_count() const; - - // Gets the number of failed tests. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Gets the number of all tests. - int total_test_count() const; - - // Gets the number of tests that should run. - int test_to_run_count() const; - - // Gets the time of the test program start, in ms from the start of the - // UNIX epoch. - TimeInMillis start_timestamp() const; - - // Gets the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const; - - // Returns true iff the unit test passed (i.e. all test cases passed). - bool Passed() const; - - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). - bool Failed() const; - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const; - - // Returns the TestResult containing information on test failures and - // properties logged outside of individual test cases. - const TestResult& ad_hoc_test_result() const; - - // Returns the list of event listeners that can be used to track events - // inside Google Test. - TestEventListeners& listeners(); - - private: - // Registers and returns a global test environment. When a test - // program is run, all global test environments will be set-up in - // the order they were registered. After all tests in the program - // have finished, all global test environments will be torn-down in - // the *reverse* order they were registered. - // - // The UnitTest object takes ownership of the given environment. - // - // This method can only be called from the main thread. - Environment* AddEnvironment(Environment* env); - - // Adds a TestPartResult to the current TestResult object. All - // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) - // eventually call this to report their results. The user code - // should use the assertion macros instead of calling this directly. - void AddTestPartResult(TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Adds a TestProperty to the current TestResult object when invoked from - // inside a test, to current TestCase's ad_hoc_test_result_ when invoked - // from SetUpTestCase or TearDownTestCase, or to the global property set - // when invoked elsewhere. If the result already contains a property with - // the same key, the value will be updated. - void RecordProperty(const std::string& key, const std::string& value); - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i); - - // Accessors for the implementation object. - internal::UnitTestImpl* impl() { return impl_; } - const internal::UnitTestImpl* impl() const { return impl_; } - - // These classes and funcions are friends as they need to access private - // members of UnitTest. - friend class Test; - friend class internal::AssertHelper; - friend class internal::ScopedTrace; - friend class internal::StreamingListenerTest; - friend class internal::UnitTestRecordPropertyTestHelper; - friend Environment* AddGlobalTestEnvironment(Environment* env); - friend internal::UnitTestImpl* internal::GetUnitTestImpl(); - friend void internal::ReportFailureInUnknownLocation( - TestPartResult::Type result_type, - const std::string& message); - - // Creates an empty UnitTest. - UnitTest(); - - // D'tor - virtual ~UnitTest(); - - // Pushes a trace defined by SCOPED_TRACE() on to the per-thread - // Google Test trace stack. - void PushGTestTrace(const internal::TraceInfo& trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Pops a trace from the per-thread Google Test trace stack. - void PopGTestTrace() - GTEST_LOCK_EXCLUDED_(mutex_); - - // Protects mutable state in *impl_. This is mutable as some const - // methods need to lock it too. - mutable internal::Mutex mutex_; - - // Opaque implementation object. This field is never changed once - // the object is constructed. We don't mark it as const here, as - // doing so will cause a warning in the constructor of UnitTest. - // Mutable state in *impl_ is protected by mutex_. - internal::UnitTestImpl* impl_; - - // We disallow copying UnitTest. - GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); -}; - -// A convenient wrapper for adding an environment for the test -// program. -// -// You should call this before RUN_ALL_TESTS() is called, probably in -// main(). If you use gtest_main, you need to call this before main() -// starts for it to take effect. For example, you can define a global -// variable like this: -// -// testing::Environment* const foo_env = -// testing::AddGlobalTestEnvironment(new FooEnvironment); -// -// However, we strongly recommend you to write your own main() and -// call AddGlobalTestEnvironment() there, as relying on initialization -// of global variables makes the code harder to read and may cause -// problems when you register multiple environments from different -// translation units and the environments have dependencies among them -// (remember that the compiler doesn't guarantee the order in which -// global variables from different translation units are initialized). -inline Environment* AddGlobalTestEnvironment(Environment* env) { - return UnitTest::GetInstance()->AddEnvironment(env); -} - -// Initializes Google Test. This must be called before calling -// RUN_ALL_TESTS(). In particular, it parses a command line for the -// flags that Google Test recognizes. Whenever a Google Test flag is -// seen, it is removed from argv, and *argc is decremented. -// -// No value is returned. Instead, the Google Test flag variables are -// updated. -// -// Calling the function for the second time has no user-visible effect. -GTEST_API_ void InitGoogleTest(int* argc, char** argv); - -// This overloaded version can be used in Windows programs compiled in -// UNICODE mode. -GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); - -namespace internal { - -// Separate the error generating code from the code path to reduce the stack -// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers -// when calling EXPECT_* in a tight loop. -template -AssertionResult CmpHelperEQFailure(const char* lhs_expression, - const char* rhs_expression, - const T1& lhs, const T2& rhs) { - return EqFailure(lhs_expression, - rhs_expression, - FormatForComparisonFailureMessage(lhs, rhs), - FormatForComparisonFailureMessage(rhs, lhs), - false); -} - -// The helper function for {ASSERT|EXPECT}_EQ. -template -AssertionResult CmpHelperEQ(const char* lhs_expression, - const char* rhs_expression, - const T1& lhs, - const T2& rhs) { -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */) - if (lhs == rhs) { - return AssertionSuccess(); - } -GTEST_DISABLE_MSC_WARNINGS_POP_() - - return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs); -} - -// With this overloaded version, we allow anonymous enums to be used -// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums -// can be implicitly cast to BiggestInt. -GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression, - const char* rhs_expression, - BiggestInt lhs, - BiggestInt rhs); - -// The helper class for {ASSERT|EXPECT}_EQ. The template argument -// lhs_is_null_literal is true iff the first argument to ASSERT_EQ() -// is a null pointer literal. The following default implementation is -// for lhs_is_null_literal being false. -template -class EqHelper { - public: - // This templatized version is for the general case. - template - static AssertionResult Compare(const char* lhs_expression, - const char* rhs_expression, - const T1& lhs, - const T2& rhs) { - return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); - } - - // With this overloaded version, we allow anonymous enums to be used - // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous - // enums can be implicitly cast to BiggestInt. - // - // Even though its body looks the same as the above version, we - // cannot merge the two, as it will make anonymous enums unhappy. - static AssertionResult Compare(const char* lhs_expression, - const char* rhs_expression, - BiggestInt lhs, - BiggestInt rhs) { - return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); - } -}; - -// This specialization is used when the first argument to ASSERT_EQ() -// is a null pointer literal, like NULL, false, or 0. -template <> -class EqHelper { - public: - // We define two overloaded versions of Compare(). The first - // version will be picked when the second argument to ASSERT_EQ() is - // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or - // EXPECT_EQ(false, a_bool). - template - static AssertionResult Compare( - const char* lhs_expression, - const char* rhs_expression, - const T1& lhs, - const T2& rhs, - // The following line prevents this overload from being considered if T2 - // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) - // expands to Compare("", "", NULL, my_ptr), which requires a conversion - // to match the Secret* in the other overload, which would otherwise make - // this template match better. - typename EnableIf::value>::type* = 0) { - return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); - } - - // This version will be picked when the second argument to ASSERT_EQ() is a - // pointer, e.g. ASSERT_EQ(NULL, a_pointer). - template - static AssertionResult Compare( - const char* lhs_expression, - const char* rhs_expression, - // We used to have a second template parameter instead of Secret*. That - // template parameter would deduce to 'long', making this a better match - // than the first overload even without the first overload's EnableIf. - // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to - // non-pointer argument" (even a deduced integral argument), so the old - // implementation caused warnings in user code. - Secret* /* lhs (NULL) */, - T* rhs) { - // We already know that 'lhs' is a null pointer. - return CmpHelperEQ(lhs_expression, rhs_expression, - static_cast(NULL), rhs); - } -}; - -// Separate the error generating code from the code path to reduce the stack -// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers -// when calling EXPECT_OP in a tight loop. -template -AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2, - const T1& val1, const T2& val2, - const char* op) { - return AssertionFailure() - << "Expected: (" << expr1 << ") " << op << " (" << expr2 - << "), actual: " << FormatForComparisonFailureMessage(val1, val2) - << " vs " << FormatForComparisonFailureMessage(val2, val1); -} - -// A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste -// of similar code. -// -// For each templatized helper function, we also define an overloaded -// version for BiggestInt in order to reduce code bloat and allow -// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled -// with gcc 4. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template \ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) - -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// Implements the helper function for {ASSERT|EXPECT}_NE -GTEST_IMPL_CMP_HELPER_(NE, !=); -// Implements the helper function for {ASSERT|EXPECT}_LE -GTEST_IMPL_CMP_HELPER_(LE, <=); -// Implements the helper function for {ASSERT|EXPECT}_LT -GTEST_IMPL_CMP_HELPER_(LT, <); -// Implements the helper function for {ASSERT|EXPECT}_GE -GTEST_IMPL_CMP_HELPER_(GE, >=); -// Implements the helper function for {ASSERT|EXPECT}_GT -GTEST_IMPL_CMP_HELPER_(GT, >); - -#undef GTEST_IMPL_CMP_HELPER_ - -// The helper function for {ASSERT|EXPECT}_STREQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRCASEEQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRNE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRCASENE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - - -// Helper function for *_STREQ on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); - -// Helper function for *_STRNE on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); - -} // namespace internal - -// IsSubstring() and IsNotSubstring() are intended to be used as the -// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by -// themselves. They check whether needle is a substring of haystack -// (NULL is considered a substring of itself only), and return an -// appropriate error message when they fail. -// -// The {needle,haystack}_expr arguments are the stringified -// expressions that generated the two real arguments. -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -#endif // GTEST_HAS_STD_WSTRING - -namespace internal { - -// Helper template function for comparing floating-points. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, - const char* rhs_expression, - RawType lhs_value, - RawType rhs_value) { - const FloatingPoint lhs(lhs_value), rhs(rhs_value); - - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - ::std::stringstream lhs_ss; - lhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << lhs_value; - - ::std::stringstream rhs_ss; - rhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << rhs_value; - - return EqFailure(lhs_expression, - rhs_expression, - StringStreamToString(&lhs_ss), - StringStreamToString(&rhs_ss), - false); -} - -// Helper function for implementing ASSERT_NEAR. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, - const char* expr2, - const char* abs_error_expr, - double val1, - double val2, - double abs_error); - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// A class that enables one to stream messages to assertion macros -class GTEST_API_ AssertHelper { - public: - // Constructor. - AssertHelper(TestPartResult::Type type, - const char* file, - int line, - const char* message); - ~AssertHelper(); - - // Message assignment is a semantic trick to enable assertion - // streaming; see the GTEST_MESSAGE_ macro below. - void operator=(const Message& message) const; - - private: - // We put our data in a struct so that the size of the AssertHelper class can - // be as small as possible. This is important because gcc is incapable of - // re-using stack space even for temporary variables, so every EXPECT_EQ - // reserves stack space for another AssertHelper. - struct AssertHelperData { - AssertHelperData(TestPartResult::Type t, - const char* srcfile, - int line_num, - const char* msg) - : type(t), file(srcfile), line(line_num), message(msg) { } - - TestPartResult::Type const type; - const char* const file; - int const line; - std::string const message; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); - }; - - AssertHelperData* const data_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); -}; - -} // namespace internal - -#if GTEST_HAS_PARAM_TEST -// The pure interface class that all value-parameterized tests inherit from. -// A value-parameterized class must inherit from both ::testing::Test and -// ::testing::WithParamInterface. In most cases that just means inheriting -// from ::testing::TestWithParam, but more complicated test hierarchies -// may need to inherit from Test and WithParamInterface at different levels. -// -// This interface has support for accessing the test parameter value via -// the GetParam() method. -// -// Use it with one of the parameter generator defining functions, like Range(), -// Values(), ValuesIn(), Bool(), and Combine(). -// -// class FooTest : public ::testing::TestWithParam { -// protected: -// FooTest() { -// // Can use GetParam() here. -// } -// virtual ~FooTest() { -// // Can use GetParam() here. -// } -// virtual void SetUp() { -// // Can use GetParam() here. -// } -// virtual void TearDown { -// // Can use GetParam() here. -// } -// }; -// TEST_P(FooTest, DoesBar) { -// // Can use GetParam() method here. -// Foo foo; -// ASSERT_TRUE(foo.DoesBar(GetParam())); -// } -// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); - -template -class WithParamInterface { - public: - typedef T ParamType; - virtual ~WithParamInterface() {} - - // The current parameter value. Is also available in the test fixture's - // constructor. This member function is non-static, even though it only - // references static data, to reduce the opportunity for incorrect uses - // like writing 'WithParamInterface::GetParam()' for a test that - // uses a fixture whose parameter type is int. - const ParamType& GetParam() const { - GTEST_CHECK_(parameter_ != NULL) - << "GetParam() can only be called inside a value-parameterized test " - << "-- did you intend to write TEST_P instead of TEST_F?"; - return *parameter_; - } - - private: - // Sets parameter value. The caller is responsible for making sure the value - // remains alive and unchanged throughout the current test. - static void SetParam(const ParamType* parameter) { - parameter_ = parameter; - } - - // Static value used for accessing parameter during a test lifetime. - static const ParamType* parameter_; - - // TestClass must be a subclass of WithParamInterface and Test. - template friend class internal::ParameterizedTestFactory; -}; - -template -const T* WithParamInterface::parameter_ = NULL; - -// Most value-parameterized classes can ignore the existence of -// WithParamInterface, and can just inherit from ::testing::TestWithParam. - -template -class TestWithParam : public Test, public WithParamInterface { -}; - -#endif // GTEST_HAS_PARAM_TEST - -// Macros for indicating success/failure in test code. - -// ADD_FAILURE unconditionally adds a failure to the current test. -// SUCCEED generates a success - it doesn't automatically make the -// current test successful, as a test is only successful when it has -// no failure. -// -// EXPECT_* verifies that a certain condition is satisfied. If not, -// it behaves like ADD_FAILURE. In particular: -// -// EXPECT_TRUE verifies that a Boolean condition is true. -// EXPECT_FALSE verifies that a Boolean condition is false. -// -// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except -// that they will also abort the current function on failure. People -// usually want the fail-fast behavior of FAIL and ASSERT_*, but those -// writing data-driven tests often find themselves using ADD_FAILURE -// and EXPECT_* more. - -// Generates a nonfatal failure with a generic message. -#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") - -// Generates a nonfatal failure at the given source file location with -// a generic message. -#define ADD_FAILURE_AT(file, line) \ - GTEST_MESSAGE_AT_(file, line, "Failed", \ - ::testing::TestPartResult::kNonFatalFailure) - -// Generates a fatal failure with a generic message. -#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") - -// Define this macro to 1 to omit the definition of FAIL(), which is a -// generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_FAIL -# define FAIL() GTEST_FAIL() -#endif - -// Generates a success with a generic message. -#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") - -// Define this macro to 1 to omit the definition of SUCCEED(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_SUCCEED -# define SUCCEED() GTEST_SUCCEED() -#endif - -// Macros for testing exceptions. -// -// * {ASSERT|EXPECT}_THROW(statement, expected_exception): -// Tests that the statement throws the expected exception. -// * {ASSERT|EXPECT}_NO_THROW(statement): -// Tests that the statement doesn't throw any exception. -// * {ASSERT|EXPECT}_ANY_THROW(statement): -// Tests that the statement throws an exception. - -#define EXPECT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) -#define EXPECT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define EXPECT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define ASSERT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) -#define ASSERT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) -#define ASSERT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) - -// Boolean assertions. Condition can be either a Boolean expression or an -// AssertionResult. For more information on how to use AssertionResult with -// these macros see comments on that class. -#define EXPECT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \ - GTEST_NONFATAL_FAILURE_) -#define EXPECT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_NONFATAL_FAILURE_) -#define ASSERT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \ - GTEST_FATAL_FAILURE_) -#define ASSERT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_FATAL_FAILURE_) - -// Includes the auto-generated header that implements a family of -// generic predicate assertion macros. -#include "gtest/gtest_pred_impl.h" - -// Macros for testing equalities and inequalities. -// -// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2 -// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 -// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 -// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 -// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 -// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 -// -// When they are not, Google Test prints both the tested expressions and -// their actual values. The values must be compatible built-in types, -// or you will get a compiler error. By "compatible" we mean that the -// values can be compared by the respective operator. -// -// Note: -// -// 1. It is possible to make a user-defined type work with -// {ASSERT|EXPECT}_??(), but that requires overloading the -// comparison operators and is thus discouraged by the Google C++ -// Usage Guide. Therefore, you are advised to use the -// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are -// equal. -// -// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on -// pointers (in particular, C strings). Therefore, if you use it -// with two C strings, you are testing how their locations in memory -// are related, not how their content is related. To compare two C -// strings by content, use {ASSERT|EXPECT}_STR*(). -// -// 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to -// {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you -// what the actual value is when it fails, and similarly for the -// other comparisons. -// -// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() -// evaluate their arguments, which is undefined. -// -// 5. These macros evaluate their arguments exactly once. -// -// Examples: -// -// EXPECT_NE(5, Foo()); -// EXPECT_EQ(NULL, a_pointer); -// ASSERT_LT(i, array_size); -// ASSERT_GT(records.size(), 0) << "There is no record left."; - -#define EXPECT_EQ(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - val1, val2) -#define EXPECT_NE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) -#define EXPECT_LE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define EXPECT_LT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define EXPECT_GE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define EXPECT_GT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -#define GTEST_ASSERT_EQ(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - val1, val2) -#define GTEST_ASSERT_NE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) -#define GTEST_ASSERT_LE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define GTEST_ASSERT_LT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define GTEST_ASSERT_GE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define GTEST_ASSERT_GT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of -// ASSERT_XY(), which clashes with some users' own code. - -#if !GTEST_DONT_DEFINE_ASSERT_EQ -# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_NE -# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LE -# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LT -# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GE -# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GT -# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) -#endif - -// C-string Comparisons. All tests treat NULL and any non-NULL string -// as different. Two NULLs are equal. -// -// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 -// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 -// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case -// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case -// -// For wide or narrow string objects, you can use the -// {ASSERT|EXPECT}_??() macros. -// -// Don't depend on the order in which the arguments are evaluated, -// which is undefined. -// -// These macros evaluate their arguments exactly once. - -#define EXPECT_STREQ(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) -#define EXPECT_STRNE(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define EXPECT_STRCASEEQ(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) -#define EXPECT_STRCASENE(s1, s2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -#define ASSERT_STREQ(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) -#define ASSERT_STRNE(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define ASSERT_STRCASEEQ(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) -#define ASSERT_STRCASENE(s1, s2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -// Macros for comparing floating-point numbers. -// -// * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2): -// Tests that two float values are almost equal. -// * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2): -// Tests that two double values are almost equal. -// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): -// Tests that v1 and v2 are within the given distance to each other. -// -// Google Test uses ULP-based comparison to automatically pick a default -// error bound that is appropriate for the operands. See the -// FloatingPoint template class in gtest-internal.h if you are -// interested in the implementation details. - -#define EXPECT_FLOAT_EQ(val1, val2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - val1, val2) - -#define EXPECT_DOUBLE_EQ(val1, val2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - val1, val2) - -#define ASSERT_FLOAT_EQ(val1, val2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - val1, val2) - -#define ASSERT_DOUBLE_EQ(val1, val2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - val1, val2) - -#define EXPECT_NEAR(val1, val2, abs_error)\ - EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -#define ASSERT_NEAR(val1, val2, abs_error)\ - ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -// These predicate format functions work on floating-point values, and -// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. -// -// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, - float val1, float val2); -GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, - double val1, double val2); - - -#if GTEST_OS_WINDOWS - -// Macros that test for HRESULT failure and success, these are only useful -// on Windows, and rely on Windows SDK macros and APIs to compile. -// -// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) -// -// When expr unexpectedly fails or succeeds, Google Test prints the -// expected result and the actual result with both a human-readable -// string representation of the error, if available, as well as the -// hex result code. -# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -#endif // GTEST_OS_WINDOWS - -// Macros that execute statement and check that it doesn't generate new fatal -// failures in the current thread. -// -// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); -// -// Examples: -// -// EXPECT_NO_FATAL_FAILURE(Process()); -// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; -// -#define ASSERT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) -#define EXPECT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) - -// Causes a trace (including the source file path, the current line -// number, and the given message) to be included in every test failure -// message generated by code in the current scope. The effect is -// undone when the control leaves the current scope. -// -// The message argument can be anything streamable to std::ostream. -// -// In the implementation, we include the current line number as part -// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s -// to appear in the same block - as long as they are on different -// lines. -#define SCOPED_TRACE(message) \ - ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ - __FILE__, __LINE__, ::testing::Message() << (message)) - -// Compile-time assertion for type equality. -// StaticAssertTypeEq() compiles iff type1 and type2 are -// the same type. The value it returns is not interesting. -// -// Instead of making StaticAssertTypeEq a class template, we make it a -// function template that invokes a helper class template. This -// prevents a user from misusing StaticAssertTypeEq by -// defining objects of that type. -// -// CAVEAT: -// -// When used inside a method of a class template, -// StaticAssertTypeEq() is effective ONLY IF the method is -// instantiated. For example, given: -// -// template class Foo { -// public: -// void Bar() { testing::StaticAssertTypeEq(); } -// }; -// -// the code: -// -// void Test1() { Foo foo; } -// -// will NOT generate a compiler error, as Foo::Bar() is never -// actually instantiated. Instead, you need: -// -// void Test2() { Foo foo; foo.Bar(); } -// -// to cause a compiler error. -template -bool StaticAssertTypeEq() { - (void)internal::StaticAssertTypeEqHelper(); - return true; -} - -// Defines a test. -// -// The first parameter is the name of the test case, and the second -// parameter is the name of the test within the test case. -// -// The convention is to end the test case name with "Test". For -// example, a test case for the Foo class can be named FooTest. -// -// Test code should appear between braces after an invocation of -// this macro. Example: -// -// TEST(FooTest, InitializesCorrectly) { -// Foo foo; -// EXPECT_TRUE(foo.StatusIsOK()); -// } - -// Note that we call GetTestTypeId() instead of GetTypeId< -// ::testing::Test>() here to get the type ID of testing::Test. This -// is to work around a suspected linker bug when using Google Test as -// a framework on Mac OS X. The bug causes GetTypeId< -// ::testing::Test>() to return different values depending on whether -// the call is from the Google Test framework itself or from user test -// code. GetTestTypeId() is guaranteed to always return the same -// value, as it always calls GetTypeId<>() from the Google Test -// framework. -#define GTEST_TEST(test_case_name, test_name)\ - GTEST_TEST_(test_case_name, test_name, \ - ::testing::Test, ::testing::internal::GetTestTypeId()) - -// Define this macro to 1 to omit the definition of TEST(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_TEST -# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) -#endif - -// Defines a test that uses a test fixture. -// -// The first parameter is the name of the test fixture class, which -// also doubles as the test case name. The second parameter is the -// name of the test within the test case. -// -// A test fixture class must be declared earlier. The user should put -// his test code between braces after using this macro. Example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { b_.AddElement(3); } -// -// Foo a_; -// Foo b_; -// }; -// -// TEST_F(FooTest, InitializesCorrectly) { -// EXPECT_TRUE(a_.StatusIsOK()); -// } -// -// TEST_F(FooTest, ReturnsElementCountCorrectly) { -// EXPECT_EQ(0, a_.size()); -// EXPECT_EQ(1, b_.size()); -// } - -#define TEST_F(test_fixture, test_name)\ - GTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId()) - -} // namespace testing - -// Use this function in main() to run all tests. It returns 0 if all -// tests are successful, or 1 otherwise. -// -// RUN_ALL_TESTS() should be invoked after the command line has been -// parsed by InitGoogleTest(). -// -// This function was formerly a macro; thus, it is in the global -// namespace and has an all-caps name. -int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; - -inline int RUN_ALL_TESTS() { - return ::testing::UnitTest::GetInstance()->Run(); -} - -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_pred_impl.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_pred_impl.h deleted file mode 100644 index 30ae712f50e..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_pred_impl.h +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command -// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! -// -// Implements a family of generic predicate assertion macros. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Makes sure this header is not included before gtest.h. -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ - -// This header implements a family of generic predicate assertion -// macros: -// -// ASSERT_PRED_FORMAT1(pred_format, v1) -// ASSERT_PRED_FORMAT2(pred_format, v1, v2) -// ... -// -// where pred_format is a function or functor that takes n (in the -// case of ASSERT_PRED_FORMATn) values and their source expression -// text, and returns a testing::AssertionResult. See the definition -// of ASSERT_EQ in gtest.h for an example. -// -// If you don't care about formatting, you can use the more -// restrictive version: -// -// ASSERT_PRED1(pred, v1) -// ASSERT_PRED2(pred, v1, v2) -// ... -// -// where pred is an n-ary function or functor that returns bool, -// and the values v1, v2, ..., must support the << operator for -// streaming to std::ostream. -// -// We also define the EXPECT_* variations. -// -// For now we only support predicates whose arity is at most 5. -// Please email googletestframework@googlegroups.com if you need -// support for higher arities. - -// GTEST_ASSERT_ is the basic statement to which all of the assertions -// in this file reduce. Don't use this in your code. - -#define GTEST_ASSERT_(expression, on_failure) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar = (expression)) \ - ; \ - else \ - on_failure(gtest_ar.failure_message()) - - -// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -template -AssertionResult AssertPred1Helper(const char* pred_text, - const char* e1, - Pred pred, - const T1& v1) { - if (pred(v1)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. -// Don't use this in your code. -#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, v1), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -#define GTEST_PRED1_(pred, v1, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ - #v1, \ - pred, \ - v1), on_failure) - -// Unary predicate assertion macros. -#define EXPECT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -template -AssertionResult AssertPred2Helper(const char* pred_text, - const char* e1, - const char* e2, - Pred pred, - const T1& v1, - const T2& v2) { - if (pred(v1, v2)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. -// Don't use this in your code. -#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -#define GTEST_PRED2_(pred, v1, v2, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ - #v1, \ - #v2, \ - pred, \ - v1, \ - v2), on_failure) - -// Binary predicate assertion macros. -#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -template -AssertionResult AssertPred3Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3) { - if (pred(v1, v2, v3)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. -// Don't use this in your code. -#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - pred, \ - v1, \ - v2, \ - v3), on_failure) - -// Ternary predicate assertion macros. -#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -template -AssertionResult AssertPred4Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4) { - if (pred(v1, v2, v3, v4)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. -// Don't use this in your code. -#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4), on_failure) - -// 4-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -template -AssertionResult AssertPred5Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - const char* e5, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4, - const T5& v5) { - if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ", " - << e5 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4 - << "\n" << e5 << " evaluates to " << v5; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. -// Don't use this in your code. -#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - #v5, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4, \ - v5), on_failure) - -// 5-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) - - - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_prod.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_prod.h deleted file mode 100644 index da80ddc6c70..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/gtest_prod.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Google C++ Testing Framework definitions useful in production code. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ - -// When you need to test the private or protected members of a class, -// use the FRIEND_TEST macro to declare your tests as friends of the -// class. For example: -// -// class MyClass { -// private: -// void MyMethod(); -// FRIEND_TEST(MyClassTest, MyMethod); -// }; -// -// class MyClassTest : public testing::Test { -// // ... -// }; -// -// TEST_F(MyClassTest, MyMethod) { -// // Can call MyClass::MyMethod() here. -// } - -#define FRIEND_TEST(test_case_name, test_name)\ -friend class test_case_name##_##test_name##_Test - -#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-port.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-port.h deleted file mode 100644 index 7e744bd3bb3..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-port.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Injection point for custom user configurations. -// The following macros can be defined: -// -// Flag related macros: -// GTEST_FLAG(flag_name) -// GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its -// own flagfile flag parsing. -// GTEST_DECLARE_bool_(name) -// GTEST_DECLARE_int32_(name) -// GTEST_DECLARE_string_(name) -// GTEST_DEFINE_bool_(name, default_val, doc) -// GTEST_DEFINE_int32_(name, default_val, doc) -// GTEST_DEFINE_string_(name, default_val, doc) -// -// Test filtering: -// GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that -// will be used if --GTEST_FLAG(test_filter) -// is not provided. -// -// Logging: -// GTEST_LOG_(severity) -// GTEST_CHECK_(condition) -// Functions LogToStderr() and FlushInfoLog() have to be provided too. -// -// Threading: -// GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided. -// GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are -// already provided. -// Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and -// GTEST_DEFINE_STATIC_MUTEX_(mutex) -// -// GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) -// GTEST_LOCK_EXCLUDED_(locks) -// -// ** Custom implementation starts here ** - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-printers.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-printers.h deleted file mode 100644 index 60c1ea050b6..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest-printers.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// This file provides an injection point for custom printers in a local -// installation of gTest. -// It will be included from gtest-printers.h and the overrides in this file -// will be visible to everyone. -// See documentation at gtest/gtest-printers.h for details on how to define a -// custom printer. -// -// ** Custom implementation starts here ** - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest.h deleted file mode 100644 index c27412a8981..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/custom/gtest.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Injection point for custom user configurations. -// The following macros can be defined: -// -// GTEST_OS_STACK_TRACE_GETTER_ - The name of an implementation of -// OsStackTraceGetterInterface. -// -// ** Custom implementation starts here ** - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h deleted file mode 100644 index 2b3a78f5bf8..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines internal utilities needed for implementing -// death tests. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - -#include "gtest/internal/gtest-internal.h" - -#include - -namespace testing { -namespace internal { - -GTEST_DECLARE_string_(internal_run_death_test); - -// Names of the flags (needed for parsing Google Test flags). -const char kDeathTestStyleFlag[] = "death_test_style"; -const char kDeathTestUseFork[] = "death_test_use_fork"; -const char kInternalRunDeathTestFlag[] = "internal_run_death_test"; - -#if GTEST_HAS_DEATH_TEST - -// DeathTest is a class that hides much of the complexity of the -// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method -// returns a concrete class that depends on the prevailing death test -// style, as defined by the --gtest_death_test_style and/or -// --gtest_internal_run_death_test flags. - -// In describing the results of death tests, these terms are used with -// the corresponding definitions: -// -// exit status: The integer exit information in the format specified -// by wait(2) -// exit code: The integer code passed to exit(3), _exit(2), or -// returned from main() -class GTEST_API_ DeathTest { - public: - // Create returns false if there was an error determining the - // appropriate action to take for the current death test; for example, - // if the gtest_death_test_style flag is set to an invalid value. - // The LastMessage method will return a more detailed message in that - // case. Otherwise, the DeathTest pointer pointed to by the "test" - // argument is set. If the death test should be skipped, the pointer - // is set to NULL; otherwise, it is set to the address of a new concrete - // DeathTest object that controls the execution of the current test. - static bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); - DeathTest(); - virtual ~DeathTest() { } - - // A helper class that aborts a death test when it's deleted. - class ReturnSentinel { - public: - explicit ReturnSentinel(DeathTest* test) : test_(test) { } - ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } - private: - DeathTest* const test_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); - } GTEST_ATTRIBUTE_UNUSED_; - - // An enumeration of possible roles that may be taken when a death - // test is encountered. EXECUTE means that the death test logic should - // be executed immediately. OVERSEE means that the program should prepare - // the appropriate environment for a child process to execute the death - // test, then wait for it to complete. - enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; - - // An enumeration of the three reasons that a test might be aborted. - enum AbortReason { - TEST_ENCOUNTERED_RETURN_STATEMENT, - TEST_THREW_EXCEPTION, - TEST_DID_NOT_DIE - }; - - // Assumes one of the above roles. - virtual TestRole AssumeRole() = 0; - - // Waits for the death test to finish and returns its status. - virtual int Wait() = 0; - - // Returns true if the death test passed; that is, the test process - // exited during the test, its exit status matches a user-supplied - // predicate, and its stderr output matches a user-supplied regular - // expression. - // The user-supplied predicate may be a macro expression rather - // than a function pointer or functor, or else Wait and Passed could - // be combined. - virtual bool Passed(bool exit_status_ok) = 0; - - // Signals that the death test did not die as expected. - virtual void Abort(AbortReason reason) = 0; - - // Returns a human-readable outcome message regarding the outcome of - // the last death test. - static const char* LastMessage(); - - static void set_last_death_test_message(const std::string& message); - - private: - // A string containing a description of the outcome of the last death test. - static std::string last_death_test_message_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); -}; - -// Factory interface for death tests. May be mocked out for testing. -class DeathTestFactory { - public: - virtual ~DeathTestFactory() { } - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test) = 0; -}; - -// A concrete DeathTestFactory implementation for normal use. -class DefaultDeathTestFactory : public DeathTestFactory { - public: - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); -}; - -// Returns true if exit_status describes a process that was terminated -// by a signal, or exited normally with a nonzero exit code. -GTEST_API_ bool ExitedUnsuccessfully(int exit_status); - -// Traps C++ exceptions escaping statement and reports them as test -// failures. Note that trapping SEH exceptions is not implemented here. -# if GTEST_HAS_EXCEPTIONS -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } catch (const ::std::exception& gtest_exception) { \ - fprintf(\ - stderr, \ - "\n%s: Caught std::exception-derived exception escaping the " \ - "death test statement. Exception message: %s\n", \ - ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ - gtest_exception.what()); \ - fflush(stderr); \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } catch (...) { \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } - -# else -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) - -# endif - -// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, -// ASSERT_EXIT*, and EXPECT_EXIT*. -# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - const ::testing::internal::RE& gtest_regex = (regex); \ - ::testing::internal::DeathTest* gtest_dt; \ - if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ - __FILE__, __LINE__, >est_dt)) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - if (gtest_dt != NULL) { \ - ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ - gtest_dt_ptr(gtest_dt); \ - switch (gtest_dt->AssumeRole()) { \ - case ::testing::internal::DeathTest::OVERSEE_TEST: \ - if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - break; \ - case ::testing::internal::DeathTest::EXECUTE_TEST: { \ - ::testing::internal::DeathTest::ReturnSentinel \ - gtest_sentinel(gtest_dt); \ - GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ - gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ - break; \ - } \ - default: \ - break; \ - } \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ - fail(::testing::internal::DeathTest::LastMessage()) -// The symbol "fail" here expands to something into which a message -// can be streamed. - -// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in -// NDEBUG mode. In this case we need the statements to be executed, the regex is -// ignored, and the macro must accept a streamed message even though the message -// is never printed. -# define GTEST_EXECUTE_STATEMENT_(statement, regex) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } else \ - ::testing::Message() - -// A class representing the parsed contents of the -// --gtest_internal_run_death_test flag, as it existed when -// RUN_ALL_TESTS was called. -class InternalRunDeathTestFlag { - public: - InternalRunDeathTestFlag(const std::string& a_file, - int a_line, - int an_index, - int a_write_fd) - : file_(a_file), line_(a_line), index_(an_index), - write_fd_(a_write_fd) {} - - ~InternalRunDeathTestFlag() { - if (write_fd_ >= 0) - posix::Close(write_fd_); - } - - const std::string& file() const { return file_; } - int line() const { return line_; } - int index() const { return index_; } - int write_fd() const { return write_fd_; } - - private: - std::string file_; - int line_; - int index_; - int write_fd_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); -}; - -// Returns a newly created InternalRunDeathTestFlag object with fields -// initialized from the GTEST_FLAG(internal_run_death_test) flag if -// the flag is specified; otherwise returns NULL. -InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() - -#endif // GTEST_HAS_DEATH_TEST - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-filepath.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-filepath.h deleted file mode 100644 index 7a13b4b0de6..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-filepath.h +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: keith.ray@gmail.com (Keith Ray) -// -// Google Test filepath utilities -// -// This header file declares classes and functions used internally by -// Google Test. They are subject to change without notice. -// -// This file is #included in . -// Do not include this header file separately! - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ - -#include "gtest/internal/gtest-string.h" - -namespace testing { -namespace internal { - -// FilePath - a class for file and directory pathname manipulation which -// handles platform-specific conventions (like the pathname separator). -// Used for helper functions for naming files in a directory for xml output. -// Except for Set methods, all methods are const or static, which provides an -// "immutable value object" -- useful for peace of mind. -// A FilePath with a value ending in a path separator ("like/this/") represents -// a directory, otherwise it is assumed to represent a file. In either case, -// it may or may not represent an actual file or directory in the file system. -// Names are NOT checked for syntax correctness -- no checking for illegal -// characters, malformed paths, etc. - -class GTEST_API_ FilePath { - public: - FilePath() : pathname_("") { } - FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } - - explicit FilePath(const std::string& pathname) : pathname_(pathname) { - Normalize(); - } - - FilePath& operator=(const FilePath& rhs) { - Set(rhs); - return *this; - } - - void Set(const FilePath& rhs) { - pathname_ = rhs.pathname_; - } - - const std::string& string() const { return pathname_; } - const char* c_str() const { return pathname_.c_str(); } - - // Returns the current working directory, or "" if unsuccessful. - static FilePath GetCurrentDir(); - - // Given directory = "dir", base_name = "test", number = 0, - // extension = "xml", returns "dir/test.xml". If number is greater - // than zero (e.g., 12), returns "dir/test_12.xml". - // On Windows platform, uses \ as the separator rather than /. - static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); - - // Given directory = "dir", relative_path = "test.xml", - // returns "dir/test.xml". - // On Windows, uses \ as the separator rather than /. - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); - - // Returns a pathname for a file that does not currently exist. The pathname - // will be directory/base_name.extension or - // directory/base_name_.extension if directory/base_name.extension - // already exists. The number will be incremented until a pathname is found - // that does not already exist. - // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. - // There could be a race condition if two or more processes are calling this - // function at the same time -- they could both pick the same filename. - static FilePath GenerateUniqueFileName(const FilePath& directory, - const FilePath& base_name, - const char* extension); - - // Returns true iff the path is "". - bool IsEmpty() const { return pathname_.empty(); } - - // If input name has a trailing separator character, removes it and returns - // the name, otherwise return the name string unmodified. - // On Windows platform, uses \ as the separator, other platforms use /. - FilePath RemoveTrailingPathSeparator() const; - - // Returns a copy of the FilePath with the directory part removed. - // Example: FilePath("path/to/file").RemoveDirectoryName() returns - // FilePath("file"). If there is no directory part ("just_a_file"), it returns - // the FilePath unmodified. If there is no file part ("just_a_dir/") it - // returns an empty FilePath (""). - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveDirectoryName() const; - - // RemoveFileName returns the directory path with the filename removed. - // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". - // If the FilePath is "a_file" or "/a_file", RemoveFileName returns - // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does - // not have a file, like "just/a/dir/", it returns the FilePath unmodified. - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveFileName() const; - - // Returns a copy of the FilePath with the case-insensitive extension removed. - // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns - // FilePath("dir/file"). If a case-insensitive extension is not - // found, returns a copy of the original FilePath. - FilePath RemoveExtension(const char* extension) const; - - // Creates directories so that path exists. Returns true if successful or if - // the directories already exist; returns false if unable to create - // directories for any reason. Will also return false if the FilePath does - // not represent a directory (that is, it doesn't end with a path separator). - bool CreateDirectoriesRecursively() const; - - // Create the directory so that path exists. Returns true if successful or - // if the directory already exists; returns false if unable to create the - // directory for any reason, including if the parent directory does not - // exist. Not named "CreateDirectory" because that's a macro on Windows. - bool CreateFolder() const; - - // Returns true if FilePath describes something in the file-system, - // either a file, directory, or whatever, and that something exists. - bool FileOrDirectoryExists() const; - - // Returns true if pathname describes a directory in the file-system - // that exists. - bool DirectoryExists() const; - - // Returns true if FilePath ends with a path separator, which indicates that - // it is intended to represent a directory. Returns false otherwise. - // This does NOT check that a directory (or file) actually exists. - bool IsDirectory() const; - - // Returns true if pathname describes a root directory. (Windows has one - // root directory per disk drive.) - bool IsRootDirectory() const; - - // Returns true if pathname describes an absolute path. - bool IsAbsolutePath() const; - - private: - // Replaces multiple consecutive separators with a single separator. - // For example, "bar///foo" becomes "bar/foo". Does not eliminate other - // redundancies that might be in a pathname involving "." or "..". - // - // A pathname with multiple consecutive separators may occur either through - // user error or as a result of some scripts or APIs that generate a pathname - // with a trailing separator. On other platforms the same API or script - // may NOT generate a pathname with a trailing "/". Then elsewhere that - // pathname may have another "/" and pathname components added to it, - // without checking for the separator already being there. - // The script language and operating system may allow paths like "foo//bar" - // but some of the functions in FilePath will not handle that correctly. In - // particular, RemoveTrailingPathSeparator() only removes one separator, and - // it is called in CreateDirectoriesRecursively() assuming that it will change - // a pathname from directory syntax (trailing separator) to filename syntax. - // - // On Windows this method also replaces the alternate path separator '/' with - // the primary path separator '\\', so that for example "bar\\/\\foo" becomes - // "bar\\foo". - - void Normalize(); - - // Returns a pointer to the last occurence of a valid path separator in - // the FilePath. On Windows, for example, both '/' and '\' are valid path - // separators. Returns NULL if no path separator was found. - const char* FindLastPathSeparator() const; - - std::string pathname_; -}; // class FilePath - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-internal.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-internal.h deleted file mode 100644 index ebd1cf615de..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-internal.h +++ /dev/null @@ -1,1238 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares functions and macros used internally by -// Google Test. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ - -#include "gtest/internal/gtest-port.h" - -#if GTEST_OS_LINUX -# include -# include -# include -# include -#endif // GTEST_OS_LINUX - -#if GTEST_HAS_EXCEPTIONS -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtest/gtest-message.h" -#include "gtest/internal/gtest-string.h" -#include "gtest/internal/gtest-filepath.h" -#include "gtest/internal/gtest-type-util.h" - -// Due to C++ preprocessor weirdness, we need double indirection to -// concatenate two tokens when one of them is __LINE__. Writing -// -// foo ## __LINE__ -// -// will result in the token foo__LINE__, instead of foo followed by -// the current line number. For more details, see -// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 -#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) -#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar - -class ProtocolMessage; -namespace proto2 { class Message; } - -namespace testing { - -// Forward declarations. - -class AssertionResult; // Result of an assertion. -class Message; // Represents a failure message. -class Test; // Represents a test. -class TestInfo; // Information about a test. -class TestPartResult; // Result of a test part. -class UnitTest; // A collection of test cases. - -template -::std::string PrintToString(const T& value); - -namespace internal { - -struct TraceInfo; // Information about a trace point. -class ScopedTrace; // Implements scoped trace. -class TestInfoImpl; // Opaque implementation of TestInfo -class UnitTestImpl; // Opaque implementation of UnitTest - -// The text used in failure messages to indicate the start of the -// stack trace. -GTEST_API_ extern const char kStackTraceMarker[]; - -// Two overloaded helpers for checking at compile time whether an -// expression is a null pointer literal (i.e. NULL or any 0-valued -// compile-time integral constant). Their return values have -// different sizes, so we can use sizeof() to test which version is -// picked by the compiler. These helpers have no implementations, as -// we only need their signatures. -// -// Given IsNullLiteralHelper(x), the compiler will pick the first -// version if x can be implicitly converted to Secret*, and pick the -// second version otherwise. Since Secret is a secret and incomplete -// type, the only expression a user can write that has type Secret* is -// a null pointer literal. Therefore, we know that x is a null -// pointer literal if and only if the first version is picked by the -// compiler. -char IsNullLiteralHelper(Secret* p); -char (&IsNullLiteralHelper(...))[2]; // NOLINT - -// A compile-time bool constant that is true if and only if x is a -// null pointer literal (i.e. NULL or any 0-valued compile-time -// integral constant). -#ifdef GTEST_ELLIPSIS_NEEDS_POD_ -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_IS_NULL_LITERAL_(x) false -#else -# define GTEST_IS_NULL_LITERAL_(x) \ - (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) -#endif // GTEST_ELLIPSIS_NEEDS_POD_ - -// Appends the user-supplied message to the Google-Test-generated message. -GTEST_API_ std::string AppendUserMessage( - const std::string& gtest_msg, const Message& user_msg); - -#if GTEST_HAS_EXCEPTIONS - -// This exception is thrown by (and only by) a failed Google Test -// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions -// are enabled). We derive it from std::runtime_error, which is for -// errors presumably detectable only at run time. Since -// std::runtime_error inherits from std::exception, many testing -// frameworks know how to extract and print the message inside it. -class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { - public: - explicit GoogleTestFailureException(const TestPartResult& failure); -}; - -#endif // GTEST_HAS_EXCEPTIONS - -// A helper class for creating scoped traces in user programs. -class GTEST_API_ ScopedTrace { - public: - // The c'tor pushes the given source file location and message onto - // a trace stack maintained by Google Test. - ScopedTrace(const char* file, int line, const Message& message); - - // The d'tor pops the info pushed by the c'tor. - // - // Note that the d'tor is not virtual in order to be efficient. - // Don't inherit from ScopedTrace! - ~ScopedTrace(); - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. - -namespace edit_distance { -// Returns the optimal edits to go from 'left' to 'right'. -// All edits cost the same, with replace having lower priority than -// add/remove. -// Simple implementation of the Wagner–Fischer algorithm. -// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm -enum EditType { kMatch, kAdd, kRemove, kReplace }; -GTEST_API_ std::vector CalculateOptimalEdits( - const std::vector& left, const std::vector& right); - -// Same as above, but the input is represented as strings. -GTEST_API_ std::vector CalculateOptimalEdits( - const std::vector& left, - const std::vector& right); - -// Create a diff of the input strings in Unified diff format. -GTEST_API_ std::string CreateUnifiedDiff(const std::vector& left, - const std::vector& right, - size_t context = 2); - -} // namespace edit_distance - -// Calculate the diff between 'left' and 'right' and return it in unified diff -// format. -// If not null, stores in 'total_line_count' the total number of lines found -// in left + right. -GTEST_API_ std::string DiffStrings(const std::string& left, - const std::string& right, - size_t* total_line_count); - -// Constructs and returns the message for an equality assertion -// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. -// -// The first four parameters are the expressions used in the assertion -// and their values, as strings. For example, for ASSERT_EQ(foo, bar) -// where foo is 5 and bar is 6, we have: -// -// expected_expression: "foo" -// actual_expression: "bar" -// expected_value: "5" -// actual_value: "6" -// -// The ignoring_case parameter is true iff the assertion is a -// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will -// be inserted into the message. -GTEST_API_ AssertionResult EqFailure(const char* expected_expression, - const char* actual_expression, - const std::string& expected_value, - const std::string& actual_value, - bool ignoring_case); - -// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. -GTEST_API_ std::string GetBoolAssertionFailureMessage( - const AssertionResult& assertion_result, - const char* expression_text, - const char* actual_predicate_value, - const char* expected_predicate_value); - -// This template class represents an IEEE floating-point number -// (either single-precision or double-precision, depending on the -// template parameters). -// -// The purpose of this class is to do more sophisticated number -// comparison. (Due to round-off error, etc, it's very unlikely that -// two floating-points will be equal exactly. Hence a naive -// comparison by the == operation often doesn't work.) -// -// Format of IEEE floating-point: -// -// The most-significant bit being the leftmost, an IEEE -// floating-point looks like -// -// sign_bit exponent_bits fraction_bits -// -// Here, sign_bit is a single bit that designates the sign of the -// number. -// -// For float, there are 8 exponent bits and 23 fraction bits. -// -// For double, there are 11 exponent bits and 52 fraction bits. -// -// More details can be found at -// http://en.wikipedia.org/wiki/IEEE_floating-point_standard. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -template -class FloatingPoint { - public: - // Defines the unsigned integer type that has the same size as the - // floating point number. - typedef typename TypeWithSize::UInt Bits; - - // Constants. - - // # of bits in a number. - static const size_t kBitCount = 8*sizeof(RawType); - - // # of fraction bits in a number. - static const size_t kFractionBitCount = - std::numeric_limits::digits - 1; - - // # of exponent bits in a number. - static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; - - // The mask for the sign bit. - static const Bits kSignBitMask = static_cast(1) << (kBitCount - 1); - - // The mask for the fraction bits. - static const Bits kFractionBitMask = - ~static_cast(0) >> (kExponentBitCount + 1); - - // The mask for the exponent bits. - static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); - - // How many ULP's (Units in the Last Place) we want to tolerate when - // comparing two numbers. The larger the value, the more error we - // allow. A 0 value means that two numbers must be exactly the same - // to be considered equal. - // - // The maximum error of a single floating-point operation is 0.5 - // units in the last place. On Intel CPU's, all floating-point - // calculations are done with 80-bit precision, while double has 64 - // bits. Therefore, 4 should be enough for ordinary use. - // - // See the following article for more details on ULP: - // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ - static const size_t kMaxUlps = 4; - - // Constructs a FloatingPoint from a raw floating-point number. - // - // On an Intel CPU, passing a non-normalized NAN (Not a Number) - // around may change its bits, although the new value is guaranteed - // to be also a NAN. Therefore, don't expect this constructor to - // preserve the bits in x when x is a NAN. - explicit FloatingPoint(const RawType& x) { u_.value_ = x; } - - // Static methods - - // Reinterprets a bit pattern as a floating-point number. - // - // This function is needed to test the AlmostEquals() method. - static RawType ReinterpretBits(const Bits bits) { - FloatingPoint fp(0); - fp.u_.bits_ = bits; - return fp.u_.value_; - } - - // Returns the floating-point number that represent positive infinity. - static RawType Infinity() { - return ReinterpretBits(kExponentBitMask); - } - - // Returns the maximum representable finite floating-point number. - static RawType Max(); - - // Non-static methods - - // Returns the bits that represents this number. - const Bits &bits() const { return u_.bits_; } - - // Returns the exponent bits of this number. - Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } - - // Returns the fraction bits of this number. - Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } - - // Returns the sign bit of this number. - Bits sign_bit() const { return kSignBitMask & u_.bits_; } - - // Returns true iff this is NAN (not a number). - bool is_nan() const { - // It's a NAN if the exponent bits are all ones and the fraction - // bits are not entirely zeros. - return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); - } - - // Returns true iff this number is at most kMaxUlps ULP's away from - // rhs. In particular, this function: - // - // - returns false if either number is (or both are) NAN. - // - treats really large numbers as almost equal to infinity. - // - thinks +0.0 and -0.0 are 0 DLP's apart. - bool AlmostEquals(const FloatingPoint& rhs) const { - // The IEEE standard says that any comparison operation involving - // a NAN must return false. - if (is_nan() || rhs.is_nan()) return false; - - return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) - <= kMaxUlps; - } - - private: - // The data type used to store the actual floating-point number. - union FloatingPointUnion { - RawType value_; // The raw floating-point number. - Bits bits_; // The bits that represent the number. - }; - - // Converts an integer from the sign-and-magnitude representation to - // the biased representation. More precisely, let N be 2 to the - // power of (kBitCount - 1), an integer x is represented by the - // unsigned number x + N. - // - // For instance, - // - // -N + 1 (the most negative number representable using - // sign-and-magnitude) is represented by 1; - // 0 is represented by N; and - // N - 1 (the biggest number representable using - // sign-and-magnitude) is represented by 2N - 1. - // - // Read http://en.wikipedia.org/wiki/Signed_number_representations - // for more details on signed number representations. - static Bits SignAndMagnitudeToBiased(const Bits &sam) { - if (kSignBitMask & sam) { - // sam represents a negative number. - return ~sam + 1; - } else { - // sam represents a positive number. - return kSignBitMask | sam; - } - } - - // Given two numbers in the sign-and-magnitude representation, - // returns the distance between them as an unsigned number. - static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, - const Bits &sam2) { - const Bits biased1 = SignAndMagnitudeToBiased(sam1); - const Bits biased2 = SignAndMagnitudeToBiased(sam2); - return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); - } - - FloatingPointUnion u_; -}; - -// We cannot use std::numeric_limits::max() as it clashes with the max() -// macro defined by . -template <> -inline float FloatingPoint::Max() { return FLT_MAX; } -template <> -inline double FloatingPoint::Max() { return DBL_MAX; } - -// Typedefs the instances of the FloatingPoint template class that we -// care to use. -typedef FloatingPoint Float; -typedef FloatingPoint Double; - -// In order to catch the mistake of putting tests that use different -// test fixture classes in the same test case, we need to assign -// unique IDs to fixture classes and compare them. The TypeId type is -// used to hold such IDs. The user should treat TypeId as an opaque -// type: the only operation allowed on TypeId values is to compare -// them for equality using the == operator. -typedef const void* TypeId; - -template -class TypeIdHelper { - public: - // dummy_ must not have a const type. Otherwise an overly eager - // compiler (e.g. MSVC 7.1 & 8.0) may try to merge - // TypeIdHelper::dummy_ for different Ts as an "optimization". - static bool dummy_; -}; - -template -bool TypeIdHelper::dummy_ = false; - -// GetTypeId() returns the ID of type T. Different values will be -// returned for different types. Calling the function twice with the -// same type argument is guaranteed to return the same ID. -template -TypeId GetTypeId() { - // The compiler is required to allocate a different - // TypeIdHelper::dummy_ variable for each T used to instantiate - // the template. Therefore, the address of dummy_ is guaranteed to - // be unique. - return &(TypeIdHelper::dummy_); -} - -// Returns the type ID of ::testing::Test. Always call this instead -// of GetTypeId< ::testing::Test>() to get the type ID of -// ::testing::Test, as the latter may give the wrong result due to a -// suspected linker bug when compiling Google Test as a Mac OS X -// framework. -GTEST_API_ TypeId GetTestTypeId(); - -// Defines the abstract factory interface that creates instances -// of a Test object. -class TestFactoryBase { - public: - virtual ~TestFactoryBase() {} - - // Creates a test instance to run. The instance is both created and destroyed - // within TestInfoImpl::Run() - virtual Test* CreateTest() = 0; - - protected: - TestFactoryBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); -}; - -// This class provides implementation of TeastFactoryBase interface. -// It is used in TEST and TEST_F macros. -template -class TestFactoryImpl : public TestFactoryBase { - public: - virtual Test* CreateTest() { return new TestClass; } -}; - -#if GTEST_OS_WINDOWS - -// Predicate-formatters for implementing the HRESULT checking macros -// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} -// We pass a long instead of HRESULT to avoid causing an -// include dependency for the HRESULT type. -GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, - long hr); // NOLINT -GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, - long hr); // NOLINT - -#endif // GTEST_OS_WINDOWS - -// Types of SetUpTestCase() and TearDownTestCase() functions. -typedef void (*SetUpTestCaseFunc)(); -typedef void (*TearDownTestCaseFunc)(); - -struct CodeLocation { - CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {} - - string file; - int line; -}; - -// Creates a new TestInfo object and registers it with Google Test; -// returns the created object. -// -// Arguments: -// -// test_case_name: name of the test case -// name: name of the test -// type_param the name of the test's type parameter, or NULL if -// this is not a typed or a type-parameterized test. -// value_param text representation of the test's value parameter, -// or NULL if this is not a type-parameterized test. -// code_location: code location where the test is defined -// fixture_class_id: ID of the test fixture class -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -// factory: pointer to the factory that creates a test object. -// The newly created TestInfo instance will assume -// ownership of the factory object. -GTEST_API_ TestInfo* MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - CodeLocation code_location, - TypeId fixture_class_id, - SetUpTestCaseFunc set_up_tc, - TearDownTestCaseFunc tear_down_tc, - TestFactoryBase* factory); - -// If *pstr starts with the given prefix, modifies *pstr to be right -// past the prefix and returns true; otherwise leaves *pstr unchanged -// and returns false. None of pstr, *pstr, and prefix can be NULL. -GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// State of the definition of a type-parameterized test case. -class GTEST_API_ TypedTestCasePState { - public: - TypedTestCasePState() : registered_(false) {} - - // Adds the given test name to defined_test_names_ and return true - // if the test case hasn't been registered; otherwise aborts the - // program. - bool AddTestName(const char* file, int line, const char* case_name, - const char* test_name) { - if (registered_) { - fprintf(stderr, "%s Test %s must be defined before " - "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n", - FormatFileLocation(file, line).c_str(), test_name, case_name); - fflush(stderr); - posix::Abort(); - } - registered_tests_.insert( - ::std::make_pair(test_name, CodeLocation(file, line))); - return true; - } - - bool TestExists(const std::string& test_name) const { - return registered_tests_.count(test_name) > 0; - } - - const CodeLocation& GetCodeLocation(const std::string& test_name) const { - RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name); - GTEST_CHECK_(it != registered_tests_.end()); - return it->second; - } - - // Verifies that registered_tests match the test names in - // defined_test_names_; returns registered_tests if successful, or - // aborts the program otherwise. - const char* VerifyRegisteredTestNames( - const char* file, int line, const char* registered_tests); - - private: - typedef ::std::map RegisteredTestsMap; - - bool registered_; - RegisteredTestsMap registered_tests_; -}; - -// Skips to the first non-space char after the first comma in 'str'; -// returns NULL if no comma is found in 'str'. -inline const char* SkipComma(const char* str) { - const char* comma = strchr(str, ','); - if (comma == NULL) { - return NULL; - } - while (IsSpace(*(++comma))) {} - return comma; -} - -// Returns the prefix of 'str' before the first comma in it; returns -// the entire string if it contains no comma. -inline std::string GetPrefixUntilComma(const char* str) { - const char* comma = strchr(str, ','); - return comma == NULL ? str : std::string(str, comma); -} - -// Splits a given string on a given delimiter, populating a given -// vector with the fields. -void SplitString(const ::std::string& str, char delimiter, - ::std::vector< ::std::string>* dest); - -// TypeParameterizedTest::Register() -// registers a list of type-parameterized tests with Google Test. The -// return value is insignificant - we just need to return something -// such that we can call this function in a namespace scope. -// -// Implementation note: The GTEST_TEMPLATE_ macro declares a template -// template parameter. It's defined in gtest-type-util.h. -template -class TypeParameterizedTest { - public: - // 'index' is the index of the test in the type list 'Types' - // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, - // Types). Valid values for 'index' are [0, N - 1] where N is the - // length of Types. - static bool Register(const char* prefix, - CodeLocation code_location, - const char* case_name, const char* test_names, - int index) { - typedef typename Types::Head Type; - typedef Fixture FixtureClass; - typedef typename GTEST_BIND_(TestSel, Type) TestClass; - - // First, registers the first type-parameterized test in the type - // list. - MakeAndRegisterTestInfo( - (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" - + StreamableToString(index)).c_str(), - StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(), - GetTypeName().c_str(), - NULL, // No value parameter. - code_location, - GetTypeId(), - TestClass::SetUpTestCase, - TestClass::TearDownTestCase, - new TestFactoryImpl); - - // Next, recurses (at compile time) with the tail of the type list. - return TypeParameterizedTest - ::Register(prefix, code_location, case_name, test_names, index + 1); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTest { - public: - static bool Register(const char* /*prefix*/, CodeLocation, - const char* /*case_name*/, const char* /*test_names*/, - int /*index*/) { - return true; - } -}; - -// TypeParameterizedTestCase::Register() -// registers *all combinations* of 'Tests' and 'Types' with Google -// Test. The return value is insignificant - we just need to return -// something such that we can call this function in a namespace scope. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* prefix, CodeLocation code_location, - const TypedTestCasePState* state, - const char* case_name, const char* test_names) { - std::string test_name = StripTrailingSpaces( - GetPrefixUntilComma(test_names)); - if (!state->TestExists(test_name)) { - fprintf(stderr, "Failed to get code location for test %s.%s at %s.", - case_name, test_name.c_str(), - FormatFileLocation(code_location.file.c_str(), - code_location.line).c_str()); - fflush(stderr); - posix::Abort(); - } - const CodeLocation& test_location = state->GetCodeLocation(test_name); - - typedef typename Tests::Head Head; - - // First, register the first test in 'Test' for each type in 'Types'. - TypeParameterizedTest::Register( - prefix, test_location, case_name, test_names, 0); - - // Next, recurses (at compile time) with the tail of the test list. - return TypeParameterizedTestCase - ::Register(prefix, code_location, state, - case_name, SkipComma(test_names)); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* /*prefix*/, CodeLocation, - const TypedTestCasePState* /*state*/, - const char* /*case_name*/, const char* /*test_names*/) { - return true; - } -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// Returns the current OS stack trace as an std::string. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in -// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -GTEST_API_ std::string GetCurrentOsStackTraceExceptTop( - UnitTest* unit_test, int skip_count); - -// Helpers for suppressing warnings on unreachable code or constant -// condition. - -// Always returns true. -GTEST_API_ bool AlwaysTrue(); - -// Always returns false. -inline bool AlwaysFalse() { return !AlwaysTrue(); } - -// Helper for suppressing false warning from Clang on a const char* -// variable declared in a conditional expression always being NULL in -// the else branch. -struct GTEST_API_ ConstCharPtr { - ConstCharPtr(const char* str) : value(str) {} - operator bool() const { return true; } - const char* value; -}; - -// A simple Linear Congruential Generator for generating random -// numbers with a uniform distribution. Unlike rand() and srand(), it -// doesn't use global state (and therefore can't interfere with user -// code). Unlike rand_r(), it's portable. An LCG isn't very random, -// but it's good enough for our purposes. -class GTEST_API_ Random { - public: - static const UInt32 kMaxRange = 1u << 31; - - explicit Random(UInt32 seed) : state_(seed) {} - - void Reseed(UInt32 seed) { state_ = seed; } - - // Generates a random number from [0, range). Crashes if 'range' is - // 0 or greater than kMaxRange. - UInt32 Generate(UInt32 range); - - private: - UInt32 state_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); -}; - -// Defining a variable of type CompileAssertTypesEqual will cause a -// compiler error iff T1 and T2 are different types. -template -struct CompileAssertTypesEqual; - -template -struct CompileAssertTypesEqual { -}; - -// Removes the reference from a type if it is a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::remove_reference, which is not widely available yet. -template -struct RemoveReference { typedef T type; }; // NOLINT -template -struct RemoveReference { typedef T type; }; // NOLINT - -// A handy wrapper around RemoveReference that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_REFERENCE_(T) \ - typename ::testing::internal::RemoveReference::type - -// Removes const from a type if it is a const type, otherwise leaves -// it unchanged. This is the same as tr1::remove_const, which is not -// widely available yet. -template -struct RemoveConst { typedef T type; }; // NOLINT -template -struct RemoveConst { typedef T type; }; // NOLINT - -// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above -// definition to fail to remove the const in 'const int[3]' and 'const -// char[3][4]'. The following specialization works around the bug. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; - -#if defined(_MSC_VER) && _MSC_VER < 1400 -// This is the only specialization that allows VC++ 7.1 to remove const in -// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC -// and thus needs to be conditionally compiled. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; -#endif - -// A handy wrapper around RemoveConst that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_CONST_(T) \ - typename ::testing::internal::RemoveConst::type - -// Turns const U&, U&, const U, and U all into U. -#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ - GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) - -// Adds reference to a type if it is not a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::add_reference, which is not widely available yet. -template -struct AddReference { typedef T& type; }; // NOLINT -template -struct AddReference { typedef T& type; }; // NOLINT - -// A handy wrapper around AddReference that works when the argument T -// depends on template parameters. -#define GTEST_ADD_REFERENCE_(T) \ - typename ::testing::internal::AddReference::type - -// Adds a reference to const on top of T as necessary. For example, -// it transforms -// -// char ==> const char& -// const char ==> const char& -// char& ==> const char& -// const char& ==> const char& -// -// The argument T must depend on some template parameters. -#define GTEST_REFERENCE_TO_CONST_(T) \ - GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) - -// ImplicitlyConvertible::value is a compile-time bool -// constant that's true iff type From can be implicitly converted to -// type To. -template -class ImplicitlyConvertible { - private: - // We need the following helper functions only for their types. - // They have no implementations. - - // MakeFrom() is an expression whose type is From. We cannot simply - // use From(), as the type From may not have a public default - // constructor. - static typename AddReference::type MakeFrom(); - - // These two functions are overloaded. Given an expression - // Helper(x), the compiler will pick the first version if x can be - // implicitly converted to type To; otherwise it will pick the - // second version. - // - // The first version returns a value of size 1, and the second - // version returns a value of size 2. Therefore, by checking the - // size of Helper(x), which can be done at compile time, we can tell - // which version of Helper() is used, and hence whether x can be - // implicitly converted to type To. - static char Helper(To); - static char (&Helper(...))[2]; // NOLINT - - // We have to put the 'public' section after the 'private' section, - // or MSVC refuses to compile the code. - public: -#if defined(__BORLANDC__) - // C++Builder cannot use member overload resolution during template - // instantiation. The simplest workaround is to use its C++0x type traits - // functions (C++Builder 2009 and above only). - static const bool value = __is_convertible(From, To); -#else - // MSVC warns about implicitly converting from double to int for - // possible loss of data, so we need to temporarily disable the - // warning. - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244) - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; - GTEST_DISABLE_MSC_WARNINGS_POP_() -#endif // __BORLANDC__ -}; -template -const bool ImplicitlyConvertible::value; - -// IsAProtocolMessage::value is a compile-time bool constant that's -// true iff T is type ProtocolMessage, proto2::Message, or a subclass -// of those. -template -struct IsAProtocolMessage - : public bool_constant< - ImplicitlyConvertible::value || - ImplicitlyConvertible::value> { -}; - -// When the compiler sees expression IsContainerTest(0), if C is an -// STL-style container class, the first overload of IsContainerTest -// will be viable (since both C::iterator* and C::const_iterator* are -// valid types and NULL can be implicitly converted to them). It will -// be picked over the second overload as 'int' is a perfect match for -// the type of argument 0. If C::iterator or C::const_iterator is not -// a valid type, the first overload is not viable, and the second -// overload will be picked. Therefore, we can determine whether C is -// a container class by checking the type of IsContainerTest(0). -// The value of the expression is insignificant. -// -// Note that we look for both C::iterator and C::const_iterator. The -// reason is that C++ injects the name of a class as a member of the -// class itself (e.g. you can refer to class iterator as either -// 'iterator' or 'iterator::iterator'). If we look for C::iterator -// only, for example, we would mistakenly think that a class named -// iterator is an STL container. -// -// Also note that the simpler approach of overloading -// IsContainerTest(typename C::const_iterator*) and -// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. -typedef int IsContainer; -template -IsContainer IsContainerTest(int /* dummy */, - typename C::iterator* /* it */ = NULL, - typename C::const_iterator* /* const_it */ = NULL) { - return 0; -} - -typedef char IsNotContainer; -template -IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } - -// EnableIf::type is void when 'Cond' is true, and -// undefined when 'Cond' is false. To use SFINAE to make a function -// overload only apply when a particular expression is true, add -// "typename EnableIf::type* = 0" as the last parameter. -template struct EnableIf; -template<> struct EnableIf { typedef void type; }; // NOLINT - -// Utilities for native arrays. - -// ArrayEq() compares two k-dimensional native arrays using the -// elements' operator==, where k can be any integer >= 0. When k is -// 0, ArrayEq() degenerates into comparing a single pair of values. - -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs); - -// This generic version is used when k is 0. -template -inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } - -// This overload is used when k >= 1. -template -inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { - return internal::ArrayEq(lhs, N, rhs); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous ArrayEq() function, arrays with different sizes would -// lead to different copies of the template code. -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs) { - for (size_t i = 0; i != size; i++) { - if (!internal::ArrayEq(lhs[i], rhs[i])) - return false; - } - return true; -} - -// Finds the first element in the iterator range [begin, end) that -// equals elem. Element may be a native array type itself. -template -Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { - for (Iter it = begin; it != end; ++it) { - if (internal::ArrayEq(*it, elem)) - return it; - } - return end; -} - -// CopyArray() copies a k-dimensional native array using the elements' -// operator=, where k can be any integer >= 0. When k is 0, -// CopyArray() degenerates into copying a single value. - -template -void CopyArray(const T* from, size_t size, U* to); - -// This generic version is used when k is 0. -template -inline void CopyArray(const T& from, U* to) { *to = from; } - -// This overload is used when k >= 1. -template -inline void CopyArray(const T(&from)[N], U(*to)[N]) { - internal::CopyArray(from, N, *to); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous CopyArray() function, arrays with different sizes -// would lead to different copies of the template code. -template -void CopyArray(const T* from, size_t size, U* to) { - for (size_t i = 0; i != size; i++) { - internal::CopyArray(from[i], to + i); - } -} - -// The relation between an NativeArray object (see below) and the -// native array it represents. -// We use 2 different structs to allow non-copyable types to be used, as long -// as RelationToSourceReference() is passed. -struct RelationToSourceReference {}; -struct RelationToSourceCopy {}; - -// Adapts a native array to a read-only STL-style container. Instead -// of the complete STL container concept, this adaptor only implements -// members useful for Google Mock's container matchers. New members -// should be added as needed. To simplify the implementation, we only -// support Element being a raw type (i.e. having no top-level const or -// reference modifier). It's the client's responsibility to satisfy -// this requirement. Element can be an array type itself (hence -// multi-dimensional arrays are supported). -template -class NativeArray { - public: - // STL-style container typedefs. - typedef Element value_type; - typedef Element* iterator; - typedef const Element* const_iterator; - - // Constructs from a native array. References the source. - NativeArray(const Element* array, size_t count, RelationToSourceReference) { - InitRef(array, count); - } - - // Constructs from a native array. Copies the source. - NativeArray(const Element* array, size_t count, RelationToSourceCopy) { - InitCopy(array, count); - } - - // Copy constructor. - NativeArray(const NativeArray& rhs) { - (this->*rhs.clone_)(rhs.array_, rhs.size_); - } - - ~NativeArray() { - if (clone_ != &NativeArray::InitRef) - delete[] array_; - } - - // STL-style container methods. - size_t size() const { return size_; } - const_iterator begin() const { return array_; } - const_iterator end() const { return array_ + size_; } - bool operator==(const NativeArray& rhs) const { - return size() == rhs.size() && - ArrayEq(begin(), size(), rhs.begin()); - } - - private: - enum { - kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper< - Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value, - }; - - // Initializes this object with a copy of the input. - void InitCopy(const Element* array, size_t a_size) { - Element* const copy = new Element[a_size]; - CopyArray(array, a_size, copy); - array_ = copy; - size_ = a_size; - clone_ = &NativeArray::InitCopy; - } - - // Initializes this object with a reference of the input. - void InitRef(const Element* array, size_t a_size) { - array_ = array; - size_ = a_size; - clone_ = &NativeArray::InitRef; - } - - const Element* array_; - size_t size_; - void (NativeArray::*clone_)(const Element*, size_t); - - GTEST_DISALLOW_ASSIGN_(NativeArray); -}; - -} // namespace internal -} // namespace testing - -#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ - ::testing::internal::AssertHelper(result_type, file, line, message) \ - = ::testing::Message() - -#define GTEST_MESSAGE_(message, result_type) \ - GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) - -#define GTEST_FATAL_FAILURE_(message) \ - return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) - -#define GTEST_NONFATAL_FAILURE_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) - -#define GTEST_SUCCESS_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) - -// Suppresses MSVC warnings 4072 (unreachable code) for the code following -// statement if it returns or throws (or doesn't return or throw in some -// situations). -#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ - if (::testing::internal::AlwaysTrue()) { statement; } - -#define GTEST_TEST_THROW_(statement, expected_exception, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::ConstCharPtr gtest_msg = "") { \ - bool gtest_caught_expected = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (expected_exception const&) { \ - gtest_caught_expected = true; \ - } \ - catch (...) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws a different type."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - if (!gtest_caught_expected) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws nothing."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ - fail(gtest_msg.value) - -#define GTEST_TEST_NO_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ - fail("Expected: " #statement " doesn't throw an exception.\n" \ - " Actual: it throws.") - -#define GTEST_TEST_ANY_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - bool gtest_caught_any = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - gtest_caught_any = true; \ - } \ - if (!gtest_caught_any) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ - fail("Expected: " #statement " throws an exception.\n" \ - " Actual: it doesn't.") - - -// Implements Boolean test assertions such as EXPECT_TRUE. expression can be -// either a boolean expression or an AssertionResult. text is a textual -// represenation of expression as it was passed into the EXPECT_TRUE. -#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ - ; \ - else \ - fail(::testing::internal::GetBoolAssertionFailureMessage(\ - gtest_ar_, text, #actual, #expected).c_str()) - -#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ - fail("Expected: " #statement " doesn't generate new fatal " \ - "failures in the current thread.\n" \ - " Actual: it does.") - -// Expands to the name of the class that implements the given test. -#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - test_case_name##_##test_name##_Test - -// Helper macro for defining tests. -#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\ -class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ - public:\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ - private:\ - virtual void TestBody();\ - static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ -};\ -\ -::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ - ::test_info_ =\ - ::testing::internal::MakeAndRegisterTestInfo(\ - #test_case_name, #test_name, NULL, NULL, \ - ::testing::internal::CodeLocation(__FILE__, __LINE__), \ - (parent_id), \ - parent_class::SetUpTestCase, \ - parent_class::TearDownTestCase, \ - new ::testing::internal::TestFactoryImpl<\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ -void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ - diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h deleted file mode 100644 index 36029422174..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2003 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: Dan Egnor (egnor@google.com) -// -// A "smart" pointer type with reference tracking. Every pointer to a -// particular object is kept on a circular linked list. When the last pointer -// to an object is destroyed or reassigned, the object is deleted. -// -// Used properly, this deletes the object when the last reference goes away. -// There are several caveats: -// - Like all reference counting schemes, cycles lead to leaks. -// - Each smart pointer is actually two pointers (8 bytes instead of 4). -// - Every time a pointer is assigned, the entire list of pointers to that -// object is traversed. This class is therefore NOT SUITABLE when there -// will often be more than two or three pointers to a particular object. -// - References are only tracked as long as linked_ptr<> objects are copied. -// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS -// will happen (double deletion). -// -// A good use of this class is storing object references in STL containers. -// You can safely put linked_ptr<> in a vector<>. -// Other uses may not be as good. -// -// Note: If you use an incomplete type with linked_ptr<>, the class -// *containing* linked_ptr<> must have a constructor and destructor (even -// if they do nothing!). -// -// Bill Gibbons suggested we use something like this. -// -// Thread Safety: -// Unlike other linked_ptr implementations, in this implementation -// a linked_ptr object is thread-safe in the sense that: -// - it's safe to copy linked_ptr objects concurrently, -// - it's safe to copy *from* a linked_ptr and read its underlying -// raw pointer (e.g. via get()) concurrently, and -// - it's safe to write to two linked_ptrs that point to the same -// shared object concurrently. -// TODO(wan@google.com): rename this to safe_linked_ptr to avoid -// confusion with normal linked_ptr. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ - -#include -#include - -#include "gtest/internal/gtest-port.h" - -namespace testing { -namespace internal { - -// Protects copying of all linked_ptr objects. -GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); - -// This is used internally by all instances of linked_ptr<>. It needs to be -// a non-template class because different types of linked_ptr<> can refer to -// the same object (linked_ptr(obj) vs linked_ptr(obj)). -// So, it needs to be possible for different types of linked_ptr to participate -// in the same circular linked list, so we need a single class type here. -// -// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr. -class linked_ptr_internal { - public: - // Create a new circle that includes only this instance. - void join_new() { - next_ = this; - } - - // Many linked_ptr operations may change p.link_ for some linked_ptr - // variable p in the same circle as this object. Therefore we need - // to prevent two such operations from occurring concurrently. - // - // Note that different types of linked_ptr objects can coexist in a - // circle (e.g. linked_ptr, linked_ptr, and - // linked_ptr). Therefore we must use a single mutex to - // protect all linked_ptr objects. This can create serious - // contention in production code, but is acceptable in a testing - // framework. - - // Join an existing circle. - void join(linked_ptr_internal const* ptr) - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - linked_ptr_internal const* p = ptr; - while (p->next_ != ptr) { - assert(p->next_ != this && - "Trying to join() a linked ring we are already in. " - "Is GMock thread safety enabled?"); - p = p->next_; - } - p->next_ = this; - next_ = ptr; - } - - // Leave whatever circle we're part of. Returns true if we were the - // last member of the circle. Once this is done, you can join() another. - bool depart() - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - if (next_ == this) return true; - linked_ptr_internal const* p = next_; - while (p->next_ != this) { - assert(p->next_ != next_ && - "Trying to depart() a linked ring we are not in. " - "Is GMock thread safety enabled?"); - p = p->next_; - } - p->next_ = next_; - return false; - } - - private: - mutable linked_ptr_internal const* next_; -}; - -template -class linked_ptr { - public: - typedef T element_type; - - // Take over ownership of a raw pointer. This should happen as soon as - // possible after the object is created. - explicit linked_ptr(T* ptr = NULL) { capture(ptr); } - ~linked_ptr() { depart(); } - - // Copy an existing linked_ptr<>, adding ourselves to the list of references. - template linked_ptr(linked_ptr const& ptr) { copy(&ptr); } - linked_ptr(linked_ptr const& ptr) { // NOLINT - assert(&ptr != this); - copy(&ptr); - } - - // Assignment releases the old value and acquires the new. - template linked_ptr& operator=(linked_ptr const& ptr) { - depart(); - copy(&ptr); - return *this; - } - - linked_ptr& operator=(linked_ptr const& ptr) { - if (&ptr != this) { - depart(); - copy(&ptr); - } - return *this; - } - - // Smart pointer members. - void reset(T* ptr = NULL) { - depart(); - capture(ptr); - } - T* get() const { return value_; } - T* operator->() const { return value_; } - T& operator*() const { return *value_; } - - bool operator==(T* p) const { return value_ == p; } - bool operator!=(T* p) const { return value_ != p; } - template - bool operator==(linked_ptr const& ptr) const { - return value_ == ptr.get(); - } - template - bool operator!=(linked_ptr const& ptr) const { - return value_ != ptr.get(); - } - - private: - template - friend class linked_ptr; - - T* value_; - linked_ptr_internal link_; - - void depart() { - if (link_.depart()) delete value_; - } - - void capture(T* ptr) { - value_ = ptr; - link_.join_new(); - } - - template void copy(linked_ptr const* ptr) { - value_ = ptr->get(); - if (value_) - link_.join(&ptr->link_); - else - link_.join_new(); - } -}; - -template inline -bool operator==(T* ptr, const linked_ptr& x) { - return ptr == x.get(); -} - -template inline -bool operator!=(T* ptr, const linked_ptr& x) { - return ptr != x.get(); -} - -// A function to convert T* into linked_ptr -// Doing e.g. make_linked_ptr(new FooBarBaz(arg)) is a shorter notation -// for linked_ptr >(new FooBarBaz(arg)) -template -linked_ptr make_linked_ptr(T* ptr) { - return linked_ptr(ptr); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h deleted file mode 100644 index 4d1d81d20ff..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h +++ /dev/null @@ -1,5146 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-param-util-generated.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most 50 arguments in Values, -// and at most 10 arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tuple which is -// currently set at 10. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-port.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -template -class ValueArray1 { - public: - explicit ValueArray1(T1 v1) : v1_(v1) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray1& other); - - const T1 v1_; -}; - -template -class ValueArray2 { - public: - ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray2& other); - - const T1 v1_; - const T2 v2_; -}; - -template -class ValueArray3 { - public: - ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray3& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; -}; - -template -class ValueArray4 { - public: - ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray4& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; -}; - -template -class ValueArray5 { - public: - ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray5& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; -}; - -template -class ValueArray6 { - public: - ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray6& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; -}; - -template -class ValueArray7 { - public: - ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray7& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; -}; - -template -class ValueArray8 { - public: - ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray8& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; -}; - -template -class ValueArray9 { - public: - ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray9& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; -}; - -template -class ValueArray10 { - public: - ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray10& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; -}; - -template -class ValueArray11 { - public: - ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray11& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; -}; - -template -class ValueArray12 { - public: - ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray12& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; -}; - -template -class ValueArray13 { - public: - ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray13& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; -}; - -template -class ValueArray14 { - public: - ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray14& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; -}; - -template -class ValueArray15 { - public: - ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray15& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; -}; - -template -class ValueArray16 { - public: - ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray16& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; -}; - -template -class ValueArray17 { - public: - ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray17& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; -}; - -template -class ValueArray18 { - public: - ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray18& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; -}; - -template -class ValueArray19 { - public: - ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray19& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; -}; - -template -class ValueArray20 { - public: - ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray20& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; -}; - -template -class ValueArray21 { - public: - ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray21& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; -}; - -template -class ValueArray22 { - public: - ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray22& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; -}; - -template -class ValueArray23 { - public: - ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray23& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; -}; - -template -class ValueArray24 { - public: - ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray24& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; -}; - -template -class ValueArray25 { - public: - ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray25& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; -}; - -template -class ValueArray26 { - public: - ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray26& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; -}; - -template -class ValueArray27 { - public: - ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray27& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; -}; - -template -class ValueArray28 { - public: - ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray28& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; -}; - -template -class ValueArray29 { - public: - ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray29& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; -}; - -template -class ValueArray30 { - public: - ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray30& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; -}; - -template -class ValueArray31 { - public: - ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray31& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; -}; - -template -class ValueArray32 { - public: - ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray32& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; -}; - -template -class ValueArray33 { - public: - ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray33& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; -}; - -template -class ValueArray34 { - public: - ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray34& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; -}; - -template -class ValueArray35 { - public: - ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray35& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; -}; - -template -class ValueArray36 { - public: - ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray36& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; -}; - -template -class ValueArray37 { - public: - ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray37& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; -}; - -template -class ValueArray38 { - public: - ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray38& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; -}; - -template -class ValueArray39 { - public: - ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray39& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; -}; - -template -class ValueArray40 { - public: - ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray40& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; -}; - -template -class ValueArray41 { - public: - ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray41& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; -}; - -template -class ValueArray42 { - public: - ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray42& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; -}; - -template -class ValueArray43 { - public: - ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), - v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray43& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; -}; - -template -class ValueArray44 { - public: - ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), - v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), - v43_(v43), v44_(v44) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray44& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; -}; - -template -class ValueArray45 { - public: - ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), - v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray45& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; -}; - -template -class ValueArray46 { - public: - ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray46& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; -}; - -template -class ValueArray47 { - public: - ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), - v47_(v47) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray47& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; -}; - -template -class ValueArray48 { - public: - ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), - v46_(v46), v47_(v47), v48_(v48) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray48& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; -}; - -template -class ValueArray49 { - public: - ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, - T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray49& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; -}; - -template -class ValueArray50 { - public: - ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, - T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_), static_cast(v50_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray50& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; - const T50 v50_; -}; - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -template -class CartesianProductGenerator2 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator2(const ParamGenerator& g1, - const ParamGenerator& g2) - : g1_(g1), g2_(g2) {} - virtual ~CartesianProductGenerator2() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current2_; - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - ParamType current_value_; - }; // class CartesianProductGenerator2::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator2& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; -}; // class CartesianProductGenerator2 - - -template -class CartesianProductGenerator3 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator3(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - virtual ~CartesianProductGenerator3() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current3_; - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - ParamType current_value_; - }; // class CartesianProductGenerator3::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator3& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; -}; // class CartesianProductGenerator3 - - -template -class CartesianProductGenerator4 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator4(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - virtual ~CartesianProductGenerator4() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current4_; - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - ParamType current_value_; - }; // class CartesianProductGenerator4::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator4& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; -}; // class CartesianProductGenerator4 - - -template -class CartesianProductGenerator5 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator5(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - virtual ~CartesianProductGenerator5() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current5_; - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - ParamType current_value_; - }; // class CartesianProductGenerator5::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator5& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; -}; // class CartesianProductGenerator5 - - -template -class CartesianProductGenerator6 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator6(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - virtual ~CartesianProductGenerator6() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current6_; - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - ParamType current_value_; - }; // class CartesianProductGenerator6::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator6& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; -}; // class CartesianProductGenerator6 - - -template -class CartesianProductGenerator7 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator7(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - virtual ~CartesianProductGenerator7() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current7_; - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - ParamType current_value_; - }; // class CartesianProductGenerator7::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator7& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; -}; // class CartesianProductGenerator7 - - -template -class CartesianProductGenerator8 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator8(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - virtual ~CartesianProductGenerator8() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current8_; - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - ParamType current_value_; - }; // class CartesianProductGenerator8::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator8& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; -}; // class CartesianProductGenerator8 - - -template -class CartesianProductGenerator9 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator9(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - virtual ~CartesianProductGenerator9() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current9_; - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - ParamType current_value_; - }; // class CartesianProductGenerator9::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator9& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; -}; // class CartesianProductGenerator9 - - -template -class CartesianProductGenerator10 - : public ParamGeneratorInterface< ::testing::tuple > { - public: - typedef ::testing::tuple ParamType; - - CartesianProductGenerator10(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9, - const ParamGenerator& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - virtual ~CartesianProductGenerator10() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end(), g10_, g10_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9, - const ParamGenerator& g10, - const typename ParamGenerator::iterator& current10) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9), - begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current10_; - if (current10_ == end10_) { - current10_ = begin10_; - ++current9_; - } - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_ && - current10_ == typed_other->current10_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_), - begin10_(other.begin10_), - end10_(other.end10_), - current10_(other.current10_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_, *current10_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_ || - current10_ == end10_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - const typename ParamGenerator::iterator begin10_; - const typename ParamGenerator::iterator end10_; - typename ParamGenerator::iterator current10_; - ParamType current_value_; - }; // class CartesianProductGenerator10::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator10& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; - const ParamGenerator g10_; -}; // class CartesianProductGenerator10 - - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -template -class CartesianProductHolder2 { - public: -CartesianProductHolder2(const Generator1& g1, const Generator2& g2) - : g1_(g1), g2_(g2) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator2( - static_cast >(g1_), - static_cast >(g2_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder2& other); - - const Generator1 g1_; - const Generator2 g2_; -}; // class CartesianProductHolder2 - -template -class CartesianProductHolder3 { - public: -CartesianProductHolder3(const Generator1& g1, const Generator2& g2, - const Generator3& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator3( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder3& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; -}; // class CartesianProductHolder3 - -template -class CartesianProductHolder4 { - public: -CartesianProductHolder4(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator4( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder4& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; -}; // class CartesianProductHolder4 - -template -class CartesianProductHolder5 { - public: -CartesianProductHolder5(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator5( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder5& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; -}; // class CartesianProductHolder5 - -template -class CartesianProductHolder6 { - public: -CartesianProductHolder6(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator6( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder6& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; -}; // class CartesianProductHolder6 - -template -class CartesianProductHolder7 { - public: -CartesianProductHolder7(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator7( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder7& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; -}; // class CartesianProductHolder7 - -template -class CartesianProductHolder8 { - public: -CartesianProductHolder8(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator8( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder8& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; -}; // class CartesianProductHolder8 - -template -class CartesianProductHolder9 { - public: -CartesianProductHolder9(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator9( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder9& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; -}; // class CartesianProductHolder9 - -template -class CartesianProductHolder10 { - public: -CartesianProductHolder10(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9, const Generator10& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - template - operator ParamGenerator< ::testing::tuple >() const { - return ParamGenerator< ::testing::tuple >( - new CartesianProductGenerator10( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_), - static_cast >(g10_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder10& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; - const Generator10 g10_; -}; // class CartesianProductHolder10 - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump deleted file mode 100644 index 5c7c47af0bb..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +++ /dev/null @@ -1,286 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 50 $$ Maximum length of Values arguments we want to support. -$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most $n arguments in Values, -// and at most $maxtuple arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tuple which is -// currently set at $maxtuple. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-port.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -$range i 1..n -$for i [[ -$range j 1..i - -template <$for j, [[typename T$j]]> -class ValueArray$i { - public: - $if i==1 [[explicit ]]ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {} - - template - operator ParamGenerator() const { - const T array[] = {$for j, [[static_cast(v$(j)_)]]}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray$i& other); - -$for j [[ - - const T$j v$(j)_; -]] - -}; - -]] - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -$range i 2..maxtuple -$for i [[ -$range j 1..i -$range k 2..i - -template <$for j, [[typename T$j]]> -class CartesianProductGenerator$i - : public ParamGeneratorInterface< ::testing::tuple<$for j, [[T$j]]> > { - public: - typedef ::testing::tuple<$for j, [[T$j]]> ParamType; - - CartesianProductGenerator$i($for j, [[const ParamGenerator& g$j]]) - : $for j, [[g$(j)_(g$j)]] {} - virtual ~CartesianProductGenerator$i() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, $for j, [[ - - const ParamGenerator& g$j, - const typename ParamGenerator::iterator& current$(j)]]) - : base_(base), -$for j, [[ - - begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j) -]] { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current$(i)_; - -$for k [[ - if (current$(i+2-k)_ == end$(i+2-k)_) { - current$(i+2-k)_ = begin$(i+2-k)_; - ++current$(i+2-k-1)_; - } - -]] - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ($for j && [[ - - current$(j)_ == typed_other->current$(j)_ -]]); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), $for j, [[ - - begin$(j)_(other.begin$(j)_), - end$(j)_(other.end$(j)_), - current$(j)_(other.current$(j)_) -]] { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType($for j, [[*current$(j)_]]); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return -$for j || [[ - - current$(j)_ == end$(j)_ -]]; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. -$for j [[ - - const typename ParamGenerator::iterator begin$(j)_; - const typename ParamGenerator::iterator end$(j)_; - typename ParamGenerator::iterator current$(j)_; -]] - - ParamType current_value_; - }; // class CartesianProductGenerator$i::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator$i& other); - - -$for j [[ - const ParamGenerator g$(j)_; - -]] -}; // class CartesianProductGenerator$i - - -]] - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -$range i 2..maxtuple -$for i [[ -$range j 1..i - -template <$for j, [[class Generator$j]]> -class CartesianProductHolder$i { - public: -CartesianProductHolder$i($for j, [[const Generator$j& g$j]]) - : $for j, [[g$(j)_(g$j)]] {} - template <$for j, [[typename T$j]]> - operator ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >() const { - return ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >( - new CartesianProductGenerator$i<$for j, [[T$j]]>( -$for j,[[ - - static_cast >(g$(j)_) -]])); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder$i& other); - - -$for j [[ - const Generator$j g$(j)_; - -]] -}; // class CartesianProductHolder$i - -]] - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util.h deleted file mode 100644 index 82cab9b0201..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-param-util.h +++ /dev/null @@ -1,731 +0,0 @@ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ - -#include - -#include -#include -#include -#include - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-linked_ptr.h" -#include "gtest/internal/gtest-port.h" -#include "gtest/gtest-printers.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Input to a parameterized test name generator, describing a test parameter. -// Consists of the parameter value and the integer parameter index. -template -struct TestParamInfo { - TestParamInfo(const ParamType& a_param, size_t an_index) : - param(a_param), - index(an_index) {} - ParamType param; - size_t index; -}; - -// A builtin parameterized test name generator which returns the result of -// testing::PrintToString. -struct PrintToStringParamName { - template - std::string operator()(const TestParamInfo& info) const { - return PrintToString(info.param); - } -}; - -namespace internal { - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Outputs a message explaining invalid registration of different -// fixture class for the same test case. This may happen when -// TEST_P macro is used to define two tests with the same name -// but in different namespaces. -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - CodeLocation code_location); - -template class ParamGeneratorInterface; -template class ParamGenerator; - -// Interface for iterating over elements provided by an implementation -// of ParamGeneratorInterface. -template -class ParamIteratorInterface { - public: - virtual ~ParamIteratorInterface() {} - // A pointer to the base generator instance. - // Used only for the purposes of iterator comparison - // to make sure that two iterators belong to the same generator. - virtual const ParamGeneratorInterface* BaseGenerator() const = 0; - // Advances iterator to point to the next element - // provided by the generator. The caller is responsible - // for not calling Advance() on an iterator equal to - // BaseGenerator()->End(). - virtual void Advance() = 0; - // Clones the iterator object. Used for implementing copy semantics - // of ParamIterator. - virtual ParamIteratorInterface* Clone() const = 0; - // Dereferences the current iterator and provides (read-only) access - // to the pointed value. It is the caller's responsibility not to call - // Current() on an iterator equal to BaseGenerator()->End(). - // Used for implementing ParamGenerator::operator*(). - virtual const T* Current() const = 0; - // Determines whether the given iterator and other point to the same - // element in the sequence generated by the generator. - // Used for implementing ParamGenerator::operator==(). - virtual bool Equals(const ParamIteratorInterface& other) const = 0; -}; - -// Class iterating over elements provided by an implementation of -// ParamGeneratorInterface. It wraps ParamIteratorInterface -// and implements the const forward iterator concept. -template -class ParamIterator { - public: - typedef T value_type; - typedef const T& reference; - typedef ptrdiff_t difference_type; - - // ParamIterator assumes ownership of the impl_ pointer. - ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} - ParamIterator& operator=(const ParamIterator& other) { - if (this != &other) - impl_.reset(other.impl_->Clone()); - return *this; - } - - const T& operator*() const { return *impl_->Current(); } - const T* operator->() const { return impl_->Current(); } - // Prefix version of operator++. - ParamIterator& operator++() { - impl_->Advance(); - return *this; - } - // Postfix version of operator++. - ParamIterator operator++(int /*unused*/) { - ParamIteratorInterface* clone = impl_->Clone(); - impl_->Advance(); - return ParamIterator(clone); - } - bool operator==(const ParamIterator& other) const { - return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); - } - bool operator!=(const ParamIterator& other) const { - return !(*this == other); - } - - private: - friend class ParamGenerator; - explicit ParamIterator(ParamIteratorInterface* impl) : impl_(impl) {} - scoped_ptr > impl_; -}; - -// ParamGeneratorInterface is the binary interface to access generators -// defined in other translation units. -template -class ParamGeneratorInterface { - public: - typedef T ParamType; - - virtual ~ParamGeneratorInterface() {} - - // Generator interface definition - virtual ParamIteratorInterface* Begin() const = 0; - virtual ParamIteratorInterface* End() const = 0; -}; - -// Wraps ParamGeneratorInterface and provides general generator syntax -// compatible with the STL Container concept. -// This class implements copy initialization semantics and the contained -// ParamGeneratorInterface instance is shared among all copies -// of the original object. This is possible because that instance is immutable. -template -class ParamGenerator { - public: - typedef ParamIterator iterator; - - explicit ParamGenerator(ParamGeneratorInterface* impl) : impl_(impl) {} - ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} - - ParamGenerator& operator=(const ParamGenerator& other) { - impl_ = other.impl_; - return *this; - } - - iterator begin() const { return iterator(impl_->Begin()); } - iterator end() const { return iterator(impl_->End()); } - - private: - linked_ptr > impl_; -}; - -// Generates values from a range of two comparable values. Can be used to -// generate sequences of user-defined types that implement operator+() and -// operator<(). -// This class is used in the Range() function. -template -class RangeGenerator : public ParamGeneratorInterface { - public: - RangeGenerator(T begin, T end, IncrementT step) - : begin_(begin), end_(end), - step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} - virtual ~RangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, begin_, 0, step_); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, end_, end_index_, step_); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, T value, int index, - IncrementT step) - : base_(base), value_(value), index_(index), step_(step) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - value_ = static_cast(value_ + step_); - index_++; - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const T* Current() const { return &value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const int other_index = - CheckedDowncastToActualType(&other)->index_; - return index_ == other_index; - } - - private: - Iterator(const Iterator& other) - : ParamIteratorInterface(), - base_(other.base_), value_(other.value_), index_(other.index_), - step_(other.step_) {} - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - T value_; - int index_; - const IncrementT step_; - }; // class RangeGenerator::Iterator - - static int CalculateEndIndex(const T& begin, - const T& end, - const IncrementT& step) { - int end_index = 0; - for (T i = begin; i < end; i = static_cast(i + step)) - end_index++; - return end_index; - } - - // No implementation - assignment is unsupported. - void operator=(const RangeGenerator& other); - - const T begin_; - const T end_; - const IncrementT step_; - // The index for the end() iterator. All the elements in the generated - // sequence are indexed (0-based) to aid iterator comparison. - const int end_index_; -}; // class RangeGenerator - - -// Generates values from a pair of STL-style iterators. Used in the -// ValuesIn() function. The elements are copied from the source range -// since the source can be located on the stack, and the generator -// is likely to persist beyond that stack frame. -template -class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { - public: - template - ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) - : container_(begin, end) {} - virtual ~ValuesInIteratorRangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, container_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, container_.end()); - } - - private: - typedef typename ::std::vector ContainerType; - - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - typename ContainerType::const_iterator iterator) - : base_(base), iterator_(iterator) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - ++iterator_; - value_.reset(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - // We need to use cached value referenced by iterator_ because *iterator_ - // can return a temporary object (and of type other then T), so just - // having "return &*iterator_;" doesn't work. - // value_ is updated here and not in Advance() because Advance() - // can advance iterator_ beyond the end of the range, and we cannot - // detect that fact. The client code, on the other hand, is - // responsible for not calling Current() on an out-of-range iterator. - virtual const T* Current() const { - if (value_.get() == NULL) - value_.reset(new T(*iterator_)); - return value_.get(); - } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - return iterator_ == - CheckedDowncastToActualType(&other)->iterator_; - } - - private: - Iterator(const Iterator& other) - // The explicit constructor call suppresses a false warning - // emitted by gcc when supplied with the -Wextra option. - : ParamIteratorInterface(), - base_(other.base_), - iterator_(other.iterator_) {} - - const ParamGeneratorInterface* const base_; - typename ContainerType::const_iterator iterator_; - // A cached value of *iterator_. We keep it here to allow access by - // pointer in the wrapping iterator's operator->(). - // value_ needs to be mutable to be accessed in Current(). - // Use of scoped_ptr helps manage cached value's lifetime, - // which is bound by the lifespan of the iterator itself. - mutable scoped_ptr value_; - }; // class ValuesInIteratorRangeGenerator::Iterator - - // No implementation - assignment is unsupported. - void operator=(const ValuesInIteratorRangeGenerator& other); - - const ContainerType container_; -}; // class ValuesInIteratorRangeGenerator - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Default parameterized test name generator, returns a string containing the -// integer test parameter index. -template -std::string DefaultParamName(const TestParamInfo& info) { - Message name_stream; - name_stream << info.index; - return name_stream.GetString(); -} - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Parameterized test name overload helpers, which help the -// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized -// test name generator and user param name generator. -template -ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) { - return func; -} - -template -struct ParamNameGenFunc { - typedef std::string Type(const TestParamInfo&); -}; - -template -typename ParamNameGenFunc::Type *GetParamNameGen() { - return DefaultParamName; -} - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Stores a parameter value and later creates tests parameterized with that -// value. -template -class ParameterizedTestFactory : public TestFactoryBase { - public: - typedef typename TestClass::ParamType ParamType; - explicit ParameterizedTestFactory(ParamType parameter) : - parameter_(parameter) {} - virtual Test* CreateTest() { - TestClass::SetParam(¶meter_); - return new TestClass(); - } - - private: - const ParamType parameter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactoryBase is a base class for meta-factories that create -// test factories for passing into MakeAndRegisterTestInfo function. -template -class TestMetaFactoryBase { - public: - virtual ~TestMetaFactoryBase() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactory creates test factories for passing into -// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives -// ownership of test factory pointer, same factory object cannot be passed -// into that method twice. But ParameterizedTestCaseInfo is going to call -// it for each Test/Parameter value combination. Thus it needs meta factory -// creator class. -template -class TestMetaFactory - : public TestMetaFactoryBase { - public: - typedef typename TestCase::ParamType ParamType; - - TestMetaFactory() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { - return new ParameterizedTestFactory(parameter); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfoBase is a generic interface -// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase -// accumulates test information provided by TEST_P macro invocations -// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations -// and uses that information to register all resulting test instances -// in RegisterTests method. The ParameterizeTestCaseRegistry class holds -// a collection of pointers to the ParameterizedTestCaseInfo objects -// and calls RegisterTests() on each of them when asked. -class ParameterizedTestCaseInfoBase { - public: - virtual ~ParameterizedTestCaseInfoBase() {} - - // Base part of test case name for display purposes. - virtual const string& GetTestCaseName() const = 0; - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const = 0; - // UnitTest class invokes this method to register tests in this - // test case right before running them in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - virtual void RegisterTests() = 0; - - protected: - ParameterizedTestCaseInfoBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P -// macro invocations for a particular test case and generators -// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that -// test case. It registers tests with all values generated by all -// generators when asked. -template -class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { - public: - // ParamType and GeneratorCreationFunc are private types but are required - // for declarations of public methods AddTestPattern() and - // AddTestCaseInstantiation(). - typedef typename TestCase::ParamType ParamType; - // A function that returns an instance of appropriate generator type. - typedef ParamGenerator(GeneratorCreationFunc)(); - typedef typename ParamNameGenFunc::Type ParamNameGeneratorFunc; - - explicit ParameterizedTestCaseInfo( - const char* name, CodeLocation code_location) - : test_case_name_(name), code_location_(code_location) {} - - // Test case base name for display purposes. - virtual const string& GetTestCaseName() const { return test_case_name_; } - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); } - // TEST_P macro uses AddTestPattern() to record information - // about a single test in a LocalTestInfo structure. - // test_case_name is the base name of the test case (without invocation - // prefix). test_base_name is the name of an individual test without - // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is - // test case base name and DoBar is test base name. - void AddTestPattern(const char* test_case_name, - const char* test_base_name, - TestMetaFactoryBase* meta_factory) { - tests_.push_back(linked_ptr(new TestInfo(test_case_name, - test_base_name, - meta_factory))); - } - // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information - // about a generator. - int AddTestCaseInstantiation(const string& instantiation_name, - GeneratorCreationFunc* func, - ParamNameGeneratorFunc* name_func, - const char* file, - int line) { - instantiations_.push_back( - InstantiationInfo(instantiation_name, func, name_func, file, line)); - return 0; // Return value used only to run this method in namespace scope. - } - // UnitTest class invokes this method to register tests in this test case - // test cases right before running tests in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - // UnitTest has a guard to prevent from calling this method more then once. - virtual void RegisterTests() { - for (typename TestInfoContainer::iterator test_it = tests_.begin(); - test_it != tests_.end(); ++test_it) { - linked_ptr test_info = *test_it; - for (typename InstantiationContainer::iterator gen_it = - instantiations_.begin(); gen_it != instantiations_.end(); - ++gen_it) { - const string& instantiation_name = gen_it->name; - ParamGenerator generator((*gen_it->generator)()); - ParamNameGeneratorFunc* name_func = gen_it->name_func; - const char* file = gen_it->file; - int line = gen_it->line; - - string test_case_name; - if ( !instantiation_name.empty() ) - test_case_name = instantiation_name + "/"; - test_case_name += test_info->test_case_base_name; - - size_t i = 0; - std::set test_param_names; - for (typename ParamGenerator::iterator param_it = - generator.begin(); - param_it != generator.end(); ++param_it, ++i) { - Message test_name_stream; - - std::string param_name = name_func( - TestParamInfo(*param_it, i)); - - GTEST_CHECK_(IsValidParamName(param_name)) - << "Parameterized test name '" << param_name - << "' is invalid, in " << file - << " line " << line << std::endl; - - GTEST_CHECK_(test_param_names.count(param_name) == 0) - << "Duplicate parameterized test name '" << param_name - << "', in " << file << " line " << line << std::endl; - - test_param_names.insert(param_name); - - test_name_stream << test_info->test_base_name << "/" << param_name; - MakeAndRegisterTestInfo( - test_case_name.c_str(), - test_name_stream.GetString().c_str(), - NULL, // No type parameter. - PrintToString(*param_it).c_str(), - code_location_, - GetTestCaseTypeId(), - TestCase::SetUpTestCase, - TestCase::TearDownTestCase, - test_info->test_meta_factory->CreateTestFactory(*param_it)); - } // for param_it - } // for gen_it - } // for test_it - } // RegisterTests - - private: - // LocalTestInfo structure keeps information about a single test registered - // with TEST_P macro. - struct TestInfo { - TestInfo(const char* a_test_case_base_name, - const char* a_test_base_name, - TestMetaFactoryBase* a_test_meta_factory) : - test_case_base_name(a_test_case_base_name), - test_base_name(a_test_base_name), - test_meta_factory(a_test_meta_factory) {} - - const string test_case_base_name; - const string test_base_name; - const scoped_ptr > test_meta_factory; - }; - typedef ::std::vector > TestInfoContainer; - // Records data received from INSTANTIATE_TEST_CASE_P macros: - // - struct InstantiationInfo { - InstantiationInfo(const std::string &name_in, - GeneratorCreationFunc* generator_in, - ParamNameGeneratorFunc* name_func_in, - const char* file_in, - int line_in) - : name(name_in), - generator(generator_in), - name_func(name_func_in), - file(file_in), - line(line_in) {} - - std::string name; - GeneratorCreationFunc* generator; - ParamNameGeneratorFunc* name_func; - const char* file; - int line; - }; - typedef ::std::vector InstantiationContainer; - - static bool IsValidParamName(const std::string& name) { - // Check for empty string - if (name.empty()) - return false; - - // Check for invalid characters - for (std::string::size_type index = 0; index < name.size(); ++index) { - if (!isalnum(name[index]) && name[index] != '_') - return false; - } - - return true; - } - - const string test_case_name_; - CodeLocation code_location_; - TestInfoContainer tests_; - InstantiationContainer instantiations_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); -}; // class ParameterizedTestCaseInfo - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase -// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P -// macros use it to locate their corresponding ParameterizedTestCaseInfo -// descriptors. -class ParameterizedTestCaseRegistry { - public: - ParameterizedTestCaseRegistry() {} - ~ParameterizedTestCaseRegistry() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - delete *it; - } - } - - // Looks up or creates and returns a structure containing information about - // tests and instantiations of a particular test case. - template - ParameterizedTestCaseInfo* GetTestCasePatternHolder( - const char* test_case_name, - CodeLocation code_location) { - ParameterizedTestCaseInfo* typed_test_info = NULL; - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - if ((*it)->GetTestCaseName() == test_case_name) { - if ((*it)->GetTestCaseTypeId() != GetTypeId()) { - // Complain about incorrect usage of Google Test facilities - // and terminate the program since we cannot guaranty correct - // test case setup and tear-down in this case. - ReportInvalidTestCaseType(test_case_name, code_location); - posix::Abort(); - } else { - // At this point we are sure that the object we found is of the same - // type we are looking for, so we downcast it to that type - // without further checks. - typed_test_info = CheckedDowncastToActualType< - ParameterizedTestCaseInfo >(*it); - } - break; - } - } - if (typed_test_info == NULL) { - typed_test_info = new ParameterizedTestCaseInfo( - test_case_name, code_location); - test_case_infos_.push_back(typed_test_info); - } - return typed_test_info; - } - void RegisterTests() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - (*it)->RegisterTests(); - } - } - - private: - typedef ::std::vector TestCaseInfoContainer; - - TestCaseInfoContainer test_case_infos_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); -}; - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port-arch.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port-arch.h deleted file mode 100644 index 74ab949057c..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port-arch.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the GTEST_OS_* macro. -// It is separate from gtest-port.h so that custom/gtest-port.h can include it. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ - -// Determines the platform on which Google Test is compiled. -#ifdef __CYGWIN__ -# define GTEST_OS_CYGWIN 1 -#elif defined __SYMBIAN32__ -# define GTEST_OS_SYMBIAN 1 -#elif defined _WIN32 -# define GTEST_OS_WINDOWS 1 -# ifdef _WIN32_WCE -# define GTEST_OS_WINDOWS_MOBILE 1 -# elif defined(__MINGW__) || defined(__MINGW32__) -# define GTEST_OS_WINDOWS_MINGW 1 -# elif defined(WINAPI_FAMILY) -# include -# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# define GTEST_OS_WINDOWS_DESKTOP 1 -# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -# define GTEST_OS_WINDOWS_PHONE 1 -# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) -# define GTEST_OS_WINDOWS_RT 1 -# else - // WINAPI_FAMILY defined but no known partition matched. - // Default to desktop. -# define GTEST_OS_WINDOWS_DESKTOP 1 -# endif -# else -# define GTEST_OS_WINDOWS_DESKTOP 1 -# endif // _WIN32_WCE -#elif defined __APPLE__ -# define GTEST_OS_MAC 1 -# if TARGET_OS_IPHONE -# define GTEST_OS_IOS 1 -# endif -#elif defined __FreeBSD__ -# define GTEST_OS_FREEBSD 1 -#elif defined __linux__ -# define GTEST_OS_LINUX 1 -# if defined __ANDROID__ -# define GTEST_OS_LINUX_ANDROID 1 -# endif -#elif defined __MVS__ -# define GTEST_OS_ZOS 1 -#elif defined(__sun) && defined(__SVR4) -# define GTEST_OS_SOLARIS 1 -#elif defined(_AIX) -# define GTEST_OS_AIX 1 -#elif defined(__hpux) -# define GTEST_OS_HPUX 1 -#elif defined __native_client__ -# define GTEST_OS_NACL 1 -#elif defined __OpenBSD__ -# define GTEST_OS_OPENBSD 1 -#elif defined __QNX__ -# define GTEST_OS_QNX 1 -#endif // __CYGWIN__ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port.h deleted file mode 100644 index 0094ed5077e..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-port.h +++ /dev/null @@ -1,2554 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan) -// -// Low-level types and utilities for porting Google Test to various -// platforms. All macros ending with _ and symbols defined in an -// internal namespace are subject to change without notice. Code -// outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't -// end with _ are part of Google Test's public API and can be used by -// code outside Google Test. -// -// This file is fundamental to Google Test. All other Google Test source -// files are expected to #include this. Therefore, it cannot #include -// any other Google Test header. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -// Environment-describing macros -// ----------------------------- -// -// Google Test can be used in many different environments. Macros in -// this section tell Google Test what kind of environment it is being -// used in, such that Google Test can provide environment-specific -// features and implementations. -// -// Google Test tries to automatically detect the properties of its -// environment, so users usually don't need to worry about these -// macros. However, the automatic detection is not perfect. -// Sometimes it's necessary for a user to define some of the following -// macros in the build script to override Google Test's decisions. -// -// If the user doesn't define a macro in the list, Google Test will -// provide a default definition. After this header is #included, all -// macros in this list will be defined to either 1 or 0. -// -// Notes to maintainers: -// - Each macro here is a user-tweakable knob; do not grow the list -// lightly. -// - Use #if to key off these macros. Don't use #ifdef or "#if -// defined(...)", which will not work as these macros are ALWAYS -// defined. -// -// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) -// is/isn't available. -// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions -// are enabled. -// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::string, which is different to std::string). -// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::wstring, which is different to std::wstring). -// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular -// expressions are/aren't available. -// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that -// is/isn't available. -// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't -// enabled. -// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that -// std::wstring does/doesn't work (Google Test can -// be used where std::wstring is unavailable). -// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple -// is/isn't available. -// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the -// compiler supports Microsoft's "Structured -// Exception Handling". -// GTEST_HAS_STREAM_REDIRECTION -// - Define it to 1/0 to indicate whether the -// platform supports I/O stream redirection using -// dup() and dup2(). -// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google -// Test's own tr1 tuple implementation should be -// used. Unused when the user sets -// GTEST_HAS_TR1_TUPLE to 0. -// GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test -// is building in C++11/C++98 mode. -// GTEST_LINKED_AS_SHARED_LIBRARY -// - Define to 1 when compiling tests that use -// Google Test as a shared library (known as -// DLL on Windows). -// GTEST_CREATE_SHARED_LIBRARY -// - Define to 1 when compiling Google Test itself -// as a shared library. - -// Platform-indicating macros -// -------------------------- -// -// Macros indicating the platform on which Google Test is being used -// (a macro is defined to 1 if compiled on the given platform; -// otherwise UNDEFINED -- it's never defined to 0.). Google Test -// defines these macros automatically. Code outside Google Test MUST -// NOT define them. -// -// GTEST_OS_AIX - IBM AIX -// GTEST_OS_CYGWIN - Cygwin -// GTEST_OS_FREEBSD - FreeBSD -// GTEST_OS_HPUX - HP-UX -// GTEST_OS_LINUX - Linux -// GTEST_OS_LINUX_ANDROID - Google Android -// GTEST_OS_MAC - Mac OS X -// GTEST_OS_IOS - iOS -// GTEST_OS_NACL - Google Native Client (NaCl) -// GTEST_OS_OPENBSD - OpenBSD -// GTEST_OS_QNX - QNX -// GTEST_OS_SOLARIS - Sun Solaris -// GTEST_OS_SYMBIAN - Symbian -// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) -// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop -// GTEST_OS_WINDOWS_MINGW - MinGW -// GTEST_OS_WINDOWS_MOBILE - Windows Mobile -// GTEST_OS_WINDOWS_PHONE - Windows Phone -// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT -// GTEST_OS_ZOS - z/OS -// -// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the -// most stable support. Since core members of the Google Test project -// don't have access to other platforms, support for them may be less -// stable. If you notice any problems on your platform, please notify -// googletestframework@googlegroups.com (patches for fixing them are -// even more welcome!). -// -// It is possible that none of the GTEST_OS_* macros are defined. - -// Feature-indicating macros -// ------------------------- -// -// Macros indicating which Google Test features are available (a macro -// is defined to 1 if the corresponding feature is supported; -// otherwise UNDEFINED -- it's never defined to 0.). Google Test -// defines these macros automatically. Code outside Google Test MUST -// NOT define them. -// -// These macros are public so that portable tests can be written. -// Such tests typically surround code using a feature with an #if -// which controls that code. For example: -// -// #if GTEST_HAS_DEATH_TEST -// EXPECT_DEATH(DoSomethingDeadly()); -// #endif -// -// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized -// tests) -// GTEST_HAS_DEATH_TEST - death tests -// GTEST_HAS_PARAM_TEST - value-parameterized tests -// GTEST_HAS_TYPED_TEST - typed tests -// GTEST_HAS_TYPED_TEST_P - type-parameterized tests -// GTEST_IS_THREADSAFE - Google Test is thread-safe. -// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with -// GTEST_HAS_POSIX_RE (see above) which users can -// define themselves. -// GTEST_USES_SIMPLE_RE - our own simple regex is used; -// the above two are mutually exclusive. -// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). - -// Misc public macros -// ------------------ -// -// GTEST_FLAG(flag_name) - references the variable corresponding to -// the given Google Test flag. - -// Internal utilities -// ------------------ -// -// The following macros and utilities are for Google Test's INTERNAL -// use only. Code outside Google Test MUST NOT USE THEM DIRECTLY. -// -// Macros for basic C++ coding: -// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. -// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a -// variable don't have to be used. -// GTEST_DISALLOW_ASSIGN_ - disables operator=. -// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. -// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. -// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is -// suppressed (constant conditional). -// GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127 -// is suppressed. -// -// C++11 feature wrappers: -// -// testing::internal::move - portability wrapper for std::move. -// -// Synchronization: -// Mutex, MutexLock, ThreadLocal, GetThreadCount() -// - synchronization primitives. -// -// Template meta programming: -// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. -// IteratorTraits - partial implementation of std::iterator_traits, which -// is not available in libCstd when compiled with Sun C++. -// -// Smart pointers: -// scoped_ptr - as in TR2. -// -// Regular expressions: -// RE - a simple regular expression class using the POSIX -// Extended Regular Expression syntax on UNIX-like -// platforms, or a reduced regular exception syntax on -// other platforms, including Windows. -// -// Logging: -// GTEST_LOG_() - logs messages at the specified severity level. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. -// -// Stdout and stderr capturing: -// CaptureStdout() - starts capturing stdout. -// GetCapturedStdout() - stops capturing stdout and returns the captured -// string. -// CaptureStderr() - starts capturing stderr. -// GetCapturedStderr() - stops capturing stderr and returns the captured -// string. -// -// Integer types: -// TypeWithSize - maps an integer to a int type. -// Int32, UInt32, Int64, UInt64, TimeInMillis -// - integers of known sizes. -// BiggestInt - the biggest signed integer type. -// -// Command-line utilities: -// GTEST_DECLARE_*() - declares a flag. -// GTEST_DEFINE_*() - defines a flag. -// GetInjectableArgvs() - returns the command line as a vector of strings. -// -// Environment variable utilities: -// GetEnv() - gets the value of an environment variable. -// BoolFromGTestEnv() - parses a bool environment variable. -// Int32FromGTestEnv() - parses an Int32 environment variable. -// StringFromGTestEnv() - parses a string environment variable. - -#include // for isspace, etc -#include // for ptrdiff_t -#include -#include -#include -#ifndef _WIN32_WCE -# include -# include -#endif // !_WIN32_WCE - -#if defined __APPLE__ -# include -# include -#endif - -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include -#include // NOLINT - -#include "gtest/internal/gtest-port-arch.h" -#include "gtest/internal/custom/gtest-port.h" - -#if !defined(GTEST_DEV_EMAIL_) -# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" -# define GTEST_FLAG_PREFIX_ "gtest_" -# define GTEST_FLAG_PREFIX_DASH_ "gtest-" -# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" -# define GTEST_NAME_ "Google Test" -# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/" -#endif // !defined(GTEST_DEV_EMAIL_) - -#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_) -# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest" -#endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_) - -// Determines the version of gcc that is used to compile this. -#ifdef __GNUC__ -// 40302 means version 4.3.2. -# define GTEST_GCC_VER_ \ - (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) -#endif // __GNUC__ - -// Macros for disabling Microsoft Visual C++ warnings. -// -// GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385) -// /* code that triggers warnings C4800 and C4385 */ -// GTEST_DISABLE_MSC_WARNINGS_POP_() -#if _MSC_VER >= 1500 -# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \ - __pragma(warning(push)) \ - __pragma(warning(disable: warnings)) -# define GTEST_DISABLE_MSC_WARNINGS_POP_() \ - __pragma(warning(pop)) -#else -// Older versions of MSVC don't have __pragma. -# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) -# define GTEST_DISABLE_MSC_WARNINGS_POP_() -#endif - -#ifndef GTEST_LANG_CXX11 -// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when -// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a -// value for __cplusplus, and recent versions of clang, gcc, and -// probably other compilers set that too in C++11 mode. -# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L -// Compiling in at least C++11 mode. -# define GTEST_LANG_CXX11 1 -# else -# define GTEST_LANG_CXX11 0 -# endif -#endif - -// Distinct from C++11 language support, some environments don't provide -// proper C++11 library support. Notably, it's possible to build in -// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++ -// with no C++11 support. -// -// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__ -// 20110325, but maintenance releases in the 4.4 and 4.5 series followed -// this date, so check for those versions by their date stamps. -// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning -#if GTEST_LANG_CXX11 && \ - (!defined(__GLIBCXX__) || ( \ - __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \ - /* Blacklist of patch releases of older branches: */ \ - __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \ - __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \ - __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \ - __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */ -# define GTEST_STDLIB_CXX11 1 -#endif - -// Only use C++11 library features if the library provides them. -#if GTEST_STDLIB_CXX11 -# define GTEST_HAS_STD_BEGIN_AND_END_ 1 -# define GTEST_HAS_STD_FORWARD_LIST_ 1 -# define GTEST_HAS_STD_FUNCTION_ 1 -# define GTEST_HAS_STD_INITIALIZER_LIST_ 1 -# define GTEST_HAS_STD_MOVE_ 1 -# define GTEST_HAS_STD_SHARED_PTR_ 1 -# define GTEST_HAS_STD_TYPE_TRAITS_ 1 -# define GTEST_HAS_STD_UNIQUE_PTR_ 1 -#endif - -// C++11 specifies that provides std::tuple. -// Some platforms still might not have it, however. -#if GTEST_LANG_CXX11 -# define GTEST_HAS_STD_TUPLE_ 1 -# if defined(__clang__) -// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include -# if defined(__has_include) && !__has_include() -# undef GTEST_HAS_STD_TUPLE_ -# endif -# elif defined(_MSC_VER) -// Inspired by boost/config/stdlib/dinkumware.hpp -# if defined(_CPPLIB_VER) && _CPPLIB_VER < 520 -# undef GTEST_HAS_STD_TUPLE_ -# endif -# elif defined(__GLIBCXX__) -// Inspired by boost/config/stdlib/libstdcpp3.hpp, -// http://gcc.gnu.org/gcc-4.2/changes.html and -// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) -# undef GTEST_HAS_STD_TUPLE_ -# endif -# endif -#endif - -// Brings in definitions for functions used in the testing::internal::posix -// namespace (read, write, close, chdir, isatty, stat). We do not currently -// use them on Windows Mobile. -#if GTEST_OS_WINDOWS -# if !GTEST_OS_WINDOWS_MOBILE -# include -# include -# endif -// In order to avoid having to include , use forward declaration -// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION. -// This assumption is verified by -// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION. -struct _RTL_CRITICAL_SECTION; -#else -// This assumes that non-Windows OSes provide unistd.h. For OSes where this -// is not the case, we need to include headers that provide the functions -// mentioned above. -# include -# include -#endif // GTEST_OS_WINDOWS - -#if GTEST_OS_LINUX_ANDROID -// Used to define __ANDROID_API__ matching the target NDK API level. -# include // NOLINT -#endif - -// Defines this to true iff Google Test can use POSIX regular expressions. -#ifndef GTEST_HAS_POSIX_RE -# if GTEST_OS_LINUX_ANDROID -// On Android, is only available starting with Gingerbread. -# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9) -# else -# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) -# endif -#endif - -#if GTEST_USES_PCRE -// The appropriate headers have already been included. - -#elif GTEST_HAS_POSIX_RE - -// On some platforms, needs someone to define size_t, and -// won't compile otherwise. We can #include it here as we already -// included , which is guaranteed to define size_t through -// . -# include // NOLINT - -# define GTEST_USES_POSIX_RE 1 - -#elif GTEST_OS_WINDOWS - -// is not available on Windows. Use our own simple regex -// implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#else - -// may not be available on this platform. Use our own -// simple regex implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#endif // GTEST_USES_PCRE - -#ifndef GTEST_HAS_EXCEPTIONS -// The user didn't tell us whether exceptions are enabled, so we need -// to figure it out. -# if defined(_MSC_VER) || defined(__BORLANDC__) -// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS -// macro to enable exceptions, so we'll do the same. -// Assumes that exceptions are enabled by default. -# ifndef _HAS_EXCEPTIONS -# define _HAS_EXCEPTIONS 1 -# endif // _HAS_EXCEPTIONS -# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS -# elif defined(__clang__) -// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714, -// but iff cleanups are enabled after that. In Obj-C++ files, there can be -// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions -// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++ -// exceptions starting at clang r206352, but which checked for cleanups prior to -// that. To reliably check for C++ exception availability with clang, check for -// __EXCEPTIONS && __has_feature(cxx_exceptions). -# define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions)) -# elif defined(__GNUC__) && __EXCEPTIONS -// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__SUNPRO_CC) -// Sun Pro CC supports exceptions. However, there is no compile-time way of -// detecting whether they are enabled or not. Therefore, we assume that -// they are enabled unless the user tells us otherwise. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__IBMCPP__) && __EXCEPTIONS -// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__HP_aCC) -// Exception handling is in effect by default in HP aCC compiler. It has to -// be turned of by +noeh compiler option if desired. -# define GTEST_HAS_EXCEPTIONS 1 -# else -// For other compilers, we assume exceptions are disabled to be -// conservative. -# define GTEST_HAS_EXCEPTIONS 0 -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -#endif // GTEST_HAS_EXCEPTIONS - -#if !defined(GTEST_HAS_STD_STRING) -// Even though we don't use this macro any longer, we keep it in case -// some clients still depend on it. -# define GTEST_HAS_STD_STRING 1 -#elif !GTEST_HAS_STD_STRING -// The user told us that ::std::string isn't available. -# error "Google Test cannot be used where ::std::string isn't available." -#endif // !defined(GTEST_HAS_STD_STRING) - -#ifndef GTEST_HAS_GLOBAL_STRING -// The user didn't tell us whether ::string is available, so we need -// to figure it out. - -# define GTEST_HAS_GLOBAL_STRING 0 - -#endif // GTEST_HAS_GLOBAL_STRING - -#ifndef GTEST_HAS_STD_WSTRING -// The user didn't tell us whether ::std::wstring is available, so we need -// to figure it out. -// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring -// is available. - -// Cygwin 1.7 and below doesn't support ::std::wstring. -// Solaris' libc++ doesn't support it either. Android has -// no support for it at least as recent as Froyo (2.2). -# define GTEST_HAS_STD_WSTRING \ - (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) - -#endif // GTEST_HAS_STD_WSTRING - -#ifndef GTEST_HAS_GLOBAL_WSTRING -// The user didn't tell us whether ::wstring is available, so we need -// to figure it out. -# define GTEST_HAS_GLOBAL_WSTRING \ - (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) -#endif // GTEST_HAS_GLOBAL_WSTRING - -// Determines whether RTTI is available. -#ifndef GTEST_HAS_RTTI -// The user didn't tell us whether RTTI is enabled, so we need to -// figure it out. - -# ifdef _MSC_VER - -# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) - -# ifdef __GXX_RTTI -// When building against STLport with the Android NDK and with -// -frtti -fno-exceptions, the build fails at link time with undefined -// references to __cxa_bad_typeid. Note sure if STL or toolchain bug, -// so disable RTTI when detected. -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \ - !defined(__EXCEPTIONS) -# define GTEST_HAS_RTTI 0 -# else -# define GTEST_HAS_RTTI 1 -# endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS -# else -# define GTEST_HAS_RTTI 0 -# endif // __GXX_RTTI - -// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends -// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the -// first version with C++ support. -# elif defined(__clang__) - -# define GTEST_HAS_RTTI __has_feature(cxx_rtti) - -// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if -// both the typeid and dynamic_cast features are present. -# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) - -# ifdef __RTTI_ALL__ -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -# else - -// For all other compilers, we assume RTTI is enabled. -# define GTEST_HAS_RTTI 1 - -# endif // _MSC_VER - -#endif // GTEST_HAS_RTTI - -// It's this header's responsibility to #include when RTTI -// is enabled. -#if GTEST_HAS_RTTI -# include -#endif - -// Determines whether Google Test can use the pthreads library. -#ifndef GTEST_HAS_PTHREAD -// The user didn't tell us explicitly, so we make reasonable assumptions about -// which platforms have pthreads support. -// -// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 -// to your compiler flags. -# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ - || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL) -#endif // GTEST_HAS_PTHREAD - -#if GTEST_HAS_PTHREAD -// gtest-port.h guarantees to #include when GTEST_HAS_PTHREAD is -// true. -# include // NOLINT - -// For timespec and nanosleep, used below. -# include // NOLINT -#endif - -// Determines if hash_map/hash_set are available. -// Only used for testing against those containers. -#if !defined(GTEST_HAS_HASH_MAP_) -# if _MSC_VER -# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available. -# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available. -# endif // _MSC_VER -#endif // !defined(GTEST_HAS_HASH_MAP_) - -// Determines whether Google Test can use tr1/tuple. You can define -// this macro to 0 to prevent Google Test from using tuple (any -// feature depending on tuple with be disabled in this mode). -#ifndef GTEST_HAS_TR1_TUPLE -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) -// STLport, provided with the Android NDK, has neither or . -# define GTEST_HAS_TR1_TUPLE 0 -# else -// The user didn't tell us not to do it, so we assume it's OK. -# define GTEST_HAS_TR1_TUPLE 1 -# endif -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether Google Test's own tr1 tuple implementation -// should be used. -#ifndef GTEST_USE_OWN_TR1_TUPLE -// The user didn't tell us, so we need to figure it out. - -// We use our own TR1 tuple if we aren't sure the user has an -// implementation of it already. At this time, libstdc++ 4.0.0+ and -// MSVC 2010 are the only mainstream standard libraries that come -// with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler -// pretends to be GCC by defining __GNUC__ and friends, but cannot -// compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1 -// tuple in a 323 MB Feature Pack download, which we cannot assume the -// user has. QNX's QCC compiler is a modified GCC but it doesn't -// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode, -// and it can be used with some compilers that define __GNUC__. -# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \ - && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600 -# define GTEST_ENV_HAS_TR1_TUPLE_ 1 -# endif - -// C++11 specifies that provides std::tuple. Use that if gtest is used -// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 -// can build with clang but need to use gcc4.2's libstdc++). -# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) -# define GTEST_ENV_HAS_STD_TUPLE_ 1 -# endif - -# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ -# define GTEST_USE_OWN_TR1_TUPLE 0 -# else -# define GTEST_USE_OWN_TR1_TUPLE 1 -# endif - -#endif // GTEST_USE_OWN_TR1_TUPLE - -// To avoid conditional compilation everywhere, we make it -// gtest-port.h's responsibility to #include the header implementing -// tuple. -#if GTEST_HAS_STD_TUPLE_ -# include // IWYU pragma: export -# define GTEST_TUPLE_NAMESPACE_ ::std -#endif // GTEST_HAS_STD_TUPLE_ - -// We include tr1::tuple even if std::tuple is available to define printers for -// them. -#if GTEST_HAS_TR1_TUPLE -# ifndef GTEST_TUPLE_NAMESPACE_ -# define GTEST_TUPLE_NAMESPACE_ ::std::tr1 -# endif // GTEST_TUPLE_NAMESPACE_ - -# if GTEST_USE_OWN_TR1_TUPLE -# include "gtest/internal/gtest-tuple.h" // IWYU pragma: export // NOLINT -# elif GTEST_ENV_HAS_STD_TUPLE_ -# include -// C++11 puts its tuple into the ::std namespace rather than -// ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. -// This causes undefined behavior, but supported compilers react in -// the way we intend. -namespace std { -namespace tr1 { -using ::std::get; -using ::std::make_tuple; -using ::std::tuple; -using ::std::tuple_element; -using ::std::tuple_size; -} -} - -# elif GTEST_OS_SYMBIAN - -// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to -// use STLport's tuple implementation, which unfortunately doesn't -// work as the copy of STLport distributed with Symbian is incomplete. -// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to -// use its own tuple implementation. -# ifdef BOOST_HAS_TR1_TUPLE -# undef BOOST_HAS_TR1_TUPLE -# endif // BOOST_HAS_TR1_TUPLE - -// This prevents , which defines -// BOOST_HAS_TR1_TUPLE, from being #included by Boost's . -# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED -# include // IWYU pragma: export // NOLINT - -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) -// GCC 4.0+ implements tr1/tuple in the header. This does -// not conform to the TR1 spec, which requires the header to be . - -# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 -// Until version 4.3.2, gcc has a bug that causes , -// which is #included by , to not compile when RTTI is -// disabled. _TR1_FUNCTIONAL is the header guard for -// . Hence the following #define is a hack to prevent -// from being included. -# define _TR1_FUNCTIONAL 1 -# include -# undef _TR1_FUNCTIONAL // Allows the user to #include - // if he chooses to. -# else -# include // NOLINT -# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 - -# else -// If the compiler is not GCC 4.0+, we assume the user is using a -// spec-conforming TR1 implementation. -# include // IWYU pragma: export // NOLINT -# endif // GTEST_USE_OWN_TR1_TUPLE - -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether clone(2) is supported. -// Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. -// Also see http://linux.die.net/man/2/clone. -#ifndef GTEST_HAS_CLONE -// The user didn't tell us, so we need to figure it out. - -# if GTEST_OS_LINUX && !defined(__ia64__) -# if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif -# else -# define GTEST_HAS_CLONE 1 -# endif -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) - -#endif // GTEST_HAS_CLONE - -// Determines whether to support stream redirection. This is used to test -// output correctness and to implement death tests. -#ifndef GTEST_HAS_STREAM_REDIRECTION -// By default, we assume that stream redirection is supported on all -// platforms except known mobile ones. -# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \ - GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT -# define GTEST_HAS_STREAM_REDIRECTION 0 -# else -# define GTEST_HAS_STREAM_REDIRECTION 1 -# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN -#endif // GTEST_HAS_STREAM_REDIRECTION - -// Determines whether to support death tests. -// Google Test does not support death tests for VC 7.1 and earlier as -// abort() in a VC 7.1 application compiled as GUI in debug config -// pops up a dialog window that cannot be suppressed programmatically. -#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ - (GTEST_OS_MAC && !GTEST_OS_IOS) || \ - (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ - GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ - GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD) -# define GTEST_HAS_DEATH_TEST 1 -#endif - -// We don't support MSVC 7.1 with exceptions disabled now. Therefore -// all the compilers we care about are adequate for supporting -// value-parameterized tests. -#define GTEST_HAS_PARAM_TEST 1 - -// Determines whether to support type-driven tests. - -// Typed tests need and variadic macros, which GCC, VC++ 8.0, -// Sun Pro CC, IBM Visual Age, and HP aCC support. -#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ - defined(__IBMCPP__) || defined(__HP_aCC) -# define GTEST_HAS_TYPED_TEST 1 -# define GTEST_HAS_TYPED_TEST_P 1 -#endif - -// Determines whether to support Combine(). This only makes sense when -// value-parameterized tests are enabled. The implementation doesn't -// work on Sun Studio since it doesn't understand templated conversion -// operators. -#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) -# define GTEST_HAS_COMBINE 1 -#endif - -// Determines whether the system compiler uses UTF-16 for encoding wide strings. -#define GTEST_WIDE_STRING_USES_UTF16_ \ - (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) - -// Determines whether test results can be streamed to a socket. -#if GTEST_OS_LINUX -# define GTEST_CAN_STREAM_RESULTS_ 1 -#endif - -// Defines some utility macros. - -// The GNU compiler emits a warning if nested "if" statements are followed by -// an "else" statement and braces are not used to explicitly disambiguate the -// "else" binding. This leads to problems with code like: -// -// if (gate) -// ASSERT_*(condition) << "Some message"; -// -// The "switch (0) case 0:" idiom is used to suppress this. -#ifdef __INTEL_COMPILER -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ -#else -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT -#endif - -// Use this annotation at the end of a struct/class definition to -// prevent the compiler from optimizing away instances that are never -// used. This is useful when all interesting logic happens inside the -// c'tor and / or d'tor. Example: -// -// struct Foo { -// Foo() { ... } -// } GTEST_ATTRIBUTE_UNUSED_; -// -// Also use it after a variable or parameter declaration to tell the -// compiler the variable/parameter does not have to be used. -#if defined(__GNUC__) && !defined(COMPILER_ICC) -# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) -#elif defined(__clang__) -# if __has_attribute(unused) -# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) -# endif -#endif -#ifndef GTEST_ATTRIBUTE_UNUSED_ -# define GTEST_ATTRIBUTE_UNUSED_ -#endif - -// A macro to disallow operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_ASSIGN_(type)\ - void operator=(type const &) - -// A macro to disallow copy constructor and operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ - type(type const &);\ - GTEST_DISALLOW_ASSIGN_(type) - -// Tell the compiler to warn about unused return values for functions declared -// with this macro. The macro should be used on function declarations -// following the argument list: -// -// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; -#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) -# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) -#else -# define GTEST_MUST_USE_RESULT_ -#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC - -// MS C++ compiler emits warning when a conditional expression is compile time -// constant. In some contexts this warning is false positive and needs to be -// suppressed. Use the following two macros in such cases: -// -// GTEST_INTENTIONAL_CONST_COND_PUSH_() -// while (true) { -// GTEST_INTENTIONAL_CONST_COND_POP_() -// } -# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \ - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127) -# define GTEST_INTENTIONAL_CONST_COND_POP_() \ - GTEST_DISABLE_MSC_WARNINGS_POP_() - -// Determine whether the compiler supports Microsoft's Structured Exception -// Handling. This is supported by several Windows compilers but generally -// does not exist on any other system. -#ifndef GTEST_HAS_SEH -// The user didn't tell us, so we need to figure it out. - -# if defined(_MSC_VER) || defined(__BORLANDC__) -// These two compilers are known to support SEH. -# define GTEST_HAS_SEH 1 -# else -// Assume no SEH. -# define GTEST_HAS_SEH 0 -# endif - -#define GTEST_IS_THREADSAFE \ - (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \ - || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \ - || GTEST_HAS_PTHREAD) - -#endif // GTEST_HAS_SEH - -#ifdef _MSC_VER -# if GTEST_LINKED_AS_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllimport) -# elif GTEST_CREATE_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllexport) -# endif -#elif __GNUC__ >= 4 || defined(__clang__) -# define GTEST_API_ __attribute__((visibility ("default"))) -#endif // _MSC_VER - -#ifndef GTEST_API_ -# define GTEST_API_ -#endif - -#ifdef __GNUC__ -// Ask the compiler to never inline a given function. -# define GTEST_NO_INLINE_ __attribute__((noinline)) -#else -# define GTEST_NO_INLINE_ -#endif - -// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project. -#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) -# define GTEST_HAS_CXXABI_H_ 1 -#else -# define GTEST_HAS_CXXABI_H_ 0 -#endif - -// A function level attribute to disable checking for use of uninitialized -// memory when built with MemorySanitizer. -#if defined(__clang__) -# if __has_feature(memory_sanitizer) -# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \ - __attribute__((no_sanitize_memory)) -# else -# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ -# endif // __has_feature(memory_sanitizer) -#else -# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ -#endif // __clang__ - -// A function level attribute to disable AddressSanitizer instrumentation. -#if defined(__clang__) -# if __has_feature(address_sanitizer) -# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \ - __attribute__((no_sanitize_address)) -# else -# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ -# endif // __has_feature(address_sanitizer) -#else -# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ -#endif // __clang__ - -// A function level attribute to disable ThreadSanitizer instrumentation. -#if defined(__clang__) -# if __has_feature(thread_sanitizer) -# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \ - __attribute__((no_sanitize_thread)) -# else -# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ -# endif // __has_feature(thread_sanitizer) -#else -# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ -#endif // __clang__ - -namespace testing { - -class Message; - -#if defined(GTEST_TUPLE_NAMESPACE_) -// Import tuple and friends into the ::testing namespace. -// It is part of our interface, having them in ::testing allows us to change -// their types as needed. -using GTEST_TUPLE_NAMESPACE_::get; -using GTEST_TUPLE_NAMESPACE_::make_tuple; -using GTEST_TUPLE_NAMESPACE_::tuple; -using GTEST_TUPLE_NAMESPACE_::tuple_size; -using GTEST_TUPLE_NAMESPACE_::tuple_element; -#endif // defined(GTEST_TUPLE_NAMESPACE_) - -namespace internal { - -// A secret type that Google Test users don't know about. It has no -// definition on purpose. Therefore it's impossible to create a -// Secret object, which is what we want. -class Secret; - -// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES, -// names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -#if GTEST_LANG_CXX11 -# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg) -#else // !GTEST_LANG_CXX11 -template - struct CompileAssert { -}; - -# define GTEST_COMPILE_ASSERT_(expr, msg) \ - typedef ::testing::internal::CompileAssert<(static_cast(expr))> \ - msg[static_cast(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_ -#endif // !GTEST_LANG_CXX11 - -// Implementation details of GTEST_COMPILE_ASSERT_: -// -// (In C++11, we simply use static_assert instead of the following) -// -// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outter parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// GTEST_COMPILE_ASSERT_(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. -// -// This template is declared, but intentionally undefined. -template -struct StaticAssertTypeEqHelper; - -template -struct StaticAssertTypeEqHelper { - enum { value = true }; -}; - -// Evaluates to the number of elements in 'array'. -#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0])) - -#if GTEST_HAS_GLOBAL_STRING -typedef ::string string; -#else -typedef ::std::string string; -#endif // GTEST_HAS_GLOBAL_STRING - -#if GTEST_HAS_GLOBAL_WSTRING -typedef ::wstring wstring; -#elif GTEST_HAS_STD_WSTRING -typedef ::std::wstring wstring; -#endif // GTEST_HAS_GLOBAL_WSTRING - -// A helper for suppressing warnings on constant condition. It just -// returns 'condition'. -GTEST_API_ bool IsTrue(bool condition); - -// Defines scoped_ptr. - -// This implementation of scoped_ptr is PARTIAL - it only contains -// enough stuff to satisfy Google Test's need. -template -class scoped_ptr { - public: - typedef T element_type; - - explicit scoped_ptr(T* p = NULL) : ptr_(p) {} - ~scoped_ptr() { reset(); } - - T& operator*() const { return *ptr_; } - T* operator->() const { return ptr_; } - T* get() const { return ptr_; } - - T* release() { - T* const ptr = ptr_; - ptr_ = NULL; - return ptr; - } - - void reset(T* p = NULL) { - if (p != ptr_) { - if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. - delete ptr_; - } - ptr_ = p; - } - } - - friend void swap(scoped_ptr& a, scoped_ptr& b) { - using std::swap; - swap(a.ptr_, b.ptr_); - } - - private: - T* ptr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); -}; - -// Defines RE. - -// A simple C++ wrapper for . It uses the POSIX Extended -// Regular Expression syntax. -class GTEST_API_ RE { - public: - // A copy constructor is required by the Standard to initialize object - // references from r-values. - RE(const RE& other) { Init(other.pattern()); } - - // Constructs an RE from a string. - RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT - -#if GTEST_HAS_GLOBAL_STRING - - RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT - -#endif // GTEST_HAS_GLOBAL_STRING - - RE(const char* regex) { Init(regex); } // NOLINT - ~RE(); - - // Returns the string representation of the regex. - const char* pattern() const { return pattern_; } - - // FullMatch(str, re) returns true iff regular expression re matches - // the entire str. - // PartialMatch(str, re) returns true iff regular expression re - // matches a substring of str (including str itself). - // - // TODO(wan@google.com): make FullMatch() and PartialMatch() work - // when str contains NUL characters. - static bool FullMatch(const ::std::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::std::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#if GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const ::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#endif // GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const char* str, const RE& re); - static bool PartialMatch(const char* str, const RE& re); - - private: - void Init(const char* regex); - - // We use a const char* instead of an std::string, as Google Test used to be - // used where std::string is not available. TODO(wan@google.com): change to - // std::string. - const char* pattern_; - bool is_valid_; - -#if GTEST_USES_POSIX_RE - - regex_t full_regex_; // For FullMatch(). - regex_t partial_regex_; // For PartialMatch(). - -#else // GTEST_USES_SIMPLE_RE - - const char* full_pattern_; // For FullMatch(); - -#endif - - GTEST_DISALLOW_ASSIGN_(RE); -}; - -// Formats a source file path and a line number as they would appear -// in an error message from the compiler used to compile this code. -GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); - -// Formats a file location for compiler-independent XML output. -// Although this function is not platform dependent, we put it next to -// FormatFileLocation in order to contrast the two functions. -GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, - int line); - -// Defines logging utilities: -// GTEST_LOG_(severity) - logs messages at the specified severity level. The -// message itself is streamed into the macro. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. - -enum GTestLogSeverity { - GTEST_INFO, - GTEST_WARNING, - GTEST_ERROR, - GTEST_FATAL -}; - -// Formats log entry severity, provides a stream object for streaming the -// log message, and terminates the message with a newline when going out of -// scope. -class GTEST_API_ GTestLog { - public: - GTestLog(GTestLogSeverity severity, const char* file, int line); - - // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. - ~GTestLog(); - - ::std::ostream& GetStream() { return ::std::cerr; } - - private: - const GTestLogSeverity severity_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); -}; - -#if !defined(GTEST_LOG_) - -# define GTEST_LOG_(severity) \ - ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ - __FILE__, __LINE__).GetStream() - -inline void LogToStderr() {} -inline void FlushInfoLog() { fflush(NULL); } - -#endif // !defined(GTEST_LOG_) - -#if !defined(GTEST_CHECK_) -// INTERNAL IMPLEMENTATION - DO NOT USE. -// -// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition -// is not satisfied. -// Synopsys: -// GTEST_CHECK_(boolean_condition); -// or -// GTEST_CHECK_(boolean_condition) << "Additional message"; -// -// This checks the condition and if the condition is not satisfied -// it prints message about the condition violation, including the -// condition itself, plus additional message streamed into it, if any, -// and then it aborts the program. It aborts the program irrespective of -// whether it is built in the debug mode or not. -# define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " -#endif // !defined(GTEST_CHECK_) - -// An all-mode assert to verify that the given POSIX-style function -// call returns 0 (indicating success). Known limitation: this -// doesn't expand to a balanced 'if' statement, so enclose the macro -// in {} if you need to use it as the only statement in an 'if' -// branch. -#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ - if (const int gtest_error = (posix_call)) \ - GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ - << gtest_error - -#if GTEST_HAS_STD_MOVE_ -using std::move; -#else // GTEST_HAS_STD_MOVE_ -template -const T& move(const T& t) { - return t; -} -#endif // GTEST_HAS_STD_MOVE_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Use ImplicitCast_ as a safe version of static_cast for upcasting in -// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a -// const Foo*). When you use ImplicitCast_, the compiler checks that -// the cast is safe. Such explicit ImplicitCast_s are necessary in -// surprisingly many situations where C++ demands an exact type match -// instead of an argument type convertable to a target type. -// -// The syntax for using ImplicitCast_ is the same as for static_cast: -// -// ImplicitCast_(expr) -// -// ImplicitCast_ would have been part of the C++ standard library, -// but the proposal was submitted too late. It will probably make -// its way into the language in the future. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., implicit_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template -inline To ImplicitCast_(To x) { return x; } - -// When you upcast (that is, cast a pointer from type Foo to type -// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts -// always succeed. When you downcast (that is, cast a pointer from -// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because -// how do you know the pointer is really of type SubclassOfFoo? It -// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, -// when you downcast, you should use this macro. In debug mode, we -// use dynamic_cast<> to double-check the downcast is legal (we die -// if it's not). In normal mode, we do the efficient static_cast<> -// instead. Thus, it's important to test in debug mode to make sure -// the cast is legal! -// This is the only place in the code we should use dynamic_cast<>. -// In particular, you SHOULDN'T be using dynamic_cast<> in order to -// do RTTI (eg code like this: -// if (dynamic_cast(foo)) HandleASubclass1Object(foo); -// if (dynamic_cast(foo)) HandleASubclass2Object(foo); -// You should design the code some other way not to need this. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., down_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template // use like this: DownCast_(foo); -inline To DownCast_(From* f) { // so we only accept pointers - // Ensures that To is a sub-type of From *. This test is here only - // for compile-time type checking, and has no overhead in an - // optimized build at run-time, as it will be optimized away - // completely. - GTEST_INTENTIONAL_CONST_COND_PUSH_() - if (false) { - GTEST_INTENTIONAL_CONST_COND_POP_() - const To to = NULL; - ::testing::internal::ImplicitCast_(to); - } - -#if GTEST_HAS_RTTI - // RTTI: debug mode only! - GTEST_CHECK_(f == NULL || dynamic_cast(f) != NULL); -#endif - return static_cast(f); -} - -// Downcasts the pointer of type Base to Derived. -// Derived must be a subclass of Base. The parameter MUST -// point to a class of type Derived, not any subclass of it. -// When RTTI is available, the function performs a runtime -// check to enforce this. -template -Derived* CheckedDowncastToActualType(Base* base) { -#if GTEST_HAS_RTTI - GTEST_CHECK_(typeid(*base) == typeid(Derived)); -#endif - -#if GTEST_HAS_DOWNCAST_ - return ::down_cast(base); -#elif GTEST_HAS_RTTI - return dynamic_cast(base); // NOLINT -#else - return static_cast(base); // Poor man's downcast. -#endif -} - -#if GTEST_HAS_STREAM_REDIRECTION - -// Defines the stderr capturer: -// CaptureStdout - starts capturing stdout. -// GetCapturedStdout - stops capturing stdout and returns the captured string. -// CaptureStderr - starts capturing stderr. -// GetCapturedStderr - stops capturing stderr and returns the captured string. -// -GTEST_API_ void CaptureStdout(); -GTEST_API_ std::string GetCapturedStdout(); -GTEST_API_ void CaptureStderr(); -GTEST_API_ std::string GetCapturedStderr(); - -#endif // GTEST_HAS_STREAM_REDIRECTION - -// Returns a path to temporary directory. -GTEST_API_ std::string TempDir(); - -// Returns the size (in bytes) of a file. -GTEST_API_ size_t GetFileSize(FILE* file); - -// Reads the entire content of a file as a string. -GTEST_API_ std::string ReadEntireFile(FILE* file); - -// All command line arguments. -GTEST_API_ const ::std::vector& GetArgvs(); - -#if GTEST_HAS_DEATH_TEST - -const ::std::vector& GetInjectableArgvs(); -void SetInjectableArgvs(const ::std::vector* - new_argvs); - - -#endif // GTEST_HAS_DEATH_TEST - -// Defines synchronization primitives. -#if GTEST_IS_THREADSAFE -# if GTEST_HAS_PTHREAD -// Sleeps for (roughly) n milliseconds. This function is only for testing -// Google Test's own constructs. Don't use it in user tests, either -// directly or indirectly. -inline void SleepMilliseconds(int n) { - const timespec time = { - 0, // 0 seconds. - n * 1000L * 1000L, // And n ms. - }; - nanosleep(&time, NULL); -} -# endif // GTEST_HAS_PTHREAD - -# if GTEST_HAS_NOTIFICATION_ -// Notification has already been imported into the namespace. -// Nothing to do here. - -# elif GTEST_HAS_PTHREAD -// Allows a controller thread to pause execution of newly created -// threads until notified. Instances of this class must be created -// and destroyed in the controller thread. -// -// This class is only for testing Google Test's own constructs. Do not -// use it in user tests, either directly or indirectly. -class Notification { - public: - Notification() : notified_(false) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - } - ~Notification() { - pthread_mutex_destroy(&mutex_); - } - - // Notifies all threads created with this notification to start. Must - // be called from the controller thread. - void Notify() { - pthread_mutex_lock(&mutex_); - notified_ = true; - pthread_mutex_unlock(&mutex_); - } - - // Blocks until the controller thread notifies. Must be called from a test - // thread. - void WaitForNotification() { - for (;;) { - pthread_mutex_lock(&mutex_); - const bool notified = notified_; - pthread_mutex_unlock(&mutex_); - if (notified) - break; - SleepMilliseconds(10); - } - } - - private: - pthread_mutex_t mutex_; - bool notified_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); -}; - -# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT - -GTEST_API_ void SleepMilliseconds(int n); - -// Provides leak-safe Windows kernel handle ownership. -// Used in death tests and in threading support. -class GTEST_API_ AutoHandle { - public: - // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to - // avoid including in this header file. Including is - // undesirable because it defines a lot of symbols and macros that tend to - // conflict with client code. This assumption is verified by - // WindowsTypesTest.HANDLEIsVoidStar. - typedef void* Handle; - AutoHandle(); - explicit AutoHandle(Handle handle); - - ~AutoHandle(); - - Handle Get() const; - void Reset(); - void Reset(Handle handle); - - private: - // Returns true iff the handle is a valid handle object that can be closed. - bool IsCloseable() const; - - Handle handle_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle); -}; - -// Allows a controller thread to pause execution of newly created -// threads until notified. Instances of this class must be created -// and destroyed in the controller thread. -// -// This class is only for testing Google Test's own constructs. Do not -// use it in user tests, either directly or indirectly. -class GTEST_API_ Notification { - public: - Notification(); - void Notify(); - void WaitForNotification(); - - private: - AutoHandle event_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); -}; -# endif // GTEST_HAS_NOTIFICATION_ - -// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD -// defined, but we don't want to use MinGW's pthreads implementation, which -// has conformance problems with some versions of the POSIX standard. -# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW - -// As a C-function, ThreadFuncWithCLinkage cannot be templated itself. -// Consequently, it cannot select a correct instantiation of ThreadWithParam -// in order to call its Run(). Introducing ThreadWithParamBase as a -// non-templated base class for ThreadWithParam allows us to bypass this -// problem. -class ThreadWithParamBase { - public: - virtual ~ThreadWithParamBase() {} - virtual void Run() = 0; -}; - -// pthread_create() accepts a pointer to a function type with the C linkage. -// According to the Standard (7.5/1), function types with different linkages -// are different even if they are otherwise identical. Some compilers (for -// example, SunStudio) treat them as different types. Since class methods -// cannot be defined with C-linkage we need to define a free C-function to -// pass into pthread_create(). -extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { - static_cast(thread)->Run(); - return NULL; -} - -// Helper class for testing Google Test's multi-threading constructs. -// To use it, write: -// -// void ThreadFunc(int param) { /* Do things with param */ } -// Notification thread_can_start; -// ... -// // The thread_can_start parameter is optional; you can supply NULL. -// ThreadWithParam thread(&ThreadFunc, 5, &thread_can_start); -// thread_can_start.Notify(); -// -// These classes are only for testing Google Test's own constructs. Do -// not use them in user tests, either directly or indirectly. -template -class ThreadWithParam : public ThreadWithParamBase { - public: - typedef void UserThreadFunc(T); - - ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start) - : func_(func), - param_(param), - thread_can_start_(thread_can_start), - finished_(false) { - ThreadWithParamBase* const base = this; - // The thread can be created only after all fields except thread_ - // have been initialized. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); - } - ~ThreadWithParam() { Join(); } - - void Join() { - if (!finished_) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); - finished_ = true; - } - } - - virtual void Run() { - if (thread_can_start_ != NULL) - thread_can_start_->WaitForNotification(); - func_(param_); - } - - private: - UserThreadFunc* const func_; // User-supplied thread function. - const T param_; // User-supplied parameter to the thread function. - // When non-NULL, used to block execution until the controller thread - // notifies. - Notification* const thread_can_start_; - bool finished_; // true iff we know that the thread function has finished. - pthread_t thread_; // The native thread object. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); -}; -# endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD || - // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - -# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ -// Mutex and ThreadLocal have already been imported into the namespace. -// Nothing to do here. - -# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT - -// Mutex implements mutex on Windows platforms. It is used in conjunction -// with class MutexLock: -// -// Mutex mutex; -// ... -// MutexLock lock(&mutex); // Acquires the mutex and releases it at the -// // end of the current scope. -// -// A static Mutex *must* be defined or declared using one of the following -// macros: -// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); -// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); -// -// (A non-static Mutex is defined/declared in the usual way). -class GTEST_API_ Mutex { - public: - enum MutexType { kStatic = 0, kDynamic = 1 }; - // We rely on kStaticMutex being 0 as it is to what the linker initializes - // type_ in static mutexes. critical_section_ will be initialized lazily - // in ThreadSafeLazyInit(). - enum StaticConstructorSelector { kStaticMutex = 0 }; - - // This constructor intentionally does nothing. It relies on type_ being - // statically initialized to 0 (effectively setting it to kStatic) and on - // ThreadSafeLazyInit() to lazily initialize the rest of the members. - explicit Mutex(StaticConstructorSelector /*dummy*/) {} - - Mutex(); - ~Mutex(); - - void Lock(); - - void Unlock(); - - // Does nothing if the current thread holds the mutex. Otherwise, crashes - // with high probability. - void AssertHeld(); - - private: - // Initializes owner_thread_id_ and critical_section_ in static mutexes. - void ThreadSafeLazyInit(); - - // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx, - // we assume that 0 is an invalid value for thread IDs. - unsigned int owner_thread_id_; - - // For static mutexes, we rely on these members being initialized to zeros - // by the linker. - MutexType type_; - long critical_section_init_phase_; // NOLINT - _RTL_CRITICAL_SECTION* critical_section_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); -}; - -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::Mutex mutex - -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ - ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex) - -// We cannot name this class MutexLock because the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. That macro is used as a defensive measure to prevent against -// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than -// "MutexLock l(&mu)". Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(Mutex* mutex) - : mutex_(mutex) { mutex_->Lock(); } - - ~GTestMutexLock() { mutex_->Unlock(); } - - private: - Mutex* const mutex_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); -}; - -typedef GTestMutexLock MutexLock; - -// Base class for ValueHolder. Allows a caller to hold and delete a value -// without knowing its type. -class ThreadLocalValueHolderBase { - public: - virtual ~ThreadLocalValueHolderBase() {} -}; - -// Provides a way for a thread to send notifications to a ThreadLocal -// regardless of its parameter type. -class ThreadLocalBase { - public: - // Creates a new ValueHolder object holding a default value passed to - // this ThreadLocal's constructor and returns it. It is the caller's - // responsibility not to call this when the ThreadLocal instance already - // has a value on the current thread. - virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0; - - protected: - ThreadLocalBase() {} - virtual ~ThreadLocalBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase); -}; - -// Maps a thread to a set of ThreadLocals that have values instantiated on that -// thread and notifies them when the thread exits. A ThreadLocal instance is -// expected to persist until all threads it has values on have terminated. -class GTEST_API_ ThreadLocalRegistry { - public: - // Registers thread_local_instance as having value on the current thread. - // Returns a value that can be used to identify the thread from other threads. - static ThreadLocalValueHolderBase* GetValueOnCurrentThread( - const ThreadLocalBase* thread_local_instance); - - // Invoked when a ThreadLocal instance is destroyed. - static void OnThreadLocalDestroyed( - const ThreadLocalBase* thread_local_instance); -}; - -class GTEST_API_ ThreadWithParamBase { - public: - void Join(); - - protected: - class Runnable { - public: - virtual ~Runnable() {} - virtual void Run() = 0; - }; - - ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start); - virtual ~ThreadWithParamBase(); - - private: - AutoHandle thread_; -}; - -// Helper class for testing Google Test's multi-threading constructs. -template -class ThreadWithParam : public ThreadWithParamBase { - public: - typedef void UserThreadFunc(T); - - ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start) - : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) { - } - virtual ~ThreadWithParam() {} - - private: - class RunnableImpl : public Runnable { - public: - RunnableImpl(UserThreadFunc* func, T param) - : func_(func), - param_(param) { - } - virtual ~RunnableImpl() {} - virtual void Run() { - func_(param_); - } - - private: - UserThreadFunc* const func_; - const T param_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl); - }; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); -}; - -// Implements thread-local storage on Windows systems. -// -// // Thread 1 -// ThreadLocal tl(100); // 100 is the default value for each thread. -// -// // Thread 2 -// tl.set(150); // Changes the value for thread 2 only. -// EXPECT_EQ(150, tl.get()); -// -// // Thread 1 -// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. -// tl.set(200); -// EXPECT_EQ(200, tl.get()); -// -// The template type argument T must have a public copy constructor. -// In addition, the default ThreadLocal constructor requires T to have -// a public default constructor. -// -// The users of a TheadLocal instance have to make sure that all but one -// threads (including the main one) using that instance have exited before -// destroying it. Otherwise, the per-thread objects managed for them by the -// ThreadLocal instance are not guaranteed to be destroyed on all platforms. -// -// Google Test only uses global ThreadLocal objects. That means they -// will die after main() has returned. Therefore, no per-thread -// object managed by Google Test will be leaked as long as all threads -// using Google Test have exited when main() returns. -template -class ThreadLocal : public ThreadLocalBase { - public: - ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {} - explicit ThreadLocal(const T& value) - : default_factory_(new InstanceValueHolderFactory(value)) {} - - ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); } - - T* pointer() { return GetOrCreateValue(); } - const T* pointer() const { return GetOrCreateValue(); } - const T& get() const { return *pointer(); } - void set(const T& value) { *pointer() = value; } - - private: - // Holds a value of T. Can be deleted via its base class without the caller - // knowing the type of T. - class ValueHolder : public ThreadLocalValueHolderBase { - public: - ValueHolder() : value_() {} - explicit ValueHolder(const T& value) : value_(value) {} - - T* pointer() { return &value_; } - - private: - T value_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); - }; - - - T* GetOrCreateValue() const { - return static_cast( - ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer(); - } - - virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const { - return default_factory_->MakeNewHolder(); - } - - class ValueHolderFactory { - public: - ValueHolderFactory() {} - virtual ~ValueHolderFactory() {} - virtual ValueHolder* MakeNewHolder() const = 0; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory); - }; - - class DefaultValueHolderFactory : public ValueHolderFactory { - public: - DefaultValueHolderFactory() {} - virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); - }; - - class InstanceValueHolderFactory : public ValueHolderFactory { - public: - explicit InstanceValueHolderFactory(const T& value) : value_(value) {} - virtual ValueHolder* MakeNewHolder() const { - return new ValueHolder(value_); - } - - private: - const T value_; // The value for each thread. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory); - }; - - scoped_ptr default_factory_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); -}; - -# elif GTEST_HAS_PTHREAD - -// MutexBase and Mutex implement mutex on pthreads-based platforms. -class MutexBase { - public: - // Acquires this mutex. - void Lock() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); - owner_ = pthread_self(); - has_owner_ = true; - } - - // Releases this mutex. - void Unlock() { - // Since the lock is being released the owner_ field should no longer be - // considered valid. We don't protect writing to has_owner_ here, as it's - // the caller's responsibility to ensure that the current thread holds the - // mutex when this is called. - has_owner_ = false; - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); - } - - // Does nothing if the current thread holds the mutex. Otherwise, crashes - // with high probability. - void AssertHeld() const { - GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) - << "The current thread is not holding the mutex @" << this; - } - - // A static mutex may be used before main() is entered. It may even - // be used before the dynamic initialization stage. Therefore we - // must be able to initialize a static mutex object at link time. - // This means MutexBase has to be a POD and its member variables - // have to be public. - public: - pthread_mutex_t mutex_; // The underlying pthread mutex. - // has_owner_ indicates whether the owner_ field below contains a valid thread - // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All - // accesses to the owner_ field should be protected by a check of this field. - // An alternative might be to memset() owner_ to all zeros, but there's no - // guarantee that a zero'd pthread_t is necessarily invalid or even different - // from pthread_self(). - bool has_owner_; - pthread_t owner_; // The thread holding the mutex. -}; - -// Forward-declares a static mutex. -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::MutexBase mutex - -// Defines and statically (i.e. at link time) initializes a static mutex. -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ - ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() } - -// The Mutex class can only be used for mutexes created at runtime. It -// shares its API with MutexBase otherwise. -class Mutex : public MutexBase { - public: - Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - has_owner_ = false; - } - ~Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); -}; - -// We cannot name this class MutexLock because the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. That macro is used as a defensive measure to prevent against -// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than -// "MutexLock l(&mu)". Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(MutexBase* mutex) - : mutex_(mutex) { mutex_->Lock(); } - - ~GTestMutexLock() { mutex_->Unlock(); } - - private: - MutexBase* const mutex_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); -}; - -typedef GTestMutexLock MutexLock; - -// Helpers for ThreadLocal. - -// pthread_key_create() requires DeleteThreadLocalValue() to have -// C-linkage. Therefore it cannot be templatized to access -// ThreadLocal. Hence the need for class -// ThreadLocalValueHolderBase. -class ThreadLocalValueHolderBase { - public: - virtual ~ThreadLocalValueHolderBase() {} -}; - -// Called by pthread to delete thread-local data stored by -// pthread_setspecific(). -extern "C" inline void DeleteThreadLocalValue(void* value_holder) { - delete static_cast(value_holder); -} - -// Implements thread-local storage on pthreads-based systems. -template -class ThreadLocal { - public: - ThreadLocal() - : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {} - explicit ThreadLocal(const T& value) - : key_(CreateKey()), - default_factory_(new InstanceValueHolderFactory(value)) {} - - ~ThreadLocal() { - // Destroys the managed object for the current thread, if any. - DeleteThreadLocalValue(pthread_getspecific(key_)); - - // Releases resources associated with the key. This will *not* - // delete managed objects for other threads. - GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); - } - - T* pointer() { return GetOrCreateValue(); } - const T* pointer() const { return GetOrCreateValue(); } - const T& get() const { return *pointer(); } - void set(const T& value) { *pointer() = value; } - - private: - // Holds a value of type T. - class ValueHolder : public ThreadLocalValueHolderBase { - public: - ValueHolder() : value_() {} - explicit ValueHolder(const T& value) : value_(value) {} - - T* pointer() { return &value_; } - - private: - T value_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); - }; - - static pthread_key_t CreateKey() { - pthread_key_t key; - // When a thread exits, DeleteThreadLocalValue() will be called on - // the object managed for that thread. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_key_create(&key, &DeleteThreadLocalValue)); - return key; - } - - T* GetOrCreateValue() const { - ThreadLocalValueHolderBase* const holder = - static_cast(pthread_getspecific(key_)); - if (holder != NULL) { - return CheckedDowncastToActualType(holder)->pointer(); - } - - ValueHolder* const new_holder = default_factory_->MakeNewHolder(); - ThreadLocalValueHolderBase* const holder_base = new_holder; - GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); - return new_holder->pointer(); - } - - class ValueHolderFactory { - public: - ValueHolderFactory() {} - virtual ~ValueHolderFactory() {} - virtual ValueHolder* MakeNewHolder() const = 0; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory); - }; - - class DefaultValueHolderFactory : public ValueHolderFactory { - public: - DefaultValueHolderFactory() {} - virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); - }; - - class InstanceValueHolderFactory : public ValueHolderFactory { - public: - explicit InstanceValueHolderFactory(const T& value) : value_(value) {} - virtual ValueHolder* MakeNewHolder() const { - return new ValueHolder(value_); - } - - private: - const T value_; // The value for each thread. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory); - }; - - // A key pthreads uses for looking up per-thread values. - const pthread_key_t key_; - scoped_ptr default_factory_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); -}; - -# endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - -#else // GTEST_IS_THREADSAFE - -// A dummy implementation of synchronization primitives (mutex, lock, -// and thread-local variable). Necessary for compiling Google Test where -// mutex is not supported - using Google Test in multiple threads is not -// supported on such platforms. - -class Mutex { - public: - Mutex() {} - void Lock() {} - void Unlock() {} - void AssertHeld() const {} -}; - -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::Mutex mutex - -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex - -// We cannot name this class MutexLock because the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. That macro is used as a defensive measure to prevent against -// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than -// "MutexLock l(&mu)". Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(Mutex*) {} // NOLINT -}; - -typedef GTestMutexLock MutexLock; - -template -class ThreadLocal { - public: - ThreadLocal() : value_() {} - explicit ThreadLocal(const T& value) : value_(value) {} - T* pointer() { return &value_; } - const T* pointer() const { return &value_; } - const T& get() const { return value_; } - void set(const T& value) { value_ = value; } - private: - T value_; -}; - -#endif // GTEST_IS_THREADSAFE - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -GTEST_API_ size_t GetThreadCount(); - -// Passing non-POD classes through ellipsis (...) crashes the ARM -// compiler and generates a warning in Sun Studio. The Nokia Symbian -// and the IBM XL C/C++ compiler try to instantiate a copy constructor -// for objects passed through ellipsis (...), failing for uncopyable -// objects. We define this to ensure that only POD is passed through -// ellipsis on these systems. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_ELLIPSIS_NEEDS_POD_ 1 -#else -# define GTEST_CAN_COMPARE_NULL 1 -#endif - -// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between -// const T& and const T* in a function template. These compilers -// _can_ decide between class template specializations for T and T*, -// so a tr1::type_traits-like is_pointer works. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) -# define GTEST_NEEDS_IS_POINTER_ 1 -#endif - -template -struct bool_constant { - typedef bool_constant type; - static const bool value = bool_value; -}; -template const bool bool_constant::value; - -typedef bool_constant false_type; -typedef bool_constant true_type; - -template -struct is_pointer : public false_type {}; - -template -struct is_pointer : public true_type {}; - -template -struct IteratorTraits { - typedef typename Iterator::value_type value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -#if GTEST_OS_WINDOWS -# define GTEST_PATH_SEP_ "\\" -# define GTEST_HAS_ALT_PATH_SEP_ 1 -// The biggest signed integer type the compiler supports. -typedef __int64 BiggestInt; -#else -# define GTEST_PATH_SEP_ "/" -# define GTEST_HAS_ALT_PATH_SEP_ 0 -typedef long long BiggestInt; // NOLINT -#endif // GTEST_OS_WINDOWS - -// Utilities for char. - -// isspace(int ch) and friends accept an unsigned char or EOF. char -// may be signed, depending on the compiler (or compiler flags). -// Therefore we need to cast a char to unsigned char before calling -// isspace(), etc. - -inline bool IsAlpha(char ch) { - return isalpha(static_cast(ch)) != 0; -} -inline bool IsAlNum(char ch) { - return isalnum(static_cast(ch)) != 0; -} -inline bool IsDigit(char ch) { - return isdigit(static_cast(ch)) != 0; -} -inline bool IsLower(char ch) { - return islower(static_cast(ch)) != 0; -} -inline bool IsSpace(char ch) { - return isspace(static_cast(ch)) != 0; -} -inline bool IsUpper(char ch) { - return isupper(static_cast(ch)) != 0; -} -inline bool IsXDigit(char ch) { - return isxdigit(static_cast(ch)) != 0; -} -inline bool IsXDigit(wchar_t ch) { - const unsigned char low_byte = static_cast(ch); - return ch == low_byte && isxdigit(low_byte) != 0; -} - -inline char ToLower(char ch) { - return static_cast(tolower(static_cast(ch))); -} -inline char ToUpper(char ch) { - return static_cast(toupper(static_cast(ch))); -} - -inline std::string StripTrailingSpaces(std::string str) { - std::string::iterator it = str.end(); - while (it != str.begin() && IsSpace(*--it)) - it = str.erase(it); - return str; -} - -// The testing::internal::posix namespace holds wrappers for common -// POSIX functions. These wrappers hide the differences between -// Windows/MSVC and POSIX systems. Since some compilers define these -// standard functions as macros, the wrapper cannot have the same name -// as the wrapped function. - -namespace posix { - -// Functions with a different name on Windows. - -#if GTEST_OS_WINDOWS - -typedef struct _stat StatStruct; - -# ifdef __BORLANDC__ -inline int IsATTY(int fd) { return isatty(fd); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -# else // !__BORLANDC__ -# if GTEST_OS_WINDOWS_MOBILE -inline int IsATTY(int /* fd */) { return 0; } -# else -inline int IsATTY(int fd) { return _isatty(fd); } -# endif // GTEST_OS_WINDOWS_MOBILE -inline int StrCaseCmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return _strdup(src); } -# endif // __BORLANDC__ - -# if GTEST_OS_WINDOWS_MOBILE -inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } -// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this -// time and thus not defined there. -# else -inline int FileNo(FILE* file) { return _fileno(file); } -inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } -inline int RmDir(const char* dir) { return _rmdir(dir); } -inline bool IsDir(const StatStruct& st) { - return (_S_IFDIR & st.st_mode) != 0; -} -# endif // GTEST_OS_WINDOWS_MOBILE - -#else - -typedef struct stat StatStruct; - -inline int FileNo(FILE* file) { return fileno(file); } -inline int IsATTY(int fd) { return isatty(fd); } -inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -inline int RmDir(const char* dir) { return rmdir(dir); } -inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } - -#endif // GTEST_OS_WINDOWS - -// Functions deprecated by MSVC 8.0. - -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */) - -inline const char* StrNCpy(char* dest, const char* src, size_t n) { - return strncpy(dest, src, n); -} - -// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and -// StrError() aren't needed on Windows CE at this time and thus not -// defined there. - -#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT -inline int ChDir(const char* dir) { return chdir(dir); } -#endif -inline FILE* FOpen(const char* path, const char* mode) { - return fopen(path, mode); -} -#if !GTEST_OS_WINDOWS_MOBILE -inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { - return freopen(path, mode, stream); -} -inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } -#endif -inline int FClose(FILE* fp) { return fclose(fp); } -#if !GTEST_OS_WINDOWS_MOBILE -inline int Read(int fd, void* buf, unsigned int count) { - return static_cast(read(fd, buf, count)); -} -inline int Write(int fd, const void* buf, unsigned int count) { - return static_cast(write(fd, buf, count)); -} -inline int Close(int fd) { return close(fd); } -inline const char* StrError(int errnum) { return strerror(errnum); } -#endif -inline const char* GetEnv(const char* name) { -#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT - // We are on Windows CE, which has no environment variables. - static_cast(name); // To prevent 'unused argument' warning. - return NULL; -#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) - // Environment variables which we programmatically clear will be set to the - // empty string rather than unset (NULL). Handle that case. - const char* const env = getenv(name); - return (env != NULL && env[0] != '\0') ? env : NULL; -#else - return getenv(name); -#endif -} - -GTEST_DISABLE_MSC_WARNINGS_POP_() - -#if GTEST_OS_WINDOWS_MOBILE -// Windows CE has no C library. The abort() function is used in -// several places in Google Test. This implementation provides a reasonable -// imitation of standard behaviour. -void Abort(); -#else -inline void Abort() { abort(); } -#endif // GTEST_OS_WINDOWS_MOBILE - -} // namespace posix - -// MSVC "deprecates" snprintf and issues warnings wherever it is used. In -// order to avoid these warnings, we need to use _snprintf or _snprintf_s on -// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate -// function in order to achieve that. We use macro definition here because -// snprintf is a variadic function. -#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE -// MSVC 2005 and above support variadic macros. -# define GTEST_SNPRINTF_(buffer, size, format, ...) \ - _snprintf_s(buffer, size, size, format, __VA_ARGS__) -#elif defined(_MSC_VER) -// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't -// complain about _snprintf. -# define GTEST_SNPRINTF_ _snprintf -#else -# define GTEST_SNPRINTF_ snprintf -#endif - -// The maximum number a BiggestInt can represent. This definition -// works no matter BiggestInt is represented in one's complement or -// two's complement. -// -// We cannot rely on numeric_limits in STL, as __int64 and long long -// are not part of standard C++ and numeric_limits doesn't need to be -// defined for them. -const BiggestInt kMaxBiggestInt = - ~(static_cast(1) << (8*sizeof(BiggestInt) - 1)); - -// This template class serves as a compile-time function from size to -// type. It maps a size in bytes to a primitive type with that -// size. e.g. -// -// TypeWithSize<4>::UInt -// -// is typedef-ed to be unsigned int (unsigned integer made up of 4 -// bytes). -// -// Such functionality should belong to STL, but I cannot find it -// there. -// -// Google Test uses this class in the implementation of floating-point -// comparison. -// -// For now it only handles UInt (unsigned int) as that's all Google Test -// needs. Other types can be easily added in the future if need -// arises. -template -class TypeWithSize { - public: - // This prevents the user from using TypeWithSize with incorrect - // values of N. - typedef void UInt; -}; - -// The specialization for size 4. -template <> -class TypeWithSize<4> { - public: - // unsigned int has size 4 in both gcc and MSVC. - // - // As base/basictypes.h doesn't compile on Windows, we cannot use - // uint32, uint64, and etc here. - typedef int Int; - typedef unsigned int UInt; -}; - -// The specialization for size 8. -template <> -class TypeWithSize<8> { - public: -#if GTEST_OS_WINDOWS - typedef __int64 Int; - typedef unsigned __int64 UInt; -#else - typedef long long Int; // NOLINT - typedef unsigned long long UInt; // NOLINT -#endif // GTEST_OS_WINDOWS -}; - -// Integer types of known sizes. -typedef TypeWithSize<4>::Int Int32; -typedef TypeWithSize<4>::UInt UInt32; -typedef TypeWithSize<8>::Int Int64; -typedef TypeWithSize<8>::UInt UInt64; -typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. - -// Utilities for command line flags and environment variables. - -// Macro for referencing flags. -#if !defined(GTEST_FLAG) -# define GTEST_FLAG(name) FLAGS_gtest_##name -#endif // !defined(GTEST_FLAG) - -#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_) -# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1 -#endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_) - -#if !defined(GTEST_DECLARE_bool_) -# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver - -// Macros for declaring flags. -# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) -# define GTEST_DECLARE_int32_(name) \ - GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) -#define GTEST_DECLARE_string_(name) \ - GTEST_API_ extern ::std::string GTEST_FLAG(name) - -// Macros for defining flags. -#define GTEST_DEFINE_bool_(name, default_val, doc) \ - GTEST_API_ bool GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_int32_(name, default_val, doc) \ - GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_string_(name, default_val, doc) \ - GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) - -#endif // !defined(GTEST_DECLARE_bool_) - -// Thread annotations -#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_) -# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) -# define GTEST_LOCK_EXCLUDED_(locks) -#endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_) - -// Parses 'str' for a 32-bit signed integer. If successful, writes the result -// to *value and returns true; otherwise leaves *value unchanged and returns -// false. -// TODO(chandlerc): Find a better way to refactor flag and environment parsing -// out of both gtest-port.cc and gtest.cc to avoid exporting this utility -// function. -bool ParseInt32(const Message& src_text, const char* str, Int32* value); - -// Parses a bool/Int32/string from the environment variable -// corresponding to the given Google Test flag. -bool BoolFromGTestEnv(const char* flag, bool default_val); -GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); -std::string StringFromGTestEnv(const char* flag, const char* default_val); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-string.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-string.h deleted file mode 100644 index 97f1a7fdd2c..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-string.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares the String class and functions used internally by -// Google Test. They are subject to change without notice. They should not used -// by code external to Google Test. -// -// This header file is #included by . -// It should not be #included by other files. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ - -#ifdef __BORLANDC__ -// string.h is not guaranteed to provide strcpy on C++ Builder. -# include -#endif - -#include -#include - -#include "gtest/internal/gtest-port.h" - -namespace testing { -namespace internal { - -// String - an abstract class holding static string utilities. -class GTEST_API_ String { - public: - // Static utility methods - - // Clones a 0-terminated C string, allocating memory using new. The - // caller is responsible for deleting the return value using - // delete[]. Returns the cloned string, or NULL if the input is - // NULL. - // - // This is different from strdup() in string.h, which allocates - // memory using malloc(). - static const char* CloneCString(const char* c_str); - -#if GTEST_OS_WINDOWS_MOBILE - // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be - // able to pass strings to Win32 APIs on CE we need to convert them - // to 'Unicode', UTF-16. - - // Creates a UTF-16 wide string from the given ANSI string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the wide string, or NULL if the - // input is NULL. - // - // The wide string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static LPCWSTR AnsiToUtf16(const char* c_str); - - // Creates an ANSI string from the given wide string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the ANSI string, or NULL if the - // input is NULL. - // - // The returned string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static const char* Utf16ToAnsi(LPCWSTR utf16_str); -#endif - - // Compares two C strings. Returns true iff they have the same content. - // - // Unlike strcmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CStringEquals(const char* lhs, const char* rhs); - - // Converts a wide C string to a String using the UTF-8 encoding. - // NULL will be converted to "(null)". If an error occurred during - // the conversion, "(failed to convert from wide string)" is - // returned. - static std::string ShowWideCString(const wchar_t* wide_c_str); - - // Compares two wide C strings. Returns true iff they have the same - // content. - // - // Unlike wcscmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); - - // Compares two C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike strcasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CaseInsensitiveCStringEquals(const char* lhs, - const char* rhs); - - // Compares two wide C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike wcscasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL wide C string, - // including the empty string. - // NB: The implementations on different platforms slightly differ. - // On windows, this method uses _wcsicmp which compares according to LC_CTYPE - // environment variable. On GNU platform this method uses wcscasecmp - // which compares according to LC_CTYPE category of the current locale. - // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the - // current locale. - static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); - - // Returns true iff the given string ends with the given suffix, ignoring - // case. Any string is considered to end with an empty suffix. - static bool EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix); - - // Formats an int value as "%02d". - static std::string FormatIntWidth2(int value); // "%02d" for width == 2 - - // Formats an int value as "%X". - static std::string FormatHexInt(int value); - - // Formats a byte as "%02X". - static std::string FormatByte(unsigned char value); - - private: - String(); // Not meant to be instantiated. -}; // class String - -// Gets the content of the stringstream's buffer as an std::string. Each '\0' -// character in the buffer is replaced with "\\0". -GTEST_API_ std::string StringStreamToString(::std::stringstream* stream); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h deleted file mode 100644 index e9b405340a8..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h +++ /dev/null @@ -1,1020 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-tuple.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2009 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - -// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict -// with our own definitions. Therefore using our own tuple does not work on -// those compilers. -#if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */ -# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \ -GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers." -#endif - -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> -#define GTEST_1_TUPLE_(T) tuple -#define GTEST_2_TUPLE_(T) tuple -#define GTEST_3_TUPLE_(T) tuple -#define GTEST_4_TUPLE_(T) tuple -#define GTEST_5_TUPLE_(T) tuple -#define GTEST_6_TUPLE_(T) tuple -#define GTEST_7_TUPLE_(T) tuple -#define GTEST_8_TUPLE_(T) tuple -#define GTEST_9_TUPLE_(T) tuple -#define GTEST_10_TUPLE_(T) tuple - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. -#define GTEST_0_TYPENAMES_(T) -#define GTEST_1_TYPENAMES_(T) typename T##0 -#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 -#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 -#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3 -#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4 -#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5 -#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6 -#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 -#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8 -#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8, typename T##9 - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - -template -struct TupleElement { - typedef T0 type; -}; - -template -struct TupleElement { - typedef T1 type; -}; - -template -struct TupleElement { - typedef T2 type; -}; - -template -struct TupleElement { - typedef T3 type; -}; - -template -struct TupleElement { - typedef T4 type; -}; - -template -struct TupleElement { - typedef T5 type; -}; - -template -struct TupleElement { - typedef T6 type; -}; - -template -struct TupleElement { - typedef T7 type; -}; - -template -struct TupleElement { - typedef T8 type; -}; - -template -struct TupleElement { - typedef T9 type; -}; - -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - -template -class GTEST_1_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} - - tuple(const tuple& t) : f0_(t.f0_) {} - - template - tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_1_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { - f0_ = t.f0_; - return *this; - } - - T0 f0_; -}; - -template -class GTEST_2_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), - f1_(f1) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} - - template - tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_2_TUPLE_(U)& t) { - return CopyFrom(t); - } - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - return *this; - } - - T0 f0_; - T1 f1_; -}; - -template -class GTEST_3_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - template - tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_3_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; -}; - -template -class GTEST_4_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} - - template - tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_4_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; -}; - -template -class GTEST_5_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, - GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_) {} - - template - tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_5_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; -}; - -template -class GTEST_6_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_) {} - - template - tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_6_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; -}; - -template -class GTEST_7_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - template - tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_7_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; -}; - -template -class GTEST_8_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, - GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - template - tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_8_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; -}; - -template -class GTEST_9_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - template - tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_9_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; -}; - -template -class tuple { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), - f9_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} - - template - tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), - f9_(t.f9_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_10_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - f9_ = t.f9_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; - T9 f9_; -}; - -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -template -inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { - return GTEST_1_TUPLE_(T)(f0); -} - -template -inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { - return GTEST_2_TUPLE_(T)(f0, f1); -} - -template -inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { - return GTEST_3_TUPLE_(T)(f0, f1, f2); -} - -template -inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3) { - return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); -} - -template -inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4) { - return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); -} - -template -inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5) { - return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); -} - -template -inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6) { - return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); -} - -template -inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { - return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); -} - -template -inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8) { - return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); -} - -template -inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8, const T9& f9) { - return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); -} - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - -template -struct tuple_size { - static const int value = 0; -}; - -template -struct tuple_size { - static const int value = 1; -}; - -template -struct tuple_size { - static const int value = 2; -}; - -template -struct tuple_size { - static const int value = 3; -}; - -template -struct tuple_size { - static const int value = 4; -}; - -template -struct tuple_size { - static const int value = 5; -}; - -template -struct tuple_size { - static const int value = 6; -}; - -template -struct tuple_size { - static const int value = 7; -}; - -template -struct tuple_size { - static const int value = 8; -}; - -template -struct tuple_size { - static const int value = 9; -}; - -template -struct tuple_size { - static const int value = 10; -}; - -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - -template <> -class Get<0> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - Field(Tuple& t) { return t.f0_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - ConstField(const Tuple& t) { return t.f0_; } -}; - -template <> -class Get<1> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - Field(Tuple& t) { return t.f1_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - ConstField(const Tuple& t) { return t.f1_; } -}; - -template <> -class Get<2> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - Field(Tuple& t) { return t.f2_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - ConstField(const Tuple& t) { return t.f2_; } -}; - -template <> -class Get<3> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - Field(Tuple& t) { return t.f3_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - ConstField(const Tuple& t) { return t.f3_; } -}; - -template <> -class Get<4> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - Field(Tuple& t) { return t.f4_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - ConstField(const Tuple& t) { return t.f4_; } -}; - -template <> -class Get<5> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - Field(Tuple& t) { return t.f5_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - ConstField(const Tuple& t) { return t.f5_; } -}; - -template <> -class Get<6> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - Field(Tuple& t) { return t.f6_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - ConstField(const Tuple& t) { return t.f6_; } -}; - -template <> -class Get<7> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - Field(Tuple& t) { return t.f7_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - ConstField(const Tuple& t) { return t.f7_; } -}; - -template <> -class Get<8> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - Field(Tuple& t) { return t.f8_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - ConstField(const Tuple& t) { return t.f8_; } -}; - -template <> -class Get<9> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - Field(Tuple& t) { return t.f9_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - ConstField(const Tuple& t) { return t.f9_; } -}; - -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(const GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - -#undef GTEST_0_TUPLE_ -#undef GTEST_1_TUPLE_ -#undef GTEST_2_TUPLE_ -#undef GTEST_3_TUPLE_ -#undef GTEST_4_TUPLE_ -#undef GTEST_5_TUPLE_ -#undef GTEST_6_TUPLE_ -#undef GTEST_7_TUPLE_ -#undef GTEST_8_TUPLE_ -#undef GTEST_9_TUPLE_ -#undef GTEST_10_TUPLE_ - -#undef GTEST_0_TYPENAMES_ -#undef GTEST_1_TYPENAMES_ -#undef GTEST_2_TYPENAMES_ -#undef GTEST_3_TYPENAMES_ -#undef GTEST_4_TYPENAMES_ -#undef GTEST_5_TYPENAMES_ -#undef GTEST_6_TYPENAMES_ -#undef GTEST_7_TYPENAMES_ -#undef GTEST_8_TYPENAMES_ -#undef GTEST_9_TYPENAMES_ -#undef GTEST_10_TYPENAMES_ - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h.pump b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h.pump deleted file mode 100644 index 429ddfeecaa..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-tuple.h.pump +++ /dev/null @@ -1,347 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 10 $$ Maximum number of tuple fields we want to support. -$$ This meta comment fixes auto-indentation in Emacs. }} -// Copyright 2009 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - -// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict -// with our own definitions. Therefore using our own tuple does not work on -// those compilers. -#if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */ -# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \ -GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers." -#endif - - -$range i 0..n-1 -$range j 0..n -$range k 1..n -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> - -$for k [[ -$range m 0..k-1 -$range m2 k..n-1 -#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]> - -]] - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. - -$for j [[ -$range m 0..j-1 -#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]] - - -]] - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template <$for i, [[typename T$i = void]]> -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - - -$for i [[ -template -struct TupleElement { - typedef T$i type; -}; - - -]] -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - - -$for k [[ -$range m 0..k-1 -template -class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] { - public: - template friend class gtest_internal::Get; - - tuple() : $for m, [[f$(m)_()]] {} - - explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]] -$for m, [[f$(m)_(f$m)]] {} - - tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} - - template - tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} - -$if k == 2 [[ - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - -]] - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) { - return CopyFrom(t); - } - -$if k == 2 [[ - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - -]] - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) { - -$for m [[ - f$(m)_ = t.f$(m)_; - -]] - return *this; - } - - -$for m [[ - T$m f$(m)_; - -]] -}; - - -]] -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -$for k [[ -$range m 0..k-1 - -template -inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) { - return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]); -} - -]] - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - - -$for j [[ -template -struct tuple_size { - static const int value = $j; -}; - - -]] -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - - -$for i [[ -template <> -class Get<$i> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) - Field(Tuple& t) { return t.f$(i)_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) - ConstField(const Tuple& t) { return t.f$(i)_; } -}; - - -]] -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) -get(GTEST_$(n)_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) -get(const GTEST_$(n)_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t, - const GTEST_$(n)_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t, - const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - - -$for j [[ -#undef GTEST_$(j)_TUPLE_ - -]] - - -$for j [[ -#undef GTEST_$(j)_TYPENAMES_ - -]] - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h deleted file mode 100644 index e46f7cfcb48..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h +++ /dev/null @@ -1,3331 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-type-util.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most 50 types in a list, and at most 50 -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -#include "gtest/internal/gtest-port.h" - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# if GTEST_HAS_CXXABI_H_ -# include -# elif defined(__HP_aCC) -# include -# endif // GTEST_HASH_CXXABI_H_ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -std::string GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# if GTEST_HAS_CXXABI_H_ - using abi::__cxa_demangle; -# endif // GTEST_HAS_CXXABI_H_ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const std::string name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; -template -struct Types2 { - typedef T1 Head; - typedef Types1 Tail; -}; - -template -struct Types3 { - typedef T1 Head; - typedef Types2 Tail; -}; - -template -struct Types4 { - typedef T1 Head; - typedef Types3 Tail; -}; - -template -struct Types5 { - typedef T1 Head; - typedef Types4 Tail; -}; - -template -struct Types6 { - typedef T1 Head; - typedef Types5 Tail; -}; - -template -struct Types7 { - typedef T1 Head; - typedef Types6 Tail; -}; - -template -struct Types8 { - typedef T1 Head; - typedef Types7 Tail; -}; - -template -struct Types9 { - typedef T1 Head; - typedef Types8 Tail; -}; - -template -struct Types10 { - typedef T1 Head; - typedef Types9 Tail; -}; - -template -struct Types11 { - typedef T1 Head; - typedef Types10 Tail; -}; - -template -struct Types12 { - typedef T1 Head; - typedef Types11 Tail; -}; - -template -struct Types13 { - typedef T1 Head; - typedef Types12 Tail; -}; - -template -struct Types14 { - typedef T1 Head; - typedef Types13 Tail; -}; - -template -struct Types15 { - typedef T1 Head; - typedef Types14 Tail; -}; - -template -struct Types16 { - typedef T1 Head; - typedef Types15 Tail; -}; - -template -struct Types17 { - typedef T1 Head; - typedef Types16 Tail; -}; - -template -struct Types18 { - typedef T1 Head; - typedef Types17 Tail; -}; - -template -struct Types19 { - typedef T1 Head; - typedef Types18 Tail; -}; - -template -struct Types20 { - typedef T1 Head; - typedef Types19 Tail; -}; - -template -struct Types21 { - typedef T1 Head; - typedef Types20 Tail; -}; - -template -struct Types22 { - typedef T1 Head; - typedef Types21 Tail; -}; - -template -struct Types23 { - typedef T1 Head; - typedef Types22 Tail; -}; - -template -struct Types24 { - typedef T1 Head; - typedef Types23 Tail; -}; - -template -struct Types25 { - typedef T1 Head; - typedef Types24 Tail; -}; - -template -struct Types26 { - typedef T1 Head; - typedef Types25 Tail; -}; - -template -struct Types27 { - typedef T1 Head; - typedef Types26 Tail; -}; - -template -struct Types28 { - typedef T1 Head; - typedef Types27 Tail; -}; - -template -struct Types29 { - typedef T1 Head; - typedef Types28 Tail; -}; - -template -struct Types30 { - typedef T1 Head; - typedef Types29 Tail; -}; - -template -struct Types31 { - typedef T1 Head; - typedef Types30 Tail; -}; - -template -struct Types32 { - typedef T1 Head; - typedef Types31 Tail; -}; - -template -struct Types33 { - typedef T1 Head; - typedef Types32 Tail; -}; - -template -struct Types34 { - typedef T1 Head; - typedef Types33 Tail; -}; - -template -struct Types35 { - typedef T1 Head; - typedef Types34 Tail; -}; - -template -struct Types36 { - typedef T1 Head; - typedef Types35 Tail; -}; - -template -struct Types37 { - typedef T1 Head; - typedef Types36 Tail; -}; - -template -struct Types38 { - typedef T1 Head; - typedef Types37 Tail; -}; - -template -struct Types39 { - typedef T1 Head; - typedef Types38 Tail; -}; - -template -struct Types40 { - typedef T1 Head; - typedef Types39 Tail; -}; - -template -struct Types41 { - typedef T1 Head; - typedef Types40 Tail; -}; - -template -struct Types42 { - typedef T1 Head; - typedef Types41 Tail; -}; - -template -struct Types43 { - typedef T1 Head; - typedef Types42 Tail; -}; - -template -struct Types44 { - typedef T1 Head; - typedef Types43 Tail; -}; - -template -struct Types45 { - typedef T1 Head; - typedef Types44 Tail; -}; - -template -struct Types46 { - typedef T1 Head; - typedef Types45 Tail; -}; - -template -struct Types47 { - typedef T1 Head; - typedef Types46 Tail; -}; - -template -struct Types48 { - typedef T1 Head; - typedef Types47 Tail; -}; - -template -struct Types49 { - typedef T1 Head; - typedef Types48 Tail; -}; - -template -struct Types50 { - typedef T1 Head; - typedef Types49 Tail; -}; - - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. -template -struct Types { - typedef internal::Types50 type; -}; - -template <> -struct Types { - typedef internal::Types0 type; -}; -template -struct Types { - typedef internal::Types1 type; -}; -template -struct Types { - typedef internal::Types2 type; -}; -template -struct Types { - typedef internal::Types3 type; -}; -template -struct Types { - typedef internal::Types4 type; -}; -template -struct Types { - typedef internal::Types5 type; -}; -template -struct Types { - typedef internal::Types6 type; -}; -template -struct Types { - typedef internal::Types7 type; -}; -template -struct Types { - typedef internal::Types8 type; -}; -template -struct Types { - typedef internal::Types9 type; -}; -template -struct Types { - typedef internal::Types10 type; -}; -template -struct Types { - typedef internal::Types11 type; -}; -template -struct Types { - typedef internal::Types12 type; -}; -template -struct Types { - typedef internal::Types13 type; -}; -template -struct Types { - typedef internal::Types14 type; -}; -template -struct Types { - typedef internal::Types15 type; -}; -template -struct Types { - typedef internal::Types16 type; -}; -template -struct Types { - typedef internal::Types17 type; -}; -template -struct Types { - typedef internal::Types18 type; -}; -template -struct Types { - typedef internal::Types19 type; -}; -template -struct Types { - typedef internal::Types20 type; -}; -template -struct Types { - typedef internal::Types21 type; -}; -template -struct Types { - typedef internal::Types22 type; -}; -template -struct Types { - typedef internal::Types23 type; -}; -template -struct Types { - typedef internal::Types24 type; -}; -template -struct Types { - typedef internal::Types25 type; -}; -template -struct Types { - typedef internal::Types26 type; -}; -template -struct Types { - typedef internal::Types27 type; -}; -template -struct Types { - typedef internal::Types28 type; -}; -template -struct Types { - typedef internal::Types29 type; -}; -template -struct Types { - typedef internal::Types30 type; -}; -template -struct Types { - typedef internal::Types31 type; -}; -template -struct Types { - typedef internal::Types32 type; -}; -template -struct Types { - typedef internal::Types33 type; -}; -template -struct Types { - typedef internal::Types34 type; -}; -template -struct Types { - typedef internal::Types35 type; -}; -template -struct Types { - typedef internal::Types36 type; -}; -template -struct Types { - typedef internal::Types37 type; -}; -template -struct Types { - typedef internal::Types38 type; -}; -template -struct Types { - typedef internal::Types39 type; -}; -template -struct Types { - typedef internal::Types40 type; -}; -template -struct Types { - typedef internal::Types41 type; -}; -template -struct Types { - typedef internal::Types42 type; -}; -template -struct Types { - typedef internal::Types43 type; -}; -template -struct Types { - typedef internal::Types44 type; -}; -template -struct Types { - typedef internal::Types45 type; -}; -template -struct Types { - typedef internal::Types46 type; -}; -template -struct Types { - typedef internal::Types47 type; -}; -template -struct Types { - typedef internal::Types48 type; -}; -template -struct Types { - typedef internal::Types49 type; -}; - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; -template -struct Templates2 { - typedef TemplateSel Head; - typedef Templates1 Tail; -}; - -template -struct Templates3 { - typedef TemplateSel Head; - typedef Templates2 Tail; -}; - -template -struct Templates4 { - typedef TemplateSel Head; - typedef Templates3 Tail; -}; - -template -struct Templates5 { - typedef TemplateSel Head; - typedef Templates4 Tail; -}; - -template -struct Templates6 { - typedef TemplateSel Head; - typedef Templates5 Tail; -}; - -template -struct Templates7 { - typedef TemplateSel Head; - typedef Templates6 Tail; -}; - -template -struct Templates8 { - typedef TemplateSel Head; - typedef Templates7 Tail; -}; - -template -struct Templates9 { - typedef TemplateSel Head; - typedef Templates8 Tail; -}; - -template -struct Templates10 { - typedef TemplateSel Head; - typedef Templates9 Tail; -}; - -template -struct Templates11 { - typedef TemplateSel Head; - typedef Templates10 Tail; -}; - -template -struct Templates12 { - typedef TemplateSel Head; - typedef Templates11 Tail; -}; - -template -struct Templates13 { - typedef TemplateSel Head; - typedef Templates12 Tail; -}; - -template -struct Templates14 { - typedef TemplateSel Head; - typedef Templates13 Tail; -}; - -template -struct Templates15 { - typedef TemplateSel Head; - typedef Templates14 Tail; -}; - -template -struct Templates16 { - typedef TemplateSel Head; - typedef Templates15 Tail; -}; - -template -struct Templates17 { - typedef TemplateSel Head; - typedef Templates16 Tail; -}; - -template -struct Templates18 { - typedef TemplateSel Head; - typedef Templates17 Tail; -}; - -template -struct Templates19 { - typedef TemplateSel Head; - typedef Templates18 Tail; -}; - -template -struct Templates20 { - typedef TemplateSel Head; - typedef Templates19 Tail; -}; - -template -struct Templates21 { - typedef TemplateSel Head; - typedef Templates20 Tail; -}; - -template -struct Templates22 { - typedef TemplateSel Head; - typedef Templates21 Tail; -}; - -template -struct Templates23 { - typedef TemplateSel Head; - typedef Templates22 Tail; -}; - -template -struct Templates24 { - typedef TemplateSel Head; - typedef Templates23 Tail; -}; - -template -struct Templates25 { - typedef TemplateSel Head; - typedef Templates24 Tail; -}; - -template -struct Templates26 { - typedef TemplateSel Head; - typedef Templates25 Tail; -}; - -template -struct Templates27 { - typedef TemplateSel Head; - typedef Templates26 Tail; -}; - -template -struct Templates28 { - typedef TemplateSel Head; - typedef Templates27 Tail; -}; - -template -struct Templates29 { - typedef TemplateSel Head; - typedef Templates28 Tail; -}; - -template -struct Templates30 { - typedef TemplateSel Head; - typedef Templates29 Tail; -}; - -template -struct Templates31 { - typedef TemplateSel Head; - typedef Templates30 Tail; -}; - -template -struct Templates32 { - typedef TemplateSel Head; - typedef Templates31 Tail; -}; - -template -struct Templates33 { - typedef TemplateSel Head; - typedef Templates32 Tail; -}; - -template -struct Templates34 { - typedef TemplateSel Head; - typedef Templates33 Tail; -}; - -template -struct Templates35 { - typedef TemplateSel Head; - typedef Templates34 Tail; -}; - -template -struct Templates36 { - typedef TemplateSel Head; - typedef Templates35 Tail; -}; - -template -struct Templates37 { - typedef TemplateSel Head; - typedef Templates36 Tail; -}; - -template -struct Templates38 { - typedef TemplateSel Head; - typedef Templates37 Tail; -}; - -template -struct Templates39 { - typedef TemplateSel Head; - typedef Templates38 Tail; -}; - -template -struct Templates40 { - typedef TemplateSel Head; - typedef Templates39 Tail; -}; - -template -struct Templates41 { - typedef TemplateSel Head; - typedef Templates40 Tail; -}; - -template -struct Templates42 { - typedef TemplateSel Head; - typedef Templates41 Tail; -}; - -template -struct Templates43 { - typedef TemplateSel Head; - typedef Templates42 Tail; -}; - -template -struct Templates44 { - typedef TemplateSel Head; - typedef Templates43 Tail; -}; - -template -struct Templates45 { - typedef TemplateSel Head; - typedef Templates44 Tail; -}; - -template -struct Templates46 { - typedef TemplateSel Head; - typedef Templates45 Tail; -}; - -template -struct Templates47 { - typedef TemplateSel Head; - typedef Templates46 Tail; -}; - -template -struct Templates48 { - typedef TemplateSel Head; - typedef Templates47 Tail; -}; - -template -struct Templates49 { - typedef TemplateSel Head; - typedef Templates48 Tail; -}; - -template -struct Templates50 { - typedef TemplateSel Head; - typedef Templates49 Tail; -}; - - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. -template -struct Templates { - typedef Templates50 type; -}; - -template <> -struct Templates { - typedef Templates0 type; -}; -template -struct Templates { - typedef Templates1 type; -}; -template -struct Templates { - typedef Templates2 type; -}; -template -struct Templates { - typedef Templates3 type; -}; -template -struct Templates { - typedef Templates4 type; -}; -template -struct Templates { - typedef Templates5 type; -}; -template -struct Templates { - typedef Templates6 type; -}; -template -struct Templates { - typedef Templates7 type; -}; -template -struct Templates { - typedef Templates8 type; -}; -template -struct Templates { - typedef Templates9 type; -}; -template -struct Templates { - typedef Templates10 type; -}; -template -struct Templates { - typedef Templates11 type; -}; -template -struct Templates { - typedef Templates12 type; -}; -template -struct Templates { - typedef Templates13 type; -}; -template -struct Templates { - typedef Templates14 type; -}; -template -struct Templates { - typedef Templates15 type; -}; -template -struct Templates { - typedef Templates16 type; -}; -template -struct Templates { - typedef Templates17 type; -}; -template -struct Templates { - typedef Templates18 type; -}; -template -struct Templates { - typedef Templates19 type; -}; -template -struct Templates { - typedef Templates20 type; -}; -template -struct Templates { - typedef Templates21 type; -}; -template -struct Templates { - typedef Templates22 type; -}; -template -struct Templates { - typedef Templates23 type; -}; -template -struct Templates { - typedef Templates24 type; -}; -template -struct Templates { - typedef Templates25 type; -}; -template -struct Templates { - typedef Templates26 type; -}; -template -struct Templates { - typedef Templates27 type; -}; -template -struct Templates { - typedef Templates28 type; -}; -template -struct Templates { - typedef Templates29 type; -}; -template -struct Templates { - typedef Templates30 type; -}; -template -struct Templates { - typedef Templates31 type; -}; -template -struct Templates { - typedef Templates32 type; -}; -template -struct Templates { - typedef Templates33 type; -}; -template -struct Templates { - typedef Templates34 type; -}; -template -struct Templates { - typedef Templates35 type; -}; -template -struct Templates { - typedef Templates36 type; -}; -template -struct Templates { - typedef Templates37 type; -}; -template -struct Templates { - typedef Templates38 type; -}; -template -struct Templates { - typedef Templates39 type; -}; -template -struct Templates { - typedef Templates40 type; -}; -template -struct Templates { - typedef Templates41 type; -}; -template -struct Templates { - typedef Templates42 type; -}; -template -struct Templates { - typedef Templates43 type; -}; -template -struct Templates { - typedef Templates44 type; -}; -template -struct Templates { - typedef Templates45 type; -}; -template -struct Templates { - typedef Templates46 type; -}; -template -struct Templates { - typedef Templates47 type; -}; -template -struct Templates { - typedef Templates48 type; -}; -template -struct Templates { - typedef Templates49 type; -}; - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { - typedef Types1 type; -}; - -template -struct TypeList > { - typedef typename Types::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h.pump b/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h.pump deleted file mode 100644 index 251fdf025b2..00000000000 --- a/lib/libcgroup-3.1.0/googletest/googletest/include/gtest/internal/gtest-type-util.h.pump +++ /dev/null @@ -1,297 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 50 $$ Maximum length of type lists we want to support. -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most $n types in a list, and at most $n -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -#include "gtest/internal/gtest-port.h" - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# if GTEST_HAS_CXXABI_H_ -# include -# elif defined(__HP_aCC) -# include -# endif // GTEST_HASH_CXXABI_H_ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -std::string GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# if GTEST_HAS_CXXABI_H_ - using abi::__cxa_demangle; -# endif // GTEST_HAS_CXXABI_H_ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const std::string name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; - -$range i 2..n - -$for i [[ -$range j 1..i -$range k 2..i -template <$for j, [[typename T$j]]> -struct Types$i { - typedef T1 Head; - typedef Types$(i-1)<$for k, [[T$k]]> Tail; -}; - - -]] - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. - -$range i 1..n -template <$for i, [[typename T$i = internal::None]]> -struct Types { - typedef internal::Types$n<$for i, [[T$i]]> type; -}; - -template <> -struct Types<$for i, [[internal::None]]> { - typedef internal::Types0 type; -}; - -$range i 1..n-1 -$for i [[ -$range j 1..i -$range k i+1..n -template <$for j, [[typename T$j]]> -struct Types<$for j, [[T$j]]$for k[[, internal::None]]> { - typedef internal::Types$i<$for j, [[T$j]]> type; -}; - -]] - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; - -$range i 2..n - -$for i [[ -$range j 1..i -$range k 2..i -template <$for j, [[GTEST_TEMPLATE_ T$j]]> -struct Templates$i { - typedef TemplateSel Head; - typedef Templates$(i-1)<$for k, [[T$k]]> Tail; -}; - - -]] - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. - -$range i 1..n -template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]> -struct Templates { - typedef Templates$n<$for i, [[T$i]]> type; -}; - -template <> -struct Templates<$for i, [[NoneT]]> { - typedef Templates0 type; -}; - -$range i 1..n-1 -$for i [[ -$range j 1..i -$range k i+1..n -template <$for j, [[GTEST_TEMPLATE_ T$j]]> -struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> { - typedef Templates$i<$for j, [[T$j]]> type; -}; - -]] - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { - typedef Types1 type; -}; - - -$range i 1..n -template <$for i, [[typename T$i]]> -struct TypeList > { - typedef typename Types<$for i, [[T$i]]>::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/libgtest.so b/lib/libcgroup-3.1.0/googletest/googletest/libgtest.so deleted file mode 100755 index cd17e16f1a3..00000000000 Binary files a/lib/libcgroup-3.1.0/googletest/googletest/libgtest.so and /dev/null differ diff --git a/lib/libcgroup-3.1.0/googletest/googletest/libgtest_main.so b/lib/libcgroup-3.1.0/googletest/googletest/libgtest_main.so deleted file mode 100755 index bcfee06fa7f..00000000000 Binary files a/lib/libcgroup-3.1.0/googletest/googletest/libgtest_main.so and /dev/null differ diff --git a/lib/libcgroup-3.1.0/include/Makefile.am b/lib/libcgroup-3.1.0/include/Makefile.am deleted file mode 100644 index 23cebaac753..00000000000 --- a/lib/libcgroup-3.1.0/include/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# Using 'nobase_', we what groups.h in /usr/include/libcgroup/ directory -nobase_include_HEADERS = libcgroup.h libcgroup/error.h libcgroup/init.h \ - libcgroup/groups.h libcgroup/tasks.h \ - libcgroup/iterators.h libcgroup/config.h \ - libcgroup/log.h libcgroup/tools.h - -if WITH_SYSTEMD -nobase_include_HEADERS += libcgroup/systemd.h -endif diff --git a/lib/libcgroup-3.1.0/include/Makefile.in b/lib/libcgroup-3.1.0/include/Makefile.in deleted file mode 100644 index ea420bf382f..00000000000 --- a/lib/libcgroup-3.1.0/include/Makefile.in +++ /dev/null @@ -1,607 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WITH_SYSTEMD_TRUE@am__append_1 = libcgroup/systemd.h -subdir = include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__nobase_include_HEADERS_DIST) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__nobase_include_HEADERS_DIST = libcgroup.h libcgroup/error.h \ - libcgroup/init.h libcgroup/groups.h libcgroup/tasks.h \ - libcgroup/iterators.h libcgroup/config.h libcgroup/log.h \ - libcgroup/tools.h libcgroup/systemd.h -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(includedir)" -HEADERS = $(nobase_include_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Using 'nobase_', we what groups.h in /usr/include/libcgroup/ directory -nobase_include_HEADERS = libcgroup.h libcgroup/error.h \ - libcgroup/init.h libcgroup/groups.h libcgroup/tasks.h \ - libcgroup/iterators.h libcgroup/config.h libcgroup/log.h \ - libcgroup/tools.h $(am__append_1) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-nobase_includeHEADERS: $(nobase_include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ - fi; \ - $(am__nobase_list) | while read dir files; do \ - xfiles=; for file in $$files; do \ - if test -f "$$file"; then xfiles="$$xfiles $$file"; \ - else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ - test -z "$$xfiles" || { \ - test "x$$dir" = x. || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ - echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ - $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ - done - -uninstall-nobase_includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ - $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-nobase_includeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-nobase_includeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man \ - install-nobase_includeHEADERS install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-nobase_includeHEADERS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/include/libcgroup.h b/lib/libcgroup-3.1.0/include/libcgroup.h deleted file mode 100644 index eddb356f678..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup.h +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright IBM Corporation. 2007 - * - * Author: Balbir Singh - */ - -#ifndef _LIBCGROUP_H -#define _LIBCGROUP_H - -#define _LIBCGROUP_H_INSIDE - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef _LIBCGROUP_H_INSIDE - -/*! \mainpage libcgroup - * - * \section intro_sec Introduction - * - * @c libcgroup is a library that abstracts the control group file system in Linux. - * It comes with various command-line tools and configuration files, see - * their man pages for details. - * - * This documentation provides description of @c libcgroup API. Read following - * sections, preferably in this order: - * -# @ref group_init "Initialization" - * -# @ref group_groups "Control Groups" - * -# @ref group_iterators "Iterators" - * -# @ref group_tasks "Manipulation with tasks" - * -# @ref group_config "Configuration" - * -# @ref group_errors "Error Handling" - */ - -#endif /* _LIBCGROUP_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/config.h b/lib/libcgroup-3.1.0/include/libcgroup/config.h deleted file mode 100644 index 08354d49f4c..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/config.h +++ /dev/null @@ -1,138 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_CONFIG_H -#define _LIBCGROUP_CONFIG_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup group_config 5. Configuration - * @{ - * - * @name Configuration file - * @{ - * - * @c libcgroup can mount and create control groups and set their parameters as - * specified in a configuration file. - * - * @todo add this description?: These functions are mostly intended - * to be used by internal @c libcgroup tools, however they are fully supported - * and applications can benefit from them. - */ - -/** - * Load configuration file and mount and create control groups described there. - * See cgconfig.conf man page for format of the file. - * @param pathname Name of the configuration file to load. - */ -int cgroup_config_load_config(const char *pathname); - -/** - * Delete all control groups and unmount all hierarchies. - */ -int cgroup_unload_cgroups(void); - -/** - * Delete all cgroups and unmount all mount points defined in specified config - * file. - * - * The groups are either removed recursively or only the empty ones, based - * on given flags. Mount point are always umounted only if they are empty, - * regardless of any flags. - * - * The groups are sorted before they are removed, so the removal of empty ones - * actually works (i.e. subgroups are removed first). - * - * @param pathname Name of the configuration file to unload. - * @param flags Combination of CGFLAG_DELETE_* flags, which indicate what and - * how to delete. - */ -int cgroup_config_unload_config(const char *pathname, int flags); - -/** - * Sets default permissions of groups created by subsequent - * cgroup_config_load_config() calls. If a config file contains a 'default {}' - * section, the default permissions from the config file is then used. - * - * Use cgroup_new_cgroup() to create a dummy group and cgroup_set_uid_gid() and - * cgroup_set_permissions() to set its permissions. Use NO_UID_GID instead of - * GID/UID and NO_PERMS instead of file/directory permissions to let kernel - * decide the default permissions where you don't want specific user and/or - * permissions. Kernel then uses current user/group and permissions from umask - * then. - * - * @param new_default New default permissions from this group are copied to - * libcgroup internal structures. I.e., this group can be freed immediatelly - * after this function returns. - */ -int cgroup_config_set_default(struct cgroup *new_default); - -/** - * Initializes the templates cache and load it from file pathname. - */ -int cgroup_init_templates_cache(char *pathname); - -/** - * Reloads the templates list from file pathname. - */ -int cgroup_reload_cached_templates(char *pathname); - -/** - * Load the templates cache from files. Before calling this function, - * cgroup_templates_cache_set_source_files has to be called first. - * @param file_index index of file which was unable to be parsed - * @return 0 on success, > 0 on error - */ -int cgroup_load_templates_cache_from_files(int *file_index); - -/** - * Setting source files of templates. This function has to be called before - * any call of cgroup_load_templates_cache_from_files. - * @param tmpl_files - */ -struct cgroup_string_list; -void cgroup_templates_cache_set_source_files( - struct cgroup_string_list *tmpl_files); - -/** - * Physically create a new control group in kernel, based on given control - * group template and configuration file. If given template is not set in - * configuration file, then the procedure works create the control group - * using cgroup_create_cgroup() function - * - * Templates are loaded using cgroup_load_templates_cache_from_files - * function, which must be preceded by cgroup_templates_cache_set_source_files - * call. - * - * The flags can alter the behavior of this function: - * CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of - * parsing the config file - * - * @param pathname Name of the configuration file with template definitions - * @param cgroup Wanted control group - contains substitute name and wanted - * controllers. - * @param template_name Template name used for cgroup setting - * @param flags Bit flags to change the behavior - */ -int cgroup_config_create_template_group( - struct cgroup *cgroup, char *template_name, - int flags); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*_LIBCGROUP_CONFIG_H*/ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/error.h b/lib/libcgroup-3.1.0/include/libcgroup/error.h deleted file mode 100644 index 3520a038831..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/error.h +++ /dev/null @@ -1,111 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_ERROR_H -#define _LIBCGROUP_ERROR_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup group_errors 6. Error handling - * @{ - * - * @name Error handling - * @{ - * Unless states otherwise in documentation of a function, all functions - * return @c int, which is zero (0) when the function succeeds, and positive - * number if the function fails. - * - * The returned integer is one of the ECG* values described below. Value - * #ECGOTHER means that the error was caused by underlying OS and the real - * cause can be found by calling cgroup_get_last_errno(). - */ - -enum { - ECGROUPNOTCOMPILED = 50000, - ECGROUPNOTMOUNTED, /* 50001 */ - ECGROUPNOTEXIST, /* 50002 */ - ECGROUPNOTCREATED, /* 50003 */ - ECGROUPSUBSYSNOTMOUNTED, /* 50004 */ - ECGROUPNOTOWNER, /* 50005 */ - /** Controllers bound to different mount points */ - ECGROUPMULTIMOUNTED, /* 50006 */ - /* This is the stock error. Default error. @todo really? */ - ECGROUPNOTALLOWED, /* 50007 */ - ECGMAXVALUESEXCEEDED, /* 50008 */ - ECGCONTROLLEREXISTS, /* 50009 */ - ECGVALUEEXISTS, /* 50010 */ - ECGINVAL, /* 50011 */ - ECGCONTROLLERCREATEFAILED, /* 50012 */ - ECGFAIL, /* 50013 */ - ECGROUPNOTINITIALIZED, /* 50014 */ - ECGROUPVALUENOTEXIST, /* 50015 */ - /** - * Represents error coming from other libraries like glibc. @c libcgroup - * users need to check cgroup_get_last_errno() upon encountering this - * error. - */ - ECGOTHER, /* 50016 */ - ECGROUPNOTEQUAL, /* 50017 */ - ECGCONTROLLERNOTEQUAL, /* 50018 */ - /** Failed to parse rules configuration file. */ - ECGROUPPARSEFAIL, /* 50019 */ - /** Rules list does not exist. */ - ECGROUPNORULES, /* 50020 */ - ECGMOUNTFAIL, /* 50021 */ - /** - * Not an real error, it just indicates that iterator has come to end - * of sequence and no more items are left. - */ - ECGEOF = 50023, - /** Failed to parse config file (cgconfig.conf). */ - ECGCONFIGPARSEFAIL, /* 50024 */ - ECGNAMESPACEPATHS, /* 50025 */ - ECGNAMESPACECONTROLLER, /* 50026 */ - ECGMOUNTNAMESPACE, /* 50027 */ - ECGROUPUNSUPP, /* 50028 */ - ECGCANTSETVALUE, /* 50029 */ - /** Removing of a group failed because it was not empty. */ - ECGNONEMPTY, /* 50030 */ - /** Failed to convert from cgroup v1 to/from cgroup v2 */ - ECGNOVERSIONCONVERT, /* 50031 */ -}; - -/** - * Legacy definition of ECGRULESPARSEFAIL error code. - */ -#define ECGRULESPARSEFAIL ECGROUPPARSEFAIL - -/** - * Format error code to a human-readable English string. No internationalization - * is currently done. Returned pointer leads to @c libcgroup memory and - * must not be freed nor modified. The memory is rewritten by subsequent - * call to this function. - * @param code Error code for which the corresponding error string is - * returned. When #ECGOTHER is used, text with glibc's description of - * cgroup_get_last_errno() value is returned. - */ -const char *cgroup_strerror(int code); - -/** - * Return last errno, which caused ECGOTHER error. - */ -int cgroup_get_last_errno(void); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_INIT_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/groups.h b/lib/libcgroup-3.1.0/include/libcgroup/groups.h deleted file mode 100644 index 503f499c339..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/groups.h +++ /dev/null @@ -1,706 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_GROUPS_H -#define _LIBCGROUP_GROUPS_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -enum cg_version_t { - CGROUP_UNK = 0, - CGROUP_V1, - CGROUP_V2, - CGROUP_DISK = 0xFF, -}; - -enum cg_setup_mode_t { - CGROUP_MODE_UNK = 0, - CGROUP_MODE_LEGACY, - CGROUP_MODE_HYBRID, - CGROUP_MODE_UNIFIED, -}; - -/** - * Flags for cgroup_delete_cgroup_ext(). - */ -enum cgroup_delete_flag { - /** - * Ignore errors caused by migration of tasks to parent group. - */ - CGFLAG_DELETE_IGNORE_MIGRATION = 1, - - /** - * Recursively delete all child groups. - */ - CGFLAG_DELETE_RECURSIVE = 2, - - /** - * Delete the cgroup only if it is empty, i.e. it has no subgroups and - * no processes inside. This flag cannot be used with - * CGFLAG_DELETE_RECURSIVE. - */ - CGFLAG_DELETE_EMPTY_ONLY = 4, -}; - -/** - * @defgroup group_groups 2. Group manipulation API - * @{ - * - * @name Basic infrastructure - * @{ - * struct cgroup* is the heart of @c libcgroup API. - * The structure is opaque to applications, all access to the structure is - * through appropriate functions. - * - * The most important information is that one struct cgroup* can - * represent zero, one or more real control groups in kernel. - * The struct cgroup* is identified by name of the group, which must be - * set by cgroup_new_cgroup(). Multiple controllers (aka subsystems) can be - * attached to one struct cgroup* using cgroup_add_controller(). These - * controllers can belong to different hierarchies. - * - * This approach is different to the one in the Linux kernel - a control group - * must be part of exactly one hierarchy there. In @c libcgroup, a group can be - * part of multiple hierarchies, as long as the group name is the same. - * - * @par Example: - * Let there be following control groups: - * @code - * cpu,cpuacct:/ - * cpu,cpuacct:/foo - * cpu,cpuacct:/bar - * freezer:/ - * freezer:/foo - * @endcode - * I.e. there is @c cpu and @c cpuacct controller mounted together in one - * hierarchy, with @c foo and @c bar groups. In addition, @c freezer is - * mounted as separate hierarchy, with only one @c foo group. - * - * @par - * Following code creates struct cgroup* structure, which represents - * one group cpu,cpuacct:/foo: - * @code - * struct cgroup *foo = cgroup_new_cgroup("foo"); - * cgroup_add_controller(foo, "cpu"); - * @endcode - * Now, you can call e.g. cgroup_delete_cgroup() and the group is deleted from - * the hierarchy. You can note that it's enough to add only one controller to - * the group to fully identify a group in cpu,cpuacct hierarchy. - * - * @par - * Following code creates struct cgroup* structure, which represents - * @b two groups, cpu,cpuacct:/foo and freezer:/foo: - * @code - * struct cgroup *foo = cgroup_new_cgroup("foo"); - * cgroup_add_controller(foo, "cpu"); - * cgroup_add_controller(foo, "freezer"); - * @endcode - * Now, if you call e.g. cgroup_delete_cgroup(), the group gets deleted from - * @b both hierarchies. - * - * @todo add some propaganda what's so great on this approach... I personally - * think it is broken and confusing (see TODOs below). - * - * Following functions are provided to create/destroy various libcgroup - * structures. Please note that none of these functions actually create or - * delete a cgroup in kernel! - */ - -/** - * @struct cgroup - * - * Structure describing one or more control groups. The structure is opaque to - * applications. - */ -struct cgroup; - -/** - * @struct cgroup_controller - * Structure describing a controller attached to one struct @c cgroup, including - * parameters of the group and their values. The structure is opaque to - * applications. - * @see groups - */ -struct cgroup_controller; - -/** - * Uninitialized file/directory permissions used for task/control files. - */ -#define NO_PERMS (-1U) - -/** - * Uninitialized UID/GID used for task/control files. - */ -#define NO_UID_GID (-1U) - -/** - * Allocate new cgroup structure. This function itself does not create new - * control group in kernel, only new struct cgroup inside libcgroup! - * - * @param name Path to the group, relative from root group. Use @c "/" or @c "." - * for the root group itself and @c "/foo/bar/baz" or @c "foo/bar/baz" for - * subgroups. - * @todo suggest one preferred way, either "/foo" or "foo". - * @returns Created group or NULL on error. - */ -struct cgroup *cgroup_new_cgroup(const char *name); - -/** - * Attach new controller to cgroup. This function just modifies internal - * libcgroup structure, not the kernel control group. - * - * @param cgroup - * @param name The name of the controller, e.g. "freezer". - * @return Created controller or NULL on error. - */ -struct cgroup_controller *cgroup_add_controller(struct cgroup *cgroup, - const char *name); - -/** - * Attach all mounted controllers to given cgroup. This function just modifies - * internal libcgroup structure, not the kernel control group. - * - * @param cgroup - * @return zero or error number - */ -int cgroup_add_all_controllers(struct cgroup *cgroup); - - -/** - * Return appropriate controller from given group. - * The controller must be added before using cgroup_add_controller() or loaded - * from kernel using cgroup_get_cgroup(). - * @param cgroup - * @param name The name of the controller, e.g. "freezer". - */ -struct cgroup_controller *cgroup_get_controller(struct cgroup *cgroup, - const char *name); - -/** - * Free internal @c cgroup structure. This function frees also all controllers - * attached to the @c cgroup, including all parameters and their values. - * @param cgroup - */ -void cgroup_free(struct cgroup **cgroup); - -/** - * Free internal list of controllers from the group. - * @todo should this function be public??? - * @param cgroup - */ -void cgroup_free_controllers(struct cgroup *cgroup); - -/** - * @} - * @name Group manipulation API - * Using following functions you can create and remove control groups and - * change their parameters. - * @note All access to kernel is through previously mounted cgroup filesystems. - * @c libcgroup does not mount/unmount anything for you. - * @{ - */ - -/** - * Physically create a control group in kernel. The group is created in all - * hierarchies, which cover controllers added by cgroup_add_controller(). - * All parameters set by cgroup_add_value_* functions are written. - * The created groups has owner which was set by cgroup_set_uid_gid() and - * permissions set by cgroup_set_permissions. - * @param cgroup - * @param ignore_ownership When nozero, all errors are ignored when setting - * owner of the group and/or its tasks file. - * @todo what is ignore_ownership good for? - * @retval #ECGROUPNOTEQUAL if not all specified controller parameters - * were successfully set. - */ -int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership); - -/** - * Physically create new control group in kernel, with all parameters and values - * copied from its parent group. The group is created in all hierarchies, where - * the parent group exists. I.e. following code creates subgroup in all - * hierarchies, because all of them have root (=parent) group. - * @code - * struct cgroup *foo = cgroup_new_cgroup("foo"); - * cgroup_create_cgroup_from_parent(foo, 0); - * @endcode - * @todo what is this good for? Why the list of controllers added by - * cgroup_add_controller() is not used, like in cgroup_create_cgroup()? I can't - * crate subgroup of root group in just one hierarchy with this function! - * - * @param cgroup The cgroup to create. Only it's name is used, everything else - * is discarded. - * @param ignore_ownership When nozero, all errors are ignored when setting - * owner of the group and/or its tasks file. - * @todo what is ignore_ownership good for? - * @retval #ECGROUPNOTEQUAL if not all inherited controller parameters - * were successfully set (this is expected). - */ -int cgroup_create_cgroup_from_parent(struct cgroup *cgroup, - int ignore_ownership); - -/** - * Physically modify a control group in kernel. All parameters added by - * cgroup_add_value_ or cgroup_set_value_ are written. - * Currently it's not possible to change and owner of a group. - * - * @param cgroup - */ -int cgroup_modify_cgroup(struct cgroup *cgroup); - -/** - * Physically remove a control group from kernel. The group is removed from - * all hierarchies, which cover controllers added by cgroup_add_controller() - * or cgroup_get_cgroup(). All tasks inside the group are automatically moved - * to parent group. - * - * The group being removed must be empty, i.e. without subgroups. Use - * cgroup_delete_cgroup_ext() for recursive delete. - * - * @param cgroup - * @param ignore_migration When nozero, all errors are ignored when migrating - * tasks from the group to the parent group. - * @todo what is ignore_migration good for? rmdir() will fail if tasks were not moved. - */ -int cgroup_delete_cgroup(struct cgroup *cgroup, int ignore_migration); - -/** - * Physically remove a control group from kernel. - * All tasks are automatically moved to parent group. - * If #CGFLAG_DELETE_IGNORE_MIGRATION flag is used, the errors that occurred - * during the task movement are ignored. - * #CGFLAG_DELETE_RECURSIVE flag specifies that all subgroups should be removed - * too. If root group is being removed with this flag specified, all subgroups - * are removed but the root group itself is left undeleted. - * @see cgroup_delete_flag. - * - * @param cgroup - * @param flags Combination of CGFLAG_DELETE_* flags, which indicate what and - * how to delete. - */ -int cgroup_delete_cgroup_ext(struct cgroup *cgroup, int flags); - -/** - * @} - * @name Other functions - * @{ - * Helper functions to manipulate with control groups. - */ - -/** - * Read all information regarding the group from kernel. - * Based on name of the group, list of controllers and all parameters and their - * values are read from all hierarchies, where a group with given name exists. - * All existing controllers are replaced. I.e. following code will fill @c root - * with controllers from all hierarchies, because the root group is available in - * all of them. - * @code - * struct cgroup *root = cgroup_new_cgroup("/"); - * cgroup_get_cgroup(root); - * @endcode - * - * @todo what is this function good for? Why is not considered only the list of - * controllers attached by cgroup_add_controller()? What owners will return - * cgroup_get_uid_gid() if the group is in multiple hierarchies, each with - * different owner of tasks file? - * - * @param cgroup The cgroup to load. Only it's name is used, everything else - * is replaced. - */ -int cgroup_get_cgroup(struct cgroup *cgroup); - -/** - * Copy all controllers, their parameters and values. Group name, permissions - * and ownerships are not coppied. All existing controllers - * in the source group are discarded. - * - * @param dst Destination group. - * @param src Source group. - */ -int cgroup_copy_cgroup(struct cgroup *dst, struct cgroup *src); - -/** - * Compare names, owners, controllers, parameters and values of two groups. - * - * @param cgroup_a - * @param cgroup_b - * - * @retval 0 if the groups are the same. - * @retval #ECGROUPNOTEQUAL if the groups are not the same. - * @retval #ECGCONTROLLERNOTEQUAL if the only difference are controllers, - * parameters or their values. - */ -int cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b); - - -/** - * Compare names, parameters and values of two controllers. - * - * @param cgca - * @param cgcb - * - * @retval 0 if the controllers are the same. - * @retval #ECGCONTROLLERNOTEQUAL if the controllers are not equal. - */ -int cgroup_compare_controllers(struct cgroup_controller *cgca, - struct cgroup_controller *cgcb); - -/** - * Set owner of the group control files and the @c tasks file. This function - * modifies only @c libcgroup internal @c cgroup structure, use - * cgroup_create_cgroup() afterwards to create the group with given owners. - * - * @param cgroup - * @param tasks_uid UID of the owner of group's @c tasks file. - * @param tasks_gid GID of the owner of group's @c tasks file. - * @param control_uid UID of the owner of group's control files (i.e. - * parameters). - * @param control_gid GID of the owner of group's control files (i.e. - * parameters). - */ -int cgroup_set_uid_gid(struct cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid, - uid_t control_uid, gid_t control_gid); - -/** - * Return owners of the group's @c tasks file and control files. - * The data is read from @c libcgroup internal @c cgroup structure, use - * cgroup_set_uid_gid() or cgroup_get_cgroup() to fill it. - */ -int cgroup_get_uid_gid(struct cgroup *cgroup, uid_t *tasks_uid, - gid_t *tasks_gid, uid_t *control_uid, - gid_t *control_gid); - -/** - * Stores given file permissions of the group's control and tasks files - * into the @c cgroup data structure. Use NO_PERMS if permissions shouldn't - * be changed or a value which applicable to chmod(2). Please note that - * the given permissions are masked with the file owner's permissions. - * For example if a control file has permissions 640 and control_fperm is - * 471 the result will be 460. - * @param cgroup - * @param control_dperm Directory permission for the group. - * @param control_fperm File permission for the control files. - * @param task_fperm File permissions for task file. - */ -void cgroup_set_permissions(struct cgroup *cgroup, - mode_t control_dperm, mode_t control_fperm, - mode_t task_fperm); - -/** - * @} - * @name Group parameters - * These are functions can read or modify parameter of a group. - * @note All these functions read/write parameters to @c libcgorup internal - * structures. Use cgroup_get_cgroup() to load parameters from kernel to these - * internal structures and cgroup_modify_cgroup() or cgroup_create_cgroup() to - * write changes to kernel. - * @{ - */ - -/** - * Add parameter and its value to internal @c libcgroup structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - * - */ -int cgroup_add_value_string(struct cgroup_controller *controller, - const char *name, const char *value); - -/** - * Add parameter and its value to internal @c libcgroup structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * Content of the value is copied to internal structures and is not needed - * after return from the function. - * - * @param controller - * @param name The name of the parameter. - * @param value - * - */ -int cgroup_add_value_int64(struct cgroup_controller *controller, - const char *name, int64_t value); - -/** - * Add parameter and its value to internal @c libcgroup structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - * - */ -int cgroup_add_value_uint64(struct cgroup_controller *controller, - const char *name, u_int64_t value); - -/** - * Add parameter and its value to internal @c libcgroup structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - * - */ -int cgroup_add_value_bool(struct cgroup_controller *controller, - const char *name, bool value); - -/** - * Read a parameter value from @c libcgroup internal structures. - * Use @c cgroup_get_cgroup() to fill these structures with data from kernel. - * It's up to the caller to free returned value. - * - * This function works only for 'short' parameters. Use - * cgroup_read_stats_begin(), cgroup_read_stats_next() and - * cgroup_read_stats_end() to read @c stats parameter, which can be longer - * than libcgroup's internal buffers. - * @todo rephrase, it's too vague... How big is the buffer actually? - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_get_value_string(struct cgroup_controller *controller, - const char *name, char **value); -/** - * Read a parameter value from @c libcgroup internal structures. - * Use @c cgroup_get_cgroup() to fill these structures with data from kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_get_value_int64(struct cgroup_controller *controller, - const char *name, int64_t *value); - -/** - * Read a parameter value from @c libcgroup internal structures. - * Use @c cgroup_get_cgroup() to fill these structures with data from kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_get_value_uint64(struct cgroup_controller *controller, - const char *name, u_int64_t *value); - -/** - * Read a parameter value from @c libcgroup internal structures. - * Use @c cgroup_get_cgroup() to fill these structures with data from kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_get_value_bool(struct cgroup_controller *controller, - const char *name, bool *value); - -/** - * Set a parameter value in @c libcgroup internal structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_set_value_string(struct cgroup_controller *controller, - const char *name, const char *value); - -/** - * Set a parameter value in @c libcgroup internal structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * Content of the value is copied to internal structures and is not needed - * after return from the function. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_set_value_int64(struct cgroup_controller *controller, - const char *name, int64_t value); -/** - * Set a parameter value in @c libcgroup internal structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_set_value_uint64(struct cgroup_controller *controller, - const char *name, u_int64_t value); - -/** - * Set a parameter value in @c libcgroup internal structures. - * Use cgroup_modify_cgroup() or cgroup_create_cgroup() to write it to kernel. - * - * @param controller - * @param name The name of the parameter. - * @param value - */ -int cgroup_set_value_bool(struct cgroup_controller *controller, - const char *name, bool value); - -/** - * Return the number of variables for the specified controller in @c libcgroup - * internal structures. Use cgroup_get_cgroup() to fill these structures with - * data from kernel. Use this function together with cgroup_get_value_name() - * to list all parameters of a group. - * - * @param controller - * @return Count of the parameters or -1 on error. - */ -int cgroup_get_value_name_count(struct cgroup_controller *controller); - -/** - * Return the name of parameter of controller at given index. - * The index goes from 0 to cgroup_get_value_name_count()-1. - * Use this function to list all parameter of the controller. - * - * @note The returned value is pointer to internal @c libcgroup structure, - * do not free it. - * - * @param controller - * @param index The index of the parameter. - * @return Name of the parameter. - */ -char *cgroup_get_value_name(struct cgroup_controller *controller, int index); - -/** - * Get the list of process in a cgroup. This list is guaranteed to - * be sorted. It is not necessary that it is unique. - * @param name The name of the cgroup - * @param controller The name of the controller - * @param pids The list of pids. Should be uninitialized when passed - * to the API. Should be freed by the caller using free. - * @param size The size of the pids array returned by the API. - */ -int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size); - -/** - * Change permission of files and directories of given group - * @param cgroup The cgroup which permissions should be changed - * @param dir_mode The permission mode of group directory - * @param dirm_change Denotes whether the directory change should be done - * @param file_mode The permission mode of group files - * @param filem_change Denotes whether the directory change should be done - */ -int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode, - int dirm_change, mode_t file_mode, int filem_change); - -/** - * Get the name of the cgroup from a given cgroup - * @param cgroup The cgroup whose name is needed - */ -char *cgroup_get_cgroup_name(struct cgroup *cgroup); - -/* - * Convert from one cgroup version to another version - * - * @param out_cgroup Destination cgroup - * @param out_version Destination cgroup version - * @param in_cgroup Source cgroup - * @param in_version Source cgroup version, only used if set to v1 or v2 - * - * @return 0 on success - * ECGFAIL conversion failed - * ECGCONTROLLERNOTEQUAL incorrect controller version provided - */ -int cgroup_convert_cgroup(struct cgroup * const out_cgroup, - enum cg_version_t out_version, - const struct cgroup * const in_cgroup, - enum cg_version_t in_version); - -/** - * List the mount paths, that matches the specified version - * - * @param cgrp_version The cgroup type/version - * @param mount_paths Holds the list of mount paths - * @return 0 success and list of mounts paths in mount_paths - * ECGOTHER on failure and mount_paths is NULL. - */ -int cgroup_list_mount_points(const enum cg_version_t cgrp_version, - char ***mount_paths); - -/** - * Get the cgroup version of a controller. Version is set to CGROUP_UNK - * if the version cannot be determined. - * - * @param controller The controller of interest - * @param version The version of the controller - */ -int cgroup_get_controller_version(const char * const controller, - enum cg_version_t * const version); - -/** - * Get the current group setup mode (legacy/unified/hybrid) - * - * @return CGROUP_MODE_UNK on failure and setup mode on success - */ -enum cg_setup_mode_t cgroup_setup_mode(void); - -/** - * Return the number of controllers for the specified cgroup in libcgroup - * internal structures. - * - * @param cgroup - * @return Count of the controllers or -1 on error. - */ -int cgroup_get_controller_count(struct cgroup *cgroup); - -/** - * Return requested controller from given group - * - * @param cgroup - * @param index The index into the cgroup controller list - */ -struct cgroup_controller *cgroup_get_controller_by_index(struct cgroup *cgroup, int index); - -/** - * Given a controller pointer, get the name of the controller - * - * @param controller - * @return controller name string, NULL if there's an error - */ -char *cgroup_get_controller_name(struct cgroup_controller *controller); - -/** - * Return true if cgroup setup mode is cgroup v1 (legacy), else - * returns false. - */ -bool is_cgroup_mode_legacy(void); - -/** - * Return true if cgroup setup mode is cgroup v1/v2 (hybrid), else - * returns false. - */ -bool is_cgroup_mode_hybrid(void); - -/** - * Return true if cgroup setup mode is cgroup v2 (unified), else - * returns false. - */ -bool is_cgroup_mode_unified(void); - -/** - * @} - * @} - */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_GROUPS_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/init.h b/lib/libcgroup-3.1.0/include/libcgroup/init.h deleted file mode 100644 index c61f5781da3..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/init.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _LIBCGROUP_INIT_H -#define _LIBCGROUP_INIT_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define CGROUP_VER_MAJOR 3 -#define CGROUP_VER_MINOR 1 -#define CGROUP_VER_RELEASE 0 - -struct cgroup_library_version { - unsigned int major; - unsigned int minor; - unsigned int release; -}; - -/** - * Query the library version information - * - * This function returns a pointer to a populated cgroup_library_version - * struct. The caller does not need to free the structure when finished. - * - */ -const struct cgroup_library_version *cgroup_version(void); - -/** - * @defgroup group_init 1. Initialization - * @{ - * - * @name Initialization - * @{ - * Application must initialize @c libcgroup using cgroup_init() before any - * other @c libcgroup function can be called. @c libcgroup caches information - * about mounted hierarchies (just what's mounted where, not the control groups - * themselves) at this time. There is currently no way to refresh this cache, - * i.e. all subsequent mounts/remounts/unmounts are not reflected in this cache - * and @c libcgroup may produce unexpected results. - * - * In addition, there is no way how to clean the cache on application exit. - * - * @todo this is very bad... There should be at least way how to refresh the - * cache and/or an option to refresh it automatically (does kernel provide - * any indication, when a filesystem is mounted/unmounted?). Dtto the cleanup - * on exit. - */ - -/** - * Initialize libcgroup. Information about mounted hierarchies are examined - * and cached internally (just what's mounted where, not the groups themselves). - * - * If the cgroup logging was not set using cgroup_set_logger() or - * cgroup_set_default_logger() before calling cgroup_init(), the default logger - * is automatically set, logging CGROUP_LOG_ERROR messages. - */ -int cgroup_init(void); - -/** - * Returns path where is mounted given controller. Applications should rely on - * @c libcgroup API and not call this function directly. - * Only the first mount point is returned, use - * cgroup_get_subsys_mount_point_begin(), cgroup_get_subsys_mount_point_next() - * and cgroup_get_subsys_mount_point_end() to get all of them. - * @param controller Name of the controller - * @param mount_point The string where the mount point location is stored. - * Please note, the caller must free the mount_point. - */ -int cgroup_get_subsys_mount_point(const char *controller, char **mount_point); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_INIT_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/init.h.in b/lib/libcgroup-3.1.0/include/libcgroup/init.h.in deleted file mode 100644 index 1e1323deb73..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/init.h.in +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _LIBCGROUP_INIT_H -#define _LIBCGROUP_INIT_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define CGROUP_VER_MAJOR @LIBRARY_VERSION_MAJOR@ -#define CGROUP_VER_MINOR @LIBRARY_VERSION_MINOR@ -#define CGROUP_VER_RELEASE @LIBRARY_VERSION_RELEASE@ - -struct cgroup_library_version { - unsigned int major; - unsigned int minor; - unsigned int release; -}; - -/** - * Query the library version information - * - * This function returns a pointer to a populated cgroup_library_version - * struct. The caller does not need to free the structure when finished. - * - */ -const struct cgroup_library_version *cgroup_version(void); - -/** - * @defgroup group_init 1. Initialization - * @{ - * - * @name Initialization - * @{ - * Application must initialize @c libcgroup using cgroup_init() before any - * other @c libcgroup function can be called. @c libcgroup caches information - * about mounted hierarchies (just what's mounted where, not the control groups - * themselves) at this time. There is currently no way to refresh this cache, - * i.e. all subsequent mounts/remounts/unmounts are not reflected in this cache - * and @c libcgroup may produce unexpected results. - * - * In addition, there is no way how to clean the cache on application exit. - * - * @todo this is very bad... There should be at least way how to refresh the - * cache and/or an option to refresh it automatically (does kernel provide - * any indication, when a filesystem is mounted/unmounted?). Dtto the cleanup - * on exit. - */ - -/** - * Initialize libcgroup. Information about mounted hierarchies are examined - * and cached internally (just what's mounted where, not the groups themselves). - * - * If the cgroup logging was not set using cgroup_set_logger() or - * cgroup_set_default_logger() before calling cgroup_init(), the default logger - * is automatically set, logging CGROUP_LOG_ERROR messages. - */ -int cgroup_init(void); - -/** - * Returns path where is mounted given controller. Applications should rely on - * @c libcgroup API and not call this function directly. - * Only the first mount point is returned, use - * cgroup_get_subsys_mount_point_begin(), cgroup_get_subsys_mount_point_next() - * and cgroup_get_subsys_mount_point_end() to get all of them. - * @param controller Name of the controller - * @param mount_point The string where the mount point location is stored. - * Please note, the caller must free the mount_point. - */ -int cgroup_get_subsys_mount_point(const char *controller, char **mount_point); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_INIT_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/iterators.h b/lib/libcgroup-3.1.0/include/libcgroup/iterators.h deleted file mode 100644 index 0256e090227..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/iterators.h +++ /dev/null @@ -1,435 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_ITERATORS_H -#define _LIBCGROUP_ITERATORS_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup group_iterators 3. Iterators - * @{ - * So-called iterators are a code pattern to retrieve various data from - * libcgroup in distinct chunks, for example when an application needs to read - * list of groups in a hierarchy, it uses iterator to get one group at a time. - * Iterator is opaque to the application, the application sees only - * void* handle pointer, which is managed internally by @c libcgroup. - * Each iterator provides at least these functions: - * - int iterator_name_begin(void **handle, my_type *item) - * - Initialize the iterator, store pointer to it into the @c handle. - * - Return the first element in the iterator, let's say it's @c my_type. - * - Return @c 0, if the operation succeeded. - * - Return #ECGEOF, if the operation succeeded, but the iterator is empty. - * The value of @c item is undefined in this case. - * - Return any other error code on error. - * - int iterator_name_next(void **handle, my_type *item) - * - Advance to next element in the iterator and return it. - * - Return @c 0, if the operation succeeded. - * - Return #ECGEOF, if there is no item to advance to, i.e. the iterator - * is already at its end. The value of @c item is undefined in this case. - * - Return any other error code on error. - * - void iterator_name_end(void **handle) - * - Free any data associated with the iterator. This function must be - * called even when iterator_name_begin() fails. - * - * @todo not all iterators follow this pattern, e.g. cgroup_walk_tree_begin() - * can result both in a state that cgroup_walk_tree_end() is not needed - * and will sigsegv and in a state that cgroup_walk_tree_end() is needed - * to free allocated memory. Complete review is needed! - * @par Example of iterator usage: - * @code - * void *handle; // our iterator handle - * my_type item; // the data returned by the iterator - * int ret; - * ret = iterator_name_begin(&handle, &item); - * while (ret == 0) { - * // process the item here - * ret = iterator_name_begin(&handle, &item); - * } - * if (ret != ECGEOF) { - * // process the error here - * } - * iterator_name_end(&handle); - * @endcode - * - * @name Walk through control group filesystem - * @{ - * This iterator returns all subgroups of given control group. It can be used - * to return all groups in given hierarchy, when root control group is provided. - */ - -/** - * Type of the walk. - */ -enum cgroup_walk_type { - /** - * Pre-order directory walk, return a directory first and then its - * subdirectories. - * E.g. directories would be returned in this order: - * @code - * / - * /group - * /group/subgroup1 - * /group/subgroup1/subsubgroup - * /group/subgroup2 - * @endcode - */ - CGROUP_WALK_TYPE_PRE_DIR = 0x1, - /** - * Post-order directory walk, return subdirectories of a directory - * first and then the directory itself. - * E.g. directories would be returned in this order: - * @code - * /group/subgroup1/subsubgroup - * /group/subgroup1 - * /group/subgroup2 - * /group - * / - * @endcode - */ - CGROUP_WALK_TYPE_POST_DIR = 0x2, -}; - -/** - * Type of returned entity. - */ -enum cgroup_file_type { - CGROUP_FILE_TYPE_FILE, /**< File. */ - CGROUP_FILE_TYPE_DIR, /**< Directory. */ - CGROUP_FILE_TYPE_OTHER, /**< Directory. @todo really? */ -}; - -/** - * Information about found directory (= a control group). - */ -struct cgroup_file_info { - /** Type of the entity. */ - enum cgroup_file_type type; - /** Name of the entity. */ - const char *path; - /** Name of its parent. */ - const char *parent; - /** - * Full path to the entity. To get path relative to the root of the - * walk, you must store its @c full_path (or its length) - * and calculate the relative path by yourself. - */ - const char *full_path; - /** - * Depth of the entity, how many directories below the root of - * walk it is. - */ - short depth; -}; - -/** - * Walk through the directory tree for the specified controller. - * The directory representing @c base_path is returned in @c info. - * Use cgroup_walk_tree_set_flags() to specify, in which order should be next - * directories returned. - * @param controller Name of the controller, for which we want to walk - * the directory tree. - * @param base_path Begin walking from this path. Use "/" to walk through - * full hierarchy. - * @param depth The maximum depth to which the function should walk, 0 - * implies all the way down. - * @param handle The handle to be used during iteration. - * @param info The info filled and returned about directory information. - * @param base_level Opaque integer which you must pass to subsequent - * cgroup_walk_tree_next. - * @todo why base_level is not hidden in **handle? - * @return #ECGEOF when there is no node. - */ -int cgroup_walk_tree_begin(const char *controller, const char *base_path, int depth, - void **handle, struct cgroup_file_info *info, - int *base_level); - -/** - * Get the next directory in the walk. - * @param depth The maximum depth to which the function should walk, 0 - * implies all the way down. - * @param handle The handle to be used during iteration. - * @param info The info filled and returned about the next directory. - * @param base_level Value of base_level returned by cgroup_walk_tree_begin(). - * @return #ECGEOF when we are done walking through the nodes. - */ -int cgroup_walk_tree_next(int depth, void **handle, - struct cgroup_file_info *info, int base_level); - -/** - * Release the iterator. - */ -int cgroup_walk_tree_end(void **handle); - -/** - * Set the flags for walk_tree. Currently available flags are in - * #cgroup_walk_type enum. - * @param handle The handle of the iterator. - * @param flags - */ -int cgroup_walk_tree_set_flags(void **handle, int flags); - -/** - * Read the value of the given variable for the specified - * controller and control group. - * The value is read up to newline character or at most max-1 characters, - * whichever comes first (i.e. similar to fgets()). - * @param controller Name of the controller for which stats are requested. - * @param path The path to control group, relative to hierarchy root. - * @param name is variable name. - * @param handle The handle to be used during iteration. - * @param buffer The buffer to read the value into. - * The buffer is always zero-terminated. - * @param max Maximal lenght of the buffer - * @return #ECGEOF when the stats file is empty. - */ - -int cgroup_read_value_begin(const char * const controller, const char *path, - const char * const name, void **handle, - char *buffer, int max); - -/** - * Read the next string from the given variable handle - * which is generated by cgroup_read_stats_begin() function. - * the value is read up to newline character or at most max-1 characters, - * whichever comes first (i.e. similar to fgets()) per - * cgroup_read_stats_next() call - * @param handle The handle to be used during iteration. - * @param data returned the string. - * @param buffer The buffer to read the value into. - * The buffer is always zero-terminated. - * @param max Maximal lenght of the buffer - * @return #ECGEOF when the iterator finishes getting the list of stats. - */ -int cgroup_read_value_next(void **handle, char *buffer, int max); - -/** - * Release the iterator. - */ -int cgroup_read_value_end(void **handle); - -/** - * @} - * - * @name Read group stats - * libcgroup's cgroup_get_value_string() reads only relatively short parametrs - * of a group. Use following functions to read @c stats parameter, which can - * be quite long. - */ - -/** - * Maximum length of a value in stats file. - */ -#define CG_VALUE_MAX 100 -/** - * One item in stats file. - */ -struct cgroup_stat { - char name[FILENAME_MAX]; - char value[CG_VALUE_MAX]; -}; - -/** - * Read the statistics values (= @c stats parameter) for the specified - * controller and control group. One line is returned per - * cgroup_read_stats_begin() and cgroup_read_stats_next() call. - * @param controller Name of the controller for which stats are requested. - * @param path The path to control group, relative to hierarchy root. - * @param handle The handle to be used during iteration. - * @param stat Returned first item in the stats file. - * @return #ECGEOF when the stats file is empty. - */ -int cgroup_read_stats_begin(const char *controller, const char *path, void **handle, - struct cgroup_stat *stat); - -/** - * Read the next stat value. - * @param handle The handle to be used during iteration. - * @param stat Returned next item in the stats file. - * @return #ECGEOF when the iterator finishes getting the list of stats. - */ -int cgroup_read_stats_next(void **handle, struct cgroup_stat *stat); - -/** - * Release the iterator. - */ -int cgroup_read_stats_end(void **handle); - -/** - * @} - * - * @name List all tasks in a group - * Use following functions to read @c tasks file of a group. - * @{ - */ - -/** - * Read the tasks file to get the list of tasks in a cgroup. - * @param cgroup Name of the cgroup. - * @param controller Name of the cgroup subsystem. - * @param handle The handle to be used in the iteration. - * @param pid The pid read from the tasks file. - * @return #ECGEOF when the group does not contain any tasks. - */ -int cgroup_get_task_begin(const char *cgroup, const char *controller, void **handle, - pid_t *pid); - -/** - * Read the next task value. - * @param handle The handle used for iterating. - * @param pid The variable where the value will be stored. - * - * @return #ECGEOF when the iterator finishes getting the list of tasks. - */ -int cgroup_get_task_next(void **handle, pid_t *pid); - -/** - * Release the iterator. - */ -int cgroup_get_task_end(void **handle); - -/** - * @} - * - * @name List mounted controllers - * Use following function to list mounted controllers and to see, how they - * are mounted together in hierarchies. - * Use cgroup_get_all_controller_begin() (see later) to list all controllers, - * including those which are not mounted. - * @{ - */ - -/** - * Information about mounted controller. - */ -struct cgroup_mount_point { - /** Name of the controller. */ - char name[FILENAME_MAX]; - /** Mount point of the controller. */ - char path[FILENAME_MAX]; -}; - -/** - * Read the mount table to give a list where each controller is - * mounted. - * @param handle The handle to be used for iteration. - * @param info The variable where the path to the controller is stored. - * @return #ECGEOF when no controllers are mounted. - */ -int cgroup_get_controller_begin(void **handle, struct cgroup_mount_point *info); - -/** - * Read the next mounted controller. - * While walking through the mount table, the controllers are - * returned in order of their mount points, i.e. controllers mounted together - * in one hierarchy are returned next to each other. - * @param handle The handle to be used for iteration. - * @param info The variable where the path to the controller is stored. - * @return #ECGEOF when all controllers were already returned. - */ -int cgroup_get_controller_next(void **handle, struct cgroup_mount_point *info); - -/** - * Release the iterator. - */ -int cgroup_get_controller_end(void **handle); - -/** - * @} - * - * @name List all controllers - * Use following functions to list all controllers, including those which are - * not mounted. The controllers are returned in the same order as in - * /proc/cgroups file, i.e. mostly random. - */ - -/** - * Detailed information about available controller. - */ -struct controller_data { - /** Controller name. */ - char name[FILENAME_MAX]; - /** - * Hierarchy ID. Controllers with the same hierarchy ID - * are mounted together as one hierarchy. Controllers with - * ID 0 are not currently mounted anywhere. - */ - int hierarchy; - /** Number of groups. */ - int num_cgroups; - /** Enabled flag. */ - int enabled; -}; - -/** - * Read the first of controllers from /proc/cgroups. - * @param handle The handle to be used for iteration. - * @param info The structure which will be filled with controller data. - */ -int cgroup_get_all_controller_begin(void **handle, - struct controller_data *info); -/** - * Read next controllers from /proc/cgroups. - * @param handle The handle to be used for iteration. - * @param info The structure which will be filled with controller data. - */ -int cgroup_get_all_controller_next(void **handle, struct controller_data *info); - -/** - * Release the iterator - */ -int cgroup_get_all_controller_end(void **handle); - -/** - * @} - * - * @name List all mount points of a controller. - * Use following functions to list all mount points of a hierarchy with given - * controller. - */ - -/** - * Read the first mount point of the hierarchy with given controller. - * The first is the same as the mount point returned by - * cgroup_get_subsys_mount_point(). - * @param handle The handle to be used for iteration. - * @param controller The controller name. - * @param path Buffer to fill the path into. The buffer must be at least - * FILENAME_MAX characters long. - */ -int cgroup_get_subsys_mount_point_begin(const char *controller, void **handle, - char *path); - -/** - * Read next mount point of the hierarchy with given controller. - * @param handle The handle to be used for iteration. - * @param path Buffer to fill the path into. The buffer must be at least - * FILENAME_MAX characters long. - */ -int cgroup_get_subsys_mount_point_next(void **handle, char *path); - -/** - * Release the iterator. - */ -int cgroup_get_subsys_mount_point_end(void **handle); - -/** - * @} - * @} - */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_ITERATORS_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/log.h b/lib/libcgroup-3.1.0/include/libcgroup/log.h deleted file mode 100644 index b65b8d39aa4..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/log.h +++ /dev/null @@ -1,158 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_LOG_H -#define _LIBCGROUP_LOG_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup group_log 7. Logging - * @{ - * - * @name Logging - * @{ - * Libcgroup allows applications to register a callback function which - * libcgroup will call when it wants to log something. Each log message - * has associated a log level. As described in previous chapter, most libcgroup - * functions return an error code, which described root cause of the failure - * and log messages might provide further details about these failures and other - * notable events. - * - * @par - * The logging callback can be set at any time, but setting the callback before - * any other libcgroup function (including cgroup_init()) is highly recommended. - * If no logger is set before cgroup_init() is called, default logger is - * automatically set, logging CGROUP_LOG_ERROR messages to stdout. - * - * @par Setting log level - * Some of the functions below set the log level as integer. - * Application can set directly a value of enum #cgroup_log_level or use - * value -1 to set the log level automatically. In this case, libcgroup - * inspects environment variable CGROUP_LOGLEVEL if it is set - * and contains any of these values: ERROR, WARNING, - * INFO, DEBUG or integer number representing value from - * enum #cgroup_log_level. If CGROUP_LOGLEVEL is not set or its value - * is not valid, CGROUP_LOG_ERROR is set as default log level. - * - * @par Example: - * Following short example shows custom libcgroup logger sending all log - * messages to stderr: - * @code - * static void my_logger(void *userdata, int level, const char *fmt, va_list ap) - * { - * vfprintf(stderr, fmt, ap); - * } - * - * int main(int argc, char **argv) - * { - * int ret; - * - * cgroup_set_logger(my_logger, -1, NULL); - * ret = cgroup_init(); - * if (ret) { - * ... - * } - * ... - * @endcode - */ - -/** - * Level of importance of a log message. - */ -enum cgroup_log_level { - /** - * Continue printing the log message, with the previous log level. - * Used to print log messages without the line break. - */ - CGROUP_LOG_CONT = 0, - /** - * Something serious happened and libcgroup failed to perform requested - * operation. - */ - CGROUP_LOG_ERROR, - /** - * Something bad happened but libcgroup recovered from the error. - */ - CGROUP_LOG_WARNING, - /** - * Something interesting happened and the message might be useful to the - * user. - */ - CGROUP_LOG_INFO, - /** - * Debugging messages useful to libcgroup developers. - */ - CGROUP_LOG_DEBUG, -}; - -typedef void (*cgroup_logger_callback)(void *userdata, int level, - const char *fmt, va_list ap); - -/** - * Set libcgroup logging callback. All log messages with equal or lower log - * level will be sent to the application's callback. There can be only - * one callback logger set, the previous callback is replaced with the new one - * by calling this function. - * Use NULL as the logger callback to completely disable libcgroup logging. - * - * @param logger The callback. - * @param loglevel The log level. Use value -1 to automatically discover the - * level from CGROUP_LOGLEVEL environment variable. - * @param userdata Application's data which will be provided back to the - * callback. - */ -extern void cgroup_set_logger(cgroup_logger_callback logger, int loglevel, - void *userdata); - -/** - * Set libcgroup logging to stdout. All messages with the given loglevel - * or below will be sent to standard output. Previous logger set by - * cgroup_set_logger() is replaced. - * - * @param loglevel The log level. Use value -1 to automatically discover the - * level from CGROUP_LOGLEVEL environment variable. - */ -extern void cgroup_set_default_logger(int loglevel); - -/** - * Change current loglevel. - * @param loglevel The log level. Use value -1 to automatically discover the - * level from CGROUP_LOGLEVEL environment variable. - */ -extern void cgroup_set_loglevel(int loglevel); - -/** - * Libcgroup log function. This is for applications which are too lazy to set - * up their own complex logging and miss-use libcgroup for that purpose. - * I.e. this function should be used only by simple command-line tools. - * This logging automatically benefits from CGROUP_LOGLEVEL env. variable. - */ -extern void cgroup_log(int loglevel, const char *fmt, ...); - -/** - * Parse levelstr string for information about desired loglevel. The levelstr - * is usually a value of the CGROUP_LOGLEVEL environment variable. - * @param levelstr String containing desired loglevel. - */ -extern int cgroup_parse_log_level_str(const char *levelstr); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_LOG_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/systemd.h b/lib/libcgroup-3.1.0/include/libcgroup/systemd.h deleted file mode 100644 index ab06128184a..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/systemd.h +++ /dev/null @@ -1,140 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_SYSTEMD_H -#define _LIBCGROUP_SYSTEMD_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -enum cgroup_systemd_mode_t { - CGROUP_SYSTEMD_MODE_FAIL = 0, - CGROUP_SYSTEMD_MODE_REPLACE, - CGROUP_SYSTEMD_MODE_ISOLATE, - CGROUP_SYSTEMD_MODE_IGNORE_DEPS, - CGROUP_SYSTEMD_MODE_IGNORE_REQS, - - CGROUP_SYSTEMD_MODE_CNT, - CGROUP_SYSTEMD_MODE_DFLT = CGROUP_SYSTEMD_MODE_REPLACE -}; - -/** - * Options associated with creating a systemd scope - */ -struct cgroup_systemd_scope_opts { - /** should systemd delegate this cgroup or not. 1 == yes, 0 == no */ - int delegated; - /** systemd behavior when the scope already exists */ - enum cgroup_systemd_mode_t mode; - /** pid to be placed in the cgroup. if 0, libcgroup will create a dummy process */ - pid_t pid; -}; - -/* - * cgroup systemd settings - */ -struct cgroup_systemd_opts { - char slice_name[FILENAME_MAX]; - char scope_name[FILENAME_MAX]; - int setdefault; - pid_t pid; - struct cgroup_systemd_opts *next; -}; - -/** - * Populate the scope options structure with default values - * - * @param opts Scope creation options structure instance. Must already be allocated - * - * @return 0 on success and > 0 on error - */ -int cgroup_set_default_scope_opts(struct cgroup_systemd_scope_opts * const opts); - -/** - * Create a systemd scope under the specified slice - * - * @param scope_name Name of the scope, must end in .scope - * @param slice_name Name of the slice, must end in .slice - * @param opts Scope creation options structure instance - * - * @return 0 on success and > 0 on error - */ -int cgroup_create_scope(const char * const scope_name, const char * const slice_name, - const struct cgroup_systemd_scope_opts * const opts); - -/** - * Create a systemd scope - * - * @param cgroup - * @param ignore_ownership When nonzero, all errors are ignored when setting owner of the group - * owner of the group and/or its tasks file - * @param opts Scope creation options structure instance - * - * @return 0 on success and > 0 on error - * - * @note The cgroup->name field should be of the form "foo.slice/bar.scope" - */ -int cgroup_create_scope2(struct cgroup *cgroup, int ignore_ownership, - const struct cgroup_systemd_scope_opts * const opts); - -/** - * Parse the systemd default cgroup's relative path from - * /var/run/libcgroup/systemd and set it as default delegation cgroup - * path, if available. - * - * The path is relative to cgroup root (default: /sys/fs/cgroup) - * - * @return 1 if a valid default slice/scope is set, 0 in all other cases - */ -int cgroup_set_default_systemd_cgroup(void); - -/** - * Parse the systemd delegation settings from the configuration file - * and allocate a new cgroup_systemd_opts object. - * This function internally calls cgroup_add_systemd_opts() to add the conf and - * value to the newly allocated cgroup_systemd_opts object. - * - * @param conf Name of the systemd delegate setting read from configuration file. - * @param value The value of the conf systemd delegate setting. - * - * @return 1 on success and 0 on error - */ -int cgroup_alloc_systemd_opts(const char * const conf, const char * const value); - -/** - * Parse the systemd delegation settings from the configuration file - * and add the conf and value to the last allocated cgroup_systemd_opts object - * (tail) allocated by cgroup_alloc_systemd_opts() - * - * @param conf Name of the systemd delegate setting read from configuration file. - * @param value The value of the conf systemd delegate setting. - * - * @return 1 on success and 0 on error - */ -int cgroup_add_systemd_opts(const char * const conf, const char * const value); - -/** - * Free the cgroup_systemd_opts objects allocated by cgroup_alloc_systemd_opts() - */ -void cgroup_cleanup_systemd_opts(void); - -/* - * Write the specified slice and scope to the libcgroup systemd run file. This - * slice and scope will then be used as the default cgroup root. Subsequent - * libcgroup commands, cgget, etc., will utilize this slice and scope when - * constructing the libcgroup path - * - * @param slice Slice name, e.g. libcgroup.slice - * @param scope Scope name, e.g. database.scope - */ -int cgroup_write_systemd_default_cgroup(const char * const slice, - const char * const scope); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_SYSTEMD_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/tasks.h b/lib/libcgroup-3.1.0/include/libcgroup/tasks.h deleted file mode 100644 index 77a85265f4a..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/tasks.h +++ /dev/null @@ -1,214 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -#ifndef _LIBCGROUP_TASKS_H -#define _LIBCGROUP_TASKS_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#include - -#ifndef SWIG -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** Flags for cgroup_change_cgroup_uid_gid(). */ -enum cgflags { - /** Use cached rules, do not read rules from disk. */ - CGFLAG_USECACHE = 0x01, - /** Use cached templates, do not read templates from disk. */ - CGFLAG_USE_TEMPLATE_CACHE = 0x02, -}; - -/** Flags for cgroup_register_unchanged_process(). */ -enum cgroup_daemon_type { - /** - * The daemon must not touch the given task, i.e. it never moves it - * to any controlgroup. - */ - CGROUP_DAEMON_UNCHANGE_CHILDREN = 0x1, - CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS = 0x2, -}; - -/** - * @defgroup group_tasks 4. Manipulation with tasks - * @{ - * - * @name Simple task assignment - * @{ - * Applications can use following functions to simply put a task into given - * control group and find a groups where given tasks is. - */ - -/** - * Move current task (=thread) to given control group. - * @param cgroup Destination control group. - */ -int cgroup_attach_task(struct cgroup *cgroup); - -/** - * Move given task (=thread) to given control group. - * @param cgroup Destination control group. - * @param tid The task to move. - */ -int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid); - -/** - * Changes the cgroup of a task based on the path provided. In this case, - * the user must already know into which cgroup the task should be placed and - * no rules will be parsed. - * - * @param path Name of the destination group. - * @param pid The task to move. - * @param controllers List of controllers. - * - * @todo should this function be really public? - */ -int cgroup_change_cgroup_path(const char *path, pid_t pid, - const char * const controllers[]); - -/** - * Get the current control group path where the given task is. - * @param pid The task to find. - * @param controller The controller (hierarchy), where to find the task. - * @param current_path The path to control group, where the task has been found. - * The patch is relative to the root of the hierarchy. The caller must - * free this memory. - */ -int cgroup_get_current_controller_path(pid_t pid, const char *controller, - char **current_path); - -/** - * @} - * - * @name Rules - * @{ - * @c libcgroup can move tasks to control groups using simple rules, loaded - * from configuration file. See cgrules.conf man page to see format of the file. - * Following functions can be used to load these rules from a file. - */ - -/** - * Initializes the rules cache and load it from /etc/cgrules.conf. - * @todo add parameter with the filename? - */ -int cgroup_init_rules_cache(void); - -/** - * Reloads the rules list from /etc/cgrules.conf. This function - * is probably NOT thread safe (calls cgroup_parse_rules_config()). - */ -int cgroup_reload_cached_rules(void); - -/** - * Print the cached rules table. This function should be called only after - * first calling cgroup_parse_config(), but it will work with an empty rule - * list. - * @param fp Destination file, where the rules will be printed. - */ -void cgroup_print_rules_config(FILE *fp); - -/** - * @} - * @name Rule based task assignment - * @{ - * @c libcgroup can move tasks to control groups using simple rules, loaded - * from configuration file. See cgrules.conf man page to see format of the file. - * Applications can move tasks to control groups based on these rules using - * following functions. - */ - -/** - * Changes the cgroup of all running PIDs based on the rules in the config - * file. If a rules exists for a PID, then the PID is placed in the correct - * group. - * - * This function may be called after creating new control groups to move - * running PIDs into the newly created control groups. - * @return 0 on success, < 0 on error - */ -int cgroup_change_all_cgroups(void); - -/** - * Changes the cgroup of a program based on the rules in the config file. - * If a rule exists for the given UID, GID or PROCESS NAME, then the given - * PID is placed into the correct group. By default, this function parses - * the configuration file each time it is called. - * - * The flags can alter the behavior of this function: - * CGFLAG_USECACHE: Use cached rules instead of parsing the config file - * CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of - * parsing the config file - * - * This function may NOT be thread safe. - * @param uid The UID to match. - * @param gid The GID to match. - * @param procname The PROCESS NAME to match. - * @param pid The PID of the process to move. - * @param flags Bit flags to change the behavior, as defined in enum #cgflags. - * @todo Determine thread-safeness and fix of not safe. - */ -int cgroup_change_cgroup_flags(uid_t uid, gid_t gid, - const char *procname, pid_t pid, int flags); - -/** - * Changes the cgroup of a program based on the rules in the config file. If a - * rule exists for the given UID or GID, then the given PID is placed into the - * correct group. By default, this function parses the configuration file each - * time it is called. - * - * This function may NOT be thread safe. - * @param uid The UID to match. - * @param gid The GID to match. - * @param pid The PID of the process to move. - * @param flags Bit flags to change the behavior, as defined in enum #cgflags. - * @todo Determine thread-safeness and fix if not safe. - */ -int cgroup_change_cgroup_uid_gid_flags(uid_t uid, gid_t gid, - pid_t pid, int flags); - -/** - * Provides backwards-compatibility with older versions of the API. This - * function is deprecated, and cgroup_change_cgroup_uid_gid_flags() should be - * used instead. In fact, this function simply calls the newer one with flags - * set to 0 (none). - * @param uid The UID to match. - * @param gid The GID to match. - * @param pid The PID of the process to move. - */ -int cgroup_change_cgroup_uid_gid(uid_t uid, gid_t gid, pid_t pid); - -/** - * @} - * @name Communication with cgrulesengd daemon - * @{ - * Users can use cgrulesengd daemon to move tasks to groups based on the rules - * automatically when they change their UID, GID or executable name. - * The daemon allows tasks to be 'sticky', i.e. all rules are ignored for these - * tasks and the daemon never moves them. - */ - -/** - * Register the unchanged process to a cgrulesengd daemon. This process - * is never moved to another control group by the daemon. - * If the daemon does not work, this function returns 0 as success. - * @param pid The task id. - * @param flags Bit flags to change the behavior, as defined in - * #cgroup_daemon_type - */ -int cgroup_register_unchanged_process(pid_t pid, int flags); - -/** - * @} - * @} - */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_TASKS_H */ diff --git a/lib/libcgroup-3.1.0/include/libcgroup/tools.h b/lib/libcgroup-3.1.0/include/libcgroup/tools.h deleted file mode 100644 index 9fcbb151f7c..00000000000 --- a/lib/libcgroup-3.1.0/include/libcgroup/tools.h +++ /dev/null @@ -1,61 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Libcgroup tools header file - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#ifndef _LIBCGROUP_TOOLS_H -#define _LIBCGROUP_TOOLS_H - -#ifndef _LIBCGROUP_H_INSIDE -#error "Only should be included directly." -#endif - -#ifndef SWIG -#include -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Read the setting-value pairs in the cgroup sysfs for param cg. - * cgroup_cgxget() will perform the necessary conversions to match - * the "on-disk" format and then convert the data back to the - * requested version. If successful, cg will be populated with - * the setting-value pairs. - * - * @param cg Input/Output cgroup. Must be initialized and freed by the caller - * @param version Cgroup version of cg If set to CGROUP_UNK, the versions - * stored within each controller will be used. Otherwise this - * value will be used to override the cg param's controller - * versions - * @param ignore_unmappable Ignore failures due to settings that cannot be - * converted from one cgroup version to another - */ -int cgroup_cgxget(struct cgroup **cg, - enum cg_version_t version, bool ignore_unmappable); - -/** - * Write the setting-value pairs in *cg to the cgroup sysfs. - * cgroup_cgxset() will perform the necessary conversions to match the - * "on-disk" format prior to writing to the cgroup sysfs. - * - * @param cg cgroup instance that will be written to the cgroup sysfs - * @param version Cgroup version of *cg - * @param ignore_unmappable Ignore failures due to settings that cannot be - * converted from one cgroup version to another - */ -int cgroup_cgxset(const struct cgroup * const cg, - enum cg_version_t version, bool ignore_unmappable); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _LIBCGROUP_TOOLS_H */ diff --git a/lib/libcgroup-3.1.0/libcgroup.doxyfile b/lib/libcgroup-3.1.0/libcgroup.doxyfile deleted file mode 100644 index bc8b4736191..00000000000 --- a/lib/libcgroup-3.1.0/libcgroup.doxyfile +++ /dev/null @@ -1,1519 +0,0 @@ -# Doxyfile 1.6.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = libcgroup - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/generated - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = include - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# If the HTML_TIMESTAMP tag is set to YES then the generated HTML -# documentation will contain the timesstamp. - -HTML_TIMESTAMP = NO - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) -# there is already a search function so this one should typically -# be disabled. - -SEARCHENGINE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = YES - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = YES - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = NO - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = NO - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = NO - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = NO - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/lib/libcgroup-3.1.0/libcgroup.pc.in b/lib/libcgroup-3.1.0/libcgroup.pc.in deleted file mode 100644 index bd925e52e96..00000000000 --- a/lib/libcgroup-3.1.0/libcgroup.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libcgroup -Description: Control Group Configuration Library -Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lcgroup -Cflags: -I${includedir} diff --git a/lib/libcgroup-3.1.0/m4/ax_code_coverage.m4 b/lib/libcgroup-3.1.0/m4/ax_code_coverage.m4 deleted file mode 100644 index a257469f7fb..00000000000 --- a/lib/libcgroup-3.1.0/m4/ax_code_coverage.m4 +++ /dev/null @@ -1,264 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CODE_COVERAGE() -# -# DESCRIPTION -# -# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, -# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included -# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every -# build target (program or library) which should be built with code -# coverage support. Also defines CODE_COVERAGE_RULES which should be -# substituted in your Makefile; and $enable_code_coverage which can be -# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined -# and substituted, and corresponds to the value of the -# --enable-code-coverage option, which defaults to being disabled. -# -# Test also for gcov program and create GCOV variable that could be -# substituted. -# -# Note that all optimisation flags in CFLAGS must be disabled when code -# coverage is enabled. -# -# Usage example: -# -# configure.ac: -# -# AX_CODE_COVERAGE -# -# Makefile.am: -# -# @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... -# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... -# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... -# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... -# -# This results in a "check-code-coverage" rule being added to any -# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module -# has been configured with --enable-code-coverage). Running `make -# check-code-coverage` in that directory will run the module's test suite -# (`make check`) and build a code coverage report detailing the code which -# was touched, then print the URI for the report. -# -# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined -# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of -# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is -# deprecated. They have the same value. -# -# This code was derived from Makefile.decl in GLib, originally licenced -# under LGPLv2.1+. -# -# LICENSE -# -# Copyright (c) 2012, 2016 Philip Withnall -# Copyright (c) 2012 Xan Lopez -# Copyright (c) 2012 Christian Persch -# Copyright (c) 2012 Paolo Borelli -# Copyright (c) 2012 Dan Winship -# Copyright (c) 2015 Bastien ROUCARIES -# -# 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 program. If not, see . - -#serial 20 - -AC_DEFUN([AX_CODE_COVERAGE],[ - dnl Check for --enable-code-coverage - AC_REQUIRE([AC_PROG_SED]) - - # allow to override gcov location - AC_ARG_WITH([gcov], - [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) - - AC_MSG_CHECKING([whether to build with code coverage support]) - AC_ARG_ENABLE([code-coverage], - AS_HELP_STRING([--enable-code-coverage], - [Whether to enable code coverage support]),, - enable_code_coverage=no) - - AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) - AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) - AC_MSG_RESULT($enable_code_coverage) - - AS_IF([ test "$enable_code_coverage" = "yes" ], [ - # check for gcov - AC_CHECK_TOOL([GCOV], - [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], - [:]) - AS_IF([test "X$GCOV" = "X:"], - [AC_MSG_ERROR([gcov is needed to do coverage])]) - AC_SUBST([GCOV]) - - dnl Check if gcc is being used - AS_IF([ test "$GCC" = "no" ], [ - AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) - ]) - - AC_CHECK_PROG([LCOV], [lcov], [lcov]) - AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) - - AS_IF([ test -z "$LCOV" ], [ - AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) - ]) - - AS_IF([ test -z "$GENHTML" ], [ - AC_MSG_ERROR([Could not find genhtml from the lcov package]) - ]) - - dnl Build the code coverage flags - dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LIBS="-lgcov" - CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" - - AC_SUBST([CODE_COVERAGE_CPPFLAGS]) - AC_SUBST([CODE_COVERAGE_CFLAGS]) - AC_SUBST([CODE_COVERAGE_CXXFLAGS]) - AC_SUBST([CODE_COVERAGE_LIBS]) - AC_SUBST([CODE_COVERAGE_LDFLAGS]) - - [CODE_COVERAGE_RULES_CHECK=' - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -'] - [CODE_COVERAGE_RULES_CAPTURE=' - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -'] - [CODE_COVERAGE_RULES_CLEAN=' -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -'] - ], [ - [CODE_COVERAGE_RULES_CHECK=' - @echo "Need to reconfigure with --enable-code-coverage" -'] - CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" - CODE_COVERAGE_RULES_CLEAN='' - ]) - -[CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# Multiple directories may be specified, separated by whitespace. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, -# set to 0 to disable it and leave empty to stay with the default. -# (Default: empty) -# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov -# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov -# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the -# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov -# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering -# lcov instance. (Default: empty) -# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov -# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the -# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(top_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage -CODE_COVERAGE_BRANCH_COVERAGE ?= -CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= -CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ -$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) -CODE_COVERAGE_IGNORE_PATTERN ?= - -code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) -code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ - $(CODE_COVERAGE_OUTPUT_FILE); -code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) -code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ - $(CODE_COVERAGE_IGNORE_PATTERN); -code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) -code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); -code_coverage_quiet = $(code_coverage_quiet_$(V)) -code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) -code_coverage_quiet_0 = --quiet - -# sanitizes the test-name: replaces with underscores: dashes and dots -code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) - -# Use recursive makes in order to ignore errors during check -check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -'"$CODE_COVERAGE_RULES_CLEAN"' - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -'] - - AC_SUBST([CODE_COVERAGE_RULES]) - m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) -]) diff --git a/lib/libcgroup-3.1.0/m4/libtool.m4 b/lib/libcgroup-3.1.0/m4/libtool.m4 deleted file mode 100644 index e3adedad630..00000000000 --- a/lib/libcgroup-3.1.0/m4/libtool.m4 +++ /dev/null @@ -1,8403 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996-2001, 2003-2019, 2021-2022 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) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -]) - -# serial 59 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK -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_PREPARE_CC_BASENAME -# ----------------------- -m4_defun([_LT_PREPARE_CC_BASENAME], [ -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in @S|@*""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} -])# _LT_PREPARE_CC_BASENAME - - -# _LT_CC_BASENAME(CC) -# ------------------- -# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, -# but that macro is also expanded into generated libtool script, which -# arranges for $SED and $ECHO to be set by different means. -m4_defun([_LT_CC_BASENAME], -[m4_require([_LT_PREPARE_CC_BASENAME])dnl -AC_REQUIRE([_LT_DECL_SED])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl -func_cc_basename $1 -cc_basename=$func_cc_basename_result -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_DECL_FILECMD])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 -m4_require([_LT_CMD_TRUNCATE])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi -]) -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 set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC and -# ICC, which need '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from 'configure', and 'config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - 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 0 = "$lt_write_fail" && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test 0 != $[#] -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test yes = "$silent" && - 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 that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# 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. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -_LT_COPYING -_LT_LIBTOOL_TAGS - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -_LT_PREPARE_MUNGE_PATH_LIST -_LT_PREPARE_CC_BASENAME - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _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) - - 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' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; 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 $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) - case $MACOSX_DEPLOYMENT_TARGET,$host in - 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - _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 yes != "$lt_cv_apple_cc_single_mod"; 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 set = "${lt_cv_aix_libpath+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 that will find a shell with a builtin -# printf (that 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], -[m4_require([_LT_DECL_SED])dnl -AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--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 yes = "$GCC"; 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 where 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 no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `$FILECMD conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `$FILECMD conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `$FILECMD conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `$FILECMD conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `$FILECMD conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `$FILECMD conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - 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 yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `$FILECMD conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -_LT_DECL([], [AR], [1], [The archiver]) - -# Use ARFLAGS variable as AR's operation code to sync the variable naming with -# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have -# higher priority because thats what people were doing historically (setting -# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS -# variable obsoleted/removed. - -test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} -lt_ar_flags=$AR_FLAGS -_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) - -# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override -# by AR_FLAGS because that was never working and AR_FLAGS is about to die. -_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], - [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 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test no = "$lt_cv_ar_at_file"; 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 - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_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" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&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 yes = "[$]$2"; 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 yes = "[$]$2"; 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; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -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 yes = "$cross_compiling"; 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 -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if 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 yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - 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 - ]) - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - AC_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 no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - 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 yes = "$lt_cv_dlopen_self"; 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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then - - # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_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 -z "$STRIP"; then - AC_MSG_RESULT([no]) -else - if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - old_striplib="$STRIP --strip-debug" - striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) - else - case $host_os in - darwin*) - # FIXME - insert some real tests, host_os isn't really good enough - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - ;; - freebsd*) - if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then - old_striplib="$STRIP --strip-debug" - striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac - fi -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_PREPARE_MUNGE_PATH_LIST -# --------------------------- -# Make sure func_munge_path_list() is defined correctly. -m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], -[[# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x@S|@2 in - x) - ;; - *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" - ;; - x:*) - eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" - ;; - *) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - esac -} -]])# _LT_PREPARE_PATH_LIST - - -# _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 -m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -AC_ARG_VAR([LT_SYS_LIBRARY_PATH], -[User-defined run-time library search path.]) - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a[(]lib.so.V[)]' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' -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* | *,icl*) - # Native MSVC or ICC - 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 and ICC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly* | midnightbsd*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - 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" - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$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 # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - -_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], [configure_time_dlsearch_path], [2], - [Detected run-time system search path for libraries]) -_LT_DECL([], [configure_time_lt_sys_library_path], [2], - [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program that 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 that 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 no = "$withval" || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], -[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi]) -rm -f conftest.i conftest2.i conftest.out]) -])# _LT_PATH_DD - - -# _LT_CMD_TRUNCATE -# ---------------- -# find command to truncate a binary pipe -m4_defun([_LT_CMD_TRUNCATE], -[m4_require([_LT_PATH_DD]) -AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) -_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], - [Command to truncate a binary pipe]) -])# _LT_CMD_TRUNCATE - - -# _LT_CHECK_MAGIC_METHOD -# ---------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_MAGIC_METHOD], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -AC_CACHE_CHECK([how to recognize dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[[4-9]]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[[45]]*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='$FILECMD -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly* | midnightbsd*) - 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=$FILECMD - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=$FILECMD - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - 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=$FILECMD - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -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 - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - 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 one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac -]) -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 yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - -# 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++ or ICC, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if 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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$_LT_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 yes = "$pipe_works"; 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_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) -_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_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) -_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 yes = "$GXX"; 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 ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - 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']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - 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 ia64 = "$host_cpu"; 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* | midnightbsd*) - # 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 ia64 != "$host_cpu"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - 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']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; 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 - ;; - - 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' - case $cc_basename in - 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' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny 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)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | $SED 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms that 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 GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl* | icl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++ or Intel C++ Compiler. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - 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 yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _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 | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - _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, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _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 - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - ;; - - 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 linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _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' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _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 yes = "$supports_anon_versioning"; 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 - tcc*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; 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 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _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,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _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 yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _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 yes = "$with_gnu_ld"; 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 - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - 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++ or Intel C++ Compiler. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl* | icl*) - # Native MSVC or ICC - _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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC and ICC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly* | midnightbsd*) - _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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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 - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(ld_shlibs, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - 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* | bitrig*) - 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__`"; 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 - _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' - 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 - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - ;; - - osf3*) - if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _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 yes = "$GCC"; 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 CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report what 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 no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || 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 no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; 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 ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _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,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _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 yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' - # 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _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 yes = "$with_gnu_ld"; 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 - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - 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* | ,icl* | no,icl*) - # Native MSVC or ICC - # 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $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, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly* | midnightbsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - _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 "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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 yes = "$GXX"; then - if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; 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 - ;; - - openbsd* | bitrig*) - 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__`"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $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 $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _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 CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes != "$_lt_caught_CXX_error" - -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 @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_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 no = "$pre_test_object_deps_done"; 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)= - ;; -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 no = "$F77"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; 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 no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || 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 yes != "$_lt_disable_F77" - -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 no = "$FC"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; 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 no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || 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 yes != "$_lt_disable_FC" - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_FILECMD -# ---------------- -# Check for a file(cmd) program that can be used to detect file type and magic -m4_defun([_LT_DECL_FILECMD], -[AC_CHECK_TOOL([FILECMD], [file], [:]) -_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) -])# _LD_DECL_FILECMD - -# _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 10 -lt "$lt_ac_count" && 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], -[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_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine what file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/lib/libcgroup-3.1.0/m4/ltoptions.m4 b/lib/libcgroup-3.1.0/m4/ltoptions.m4 deleted file mode 100644 index b0b5e9c2126..00000000000 --- a/lib/libcgroup-3.1.0/m4/ltoptions.m4 +++ /dev/null @@ -1,437 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], - [_LT_WITH_AIX_SONAME([aix])]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_AIX_SONAME([DEFAULT]) -# ---------------------------------- -# implement the --with-aix-soname flag, and support the `aix-soname=aix' -# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT -# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. -m4_define([_LT_WITH_AIX_SONAME], -[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl -shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[[5-9]]*,yes) - AC_MSG_CHECKING([which variant of shared library versioning to provide]) - AC_ARG_WITH([aix-soname], - [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], - [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], - [case $withval in - aix|svr4|both) - ;; - *) - AC_MSG_ERROR([Unknown argument to --with-aix-soname]) - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname], - [AC_CACHE_VAL([lt_cv_with_aix_soname], - [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) - with_aix_soname=$lt_cv_with_aix_soname]) - AC_MSG_RESULT([$with_aix_soname]) - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - -_LT_DECL([], [shared_archive_member_spec], [0], - [Shared archive member basename, for filename based shared library versioning on AIX])dnl -])# _LT_WITH_AIX_SONAME - -LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' -# LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [pic_mode=m4_default([$1], [default])]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/lib/libcgroup-3.1.0/m4/ltsugar.m4 b/lib/libcgroup-3.1.0/m4/ltsugar.m4 deleted file mode 100644 index 902508bd93a..00000000000 --- a/lib/libcgroup-3.1.0/m4/ltsugar.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59, which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) diff --git a/lib/libcgroup-3.1.0/m4/ltversion.m4 b/lib/libcgroup-3.1.0/m4/ltversion.m4 deleted file mode 100644 index b155d0aceca..00000000000 --- a/lib/libcgroup-3.1.0/m4/ltversion.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004, 2011-2019, 2021-2022 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 4245 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.7]) -m4_define([LT_PACKAGE_REVISION], [2.4.7]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.7' -macro_revision='2.4.7' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff --git a/lib/libcgroup-3.1.0/m4/lt~obsolete.m4 b/lib/libcgroup-3.1.0/m4/lt~obsolete.m4 deleted file mode 100644 index 0f7a8759da8..00000000000 --- a/lib/libcgroup-3.1.0/m4/lt~obsolete.m4 +++ /dev/null @@ -1,99 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 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/lib/libcgroup-3.1.0/myconfigure b/lib/libcgroup-3.1.0/myconfigure deleted file mode 100755 index e84d8f60961..00000000000 --- a/lib/libcgroup-3.1.0/myconfigure +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -cd "$SCRIPT_DIR" - -# libpam dependency for cgroup is unnecessary for our purposes. -./configure --disable-pam diff --git a/lib/libcgroup-3.1.0/samples/Makefile.am b/lib/libcgroup-3.1.0/samples/Makefile.am deleted file mode 100644 index d8374f6cc4d..00000000000 --- a/lib/libcgroup-3.1.0/samples/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -DIST_SUBDIRS = config c python cmdline -SUBDIRS = $(DIST_SUBDIRS) diff --git a/lib/libcgroup-3.1.0/samples/Makefile.in b/lib/libcgroup-3.1.0/samples/Makefile.in deleted file mode 100644 index 23d01b25cb0..00000000000 --- a/lib/libcgroup-3.1.0/samples/Makefile.in +++ /dev/null @@ -1,653 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = samples -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir distdir-am -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -DIST_SUBDIRS = config c python cmdline -SUBDIRS = $(DIST_SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign samples/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/samples/c/Makefile.am b/lib/libcgroup-3.1.0/samples/c/Makefile.am deleted file mode 100644 index 32b3e8b1cb3..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -LDADD = $(top_builddir)/src/.libs/libcgroup.la - -if WITH_SAMPLES - -noinst_PROGRAMS = setuid walk_test read_stats walk_task get_controller \ - get_mount_point proctest get_all_controller \ - get_variable_names test_named_hierarchy \ - get_procs wrapper_test logger empty_cgroup_v2 \ - get_setup_mode - -if WITH_SYSTEMD -noinst_PROGRAMS += create_systemd_scope -endif - -setuid_SOURCES=setuid.c -walk_test_SOURCES=walk_test.c -read_stats_SOURCES=read_stats.c -walk_task_SOURCES=walk_task.c -get_controller_SOURCES=get_controller.c -get_mount_point_SOURCES=get_mount_point.c -proctest_SOURCES=proctest.c -get_all_controller_SOURCES=get_all_controller.c -get_variable_names_SOURCES=get_variable_names.c -test_named_hierarchy_SOURCES=test_named_hierarchy.c -get_procs_SOURCES=get_procs.c -wrapper_test_SOURCES=wrapper_test.c -logger_SOURCES=logger.c -empty_cgroup_v2_SOURCES=empty_cgroup_v2.c -get_setup_mode_SOURCES=get_setup_mode.c -create_systemd_scope_SOURCES=create_systemd_scope.c - -endif diff --git a/lib/libcgroup-3.1.0/samples/c/Makefile.in b/lib/libcgroup-3.1.0/samples/c/Makefile.in deleted file mode 100644 index 72c047fbad6..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/Makefile.in +++ /dev/null @@ -1,880 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WITH_SAMPLES_TRUE@noinst_PROGRAMS = setuid$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ walk_test$(EXEEXT) read_stats$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ walk_task$(EXEEXT) get_controller$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ get_mount_point$(EXEEXT) proctest$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ get_all_controller$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ get_variable_names$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ test_named_hierarchy$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ get_procs$(EXEEXT) wrapper_test$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ logger$(EXEEXT) empty_cgroup_v2$(EXEEXT) \ -@WITH_SAMPLES_TRUE@ get_setup_mode$(EXEEXT) $(am__EXEEXT_1) -@WITH_SAMPLES_TRUE@@WITH_SYSTEMD_TRUE@am__append_1 = create_systemd_scope -subdir = samples/c -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -@WITH_SAMPLES_TRUE@@WITH_SYSTEMD_TRUE@am__EXEEXT_1 = create_systemd_scope$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -am__create_systemd_scope_SOURCES_DIST = create_systemd_scope.c -@WITH_SAMPLES_TRUE@am_create_systemd_scope_OBJECTS = \ -@WITH_SAMPLES_TRUE@ create_systemd_scope.$(OBJEXT) -create_systemd_scope_OBJECTS = $(am_create_systemd_scope_OBJECTS) -create_systemd_scope_LDADD = $(LDADD) -create_systemd_scope_DEPENDENCIES = \ - $(top_builddir)/src/.libs/libcgroup.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -am__empty_cgroup_v2_SOURCES_DIST = empty_cgroup_v2.c -@WITH_SAMPLES_TRUE@am_empty_cgroup_v2_OBJECTS = \ -@WITH_SAMPLES_TRUE@ empty_cgroup_v2.$(OBJEXT) -empty_cgroup_v2_OBJECTS = $(am_empty_cgroup_v2_OBJECTS) -empty_cgroup_v2_LDADD = $(LDADD) -empty_cgroup_v2_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__get_all_controller_SOURCES_DIST = get_all_controller.c -@WITH_SAMPLES_TRUE@am_get_all_controller_OBJECTS = \ -@WITH_SAMPLES_TRUE@ get_all_controller.$(OBJEXT) -get_all_controller_OBJECTS = $(am_get_all_controller_OBJECTS) -get_all_controller_LDADD = $(LDADD) -get_all_controller_DEPENDENCIES = \ - $(top_builddir)/src/.libs/libcgroup.la -am__get_controller_SOURCES_DIST = get_controller.c -@WITH_SAMPLES_TRUE@am_get_controller_OBJECTS = \ -@WITH_SAMPLES_TRUE@ get_controller.$(OBJEXT) -get_controller_OBJECTS = $(am_get_controller_OBJECTS) -get_controller_LDADD = $(LDADD) -get_controller_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__get_mount_point_SOURCES_DIST = get_mount_point.c -@WITH_SAMPLES_TRUE@am_get_mount_point_OBJECTS = \ -@WITH_SAMPLES_TRUE@ get_mount_point.$(OBJEXT) -get_mount_point_OBJECTS = $(am_get_mount_point_OBJECTS) -get_mount_point_LDADD = $(LDADD) -get_mount_point_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__get_procs_SOURCES_DIST = get_procs.c -@WITH_SAMPLES_TRUE@am_get_procs_OBJECTS = get_procs.$(OBJEXT) -get_procs_OBJECTS = $(am_get_procs_OBJECTS) -get_procs_LDADD = $(LDADD) -get_procs_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__get_setup_mode_SOURCES_DIST = get_setup_mode.c -@WITH_SAMPLES_TRUE@am_get_setup_mode_OBJECTS = \ -@WITH_SAMPLES_TRUE@ get_setup_mode.$(OBJEXT) -get_setup_mode_OBJECTS = $(am_get_setup_mode_OBJECTS) -get_setup_mode_LDADD = $(LDADD) -get_setup_mode_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__get_variable_names_SOURCES_DIST = get_variable_names.c -@WITH_SAMPLES_TRUE@am_get_variable_names_OBJECTS = \ -@WITH_SAMPLES_TRUE@ get_variable_names.$(OBJEXT) -get_variable_names_OBJECTS = $(am_get_variable_names_OBJECTS) -get_variable_names_LDADD = $(LDADD) -get_variable_names_DEPENDENCIES = \ - $(top_builddir)/src/.libs/libcgroup.la -am__logger_SOURCES_DIST = logger.c -@WITH_SAMPLES_TRUE@am_logger_OBJECTS = logger.$(OBJEXT) -logger_OBJECTS = $(am_logger_OBJECTS) -logger_LDADD = $(LDADD) -logger_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__proctest_SOURCES_DIST = proctest.c -@WITH_SAMPLES_TRUE@am_proctest_OBJECTS = proctest.$(OBJEXT) -proctest_OBJECTS = $(am_proctest_OBJECTS) -proctest_LDADD = $(LDADD) -proctest_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__read_stats_SOURCES_DIST = read_stats.c -@WITH_SAMPLES_TRUE@am_read_stats_OBJECTS = read_stats.$(OBJEXT) -read_stats_OBJECTS = $(am_read_stats_OBJECTS) -read_stats_LDADD = $(LDADD) -read_stats_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__setuid_SOURCES_DIST = setuid.c -@WITH_SAMPLES_TRUE@am_setuid_OBJECTS = setuid.$(OBJEXT) -setuid_OBJECTS = $(am_setuid_OBJECTS) -setuid_LDADD = $(LDADD) -setuid_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__test_named_hierarchy_SOURCES_DIST = test_named_hierarchy.c -@WITH_SAMPLES_TRUE@am_test_named_hierarchy_OBJECTS = \ -@WITH_SAMPLES_TRUE@ test_named_hierarchy.$(OBJEXT) -test_named_hierarchy_OBJECTS = $(am_test_named_hierarchy_OBJECTS) -test_named_hierarchy_LDADD = $(LDADD) -test_named_hierarchy_DEPENDENCIES = \ - $(top_builddir)/src/.libs/libcgroup.la -am__walk_task_SOURCES_DIST = walk_task.c -@WITH_SAMPLES_TRUE@am_walk_task_OBJECTS = walk_task.$(OBJEXT) -walk_task_OBJECTS = $(am_walk_task_OBJECTS) -walk_task_LDADD = $(LDADD) -walk_task_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__walk_test_SOURCES_DIST = walk_test.c -@WITH_SAMPLES_TRUE@am_walk_test_OBJECTS = walk_test.$(OBJEXT) -walk_test_OBJECTS = $(am_walk_test_OBJECTS) -walk_test_LDADD = $(LDADD) -walk_test_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -am__wrapper_test_SOURCES_DIST = wrapper_test.c -@WITH_SAMPLES_TRUE@am_wrapper_test_OBJECTS = wrapper_test.$(OBJEXT) -wrapper_test_OBJECTS = $(am_wrapper_test_OBJECTS) -wrapper_test_LDADD = $(LDADD) -wrapper_test_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroup.la -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/create_systemd_scope.Po \ - ./$(DEPDIR)/empty_cgroup_v2.Po \ - ./$(DEPDIR)/get_all_controller.Po \ - ./$(DEPDIR)/get_controller.Po ./$(DEPDIR)/get_mount_point.Po \ - ./$(DEPDIR)/get_procs.Po ./$(DEPDIR)/get_setup_mode.Po \ - ./$(DEPDIR)/get_variable_names.Po ./$(DEPDIR)/logger.Po \ - ./$(DEPDIR)/proctest.Po ./$(DEPDIR)/read_stats.Po \ - ./$(DEPDIR)/setuid.Po ./$(DEPDIR)/test_named_hierarchy.Po \ - ./$(DEPDIR)/walk_task.Po ./$(DEPDIR)/walk_test.Po \ - ./$(DEPDIR)/wrapper_test.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(create_systemd_scope_SOURCES) $(empty_cgroup_v2_SOURCES) \ - $(get_all_controller_SOURCES) $(get_controller_SOURCES) \ - $(get_mount_point_SOURCES) $(get_procs_SOURCES) \ - $(get_setup_mode_SOURCES) $(get_variable_names_SOURCES) \ - $(logger_SOURCES) $(proctest_SOURCES) $(read_stats_SOURCES) \ - $(setuid_SOURCES) $(test_named_hierarchy_SOURCES) \ - $(walk_task_SOURCES) $(walk_test_SOURCES) \ - $(wrapper_test_SOURCES) -DIST_SOURCES = $(am__create_systemd_scope_SOURCES_DIST) \ - $(am__empty_cgroup_v2_SOURCES_DIST) \ - $(am__get_all_controller_SOURCES_DIST) \ - $(am__get_controller_SOURCES_DIST) \ - $(am__get_mount_point_SOURCES_DIST) \ - $(am__get_procs_SOURCES_DIST) \ - $(am__get_setup_mode_SOURCES_DIST) \ - $(am__get_variable_names_SOURCES_DIST) \ - $(am__logger_SOURCES_DIST) $(am__proctest_SOURCES_DIST) \ - $(am__read_stats_SOURCES_DIST) $(am__setuid_SOURCES_DIST) \ - $(am__test_named_hierarchy_SOURCES_DIST) \ - $(am__walk_task_SOURCES_DIST) $(am__walk_test_SOURCES_DIST) \ - $(am__wrapper_test_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir)/include -LDADD = $(top_builddir)/src/.libs/libcgroup.la -@WITH_SAMPLES_TRUE@setuid_SOURCES = setuid.c -@WITH_SAMPLES_TRUE@walk_test_SOURCES = walk_test.c -@WITH_SAMPLES_TRUE@read_stats_SOURCES = read_stats.c -@WITH_SAMPLES_TRUE@walk_task_SOURCES = walk_task.c -@WITH_SAMPLES_TRUE@get_controller_SOURCES = get_controller.c -@WITH_SAMPLES_TRUE@get_mount_point_SOURCES = get_mount_point.c -@WITH_SAMPLES_TRUE@proctest_SOURCES = proctest.c -@WITH_SAMPLES_TRUE@get_all_controller_SOURCES = get_all_controller.c -@WITH_SAMPLES_TRUE@get_variable_names_SOURCES = get_variable_names.c -@WITH_SAMPLES_TRUE@test_named_hierarchy_SOURCES = test_named_hierarchy.c -@WITH_SAMPLES_TRUE@get_procs_SOURCES = get_procs.c -@WITH_SAMPLES_TRUE@wrapper_test_SOURCES = wrapper_test.c -@WITH_SAMPLES_TRUE@logger_SOURCES = logger.c -@WITH_SAMPLES_TRUE@empty_cgroup_v2_SOURCES = empty_cgroup_v2.c -@WITH_SAMPLES_TRUE@get_setup_mode_SOURCES = get_setup_mode.c -@WITH_SAMPLES_TRUE@create_systemd_scope_SOURCES = create_systemd_scope.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/c/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign samples/c/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -create_systemd_scope$(EXEEXT): $(create_systemd_scope_OBJECTS) $(create_systemd_scope_DEPENDENCIES) $(EXTRA_create_systemd_scope_DEPENDENCIES) - @rm -f create_systemd_scope$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(create_systemd_scope_OBJECTS) $(create_systemd_scope_LDADD) $(LIBS) - -empty_cgroup_v2$(EXEEXT): $(empty_cgroup_v2_OBJECTS) $(empty_cgroup_v2_DEPENDENCIES) $(EXTRA_empty_cgroup_v2_DEPENDENCIES) - @rm -f empty_cgroup_v2$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(empty_cgroup_v2_OBJECTS) $(empty_cgroup_v2_LDADD) $(LIBS) - -get_all_controller$(EXEEXT): $(get_all_controller_OBJECTS) $(get_all_controller_DEPENDENCIES) $(EXTRA_get_all_controller_DEPENDENCIES) - @rm -f get_all_controller$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_all_controller_OBJECTS) $(get_all_controller_LDADD) $(LIBS) - -get_controller$(EXEEXT): $(get_controller_OBJECTS) $(get_controller_DEPENDENCIES) $(EXTRA_get_controller_DEPENDENCIES) - @rm -f get_controller$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_controller_OBJECTS) $(get_controller_LDADD) $(LIBS) - -get_mount_point$(EXEEXT): $(get_mount_point_OBJECTS) $(get_mount_point_DEPENDENCIES) $(EXTRA_get_mount_point_DEPENDENCIES) - @rm -f get_mount_point$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_mount_point_OBJECTS) $(get_mount_point_LDADD) $(LIBS) - -get_procs$(EXEEXT): $(get_procs_OBJECTS) $(get_procs_DEPENDENCIES) $(EXTRA_get_procs_DEPENDENCIES) - @rm -f get_procs$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_procs_OBJECTS) $(get_procs_LDADD) $(LIBS) - -get_setup_mode$(EXEEXT): $(get_setup_mode_OBJECTS) $(get_setup_mode_DEPENDENCIES) $(EXTRA_get_setup_mode_DEPENDENCIES) - @rm -f get_setup_mode$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_setup_mode_OBJECTS) $(get_setup_mode_LDADD) $(LIBS) - -get_variable_names$(EXEEXT): $(get_variable_names_OBJECTS) $(get_variable_names_DEPENDENCIES) $(EXTRA_get_variable_names_DEPENDENCIES) - @rm -f get_variable_names$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(get_variable_names_OBJECTS) $(get_variable_names_LDADD) $(LIBS) - -logger$(EXEEXT): $(logger_OBJECTS) $(logger_DEPENDENCIES) $(EXTRA_logger_DEPENDENCIES) - @rm -f logger$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(logger_OBJECTS) $(logger_LDADD) $(LIBS) - -proctest$(EXEEXT): $(proctest_OBJECTS) $(proctest_DEPENDENCIES) $(EXTRA_proctest_DEPENDENCIES) - @rm -f proctest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(proctest_OBJECTS) $(proctest_LDADD) $(LIBS) - -read_stats$(EXEEXT): $(read_stats_OBJECTS) $(read_stats_DEPENDENCIES) $(EXTRA_read_stats_DEPENDENCIES) - @rm -f read_stats$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(read_stats_OBJECTS) $(read_stats_LDADD) $(LIBS) - -setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) - @rm -f setuid$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) - -test_named_hierarchy$(EXEEXT): $(test_named_hierarchy_OBJECTS) $(test_named_hierarchy_DEPENDENCIES) $(EXTRA_test_named_hierarchy_DEPENDENCIES) - @rm -f test_named_hierarchy$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(test_named_hierarchy_OBJECTS) $(test_named_hierarchy_LDADD) $(LIBS) - -walk_task$(EXEEXT): $(walk_task_OBJECTS) $(walk_task_DEPENDENCIES) $(EXTRA_walk_task_DEPENDENCIES) - @rm -f walk_task$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(walk_task_OBJECTS) $(walk_task_LDADD) $(LIBS) - -walk_test$(EXEEXT): $(walk_test_OBJECTS) $(walk_test_DEPENDENCIES) $(EXTRA_walk_test_DEPENDENCIES) - @rm -f walk_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(walk_test_OBJECTS) $(walk_test_LDADD) $(LIBS) - -wrapper_test$(EXEEXT): $(wrapper_test_OBJECTS) $(wrapper_test_DEPENDENCIES) $(EXTRA_wrapper_test_DEPENDENCIES) - @rm -f wrapper_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(wrapper_test_OBJECTS) $(wrapper_test_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_systemd_scope.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/empty_cgroup_v2.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_all_controller.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_controller.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mount_point.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_procs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_setup_mode.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_variable_names.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_stats.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_named_hierarchy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/walk_task.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/walk_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrapper_test.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(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: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/create_systemd_scope.Po - -rm -f ./$(DEPDIR)/empty_cgroup_v2.Po - -rm -f ./$(DEPDIR)/get_all_controller.Po - -rm -f ./$(DEPDIR)/get_controller.Po - -rm -f ./$(DEPDIR)/get_mount_point.Po - -rm -f ./$(DEPDIR)/get_procs.Po - -rm -f ./$(DEPDIR)/get_setup_mode.Po - -rm -f ./$(DEPDIR)/get_variable_names.Po - -rm -f ./$(DEPDIR)/logger.Po - -rm -f ./$(DEPDIR)/proctest.Po - -rm -f ./$(DEPDIR)/read_stats.Po - -rm -f ./$(DEPDIR)/setuid.Po - -rm -f ./$(DEPDIR)/test_named_hierarchy.Po - -rm -f ./$(DEPDIR)/walk_task.Po - -rm -f ./$(DEPDIR)/walk_test.Po - -rm -f ./$(DEPDIR)/wrapper_test.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/create_systemd_scope.Po - -rm -f ./$(DEPDIR)/empty_cgroup_v2.Po - -rm -f ./$(DEPDIR)/get_all_controller.Po - -rm -f ./$(DEPDIR)/get_controller.Po - -rm -f ./$(DEPDIR)/get_mount_point.Po - -rm -f ./$(DEPDIR)/get_procs.Po - -rm -f ./$(DEPDIR)/get_setup_mode.Po - -rm -f ./$(DEPDIR)/get_variable_names.Po - -rm -f ./$(DEPDIR)/logger.Po - -rm -f ./$(DEPDIR)/proctest.Po - -rm -f ./$(DEPDIR)/read_stats.Po - -rm -f ./$(DEPDIR)/setuid.Po - -rm -f ./$(DEPDIR)/test_named_hierarchy.Po - -rm -f ./$(DEPDIR)/walk_task.Po - -rm -f ./$(DEPDIR)/walk_test.Po - -rm -f ./$(DEPDIR)/wrapper_test.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/samples/c/create_systemd_scope.c b/lib/libcgroup-3.1.0/samples/c/create_systemd_scope.c deleted file mode 100644 index cb9ab7d4227..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/create_systemd_scope.c +++ /dev/null @@ -1,613 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Sample program that shows how to use libcgroup to create a systemd scope - * - * This program is designed to meet the requirements outlined in the systemd - * cmdline example [1] via the libcgroup C APIs. - * - * [1] https://github.com/libcgroup/libcgroup/blob/main/samples/cmdline/systemd-with-idle-process.md - * - * Copyright (c) 2023 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -/* - * To compile and link this program: - * (From the root of the libcgroup source code directory) - * $ ./bootstrap - * $ ./configure --sysconfdir=/etc --localstatedir=/var \ - * --enable-opaque-hierarchy="name=systemd" --enable-systemd \ - * --enable-python --enable-samples - * $ make - * - * Add the libcgroup idle thread to your PATH. (Some distros restrict the - * modification of the $PATH environment variable when invoking sudo, so you - * will need to manually copy the executable to your path.) - * $ sudo cp src/libcgroup_systemd_idle_thread /a/path/in/your/sudo/path - * - * To run this program: - * $ # Note that there are more options. Run `create_systemd_scope -h` for more info - * $ sudo LD_LIBRARY_PATH=src/.libs ./samples/c/create_systemd_scope \ - * --slice --scope - */ - -/* - */ - -#include -#include -#include -#include -#include -#include -#include - -#define TMP_CGNAME "tmp" -#define HIGH_CGNAME "high-priority" -#define MED_CGNAME "medium-priority" -#define LOW_CGNAME "low-priority" - -struct example_opts { - char slice[FILENAME_MAX]; - char scope[FILENAME_MAX]; - - struct cgroup_systemd_scope_opts systemd_opts; - - bool debug; -}; - -static const struct option long_opts[] = { - {"delegated", no_argument, NULL, 'd'}, - {"help", no_argument, NULL, 'h'}, - {"pid", required_argument, NULL, 'p'}, - {"scope", required_argument, NULL, 's'}, - {"slice", required_argument, NULL, 't'}, - {"verbose", no_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} -}; - -static void usage(const char * const program_name) -{ - printf("Usage: %s -s -t [-p ]\n", program_name); - printf("Create a systemd scope using the libcgroup C APIs\n"); - printf(" -d, --delegated Instruct systemd to create a delegated scope\n"); - printf(" -p, --pid PID to be placed in the scope, if not provided,\n"); - printf(" libcgroup will place a default idle PID in the scope\n"); - printf(" -s, --scope Scope name, must end in .scope\n"); - printf(" -t, --slice Slice name, must end in .slice\n"); - printf(" -v, --verbose Enable libcgroup debug messages\n"); -} - -static int parse_opts(int argc, char *argv[], struct example_opts * const opts) -{ - int c; - - while ((c = getopt_long(argc, argv, "hs:t:p:dv", long_opts, NULL)) > 0) { - switch (c) { - case 'd': - opts->systemd_opts.delegated = true; - break; - case 'h': - usage(argv[0]); - exit(0); - case 'p': - opts->systemd_opts.pid = atoi(optarg); - if (opts->systemd_opts.pid <= 1) { - usage(argv[0]); - exit(1); - } - break; - case 's': - strncpy(opts->scope, optarg, FILENAME_MAX - 1); - break; - case 't': - strncpy(opts->slice, optarg, FILENAME_MAX - 1); - break; - case 'v': - opts->debug = true; - break; - default: - usage(argv[0]); - exit(1); - break; - } - } - - return 0; -} - -static int create_scope(const struct example_opts * const opts) -{ - int ret; - - printf("\n----------------------------------------------------------------\n"); - printf("Creating systemd scope, %s/%s,\n", opts->slice, opts->scope); - if (opts->systemd_opts.pid > 1) - printf("and placing PID, %d, in the scope\n", opts->systemd_opts.pid); - else - printf("and libcgroup will place an idle process in the scope\n"); - printf("----------------------------------------------------------------\n\n"); - - ret = cgroup_create_scope(opts->scope, opts->slice, &opts->systemd_opts); - if (ret == ECGINVAL) { - printf("An invalid parameter was passed into cgroup_create_scope()\n" - "Check your scope name, slice name, and systemd options carefully\n"); - goto error; - } else if (ret == ECGOTHER) { - printf("Libcgroup typically returns ECGOTHER when a system call fails.\n" - "These failures could be caused by being out of memory, lack of\n" - "permissions, etc. Enabling libcgroup debug messages may help\n" - "root cause the issue; pass in '-v' to this program\n"); - printf("The failing system call returned an errno of %d\n", - cgroup_get_last_errno()); - goto error; - } else if (ret > 0) { - printf("An unspecified error occurred - likely in the formation or\n" - "sending/receiving of the message to systemd to create the scope.\n" - "Ensure that this application has the requisite permissions and\n" - "capabilities to create a scope. Enabling libcgroup debug\n" - "messages may help root cause the failing instruction; pass in\n" - "'-v' to this program\n"); - printf("Libcgroup returned %d\n", ret); - goto error; - } - - /* - * Counterintuitively, this function returns 1 on success - */ - ret = cgroup_write_systemd_default_cgroup(opts->slice, opts->scope); - if (ret != 1) { - printf("Failed to set the libcgroup default scope/slice: %d: %s\n", - ret, cgroup_strerror(ret)); - ret = ECGFAIL; - goto error; - } - - /* - * cgroup_set_default_systemd_cgroup() will return 1 if a default slice/scope are - * set, and will return 0 otherwise. Ensure that a default slice/scope are set. - * This is critical because subsequent code in this example is assuming a default, - * and if the default is not set, then calls will be operating on the root cgroup. - */ - ret = cgroup_set_default_systemd_cgroup(); - if (ret != 1) { - printf("The default slice/scope are not properly set\n"); - ret = ECGFAIL; - goto error; - } - - ret = 0; - -error: - return ret; -} - -static int create_tmp_cgroup(const struct example_opts * const opts) -{ - struct cgroup *cg; - int ret = 0; - - cg = cgroup_new_cgroup(TMP_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - goto error; - } - - ret = cgroup_create_cgroup(cg, 1); - if (ret) { - printf("Failed to write the cgroup to /sys/fs/cgroup: %d: %s\n", - ret, cgroup_strerror(ret)); - goto error; - } - -error: - if (cg) - cgroup_free(&cg); - - return ret; -} - -static int move_pids_to_tmp_cgroup(const struct example_opts * const opts) -{ - struct cgroup *cg = NULL; - int ret, pid_cnt, i; - pid_t *pids = NULL; - int saved_ret = 0; - - /* - * Since we told libcgroup that our slice and scope are the default, we can - * operate with that as our "root" directory. If we hadn't set them as the - * default, then we would have had to build up the relative path - - * /. - */ - ret = cgroup_get_procs("/", NULL, &pids, &pid_cnt); - if (ret) { - printf("Failed to get the pids in %s: %d: %s\n", opts->scope, - ret, cgroup_strerror(ret)); - goto error; - } - - cg = cgroup_new_cgroup(TMP_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - goto error; - } - - for (i = 0; i < pid_cnt; i++) { - ret = cgroup_attach_task_pid(cg, pids[i]); - if (ret) { - printf("Failed to attach pid %d to %s\n", pids[i], TMP_CGNAME); - /* - * Instead of failing, let's save off the return code and continue - * moving processes to the new cgroup. Perhaps the failing PID was - * killed between when we read cgroup.procs and when we tried to - * move it - */ - saved_ret = ret; - } - } - -error: - if (pids) - free(pids); - - if (cg) - cgroup_free(&cg); - - if (ret == 0 && saved_ret) - ret = saved_ret; - - return ret; -} - -static int create_high_priority_cgroup(const struct example_opts * const opts) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg; - int ret = 0; - - cg = cgroup_new_cgroup(HIGH_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - ret = ECGFAIL; - goto error; - } - - ctrl = cgroup_add_controller(cg, "cpu"); - if (!ctrl) { - printf("Failed to add the cpu controller to the %s cgroup struct\n", - HIGH_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "cpu.weight", "600"); - if (ret) { - printf("Failed to set %s's cpu.weight: %d: %s\n", HIGH_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ctrl = cgroup_add_controller(cg, "memory"); - if (!ctrl) { - printf("Failed to add the memory controller to the %s cgroup struct\n", - HIGH_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "memory.low", "1G"); - if (ret) { - printf("Failed to set %s's memory.low: %d: %s\n", HIGH_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ret = cgroup_create_cgroup(cg, 0); - if (ret) { - printf("Failed to write the %s cgroup to /sys/fs/cgroup: %d: %s\n", - HIGH_CGNAME, ret, cgroup_strerror(ret)); - goto error; - } - -error: - if (cg) - cgroup_free(&cg); - - return ret; -} - -static int create_medium_priority_cgroup(const struct example_opts * const opts) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg; - int ret = 0; - - cg = cgroup_new_cgroup(MED_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - ret = ECGFAIL; - goto error; - } - - ctrl = cgroup_add_controller(cg, "cpu"); - if (!ctrl) { - printf("Failed to add the cpu controller to the %s cgroup struct\n", - MED_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "cpu.weight", "300"); - if (ret) { - printf("Failed to set %s's cpu.weight: %d: %s\n", MED_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ctrl = cgroup_add_controller(cg, "memory"); - if (!ctrl) { - printf("Failed to add the memory controller to the %s cgroup struct\n", - MED_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "memory.high", "3G"); - if (ret) { - printf("Failed to set %s's memory.high: %d: %s\n", MED_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ret = cgroup_create_cgroup(cg, 0); - if (ret) { - printf("Failed to write the %s cgroup to /sys/fs/cgroup: %d: %s\n", - MED_CGNAME, ret, cgroup_strerror(ret)); - goto error; - } - -error: - if (cg) - cgroup_free(&cg); - - return ret; -} - -static int create_low_priority_cgroup(const struct example_opts * const opts) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg; - int ret = 0; - - cg = cgroup_new_cgroup(LOW_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - ret = ECGFAIL; - goto error; - } - - ctrl = cgroup_add_controller(cg, "cpu"); - if (!ctrl) { - printf("Failed to add the cpu controller to the %s cgroup struct\n", - LOW_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "cpu.weight", "100"); - if (ret) { - printf("Failed to set %s's cpu.weight: %d: %s\n", LOW_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ctrl = cgroup_add_controller(cg, "memory"); - if (!ctrl) { - printf("Failed to add the memory controller to the %s cgroup struct\n", - LOW_CGNAME); - ret = ECGFAIL; - goto error; - } - - ret = cgroup_set_value_string(ctrl, "memory.max", "2G"); - if (ret) { - printf("Failed to set %s's memory.high: %d: %s\n", LOW_CGNAME, ret, - cgroup_strerror(ret)); - goto error; - } - - ret = cgroup_create_cgroup(cg, 0); - if (ret) { - printf("Failed to write the %s cgroup to /sys/fs/cgroup: %d: %s\n", - LOW_CGNAME, ret, cgroup_strerror(ret)); - goto error; - } - -error: - if (cg) - cgroup_free(&cg); - - return ret; -} - -static int create_process(pid_t * const pid, const char * const cgname) -{ - int ret = 0; - - *pid = fork(); - if (*pid < 0) { - printf("Failed to create the process: %d\n", errno); - ret = ECGFAIL; - goto error; - } else if (*pid == 0) { - /* - * This is the child process. Move it to the requested cgroup - */ - ret = cgroup_change_cgroup_path(cgname, getpid(), NULL); - if (ret) - exit(0); - - while (true) - sleep(10); - } - -error: - if (ret) - *pid = -1; - - return ret; -} - -static int delete_tmp_cgroup(void) -{ - struct cgroup *cg = NULL; - int ret, pid_cnt, i; - int saved_errno = 0; - pid_t *pids = NULL; - - ret = cgroup_get_procs(TMP_CGNAME, NULL, &pids, &pid_cnt); - if (ret) { - printf("Failed to get the pids in %s: %d: %s\n", TMP_CGNAME, - ret, cgroup_strerror(ret)); - goto error; - } - - for (i = 0; i < pid_cnt; i++) { - ret = kill(pids[i], SIGTERM); - if (ret < 0) { - saved_errno = errno; - printf("Kill failed: %d\n", errno); - /* - * Do not bail out here as there may be other PIDS to process - */ - } - } - - cg = cgroup_new_cgroup(TMP_CGNAME); - if (!cg) { - printf("Failed to allocate the cgroup struct. Are we out of memory?\n"); - goto error; - } - - ret = cgroup_delete_cgroup(cg, 1); - if (ret) - printf("Failed to delete the %s cgroup: %d: %s\n", TMP_CGNAME, ret, - cgroup_strerror(ret)); - -error: - if (pids) - free(pids); - - if (cg) - cgroup_free(&cg); - - if (ret == 0 && saved_errno) - ret = ECGFAIL; - - return ret; -} - -static void wait_for_child(pid_t pid) -{ - int wstatus; - - (void)waitpid(pid, &wstatus, 0); - - if (WIFEXITED(wstatus)) - printf("pid %d exited with status %d\n", pid, WEXITSTATUS(wstatus)); - else if (WIFSIGNALED(wstatus)) - printf("pid %d exited due to signal %d\n", pid, WTERMSIG(wstatus)); -} - -int main(int argc, char *argv[]) -{ - pid_t high_pid, med_pid, low_pid; - struct example_opts opts = {0}; - int ret = 0; - - if (argc < 3) { - usage(argv[0]); - exit(1); - } - - ret = cgroup_set_default_scope_opts(&opts.systemd_opts); - if (ret) { - printf("Failed to set the default systemd options: %d\n", ret); - goto error; - } - - ret = parse_opts(argc, argv, &opts); - if (ret) { - printf("Failed to parse the command line options: %d\n", ret); - goto error; - } - - if (opts.debug) - cgroup_set_default_logger(CGROUP_LOG_DEBUG); - - ret = cgroup_init(); - if (ret) - goto error; - - ret = create_scope(&opts); - if (ret) - goto error; - - ret = create_tmp_cgroup(&opts); - if (ret) - goto error; - - ret = move_pids_to_tmp_cgroup(&opts); - if (ret) - goto error; - - ret = create_high_priority_cgroup(&opts); - if (ret) - goto error; - - ret = create_medium_priority_cgroup(&opts); - if (ret) - goto error; - - ret = create_low_priority_cgroup(&opts); - if (ret) - goto error; - - ret = create_process(&high_pid, HIGH_CGNAME); - if (ret) - goto error; - - ret = create_process(&med_pid, MED_CGNAME); - if (ret) - goto error; - - ret = create_process(&low_pid, LOW_CGNAME); - if (ret) - goto error; - - ret = delete_tmp_cgroup(); - if (ret) - goto error; - - printf("\n----------------------------------------------------------------\n"); - printf("Cgroup setup completed successfully\n"); - printf("\t* The scope %s was placed under slice %s\n", opts.scope, opts.slice); - printf("\t* Libcgroup initially placed an idle process in the scope,\n" - "\t but it has been removed by this program\n"); - printf("\t* PID %d has been placed in the %s cgroup\n", high_pid, HIGH_CGNAME); - printf("\t* PID %d has been placed in the %s cgroup\n", med_pid, MED_CGNAME); - printf("\t* PID %d has been placed in the %s cgroup\n", low_pid, LOW_CGNAME); - printf("\nThis program will wait for the aforementioned child processes to\n" - "exit before exiting itself. Systemd will automatically delete the\n" - "scope when there are no longer any processes running within the.\n" - "scope. Systemd will not automatically delete the slice.\n"); - printf("----------------------------------------------------------------\n\n"); - - wait_for_child(high_pid); - wait_for_child(med_pid); - wait_for_child(low_pid); - -error: - return ret; -} diff --git a/lib/libcgroup-3.1.0/samples/c/empty_cgroup_v2.c b/lib/libcgroup-3.1.0/samples/c/empty_cgroup_v2.c deleted file mode 100644 index a6dcf688576..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/empty_cgroup_v2.c +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Simple program to add empty cgroup v2 - * - * Copyright (c) 2022 Oracle and/or its affiliates. - * Author: Kamalesh babulal - */ - -#include - -#include -#include - -#define CGRP_NAME "empty_cgrp" - -int main(int argc, char **argv) -{ - struct cgroup *cgroup = NULL; - int ret = 0; - - ret = cgroup_init(); - if (ret) { - fprintf(stderr, "cgroup_init failed\n"); - exit(1); - } - - cgroup = cgroup_new_cgroup(CGRP_NAME); - if (!cgroup) { - fprintf(stderr, "Failed to allocate cgroup %s\n", CGRP_NAME); - exit(1); - } - - ret = cgroup_create_cgroup(cgroup, 0); - if (ret) - fprintf(stderr, "Failed to create cgroup %s\n", CGRP_NAME); - - cgroup_free(&cgroup); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_all_controller.c b/lib/libcgroup-3.1.0/samples/c/get_all_controller.c deleted file mode 100644 index 8695fb552fc..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_all_controller.c +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include - -int main(void) -{ - struct controller_data info; - void *handle; - int error; - - error = cgroup_init(); - - if (error) { - printf("cgroup_init failed with %s\n", cgroup_strerror(error)); - exit(1); - } - - error = cgroup_get_all_controller_begin(&handle, &info); - - while (error != ECGEOF) { - printf("Controller %10s %5d %5d %5d\n", info.name, - info.hierarchy, info.num_cgroups, info.enabled); - error = cgroup_get_all_controller_next(&handle, &info); - if (error && error != ECGEOF) { - printf("cgroup_get_controller_next failed with %s\n", - cgroup_strerror(error)); - exit(1); - } - } - - error = cgroup_get_all_controller_end(&handle); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_controller.c b/lib/libcgroup-3.1.0/samples/c/get_controller.c deleted file mode 100644 index 6115bc97194..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_controller.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include - -int main(void) -{ - struct cgroup_mount_point info; - void *handle; - int error; - - error = cgroup_init(); - if (error) { - printf("cgroup_init failed with %s\n", cgroup_strerror(error)); - exit(1); - } - - error = cgroup_get_controller_begin(&handle, &info); - while (error != ECGEOF) { - printf("Controller %s is mounted at %s\n", - info.name, info.path); - error = cgroup_get_controller_next(&handle, &info); - if (error && error != ECGEOF) { - printf("cgroup_get_controller_next failed with %s", - cgroup_strerror(error)); - exit(1); - } - } - - error = cgroup_get_controller_end(&handle); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_mount_point.c b/lib/libcgroup-3.1.0/samples/c/get_mount_point.c deleted file mode 100644 index 788500744df..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_mount_point.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include -#include -#include - -int main(void) -{ - char *mount_point; - char string[100]; - int ret; - - strcpy(string, "cpu"); - - ret = cgroup_init(); - if (ret) { - printf("cgroup_init failed with %s\n", cgroup_strerror(ret)); - exit(3); - } - - ret = cgroup_get_subsys_mount_point(string, &mount_point); - if (ret) { - printf("get_mount_point failed with %s\n", - cgroup_strerror(ret)); - exit(3); - } - - printf("The mount point is %s\n", mount_point); - free(mount_point); - - strcpy(string, "obviouslynonexistsubsys"); - - ret = cgroup_get_subsys_mount_point(string, &mount_point); - if (!ret) { - printf("get_mount_point failed as it got a "); - printf("non existent subsys\n"); - exit(3); - } - - if (ret == ECGROUPNOTEXIST) { - printf("get_mount_point worked as expected\n"); - return 0; - } - - printf("get_mount_point failed with %s\n", cgroup_strerror(ret)); - - return 3; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_procs.c b/lib/libcgroup-3.1.0/samples/c/get_procs.c deleted file mode 100644 index 30f7b0ae0e1..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_procs.c +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include - -/* - * Assumes the cgroup is already mounted at /cgroup/memory/a - * Assumes some processes are already in the cgroup - * Assumes it is the memory controller is mounted in at that point - */ -int main(void) -{ - pid_t *pids; - int size; - int ret; - int i; - - ret = cgroup_init(); - if (ret) { - printf("FAIL: cgroup_init failed with %s\n", - cgroup_strerror(ret)); - exit(3); - } - - ret = cgroup_get_procs("a", "memory", &pids, &size); - if (ret) { - printf("FAIL: cgroup_get_procs failed with %s\n", - cgroup_strerror(ret)); - exit(3); - } - - for (i = 0; i < size; i++) - printf("%u\n", pids[i]); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_setup_mode.c b/lib/libcgroup-3.1.0/samples/c/get_setup_mode.c deleted file mode 100644 index e983f4fe71e..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_setup_mode.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/* - * Copyright (c) 2023 Oracle and/or its affiliates - * - * Author: Kamalesh Babulal - * - * Description: This file contains the sample code to demonstrate usage of - * cgroup_setup_mode() API. - */ - -#include -#include - -#include - -int main(void) -{ - enum cg_setup_mode_t setup_mode; - int ret; - - ret = cgroup_init(); - if (ret) { - printf("cgroup_init failed with %s\n", cgroup_strerror(ret)); - exit(1); - } - - setup_mode = cgroup_setup_mode(); - switch(setup_mode) { - case CGROUP_MODE_LEGACY: - printf("cgroup mode: Legacy\n"); - break; - case CGROUP_MODE_HYBRID: - printf("cgroup mode: Hybrid\n"); - break; - case CGROUP_MODE_UNIFIED: - printf("cgroup mode: Unified\n"); - break; - default: - printf("cgroup mode: Unknown\n"); - break; - } - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/get_variable_names.c b/lib/libcgroup-3.1.0/samples/c/get_variable_names.c deleted file mode 100644 index da4e5d12235..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/get_variable_names.c +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include "../src/libcgroup-internal.h" -#include - -#include -#include -#include - -int main(int argc, char *argv[]) -{ - struct cgroup_controller *group_controller = NULL; - struct cgroup *group = NULL; - char group_name[] = "/"; - char *name; - int count; - int ret; - int i, j; - - if (argc < 2) { - printf("no list of groups provided\n"); - return -1; - } - - ret = cgroup_init(); - if (ret) { - printf("cgroup_init failed with %s\n", cgroup_strerror(ret)); - exit(1); - } - - group = cgroup_new_cgroup(group_name); - if (group == NULL) { - printf("cannot create group '%s'\n", group_name); - return -1; - } - - ret = cgroup_get_cgroup(group); - if (ret != 0) { - printf("cannot read group '%s': %s\n", - group_name, cgroup_strerror(ret)); - } - - for (i = 1; i < argc; i++) { - - group_controller = cgroup_get_controller(group, argv[i]); - if (group_controller == NULL) { - printf("cannot find controller '%s' in group '%s'\n", - argv[i], group_name); - ret = -1; - continue; - } - - count = cgroup_get_value_name_count(group_controller); - for (j = 0; j < count; j++) { - name = cgroup_get_value_name(group_controller, j); - if (name != NULL) - printf("%s\n", name); - } - } - - return ret; -} diff --git a/lib/libcgroup-3.1.0/samples/c/logger.c b/lib/libcgroup-3.1.0/samples/c/logger.c deleted file mode 100644 index cdadf647966..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/logger.c +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/* - * Copyright Red Hat Inc., 2012 - * - * Author: Jan Safranek - * - * Description: This file contains the test code for libcgroup logging. - */ - -#include "config.h" -#include "libcgroup.h" -#include "../src/libcgroup-internal.h" - -#include -#include - -static void mylogger(void *userdata, int loglevel, const char *fmt, va_list ap) -{ - printf("custom: "); - vprintf(fmt, ap); -} - -int main(int argc, char **argv) -{ - int loglevel = -1; - int custom = 0; - int i; - - for (i = 1; i < argc; i++) { - if (strcmp("custom", argv[i]) == 0) - custom = 1; - else - loglevel = atoi(argv[i]); - } - - if (custom) - cgroup_set_logger(mylogger, loglevel, NULL); - else - cgroup_set_default_logger(loglevel); - - cgroup_dbg("DEBUG message\n"); - cgroup_info("INFO message\n"); - cgroup_warn("WARNING message\n"); - cgroup_err("ERROR message\n"); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/proctest.c b/lib/libcgroup-3.1.0/samples/c/proctest.c deleted file mode 100644 index 8f8007f8a09..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/proctest.c +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/* - * Copyright NEC Soft Ltd. 2009 - * - * Author: Ken'ichi Ohmichi - */ - -#include "../src/libcgroup-internal.h" - -#include -#include - -int main(int argc, char *argv[]) -{ - char *procname; - pid_t pid; - uid_t uid; - gid_t gid; - int ret; - int i; - - if (argc < 2) { - printf("Specify process-id.\n"); - return 1; - } - - printf(" Pid | Process name | Uid | Gid\n"); - printf("-------+----------------------------------+-------+-------\n"); - - for (i = 1; i < argc; i++) { - pid = atoi(argv[i]); - - ret = cgroup_get_uid_gid_from_procfs(pid, &uid, &gid); - if (ret) { - printf("%6d | ret = %d\n", pid, ret); - continue; - } - ret = cgroup_get_procname_from_procfs(pid, &procname); - if (ret) { - printf("%6d | ret = %d\n", pid, ret); - continue; - } - printf("%6d | %32s | %5d | %5d\n", pid, procname, uid, gid); - free(procname); - } - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/read_stats.c b/lib/libcgroup-3.1.0/samples/c/read_stats.c deleted file mode 100644 index 92974d1e3d6..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/read_stats.c +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include -#include -#include - -#include - -int read_stats(char *path, char *controller) -{ - struct cgroup_stat stat; - void *handle; - int ret; - - ret = cgroup_read_stats_begin(controller, path, &handle, &stat); - if (ret != 0) { - fprintf(stderr, "stats read failed\n"); - return -1; - } - - printf("Stats for %s:\n", path); - printf("%s: %s", stat.name, stat.value); - - while ((ret = cgroup_read_stats_next(&handle, &stat)) != - ECGEOF) { - printf("%s: %s", stat.name, stat.value); - } - - cgroup_read_stats_end(&handle); - printf("\n"); - return 0; -} - -int main(int argc, char *argv[]) -{ - struct cgroup_file_info info; - char cgroup_path[FILENAME_MAX]; - char *controller; - int root_len; - void *handle; - int lvl; - int ret; - - if (argc < 2) { - fprintf(stderr, "Usage %s: \n", - argv[0]); - exit(EXIT_FAILURE); - } - - controller = argv[1]; - - ret = cgroup_init(); - if (ret != 0) { - fprintf(stderr, "init failed\n"); - exit(EXIT_FAILURE); - } - - ret = cgroup_walk_tree_begin(controller, "/", 0, &handle, &info, &lvl); - - if (ret != 0) { - fprintf(stderr, "Walk failed\n"); - exit(EXIT_FAILURE); - } - - root_len = strlen(info.full_path) - 1; - strncpy(cgroup_path, info.path, FILENAME_MAX - 1); - ret = read_stats(cgroup_path, controller); - if (ret < 0) - exit(EXIT_FAILURE); - - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) != - ECGEOF) { - if (info.type != CGROUP_FILE_TYPE_DIR) - continue; - strncpy(cgroup_path, info.full_path + root_len, FILENAME_MAX - 1); - strcat(cgroup_path, "/"); - ret = read_stats(cgroup_path, controller); - if (ret < 0) - exit(EXIT_FAILURE); - } - cgroup_walk_tree_end(&handle); - - return EXIT_SUCCESS; -} diff --git a/lib/libcgroup-3.1.0/samples/c/setuid.c b/lib/libcgroup-3.1.0/samples/c/setuid.c deleted file mode 100644 index a51fdb34584..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/setuid.c +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/* - * Copyright Red Hat Inc. 2008 - * - * Author: Steve Olivieri - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * This is just a simple program for changing a UID or a GID. Comment out - * whichever block you don't want to use. - */ -int main(int argc, char *argv[]) -{ - /* User data */ - struct passwd *pwd; - - /* UID of user */ - uid_t uid; - - /* Return codes */ - int ret = 0; - - if (argc < 2) { - printf("Usage: %s \n", argv[0]); - goto finished; - } - - pwd = getpwnam(argv[1]); - if (!pwd) { - fprintf(stderr, "getpwnam() failed: %s\n", - strerror(errno)); - ret = -errno; - goto finished; - } - - uid = pwd->pw_uid; - fprintf(stdout, "Setting UID to %s (%d).\n", pwd->pw_name, uid); - ret = setuid(uid); - if (ret != 0) { - fprintf(stderr, "Call to setuid() failed with error: %s\n", - strerror(errno)); - ret = -errno; - goto finished; - } - -// while(1) { -// grp = getgrnam("root"); -// gid = grp->gr_gid; -// fprintf(stdout, "Setting GID to %s (%d).\n", -// grp->gr_name, gid); -// if ((ret = setgid(gid))) { -// fprintf(stderr, "Call to setgid() failed with error:" -// " %s\n", strerror(errno)); -// ret = -errno; -// goto finished; -// } -// } - - while (1) - usleep(3000000); - -finished: - return ret; -} diff --git a/lib/libcgroup-3.1.0/samples/c/test_named_hierarchy.c b/lib/libcgroup-3.1.0/samples/c/test_named_hierarchy.c deleted file mode 100644 index c0bf7eeba46..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/test_named_hierarchy.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include -#include - -/* - * Assumes cgroup is mounted at /cgroup using - * mount -t cgroup -o none,name=test none /cgroup - */ -int main(void) -{ - struct cgroup_controller *cgc; - struct cgroup *cgroup; - int ret; - - ret = cgroup_init(); - if (ret) { - printf("FAIL: cgroup_init failed with %s\n", - cgroup_strerror(ret)); - exit(3); - } - - cgroup = cgroup_new_cgroup("test"); - if (!cgroup) { - printf("FAIL: cgroup_new_cgroup failed\n"); - exit(3); - } - - cgc = cgroup_add_controller(cgroup, "name=test"); - if (!cgc) { - printf("FAIL: cgroup_add_controller failed\n"); - exit(3); - } - - ret = cgroup_create_cgroup(cgroup, 1); - if (ret) { - printf("FAIL: cgroup_create_cgroup failed with %s\n", - cgroup_strerror(ret)); - exit(3); - } - - if (access("/cgroup/test", F_OK)) - printf("PASS\n"); - else - printf("Failed to create cgroup\n"); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/walk_task.c b/lib/libcgroup-3.1.0/samples/c/walk_task.c deleted file mode 100644 index 1a9f59d8820..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/walk_task.c +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - char *group = NULL; - void *handle; - int ret, i; - - if (argc < 2) { - printf("No list of groups provided\n"); - return -1; - } - - ret = cgroup_init(); - if (ret) { - printf("cgroup_init failed with %s\n", cgroup_strerror(ret)); - return -1; - } - - for (i = 1; i < argc; i++) { - pid_t pid; - - group = strdup(argv[i]); - printf("Printing the details of groups %s\n", group); - - ret = cgroup_get_task_begin(group, "cpu", &handle, &pid); - while (!ret) { - printf("Pid is %u\n", pid); - ret = cgroup_get_task_next(&handle, &pid); - if (ret && ret != ECGEOF) { - printf("cgroup_get_task_next failed with %s\n", - cgroup_strerror(ret)); - if (ret == ECGOTHER) - printf("failure with %s\n", - strerror(errno)); - return -1; - } - } - free(group); - group = NULL; - ret = cgroup_get_task_end(&handle); - } - - return 0; -} diff --git a/lib/libcgroup-3.1.0/samples/c/walk_test.c b/lib/libcgroup-3.1.0/samples/c/walk_test.c deleted file mode 100644 index 20c7641b5ff..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/walk_test.c +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include - -#include -#include -#include -#include - -#include - -void visit_node(struct cgroup_file_info *info, char *root) -{ - if (info->type == CGROUP_FILE_TYPE_DIR) { - printf("path %s, parent %s, relative %s, full %s\n", - info->path, info->parent, - info->full_path + strlen(root) - 1, - info->full_path); - } -} - -int main(int argc, char *argv[]) -{ - struct cgroup_file_info info; - char root[FILENAME_MAX]; - char *controller; - void *handle; - int lvl, i; - int ret; - - if (argc < 2) { - fprintf(stderr, "Usage %s: \n", - argv[0]); - exit(EXIT_FAILURE); - } - - controller = argv[1]; - - ret = cgroup_init(); - if (ret != 0) { - fprintf(stderr, "Init failed\n"); - exit(EXIT_FAILURE); - } - - ret = cgroup_walk_tree_begin(controller, "/", 0, &handle, &info, &lvl); - - if (ret != 0) { - fprintf(stderr, "Walk failed\n"); - exit(EXIT_FAILURE); - } - - strcpy(root, info.full_path); - printf("Begin pre-order walk\n"); - printf("root is %s\n", root); - visit_node(&info, root); - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) != - ECGEOF) { - visit_node(&info, root); - } - cgroup_walk_tree_end(&handle); - - printf("pre-order walk finished\n"); - ret = cgroup_walk_tree_begin(controller, "/", 0, &handle, &info, &lvl); - - if (ret != 0) { - fprintf(stderr, "Walk failed\n"); - exit(EXIT_FAILURE); - } - - ret = cgroup_walk_tree_set_flags(&handle, CGROUP_WALK_TYPE_POST_DIR); - - if (ret) { - fprintf(stderr, "Walk failed with %s\n", cgroup_strerror(ret)); - exit(EXIT_FAILURE); - } - - strcpy(root, info.full_path); - printf("Begin post-order walk\n"); - printf("root is %s\n", root); - visit_node(&info, root); - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) != - ECGEOF) { - visit_node(&info, root); - } - cgroup_walk_tree_end(&handle); - printf("post order walk finished\n"); - - ret = cgroup_walk_tree_begin(controller, "/a", 2, &handle, &info, &lvl); - - if (ret != 0) { - fprintf(stderr, "Walk failed\n"); - exit(EXIT_FAILURE); - } - strcpy(root, info.full_path); - printf("root is %s\n", root); - visit_node(&info, root); - while ((ret = cgroup_walk_tree_next(2, &handle, &info, lvl)) != - ECGEOF) { - visit_node(&info, root); - } - cgroup_walk_tree_end(&handle); - - /* - * Walk only the first five nodes - */ - i = 0; - printf("Walking the first 5 nodes\n"); - ret = cgroup_walk_tree_begin(controller, "/", 0, &handle, &info, &lvl); - - if (ret != 0) { - fprintf(stderr, "Walk failed\n"); - exit(EXIT_FAILURE); - } - strcpy(root, info.full_path); - printf("root is %s\n", root); - visit_node(&info, root); - i++; - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) != - ECGEOF) { - visit_node(&info, root); - if (++i >= 5) - break; - } - cgroup_walk_tree_end(&handle); - - return EXIT_SUCCESS; -} diff --git a/lib/libcgroup-3.1.0/samples/c/wrapper_test.c b/lib/libcgroup-3.1.0/samples/c/wrapper_test.c deleted file mode 100644 index c1f88371bf7..00000000000 --- a/lib/libcgroup-3.1.0/samples/c/wrapper_test.c +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include "../src/libcgroup-internal.h" -#include - -#include -#include - -int main(void) -{ - struct cgroup *cgroup; - struct cgroup_controller *cgc; - int fail = 0; - - cgroup = cgroup_new_cgroup("test"); - cgc = cgroup_add_controller(cgroup, "cpu"); - - cgroup_add_value_int64(cgc, "cpu.shares", 2048); - cgroup_add_value_uint64(cgc, "cpu.something", 1000); - cgroup_add_value_bool(cgc, "cpu.bool", 1); - - if (!strcmp(cgroup->controller[0]->values[0]->name, "cpu.shares")) { - if (strcmp(cgroup->controller[0]->values[0]->value, "2048")) { - printf("FAIL for add_value_int\n"); - fail = 1; - } - } - - if (!strcmp(cgroup->controller[0]->values[1]->name, "cpu.something")) { - if (strcmp(cgroup->controller[0]->values[1]->value, "1000")) { - printf("FAIL for add_value_uint\n"); - fail = 1; - } - } - - if (!strcmp(cgroup->controller[0]->values[2]->name, "cpu.bool")) { - if (strcmp(cgroup->controller[0]->values[2]->value, "1")) { - printf("FAIL for add_value_bool\n"); - fail = 1; - } - } - - if (!fail) - printf("PASS!\n"); - - return fail; -} diff --git a/lib/libcgroup-3.1.0/samples/cmdline/Makefile.am b/lib/libcgroup-3.1.0/samples/cmdline/Makefile.am deleted file mode 100644 index dd0ca5e930b..00000000000 --- a/lib/libcgroup-3.1.0/samples/cmdline/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup cmdline samples Makefile.am -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -if WITH_SAMPLES - -EXTRA_DIST = systemd-with-idle-process.md - -endif diff --git a/lib/libcgroup-3.1.0/samples/cmdline/Makefile.in b/lib/libcgroup-3.1.0/samples/cmdline/Makefile.in deleted file mode 100644 index ff919868173..00000000000 --- a/lib/libcgroup-3.1.0/samples/cmdline/Makefile.in +++ /dev/null @@ -1,483 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 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@ - -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup cmdline samples Makefile.am -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = samples/cmdline -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -@WITH_SAMPLES_TRUE@EXTRA_DIST = systemd-with-idle-process.md -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/cmdline/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign samples/cmdline/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f 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-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# 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/lib/libcgroup-3.1.0/samples/config/Makefile.am b/lib/libcgroup-3.1.0/samples/config/Makefile.am deleted file mode 100644 index a52cef736e0..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -EXTRA_DIST = cgconfig.conf \ - cgconfig.sysconfig \ - cgred.conf \ - cgrules.conf \ - cgsnapshot_denylist.conf \ - cgsnapshot_allowlist.conf \ - invalid_namespace_config.conf \ - invalid_namespace_mount_config.conf \ - namespace_config.conf diff --git a/lib/libcgroup-3.1.0/samples/config/Makefile.in b/lib/libcgroup-3.1.0/samples/config/Makefile.in deleted file mode 100644 index 8d1b2d41d02..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/Makefile.in +++ /dev/null @@ -1,484 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = samples/config -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = cgconfig.conf \ - cgconfig.sysconfig \ - cgred.conf \ - cgrules.conf \ - cgsnapshot_denylist.conf \ - cgsnapshot_allowlist.conf \ - invalid_namespace_config.conf \ - invalid_namespace_mount_config.conf \ - namespace_config.conf - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/config/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign samples/config/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f 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-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# 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/lib/libcgroup-3.1.0/samples/config/cgconfig.conf b/lib/libcgroup-3.1.0/samples/config/cgconfig.conf deleted file mode 100644 index de29594fd74..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgconfig.conf +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright IBM Corporation. 2007 -# -# Authors: Balbir Singh -# -#group daemons/www { -# perm { -# task { -# uid = root; -# gid = webmaster; -# } -# admin { -# uid = root; -# gid = root; -# } -# } -# cpu { -# cpu.shares = 1000; -# } -#} -# -#group daemons/ftp { -# perm { -# task { -# uid = root; -# gid = ftpmaster; -# } -# admin { -# uid = root; -# gid = root; -# } -# } -# cpu { -# cpu.shares = 500; -# } -#} -# -#mount { -# cpu = /mnt/cgroups/cpu; -# cpuacct = /mnt/cgroups/cpuacct; -#} diff --git a/lib/libcgroup-3.1.0/samples/config/cgconfig.sysconfig b/lib/libcgroup-3.1.0/samples/config/cgconfig.sysconfig deleted file mode 100644 index 5a61bf6e987..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgconfig.sysconfig +++ /dev/null @@ -1,12 +0,0 @@ -# Service cgconfig can create a default group in all mounted hierarchies and -# move all processes there on boot. If no default rule is specified in -# /etc/cgrules.conf, the default group is named '/sysdefault'. -# This automatically created group(s) can be useful e.g. when using 'cpu' -# controller to limit cpu.shares of this default group and allowing some more -# important group take most of the CPU. -# -# By default, create these groups: -CREATE_DEFAULT=yes - -# Uncomment following line to disable creation of the default group on startup: -# CREATE_DEFAULT=no diff --git a/lib/libcgroup-3.1.0/samples/config/cgred.conf b/lib/libcgroup-3.1.0/samples/config/cgred.conf deleted file mode 100644 index edd0dc763d9..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgred.conf +++ /dev/null @@ -1,27 +0,0 @@ -# /etc/sysconfig/cgred.conf - CGroup Rules Engine Daemon configuration file -# -# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, LOG) are -# the only valid ones. Defining anything else in this file will cause the -# CGroup Rules Engine program to fail. So, don't do it. - -# The pathname to the configuration file for CGroup Rules Engine -CONFIG_FILE="/etc/cgrules.conf" - -# Uncomment the following line to log to specified file instead of syslog -#LOG_FILE="/var/log/cgrulesengd.log" - -# Uncomment the second line to run CGroup Rules Engine in non-daemon mode -NODAEMON="" -#NODAEMON="--nodaemon" - -# Set owner of cgred socket. 'cgexec' tool should have write access there -# (either using suid and/or sgid permissions or Linux capabilities). -SOCKET_USER="" -SOCKET_GROUP="cgred" - -# Uncomment the second line to disable logging for CGroup Rules Engine -# Uncomment the third line to enable more verbose logging. -LOG="" -#LOG="--nolog" -#LOG="-v" - diff --git a/lib/libcgroup-3.1.0/samples/config/cgrules.conf b/lib/libcgroup-3.1.0/samples/config/cgrules.conf deleted file mode 100644 index 86300b3d850..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgrules.conf +++ /dev/null @@ -1,10 +0,0 @@ -# /etc/cgrules.conf -#The format of this file is described in cgrules.conf(5) -#manual page. -# -# Example: -# -#@student cpu,memory usergroup/student/ -#peter cpu test1/ -#% memory test2/ -# End of file diff --git a/lib/libcgroup-3.1.0/samples/config/cgsnapshot_allowlist.conf b/lib/libcgroup-3.1.0/samples/config/cgsnapshot_allowlist.conf deleted file mode 100644 index 2c9ab23831b..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgsnapshot_allowlist.conf +++ /dev/null @@ -1,48 +0,0 @@ -#cgsnapshot tool configuration file - -#memory -memory.memsw.failcnt -memory.memsw.limit_in_bytes -memory.memsw.max_usage_in_bytes -memory.swappiness -memory.use_hierarchy -memory.failcnt -memory.soft_limit_in_bytes -memory.limit_in_bytes -memory.max_usage_in_bytes -memory.move_charge_at_immigrate - -#cpu -cpu.rt_runtime_us -cpu.rt_period_us - -#cpuacct -cpuacct.usage - -#devices -devices.deny -devices.allow -devices.list - -#cpuset -cpuset.memory_spread_slab -cpuset.memory_spread_page -cpuset.memory_migrate -cpuset.sched_relax_domain_level -cpuset.sched_load_balance -cpuset.mem_hardwall -cpuset.mem_exclusive -cpuset.cpu_exclusive -cpuset.mems -cpuset.cpus - -#ns - -#freezer -freezer.state - -#net_cls -net_cls.classid - -#blkio -blkio.weight \ No newline at end of file diff --git a/lib/libcgroup-3.1.0/samples/config/cgsnapshot_denylist.conf b/lib/libcgroup-3.1.0/samples/config/cgsnapshot_denylist.conf deleted file mode 100644 index 3d63373e78e..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/cgsnapshot_denylist.conf +++ /dev/null @@ -1,20 +0,0 @@ -#cgsnapshot tool configuration file - -#memory -memory.oom_control - -#cpu - -#cpuacct - -#devices - -#cpuset - -#ns - -#freezer - -#net_cls - -#blkio \ No newline at end of file diff --git a/lib/libcgroup-3.1.0/samples/config/invalid_namespace_config.conf b/lib/libcgroup-3.1.0/samples/config/invalid_namespace_config.conf deleted file mode 100644 index 074e1869cfc..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/invalid_namespace_config.conf +++ /dev/null @@ -1,53 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright IBM Corporation. 2009 -# -# Authors: Dhaval Giani -# -group www { - perm { - task { - uid = root; - gid = webmaster; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 1000; - } - cpuacct { - } -} - -group ftp { - perm { - task { - uid = root; - gid = ftpmaster; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 500; - } - cpuacct { - } -} - -mount { - cpu = /mnt/cgroups; - cpuacct = /mnt/cgroups; -} - -namespace { - cpu = daemons; - #This is invalid since both cpu and cpuacct are mounted at the - #same place but have different namespace - cpuacct = network; -} diff --git a/lib/libcgroup-3.1.0/samples/config/invalid_namespace_mount_config.conf b/lib/libcgroup-3.1.0/samples/config/invalid_namespace_mount_config.conf deleted file mode 100644 index e910672c47b..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/invalid_namespace_mount_config.conf +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright IBM Corporation. 2009 -# -# Authors: Dhaval Giani -# This program is free software; you can redistribute it and/or modify it -# under the terms of version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# This program is distributed in the hope that it would be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -group www { - perm { - task { - uid = root; - gid = root; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 1000; - } - cpuacct { - } -} - -group ftp { - perm { - task { - uid = root; - gid = root; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 500; - } - cpuacct { - } -} - -#This is invalid because we cannot have mount and namespace in the same -#configuration file. -mount { - cpu = /cgroups/cpu; - cpuacct = /cgroups/cpuacct; -} - -namespace { - cpu = daemons; - cpuacct = daemons; -} diff --git a/lib/libcgroup-3.1.0/samples/config/namespace_config.conf b/lib/libcgroup-3.1.0/samples/config/namespace_config.conf deleted file mode 100644 index bdb5e7f5642..00000000000 --- a/lib/libcgroup-3.1.0/samples/config/namespace_config.conf +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright IBM Corporation. 2009 -# -# Authors: Dhaval Giani -# -group www { - perm { - task { - uid = root; - gid = root; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 1000; - } - cpuacct { - } -} - -group ftp { - perm { - task { - uid = root; - gid = root; - } - admin { - uid = root; - gid = root; - } - } - cpu { - cpu.shares = 500; - } - cpuacct { - } -} - -namespace { - cpu = daemons; - cpuacct = daemons; -} diff --git a/lib/libcgroup-3.1.0/samples/python/Makefile.am b/lib/libcgroup-3.1.0/samples/python/Makefile.am deleted file mode 100644 index 17aaf89b7db..00000000000 --- a/lib/libcgroup-3.1.0/samples/python/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup python samples Makefile.am -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -if WITH_SAMPLES - -EXTRA_DIST = create_systemd_scope.py - -endif - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - -rm -f *.pyc diff --git a/lib/libcgroup-3.1.0/samples/python/Makefile.in b/lib/libcgroup-3.1.0/samples/python/Makefile.in deleted file mode 100644 index 82973de5453..00000000000 --- a/lib/libcgroup-3.1.0/samples/python/Makefile.in +++ /dev/null @@ -1,488 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 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@ - -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup python samples Makefile.am -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = samples/python -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -@WITH_SAMPLES_TRUE@EXTRA_DIST = create_systemd_scope.py -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign samples/python/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign samples/python/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f 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-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - -rm -f *.pyc - -# 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/lib/libcgroup-3.1.0/scripts/Makefile.am b/lib/libcgroup-3.1.0/scripts/Makefile.am deleted file mode 100644 index 9d0f19165b4..00000000000 --- a/lib/libcgroup-3.1.0/scripts/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -EXTRA_DIST = init.d/cgconfig.in init.d/cgred.in - -if WITH_INITSCRIPT_INSTALL -INITSCRIPTDIR=$(DESTDIR)$(sysconfdir)/rc.d/init.d -install-exec-hook: - $(INSTALL) -d $(INITSCRIPTDIR) - $(INSTALL_SCRIPT) init.d/cgconfig init.d/cgred $(INITSCRIPTDIR) - -uninstall-hook: - rm -f $(INITSCRIPTDIR)/cgconfig $(INITSCRIPTDIR)/cgred -endif diff --git a/lib/libcgroup-3.1.0/scripts/Makefile.in b/lib/libcgroup-3.1.0/scripts/Makefile.in deleted file mode 100644 index e626dc29ad5..00000000000 --- a/lib/libcgroup-3.1.0/scripts/Makefile.in +++ /dev/null @@ -1,486 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = scripts -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = init.d/cgconfig.in init.d/cgred.in -@WITH_INITSCRIPT_INSTALL_TRUE@INITSCRIPTDIR = $(DESTDIR)$(sysconfdir)/rc.d/init.d -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign scripts/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -@WITH_INITSCRIPT_INSTALL_FALSE@install-exec-hook: -@WITH_INITSCRIPT_INSTALL_FALSE@uninstall-hook: -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 - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-exec-am install-strip uninstall-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags-am uninstall uninstall-am uninstall-hook - -.PRECIOUS: Makefile - -@WITH_INITSCRIPT_INSTALL_TRUE@install-exec-hook: -@WITH_INITSCRIPT_INSTALL_TRUE@ $(INSTALL) -d $(INITSCRIPTDIR) -@WITH_INITSCRIPT_INSTALL_TRUE@ $(INSTALL_SCRIPT) init.d/cgconfig init.d/cgred $(INITSCRIPTDIR) - -@WITH_INITSCRIPT_INSTALL_TRUE@uninstall-hook: -@WITH_INITSCRIPT_INSTALL_TRUE@ rm -f $(INITSCRIPTDIR)/cgconfig $(INITSCRIPTDIR)/cgred - -# 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/lib/libcgroup-3.1.0/scripts/init.d/cgconfig.in b/lib/libcgroup-3.1.0/scripts/init.d/cgconfig.in deleted file mode 100644 index 527430e042b..00000000000 --- a/lib/libcgroup-3.1.0/scripts/init.d/cgconfig.in +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-only -# -# Start/Stop the workload manager -# -# Copyright IBM Corporation. 2008 -# -# Authors: Balbir Singh -# -# cgconfig Control Groups Configuration Startup -# chkconfig: - 5 95 -# description: This script runs the cgconfigparser utility to parse and setup -# the control group filesystem. It uses /etc/cgconfig.conf -# and parses the configuration specified in there. - -### BEGIN INIT INFO -# Provides: cgconfig -# Required-Start: -# Required-Stop: -# Should-Start: ypbind -# Should-Stop: ypbind -# Short-Description: Create and setup control group filesystem(s) -# Description: Create and setup control group filesystem(s) -### END INIT INFO - -# get correct location of binaries from configure -sbindir=@sbindir@ -CGCONFIGPARSER_BIN=$sbindir/cgconfigparser -CONFIG_FILE=/etc/cgconfig.conf -CONFIG_DIR=/etc/cgconfig.d -servicename=cgconfig - - -lockfile=/run/lock/subsys/$servicename -# -# Source LSB routines -# -SYSLIBFILE=/lib/lsb/init-functions -OLDSYSLIBFILE=/etc/init.d/functions -if [[ -x $SYSLIBFILE ]] ; then - # shellcheck disable=SC1090 - source $SYSLIBFILE -elif [[ -x $OLDSYSLIBFILE ]] ; then - # shellcheck disable=SC1090 - source $OLDSYSLIBFILE - log_warning_msg() ( warning "$@" ; printf "\n" 1>&2 ; ) - log_failure_msg() ( failure "$@" ; printf "\n" 1>&2 ; ) - log_success_msg() ( success "$@" ; printf "\n" 1>&2 ; ) -else - log_warning_msg() ( printf "warning:%s\n" "$@" 1>&2 ;) - log_failure_msg() ( printf "failure:%s\n" "$@" 1>&2 ;) - log_success_msg() ( printf "success:%s\n" "$@" 1>&2 ;) -fi - -# read the config -CREATE_DEFAULT=yes -if [ -e /etc/sysconfig/cgconfig ]; then - # shellcheck disable=SC1091 - source /etc/sysconfig/cgconfig -fi - -lockfiledir=$(dirname "$lockfile") - -create_default_groups() { - defaultcgroup= - - if [ -f /etc/cgrules.conf ]; then - # shellcheck disable=SC2034 - read -r user ctrl defaultcgroup <<< \ - "$(grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf)" - if [[ ( -n "$defaultcgroup" ) && ( "$defaultcgroup" = "*" ) ]]; then - log_warning_msg "/etc/cgrules.conf incorrect" - log_warning_msg "Overriding it" - defaultcgroup= - fi - fi - - if [[ -z "$defaultcgroup" ]] - then - defaultcgroup=sysdefault/ - fi - - # - # Find all mounted subsystems and create comma-separated list - # of controllers. - # - controllers=$(lssubsys 2>/dev/null | tr '\n' ',' | sed s/.$//) - - # - # Create the default group, ignore errors when the default group - # already exists. - # - cgcreate -f 664 -d 775 -g "$controllers":"$defaultcgroup" 2>/dev/null - - # - # special rule for cpusets - # - if echo "$controllers" | grep -q -w cpuset; then - cpus=$(cgget -nv -r cpuset.cpus /) - cgset -r cpuset.cpus="$cpus $defaultcgroup" - mems=$(cgget -nv -r cpuset.mems /) - cgset -r cpuset.mems="$mems $defaultcgroup" - fi - - # - # Classify everything to default cgroup. Ignore errors, some processes - # may exit after ps is run and before cgclassify moves them. - # - cgclassify -g "$controllers:$defaultcgroup $(ps --no-headers -eL o tid)" \ - 2>/dev/null || : -} - -start() { - printf "Starting %s service: " "$servicename" - if [[ -f "$lockfile" ]]; then - log_warning_msg "lock file already exists" - return 0 - fi - - if [[ ! -s "$CONFIG_FILE" ]]; then - log_failure_msg $CONFIG_FILE "is not configured" - return 6 - fi - - - if ! "$CGCONFIGPARSER_BIN" -l "$CONFIG_FILE" -L "$CONFIG_DIR" - then - log_failure_msg "Failed to parse " "$CONFIG_FILE" "or" "$CONFIG_DIR"'/*' - return 1 - fi - - if [ $CREATE_DEFAULT = "yes" ]; then - create_default_groups - fi - - if ! mkdir -p "$lockfiledir" ; then - log_failure_msg "Failed to mkdir $lockfiledir directory" - return 1 - fi - - - if ! touch "$lockfile" ; then - log_failure_msg "Failed to touch $lockfile" - return 1 - fi - log_success_msg "Started $servicename" - return 0 -} - -stop() { - printf "Stopping %s service is not supported!: " "$servicename" - log_failure_msg "Failed to stop $servicename" - return 1 -} - -trapped() { - # - # Do nothing - # - true -} - -usage() { - echo "$0 " - exit 2 -} - -common() { - # - # main script work done here - # - trap "trapped ABRT" ABRT - trap "trapped QUIT" QUIT - trap "trapped TERM" TERM - trap "trapped INT" INT -} - -restart() { - common - stop - start -} - -RETVAL=0 - -case $1 in - 'stop') - common - stop - RETVAL=$? - ;; - 'start') - common - start - RETVAL=$? - ;; - 'restart'|'reload') - restart - RETVAL=$? - ;; - 'condrestart') - if [[ -f "$lockfile" ]]; then - restart - RETVAL=$? - fi - ;; - 'status') - if [ -f "$lockfile" ]; then - echo "Running" - exit 0 - else - echo "Stopped" - exit 3 - fi - ;; - *) - usage - ;; -esac - -exit $RETVAL diff --git a/lib/libcgroup-3.1.0/scripts/init.d/cgred.in b/lib/libcgroup-3.1.0/scripts/init.d/cgred.in deleted file mode 100644 index 3374dafeb5b..00000000000 --- a/lib/libcgroup-3.1.0/scripts/init.d/cgred.in +++ /dev/null @@ -1,170 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-only -# -# Start/Stop the CGroups Rules Engine Daemon -# -# Copyright Red Hat Inc. 2008 -# -# Authors: Steve Olivieri -# -# cgred CGroups Rules Engine Daemon -# chkconfig: - 14 86 -# description: This is a daemon for automatically classifying processes \ -# into cgroups based on UID/GID. -# -# processname: cgrulesengd -# pidfile: /var/run/cgred.pid -# -### BEGIN INIT INFO -# Provides: cgrulesengd -# Required-Start: $local_fs $syslog $cgconfig -# Required-Stop: $local_fs $syslog -# Should-Start: -# Should-Stop: -# Short-Description: start and stop the cgroups rules engine daemon -# Description: CGroup Rules Engine is a tool for automatically using \ -# cgroups to classify processes -### END INIT INFO - -sbindir=@sbindir@ -CGRED_BIN=$sbindir/cgrulesengd - -# Sanity checks -[[ -x $CGRED_BIN ]] || exit 1 - -# -# Source LSB routines -# -SYSLIBFILE=/lib/lsb/init-functions -OLDSYSLIBFILE=/etc/init.d/functions -if [[ -x $SYSLIBFILE ]] ; then - # shellcheck disable=SC1090 - source $SYSLIBFILE -elif [[ -x $OLDSYSLIBFILE ]] ; then - # shellcheck disable=SC1090 - source $OLDSYSLIBFILE - log_warning_msg() ( warning "$@" ; printf "\n" 1>&2 ; ) - log_failure_msg() ( failure "$@" ; printf "\n" 1>&2 ; ) - log_success_msg() ( success "$@" ; printf "\n" 1>&2 ; ) -else - log_warning_msg() ( printf "warning:%s\n" "$@" 1>&2 ;) - log_failure_msg() ( printf "failure:%s\n" "$@" 1>&2 ;) - log_success_msg() ( printf "success:%s\n" "$@" 1>&2 ;) -fi - -# Read in configuration options. -if [[ -f "/etc/sysconfig/cgred.conf" ]] ; then - # shellcheck disable=SC1091 - source /etc/sysconfig/cgred.conf - OPTIONS="$NODAEMON $LOG" - if [[ -n "$LOG_FILE" ]]; then - OPTIONS="$OPTIONS --logfile=$LOG_FILE" - fi - if [[ -n "$SOCKET_USER" ]]; then - OPTIONS="$OPTIONS -u $SOCKET_USER" - fi - if [[ -n "$SOCKET_GROUP" ]]; then - OPTIONS="$OPTIONS -g $SOCKET_GROUP" - fi -else - OPTIONS="" -fi - -# For convenience -processname=cgrulesengd -servicename=cgred -lockfile="/var/lock/subsys/$servicename" -pidfile=/var/run/cgred.pid - -start() -{ - echo -n $"Starting CGroup Rules Engine Daemon: " - if [[ -f "$lockfile" ]]; then - log_failure_msg "$servicename is already running with PID $(cat ${pidfile})" - return 0 - fi - num=$(grep "cgroup" /proc/mounts | awk '$3=="cgroup"' | wc -l) - if [[ "$num" -eq 0 ]]; then - echo - log_failure_msg $"Cannot find cgroups, is cgconfig service running?" - return 1 - fi - daemon --check $servicename --pidfile $pidfile $CGRED_BIN $OPTIONS - retval=$? - echo - if [[ $retval -ne 0 ]]; then - return 7 - fi - if ! touch "$lockfile"; then - return 1 - fi - pidof "$processname" > $pidfile - return 0 -} - -stop() -{ - echo -n $"Stopping CGroup Rules Engine Daemon..." - if [[ ! -f $pidfile ]]; then - log_success_msg - return 0 - fi - killproc -p $pidfile -TERM "$processname" - retval=$? - echo - if [[ $retval -ne 0 ]]; then - return 1 - fi - rm -f "$lockfile" "$pidfile" - return 0 -} - -RETVAL=0 - -# See how we are called -case "$1" in - start) - start - RETVAL=$? - ;; - stop) - stop - RETVAL=$? - ;; - status) - status -p $pidfile $servicename - RETVAL=$? - ;; - restart) - stop - start - RETVAL=$? - ;; - condrestart) - if [[ -f "$lockfile" ]]; then - stop - start - RETVAL=$? - fi - ;; - reload|flash) - if [[ -f "$lockfile" ]]; then - echo $"Reloading rules configuration..." - kill -s 12 "$(cat ${pidfile})" - RETVAL=$? - if [[ $RETVAL -eq 0 ]] ; then - log_success_msg "" - else - log_failure_msg "" - fi - else - log_failure_msg "$servicename is not running." - fi - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - RETVAL=2 - ;; -esac - -exit $RETVAL diff --git a/lib/libcgroup-3.1.0/src/Makefile.am b/lib/libcgroup-3.1.0/src/Makefile.am deleted file mode 100644 index 12c94b37d98..00000000000 --- a/lib/libcgroup-3.1.0/src/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -@CODE_COVERAGE_RULES@ - -BUILT_SOURCES = parse.c parse.h - -DIST_SUBDIRS = . daemon pam tools python -SUBDIRS = . daemon pam tools -if ENABLE_PYTHON -SUBDIRS += python -endif -EXTRA_DIST = libcgroup_systemd_idle_thread - -# generate parse.h from parse.y -AM_YFLAGS = -d - -CLEANFILES = lex.c parse.c parse.h - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -VERSION_NUMBER = $(LIBRARY_VERSION_MAJOR):$(LIBRARY_VERSION_MINOR):$(LIBRARY_VERSION_RELEASE) -TESTING_MAP_FILE = $(top_srcdir)/tests/gunit/libcgroup_unittest.map - -if WITH_SYSTEMD -libcgroup_systemd_idle_thread_SOURCES = libcgroup_systemd_idle_thread.c -bin_PROGRAMS = libcgroup_systemd_idle_thread -endif - -lib_LTLIBRARIES = libcgroup.la -libcgroup_la_SOURCES = parse.h parse.y lex.l api.c config.c libcgroup-internal.h libcgroup.map \ - wrapper.c log.c abstraction-common.c abstraction-common.h \ - abstraction-map.c abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \ - tools/cgxget.c tools/cgxset.c -if WITH_SYSTEMD -libcgroup_la_SOURCES += systemd.c -endif - -libcgroup_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS) -libcgroup_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC=static -DLIBCG_LIB -fPIC - -libcgroup_la_LDFLAGS = -Wl,--version-script,$(srcdir)/libcgroup.map \ - -version-number $(VERSION_NUMBER) -if WITH_SYSTEMD -libcgroup_la_LDFLAGS += -lsystemd -libcgroup_la_CFLAGS += -DWITH_SYSTEMD -endif - -noinst_LTLIBRARIES = libcgroupfortesting.la -libcgroupfortesting_la_SOURCES = parse.h parse.y lex.l api.c config.c libcgroup-internal.h \ - libcgroup.map wrapper.c log.c abstraction-common.c \ - abstraction-common.h abstraction-map.c abstraction-map.h \ - abstraction-cpu.c abstraction-cpuset.c -if WITH_SYSTEMD -libcgroupfortesting_la_SOURCES += systemd.c -endif - -libcgroupfortesting_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS) -libcgroupfortesting_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC= -DUNIT_TEST - -libcgroupfortesting_la_LDFLAGS = -Wl,--version-script,$(TESTING_MAP_FILE) \ - -version-number $(VERSION_NUMBER) -if WITH_SYSTEMD -libcgroupfortesting_la_LDFLAGS += -lsystemd -endif diff --git a/lib/libcgroup-3.1.0/src/Makefile.in b/lib/libcgroup-3.1.0/src/Makefile.in deleted file mode 100644 index 99199aa5b71..00000000000 --- a/lib/libcgroup-3.1.0/src/Makefile.in +++ /dev/null @@ -1,1281 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@ENABLE_PYTHON_TRUE@am__append_1 = python -@WITH_SYSTEMD_TRUE@bin_PROGRAMS = \ -@WITH_SYSTEMD_TRUE@ libcgroup_systemd_idle_thread$(EXEEXT) -@WITH_SYSTEMD_TRUE@am__append_2 = systemd.c -@WITH_SYSTEMD_TRUE@am__append_3 = -lsystemd -@WITH_SYSTEMD_TRUE@am__append_4 = -DWITH_SYSTEMD -@WITH_SYSTEMD_TRUE@am__append_5 = systemd.c -@WITH_SYSTEMD_TRUE@am__append_6 = -lsystemd -subdir = src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" -PROGRAMS = $(bin_PROGRAMS) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -libcgroup_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__libcgroup_la_SOURCES_DIST = parse.h parse.y lex.l api.c config.c \ - libcgroup-internal.h libcgroup.map wrapper.c log.c \ - abstraction-common.c abstraction-common.h abstraction-map.c \ - abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \ - tools/cgxget.c tools/cgxset.c systemd.c -am__dirstamp = $(am__leading_dot)dirstamp -@WITH_SYSTEMD_TRUE@am__objects_1 = libcgroup_la-systemd.lo -am_libcgroup_la_OBJECTS = libcgroup_la-parse.lo libcgroup_la-lex.lo \ - libcgroup_la-api.lo libcgroup_la-config.lo \ - libcgroup_la-wrapper.lo libcgroup_la-log.lo \ - libcgroup_la-abstraction-common.lo \ - libcgroup_la-abstraction-map.lo \ - libcgroup_la-abstraction-cpu.lo \ - libcgroup_la-abstraction-cpuset.lo \ - tools/libcgroup_la-cgxget.lo tools/libcgroup_la-cgxset.lo \ - $(am__objects_1) -libcgroup_la_OBJECTS = $(am_libcgroup_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libcgroup_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcgroup_la_CFLAGS) \ - $(CFLAGS) $(libcgroup_la_LDFLAGS) $(LDFLAGS) -o $@ -libcgroupfortesting_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__libcgroupfortesting_la_SOURCES_DIST = parse.h parse.y lex.l api.c \ - config.c libcgroup-internal.h libcgroup.map wrapper.c log.c \ - abstraction-common.c abstraction-common.h abstraction-map.c \ - abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \ - systemd.c -@WITH_SYSTEMD_TRUE@am__objects_2 = libcgroupfortesting_la-systemd.lo -am_libcgroupfortesting_la_OBJECTS = libcgroupfortesting_la-parse.lo \ - libcgroupfortesting_la-lex.lo libcgroupfortesting_la-api.lo \ - libcgroupfortesting_la-config.lo \ - libcgroupfortesting_la-wrapper.lo \ - libcgroupfortesting_la-log.lo \ - libcgroupfortesting_la-abstraction-common.lo \ - libcgroupfortesting_la-abstraction-map.lo \ - libcgroupfortesting_la-abstraction-cpu.lo \ - libcgroupfortesting_la-abstraction-cpuset.lo $(am__objects_2) -libcgroupfortesting_la_OBJECTS = $(am_libcgroupfortesting_la_OBJECTS) -libcgroupfortesting_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) \ - $(libcgroupfortesting_la_LDFLAGS) $(LDFLAGS) -o $@ -am__libcgroup_systemd_idle_thread_SOURCES_DIST = \ - libcgroup_systemd_idle_thread.c -@WITH_SYSTEMD_TRUE@am_libcgroup_systemd_idle_thread_OBJECTS = \ -@WITH_SYSTEMD_TRUE@ libcgroup_systemd_idle_thread.$(OBJEXT) -libcgroup_systemd_idle_thread_OBJECTS = \ - $(am_libcgroup_systemd_idle_thread_OBJECTS) -libcgroup_systemd_idle_thread_LDADD = $(LDADD) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/libcgroup_la-abstraction-common.Plo \ - ./$(DEPDIR)/libcgroup_la-abstraction-cpu.Plo \ - ./$(DEPDIR)/libcgroup_la-abstraction-cpuset.Plo \ - ./$(DEPDIR)/libcgroup_la-abstraction-map.Plo \ - ./$(DEPDIR)/libcgroup_la-api.Plo \ - ./$(DEPDIR)/libcgroup_la-config.Plo \ - ./$(DEPDIR)/libcgroup_la-lex.Plo \ - ./$(DEPDIR)/libcgroup_la-log.Plo \ - ./$(DEPDIR)/libcgroup_la-parse.Plo \ - ./$(DEPDIR)/libcgroup_la-systemd.Plo \ - ./$(DEPDIR)/libcgroup_la-wrapper.Plo \ - ./$(DEPDIR)/libcgroup_systemd_idle_thread.Po \ - ./$(DEPDIR)/libcgroupfortesting_la-abstraction-common.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-abstraction-map.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-api.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-config.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-lex.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-log.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-parse.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-systemd.Plo \ - ./$(DEPDIR)/libcgroupfortesting_la-wrapper.Plo \ - tools/$(DEPDIR)/libcgroup_la-cgxget.Plo \ - tools/$(DEPDIR)/libcgroup_la-cgxset.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) -LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) -AM_V_LEX = $(am__v_LEX_@AM_V@) -am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) -am__v_LEX_0 = @echo " LEX " $@; -am__v_LEX_1 = -YLWRAP = $(top_srcdir)/build-aux/ylwrap -am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ - -e s/c++$$/h++/ -e s/c$$/h/ -YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) -LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) -AM_V_YACC = $(am__v_YACC_@AM_V@) -am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) -am__v_YACC_0 = @echo " YACC " $@; -am__v_YACC_1 = -SOURCES = $(libcgroup_la_SOURCES) $(libcgroupfortesting_la_SOURCES) \ - $(libcgroup_systemd_idle_thread_SOURCES) -DIST_SOURCES = $(am__libcgroup_la_SOURCES_DIST) \ - $(am__libcgroupfortesting_la_SOURCES_DIST) \ - $(am__libcgroup_systemd_idle_thread_SOURCES_DIST) -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir distdir-am -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/ylwrap \ - lex.c parse.c parse.h -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -BUILT_SOURCES = parse.c parse.h -DIST_SUBDIRS = . daemon pam tools python -SUBDIRS = . daemon pam tools $(am__append_1) -EXTRA_DIST = libcgroup_systemd_idle_thread - -# generate parse.h from parse.y -AM_YFLAGS = -d -CLEANFILES = lex.c parse.c parse.h -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -VERSION_NUMBER = $(LIBRARY_VERSION_MAJOR):$(LIBRARY_VERSION_MINOR):$(LIBRARY_VERSION_RELEASE) -TESTING_MAP_FILE = $(top_srcdir)/tests/gunit/libcgroup_unittest.map -@WITH_SYSTEMD_TRUE@libcgroup_systemd_idle_thread_SOURCES = libcgroup_systemd_idle_thread.c -lib_LTLIBRARIES = libcgroup.la -libcgroup_la_SOURCES = parse.h parse.y lex.l api.c config.c \ - libcgroup-internal.h libcgroup.map wrapper.c log.c \ - abstraction-common.c abstraction-common.h abstraction-map.c \ - abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \ - tools/cgxget.c tools/cgxset.c $(am__append_2) -libcgroup_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS) -libcgroup_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC=static \ - -DLIBCG_LIB -fPIC $(am__append_4) -libcgroup_la_LDFLAGS = -Wl,--version-script,$(srcdir)/libcgroup.map \ - -version-number $(VERSION_NUMBER) $(am__append_3) -noinst_LTLIBRARIES = libcgroupfortesting.la -libcgroupfortesting_la_SOURCES = parse.h parse.y lex.l api.c config.c \ - libcgroup-internal.h libcgroup.map wrapper.c log.c \ - abstraction-common.c abstraction-common.h abstraction-map.c \ - abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \ - $(am__append_5) -libcgroupfortesting_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS) -libcgroupfortesting_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC= -DUNIT_TEST -libcgroupfortesting_la_LDFLAGS = \ - -Wl,--version-script,$(TESTING_MAP_FILE) -version-number \ - $(VERSION_NUMBER) $(am__append_6) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -.SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -parse.h: parse.c - @if test ! -f $@; then rm -f parse.c; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parse.c; else :; fi -tools/$(am__dirstamp): - @$(MKDIR_P) tools - @: > tools/$(am__dirstamp) -tools/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tools/$(DEPDIR) - @: > tools/$(DEPDIR)/$(am__dirstamp) -tools/libcgroup_la-cgxget.lo: tools/$(am__dirstamp) \ - tools/$(DEPDIR)/$(am__dirstamp) -tools/libcgroup_la-cgxset.lo: tools/$(am__dirstamp) \ - tools/$(DEPDIR)/$(am__dirstamp) - -libcgroup.la: $(libcgroup_la_OBJECTS) $(libcgroup_la_DEPENDENCIES) $(EXTRA_libcgroup_la_DEPENDENCIES) - $(AM_V_CCLD)$(libcgroup_la_LINK) -rpath $(libdir) $(libcgroup_la_OBJECTS) $(libcgroup_la_LIBADD) $(LIBS) - -libcgroupfortesting.la: $(libcgroupfortesting_la_OBJECTS) $(libcgroupfortesting_la_DEPENDENCIES) $(EXTRA_libcgroupfortesting_la_DEPENDENCIES) - $(AM_V_CCLD)$(libcgroupfortesting_la_LINK) $(libcgroupfortesting_la_OBJECTS) $(libcgroupfortesting_la_LIBADD) $(LIBS) - -libcgroup_systemd_idle_thread$(EXEEXT): $(libcgroup_systemd_idle_thread_OBJECTS) $(libcgroup_systemd_idle_thread_DEPENDENCIES) $(EXTRA_libcgroup_systemd_idle_thread_DEPENDENCIES) - @rm -f libcgroup_systemd_idle_thread$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(libcgroup_systemd_idle_thread_OBJECTS) $(libcgroup_systemd_idle_thread_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f tools/*.$(OBJEXT) - -rm -f tools/*.lo - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-abstraction-common.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-abstraction-cpu.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-abstraction-cpuset.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-abstraction-map.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-api.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-config.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-lex.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-log.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-parse.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-systemd.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_la-wrapper.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroup_systemd_idle_thread.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-abstraction-common.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-abstraction-map.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-api.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-config.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-lex.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-log.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-parse.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-systemd.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgroupfortesting_la-wrapper.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/libcgroup_la-cgxget.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/libcgroup_la-cgxset.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libcgroup_la-parse.lo: parse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-parse.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-parse.Tpo -c -o libcgroup_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-parse.Tpo $(DEPDIR)/libcgroup_la-parse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parse.c' object='libcgroup_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c - -libcgroup_la-lex.lo: lex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-lex.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-lex.Tpo -c -o libcgroup_la-lex.lo `test -f 'lex.c' || echo '$(srcdir)/'`lex.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-lex.Tpo $(DEPDIR)/libcgroup_la-lex.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lex.c' object='libcgroup_la-lex.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-lex.lo `test -f 'lex.c' || echo '$(srcdir)/'`lex.c - -libcgroup_la-api.lo: api.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-api.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-api.Tpo -c -o libcgroup_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-api.Tpo $(DEPDIR)/libcgroup_la-api.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='api.c' object='libcgroup_la-api.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c - -libcgroup_la-config.lo: config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-config.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-config.Tpo -c -o libcgroup_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-config.Tpo $(DEPDIR)/libcgroup_la-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config.c' object='libcgroup_la-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c - -libcgroup_la-wrapper.lo: wrapper.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-wrapper.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-wrapper.Tpo -c -o libcgroup_la-wrapper.lo `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-wrapper.Tpo $(DEPDIR)/libcgroup_la-wrapper.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wrapper.c' object='libcgroup_la-wrapper.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-wrapper.lo `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c - -libcgroup_la-log.lo: log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-log.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-log.Tpo -c -o libcgroup_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-log.Tpo $(DEPDIR)/libcgroup_la-log.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libcgroup_la-log.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c - -libcgroup_la-abstraction-common.lo: abstraction-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-abstraction-common.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-abstraction-common.Tpo -c -o libcgroup_la-abstraction-common.lo `test -f 'abstraction-common.c' || echo '$(srcdir)/'`abstraction-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-abstraction-common.Tpo $(DEPDIR)/libcgroup_la-abstraction-common.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-common.c' object='libcgroup_la-abstraction-common.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-abstraction-common.lo `test -f 'abstraction-common.c' || echo '$(srcdir)/'`abstraction-common.c - -libcgroup_la-abstraction-map.lo: abstraction-map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-abstraction-map.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-abstraction-map.Tpo -c -o libcgroup_la-abstraction-map.lo `test -f 'abstraction-map.c' || echo '$(srcdir)/'`abstraction-map.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-abstraction-map.Tpo $(DEPDIR)/libcgroup_la-abstraction-map.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-map.c' object='libcgroup_la-abstraction-map.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-abstraction-map.lo `test -f 'abstraction-map.c' || echo '$(srcdir)/'`abstraction-map.c - -libcgroup_la-abstraction-cpu.lo: abstraction-cpu.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-abstraction-cpu.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-abstraction-cpu.Tpo -c -o libcgroup_la-abstraction-cpu.lo `test -f 'abstraction-cpu.c' || echo '$(srcdir)/'`abstraction-cpu.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-abstraction-cpu.Tpo $(DEPDIR)/libcgroup_la-abstraction-cpu.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-cpu.c' object='libcgroup_la-abstraction-cpu.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-abstraction-cpu.lo `test -f 'abstraction-cpu.c' || echo '$(srcdir)/'`abstraction-cpu.c - -libcgroup_la-abstraction-cpuset.lo: abstraction-cpuset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-abstraction-cpuset.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-abstraction-cpuset.Tpo -c -o libcgroup_la-abstraction-cpuset.lo `test -f 'abstraction-cpuset.c' || echo '$(srcdir)/'`abstraction-cpuset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-abstraction-cpuset.Tpo $(DEPDIR)/libcgroup_la-abstraction-cpuset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-cpuset.c' object='libcgroup_la-abstraction-cpuset.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-abstraction-cpuset.lo `test -f 'abstraction-cpuset.c' || echo '$(srcdir)/'`abstraction-cpuset.c - -tools/libcgroup_la-cgxget.lo: tools/cgxget.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT tools/libcgroup_la-cgxget.lo -MD -MP -MF tools/$(DEPDIR)/libcgroup_la-cgxget.Tpo -c -o tools/libcgroup_la-cgxget.lo `test -f 'tools/cgxget.c' || echo '$(srcdir)/'`tools/cgxget.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/$(DEPDIR)/libcgroup_la-cgxget.Tpo tools/$(DEPDIR)/libcgroup_la-cgxget.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/cgxget.c' object='tools/libcgroup_la-cgxget.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o tools/libcgroup_la-cgxget.lo `test -f 'tools/cgxget.c' || echo '$(srcdir)/'`tools/cgxget.c - -tools/libcgroup_la-cgxset.lo: tools/cgxset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT tools/libcgroup_la-cgxset.lo -MD -MP -MF tools/$(DEPDIR)/libcgroup_la-cgxset.Tpo -c -o tools/libcgroup_la-cgxset.lo `test -f 'tools/cgxset.c' || echo '$(srcdir)/'`tools/cgxset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/$(DEPDIR)/libcgroup_la-cgxset.Tpo tools/$(DEPDIR)/libcgroup_la-cgxset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/cgxset.c' object='tools/libcgroup_la-cgxset.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o tools/libcgroup_la-cgxset.lo `test -f 'tools/cgxset.c' || echo '$(srcdir)/'`tools/cgxset.c - -libcgroup_la-systemd.lo: systemd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -MT libcgroup_la-systemd.lo -MD -MP -MF $(DEPDIR)/libcgroup_la-systemd.Tpo -c -o libcgroup_la-systemd.lo `test -f 'systemd.c' || echo '$(srcdir)/'`systemd.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroup_la-systemd.Tpo $(DEPDIR)/libcgroup_la-systemd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='systemd.c' object='libcgroup_la-systemd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroup_la_CFLAGS) $(CFLAGS) -c -o libcgroup_la-systemd.lo `test -f 'systemd.c' || echo '$(srcdir)/'`systemd.c - -libcgroupfortesting_la-parse.lo: parse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-parse.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-parse.Tpo -c -o libcgroupfortesting_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-parse.Tpo $(DEPDIR)/libcgroupfortesting_la-parse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parse.c' object='libcgroupfortesting_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c - -libcgroupfortesting_la-lex.lo: lex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-lex.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-lex.Tpo -c -o libcgroupfortesting_la-lex.lo `test -f 'lex.c' || echo '$(srcdir)/'`lex.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-lex.Tpo $(DEPDIR)/libcgroupfortesting_la-lex.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lex.c' object='libcgroupfortesting_la-lex.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-lex.lo `test -f 'lex.c' || echo '$(srcdir)/'`lex.c - -libcgroupfortesting_la-api.lo: api.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-api.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-api.Tpo -c -o libcgroupfortesting_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-api.Tpo $(DEPDIR)/libcgroupfortesting_la-api.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='api.c' object='libcgroupfortesting_la-api.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c - -libcgroupfortesting_la-config.lo: config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-config.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-config.Tpo -c -o libcgroupfortesting_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-config.Tpo $(DEPDIR)/libcgroupfortesting_la-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config.c' object='libcgroupfortesting_la-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c - -libcgroupfortesting_la-wrapper.lo: wrapper.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-wrapper.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-wrapper.Tpo -c -o libcgroupfortesting_la-wrapper.lo `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-wrapper.Tpo $(DEPDIR)/libcgroupfortesting_la-wrapper.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wrapper.c' object='libcgroupfortesting_la-wrapper.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-wrapper.lo `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c - -libcgroupfortesting_la-log.lo: log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-log.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-log.Tpo -c -o libcgroupfortesting_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-log.Tpo $(DEPDIR)/libcgroupfortesting_la-log.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libcgroupfortesting_la-log.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c - -libcgroupfortesting_la-abstraction-common.lo: abstraction-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-abstraction-common.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-abstraction-common.Tpo -c -o libcgroupfortesting_la-abstraction-common.lo `test -f 'abstraction-common.c' || echo '$(srcdir)/'`abstraction-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-abstraction-common.Tpo $(DEPDIR)/libcgroupfortesting_la-abstraction-common.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-common.c' object='libcgroupfortesting_la-abstraction-common.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-abstraction-common.lo `test -f 'abstraction-common.c' || echo '$(srcdir)/'`abstraction-common.c - -libcgroupfortesting_la-abstraction-map.lo: abstraction-map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-abstraction-map.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-abstraction-map.Tpo -c -o libcgroupfortesting_la-abstraction-map.lo `test -f 'abstraction-map.c' || echo '$(srcdir)/'`abstraction-map.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-abstraction-map.Tpo $(DEPDIR)/libcgroupfortesting_la-abstraction-map.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-map.c' object='libcgroupfortesting_la-abstraction-map.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-abstraction-map.lo `test -f 'abstraction-map.c' || echo '$(srcdir)/'`abstraction-map.c - -libcgroupfortesting_la-abstraction-cpu.lo: abstraction-cpu.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-abstraction-cpu.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Tpo -c -o libcgroupfortesting_la-abstraction-cpu.lo `test -f 'abstraction-cpu.c' || echo '$(srcdir)/'`abstraction-cpu.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Tpo $(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-cpu.c' object='libcgroupfortesting_la-abstraction-cpu.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-abstraction-cpu.lo `test -f 'abstraction-cpu.c' || echo '$(srcdir)/'`abstraction-cpu.c - -libcgroupfortesting_la-abstraction-cpuset.lo: abstraction-cpuset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-abstraction-cpuset.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Tpo -c -o libcgroupfortesting_la-abstraction-cpuset.lo `test -f 'abstraction-cpuset.c' || echo '$(srcdir)/'`abstraction-cpuset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Tpo $(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstraction-cpuset.c' object='libcgroupfortesting_la-abstraction-cpuset.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-abstraction-cpuset.lo `test -f 'abstraction-cpuset.c' || echo '$(srcdir)/'`abstraction-cpuset.c - -libcgroupfortesting_la-systemd.lo: systemd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -MT libcgroupfortesting_la-systemd.lo -MD -MP -MF $(DEPDIR)/libcgroupfortesting_la-systemd.Tpo -c -o libcgroupfortesting_la-systemd.lo `test -f 'systemd.c' || echo '$(srcdir)/'`systemd.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgroupfortesting_la-systemd.Tpo $(DEPDIR)/libcgroupfortesting_la-systemd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='systemd.c' object='libcgroupfortesting_la-systemd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgroupfortesting_la_CFLAGS) $(CFLAGS) -c -o libcgroupfortesting_la-systemd.lo `test -f 'systemd.c' || echo '$(srcdir)/'`systemd.c - -.l.c: - $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) - -.y.c: - $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -rm -rf tools/.libs tools/_libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f tools/$(DEPDIR)/$(am__dirstamp) - -rm -f tools/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -rm -f lex.c - -rm -f parse.c - -rm -f parse.h - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-recursive - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstLTLIBRARIES mostlyclean-am - -distclean: distclean-recursive - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-common.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-cpu.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-cpuset.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-map.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-api.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-config.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-lex.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-log.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-parse.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-systemd.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-wrapper.Plo - -rm -f ./$(DEPDIR)/libcgroup_systemd_idle_thread.Po - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-common.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-map.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-api.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-config.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-lex.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-log.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-parse.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-systemd.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-wrapper.Plo - -rm -f tools/$(DEPDIR)/libcgroup_la-cgxget.Plo - -rm -f tools/$(DEPDIR)/libcgroup_la-cgxset.Plo - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-common.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-cpu.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-cpuset.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-abstraction-map.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-api.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-config.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-lex.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-log.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-parse.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-systemd.Plo - -rm -f ./$(DEPDIR)/libcgroup_la-wrapper.Plo - -rm -f ./$(DEPDIR)/libcgroup_systemd_idle_thread.Po - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-common.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpu.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-cpuset.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-abstraction-map.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-api.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-config.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-lex.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-log.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-parse.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-systemd.Plo - -rm -f ./$(DEPDIR)/libcgroupfortesting_la-wrapper.Plo - -rm -f tools/$(DEPDIR)/libcgroup_la-cgxget.Plo - -rm -f tools/$(DEPDIR)/libcgroup_la-cgxset.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES - -.MAKE: $(am__recursive_targets) all check install install-am \ - install-exec install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--depfiles check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-libLTLIBRARIES - -.PRECIOUS: Makefile - -@CODE_COVERAGE_RULES@ - -# 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/lib/libcgroup-3.1.0/src/abstraction-common.c b/lib/libcgroup-3.1.0/src/abstraction-common.c deleted file mode 100644 index fe0511d1a46..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-common.c +++ /dev/null @@ -1,286 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup abstraction layer - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include "abstraction-common.h" -#include "abstraction-map.h" - -#include -#include - -#include -#include -#include -#include -#include - - -int cgroup_strtol(const char * const in_str, int base, long * const out_value) -{ - char *endptr = NULL; - int ret = 0; - - if (out_value == NULL) { - cgroup_err("Invalid parameter to %s\n", __func__); - ret = ECGINVAL; - goto out; - } - - errno = 0; - *out_value = strtol(in_str, &endptr, base); - - /* taken directly from strtol's man page */ - if ((errno == ERANGE && (*out_value == LONG_MAX || *out_value == LONG_MIN)) || - (errno != 0 && *out_value == 0)) { - cgroup_err("Failed to convert %s from strtol: %s\n", in_str); - ret = ECGFAIL; - goto out; - } - - if (endptr == in_str) { - cgroup_err("No long value found in %s\n", in_str); - ret = ECGFAIL; - goto out; - } - -out: - return ret; -} - -int cgroup_convert_int(struct cgroup_controller * const dst_cgc, const char * const in_value, - const char * const out_setting, void *in_dflt, void *out_dflt) -{ -#define OUT_VALUE_STR_LEN 20 - - long out_dflt_int = (long)out_dflt; - long in_dflt_int = (long)in_dflt; - char *out_value_str = NULL; - long out_value; - int ret; - - if (!in_value) - return ECGINVAL; - - if (strlen(in_value) > 0) { - ret = cgroup_strtol(in_value, 10, &out_value); - if (ret) - goto out; - - /* now scale from the input range to the output range */ - out_value = out_value * out_dflt_int / in_dflt_int; - - out_value_str = calloc(sizeof(char), OUT_VALUE_STR_LEN); - if (!out_value_str) { - ret = ECGOTHER; - goto out; - } - - ret = snprintf(out_value_str, OUT_VALUE_STR_LEN, "%ld", out_value); - if (ret == OUT_VALUE_STR_LEN) { - /* we ran out of room in the string. throw an error */ - cgroup_err("output value too large for string: %d\n", out_value); - ret = ECGFAIL; - goto out; - } - } - - ret = cgroup_add_value_string(dst_cgc, out_setting, out_value_str); - -out: - if (out_value_str) - free(out_value_str); - - return ret; -} - -int cgroup_convert_name_only(struct cgroup_controller * const dst_cgc, const char * const in_value, - const char * const out_setting, void *in_dflt, void *out_dflt) -{ - return cgroup_add_value_string(dst_cgc, out_setting, in_value); -} - -int cgroup_convert_passthrough(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - return cgroup_add_value_string(dst_cgc, out_setting, in_value); -} - -int cgroup_convert_unmappable(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - return ECGNOVERSIONCONVERT; -} - -static int convert_setting(struct cgroup_controller * const out_cgc, - const struct control_value * const in_ctrl_val) -{ - const struct cgroup_abstraction_map *convert_tbl; - int ret = ECGINVAL; - int tbl_sz = 0; - int i; - - switch (out_cgc->version) { - case CGROUP_V1: - convert_tbl = cgroup_v2_to_v1_map; - tbl_sz = cgroup_v2_to_v1_map_sz; - break; - case CGROUP_V2: - convert_tbl = cgroup_v1_to_v2_map; - tbl_sz = cgroup_v1_to_v2_map_sz; - break; - default: - ret = ECGFAIL; - goto out; - } - - for (i = 0; i < tbl_sz; i++) { - /* - * For a few settings, e.g. - * cpu.max <-> cpu.cfs_quota_us/cpu.cfs_period_us, the - * conversion from the N->1 field (cpu.max) back to one of the - * other settings cannot be done without prior knowledge of our - * desired setting (quota or period in this example). - * If prev_name is set, it can guide us back to the correct - * mapping. - */ - if (strcmp(convert_tbl[i].in_setting, in_ctrl_val->name) == 0 && - (in_ctrl_val->prev_name == NULL || - strcmp(in_ctrl_val->prev_name, convert_tbl[i].out_setting) == 0)) { - - ret = convert_tbl[i].cgroup_convert(out_cgc, in_ctrl_val->value, - convert_tbl[i].out_setting, - convert_tbl[i].in_dflt, - convert_tbl[i].out_dflt); - if (ret) - goto out; - } - } - -out: - return ret; -} - -static int convert_controller(struct cgroup_controller ** const out_cgc, - struct cgroup_controller * const in_cgc) -{ - bool unmappable = false; - int ret; - int i; - - - if (in_cgc->version == (*out_cgc)->version) { - ret = cgroup_copy_controller_values(*out_cgc, in_cgc); - /* regardless of success/failure, there's nothing more to do */ - goto out; - } - - if (strcmp(in_cgc->name, "cpu") == 0) { - ret = cgroup_convert_cpu_nto1(*out_cgc, in_cgc); - if (ret) - goto out; - } - - for (i = 0; i < in_cgc->index; i++) { - ret = convert_setting(*out_cgc, in_cgc->values[i]); - if (ret == ECGNOVERSIONCONVERT) { - /* - * Ignore unmappable errors while they happen, as - * there may be mappable settings after that - */ - unmappable = true; - ret = 0; - } else if (ret) { - /* immediately fail on all other errors */ - goto out; - } - } - -out: - if (ret == 0 && unmappable) { - /* The only error received was an unmappable error. Return it. */ - ret = ECGNOVERSIONCONVERT; - - if ((*out_cgc)->index == 0) { - /* - * No settings were successfully converted. Remove this - * controller so that tools like cgxget aren't confused - */ - cgroup_free_controller(*out_cgc); - *out_cgc = NULL; - } - } - - return ret; -} - -int cgroup_convert_cgroup(struct cgroup * const out_cgroup, enum cg_version_t out_version, - const struct cgroup * const in_cgroup, enum cg_version_t in_version) -{ - struct cgroup_controller *cgc; - bool unmappable = false; - int ret = 0; - int i; - - for (i = 0; i < in_cgroup->index; i++) { - cgc = cgroup_add_controller(out_cgroup, in_cgroup->controller[i]->name); - if (cgc == NULL) { - ret = ECGFAIL; - goto out; - } - - /* the user has overridden the version */ - if (in_version == CGROUP_V1 || in_version == CGROUP_V2) - in_cgroup->controller[i]->version = in_version; - - if (strcmp(CGROUP_FILE_PREFIX, cgc->name) == 0) - /* - * libcgroup only supports accessing cgroup.* files - * on cgroup v2 filesystems. - */ - cgc->version = CGROUP_V2; - else - cgc->version = out_version; - - if (cgc->version == CGROUP_UNK || cgc->version == CGROUP_DISK) { - ret = cgroup_get_controller_version(cgc->name, &cgc->version); - if (ret) - goto out; - } - - ret = convert_controller(&cgc, in_cgroup->controller[i]); - if (ret == ECGNOVERSIONCONVERT) { - /* - * Ignore unmappable errors while they happen, as - * there may be mappable settings after that - */ - unmappable = true; - - if (!cgc) - /* - * The converted controller had no settings - * and was removed. It's up to us to manage - * the controller count - */ - out_cgroup->index--; - } else if (ret) { - /* immediately fail on all other errors */ - goto out; - } - } - -out: - if (ret == 0 && unmappable) - /* - * The only error received was an unmappable - * error. Return it. - */ - ret = ECGNOVERSIONCONVERT; - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/abstraction-common.h b/lib/libcgroup-3.1.0/src/abstraction-common.h deleted file mode 100644 index e14b1a69462..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-common.h +++ /dev/null @@ -1,119 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Libcgroup abstraction layer prototypes and structs - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#ifndef __ABSTRACTION_COMMON -#define __ABSTRACTION_COMMON - -#ifdef __cplusplus -extern "C" { -#endif - -#include "config.h" - -#include -#include "libcgroup-internal.h" - -/** - * Convert a string to a long - * - * @param in_str String to be converted - * @param base Integer base - * @param out_value Pointer to hold the output long value - * - * @return 0 on success, - * ECGFAIL if the conversion to long failed, - * ECGINVAL upon an invalid parameter - */ -int cgroup_strtol(const char * const in_str, int base, long * const out_value); - -/** - * Convert an integer setting to another integer setting - * - * @param dst_cgc Destination cgroup controller - * @param in_value Contents of the input setting - * @param out_setting Destination cgroup setting - * @param in_dflt Default value of the input setting (used to scale the value) - * @param out_dflt Default value of the output setting (used to scale the value) - */ -int cgroup_convert_int(struct cgroup_controller * const dst_cgc, const char * const in_value, - const char * const out_setting, void *in_dflt, void *out_dflt); - -/** - * Convert only the name from one setting to another. The contents remain - * the same - * - * @param dst_cgc Destination cgroup controller - * @param in_value Contents of the input setting - * @param out_setting Destination cgroup setting - * @param in_dflt Default value of the input setting (unused) - * @param out_dflt Default value of the output setting (unused) - */ -int cgroup_convert_name_only(struct cgroup_controller * const dst_cgc, const char * const in_value, - const char * const out_setting, void *in_dflt, void *out_dflt); - -/** - * No conversion necessary. The name and the contents are the same - * - * @param dst_cgc Destination cgroup controller - * @param in_value Contents of the input setting - * @param out_setting Destination cgroup setting - * @param in_dflt Default value of the input setting (unused) - * @param out_dflt Default value of the output setting (unused) - */ -int cgroup_convert_passthrough(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -/** - * Convert from an unmapple setting - * - * @param dst_cgc Destination cgroup controller (unused) - * @param in_value Contents of the input setting (unsed) - * @param out_setting Destination cgroup setting (unused) - * @param in_dflt Default value of the input setting (unused) - * @param out_dflt Default value of the output setting (unused) - * @return Always returns ECGNOVERSIONCONVERT - */ -int cgroup_convert_unmappable(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -/* cpu */ -int cgroup_convert_cpu_nto1(struct cgroup_controller * const out_cgc, - struct cgroup_controller * const in_cgc); - -int cgroup_convert_cpu_quota_to_max(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -int cgroup_convert_cpu_period_to_max(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -int cgroup_convert_cpu_max_to_quota(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -int cgroup_convert_cpu_max_to_period(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -/* cpuset */ -int cgroup_convert_cpuset_to_exclusive(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -int cgroup_convert_cpuset_to_partition(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __ABSTRACTION_COMMON */ diff --git a/lib/libcgroup-3.1.0/src/abstraction-cpu.c b/lib/libcgroup-3.1.0/src/abstraction-cpu.c deleted file mode 100644 index 5a56bc07fe5..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-cpu.c +++ /dev/null @@ -1,271 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup abstraction layer for the cpu controller - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include "abstraction-common.h" -#include "abstraction-map.h" - -#include -#include - -#include -#include -#include -#include -#include - -#define LL_MAX 8192 - -static const char * const MAX = "max"; -static const char * const CPU_MAX = "cpu.max"; -static const char * const CFS_QUOTA_US = "cpu.cfs_quota_us"; -static const char * const CFS_PERIOD_US = "cpu.cfs_period_us"; - -static int read_setting(const char * const cgroup_name, const char * const controller_name, - const char * const setting_name, char ** const value) -{ - char tmp_line[LL_MAX]; - void *handle; - int ret; - - ret = cgroup_read_value_begin(controller_name, cgroup_name, setting_name, &handle, - tmp_line, LL_MAX); - if (ret == ECGEOF) - goto read_end; - else if (ret != 0) - goto end; - - *value = strdup(tmp_line); - if ((*value) == NULL) - ret = ECGOTHER; - -read_end: - cgroup_read_value_end(&handle); - if (ret == ECGEOF) - ret = 0; -end: - return ret; -} - -static int get_max(struct cgroup_controller * const cgc, char ** const max) -{ - return read_setting(cgc->cgroup->name, "cpu", "cpu.max", max); -} - -static int get_quota_from_max(struct cgroup_controller * const cgc, char ** const quota) -{ - char *token, *max = NULL, *saveptr = NULL; - int ret; - - ret = get_max(cgc, &max); - if (ret) - goto out; - - token = strtok_r(max, " ", &saveptr); - - *quota = strdup(token); - if ((*quota) == NULL) - ret = ECGOTHER; - -out: - if (max) - free(max); - - return ret; -} - -static int get_period_from_max(struct cgroup_controller * const cgc, char ** const period) -{ - char *token, *max = NULL, *saveptr = NULL; - int ret; - - ret = get_max(cgc, &max); - if (ret) - goto out; - - token = strtok_r(max, " ", &saveptr); - token = strtok_r(NULL, " ", &saveptr); - - *period = strdup(token); - if ((*period) == NULL) - ret = ECGOTHER; - -out: - if (max) - free(max); - - return ret; -} - -int cgroup_convert_cpu_quota_to_max(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - char max_line[LL_MAX] = {0}; - char *period = NULL; - int ret; - - if (strlen(in_value) == 0) { - /* There's no value to convert. Populate the setting */ - ret = cgroup_add_value_string(dst_cgc, out_setting, NULL); - if (ret) - goto out; - } else { - ret = get_period_from_max(dst_cgc, &period); - if (ret) - goto out; - - if (strcmp(in_value, "-1") == 0) - snprintf(max_line, LL_MAX, "%s %s", MAX, period); - else - snprintf(max_line, LL_MAX, "%s %s", in_value, period); - - ret = cgroup_add_value_string(dst_cgc, out_setting, max_line); - if (ret) - goto out; - } - - dst_cgc->values[dst_cgc->index - 1]->prev_name = strdup(CFS_QUOTA_US); - -out: - if (period) - free(period); - - return ret; -} - -int cgroup_convert_cpu_period_to_max(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - char max_line[LL_MAX] = {0}; - char *quota = NULL; - int ret; - - if (strlen(in_value) == 0) { - /* There's no value to convert. Populate the setting and return */ - ret = cgroup_add_value_string(dst_cgc, out_setting, NULL); - if (ret) - goto out; - } else { - ret = get_quota_from_max(dst_cgc, "a); - if (ret) - goto out; - - if (strcmp(in_value, "-1") == 0) - snprintf(max_line, LL_MAX, "%s %s", quota, MAX); - else - snprintf(max_line, LL_MAX, "%s %s", quota, in_value); - ret = cgroup_add_value_string(dst_cgc, out_setting, max_line); - if (ret) - goto out; - } - - dst_cgc->values[dst_cgc->index - 1]->prev_name = strdup(CFS_PERIOD_US); - -out: - if (quota) - free(quota); - - return ret; -} - -int cgroup_convert_cpu_max_to_quota(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - char *token, *copy = NULL, *saveptr = NULL; - int ret; - - if (strlen(in_value) == 0) { - /* There's no value to convert. Populate the setting and return */ - return cgroup_add_value_string(dst_cgc, out_setting, NULL); - } - - copy = strdup(in_value); - if (!copy) - return ECGOTHER; - - token = strtok_r(copy, " ", &saveptr); - - if (strcmp(token, MAX) == 0) - ret = cgroup_add_value_string(dst_cgc, out_setting, "-1"); - else - ret = cgroup_add_value_string(dst_cgc, out_setting, token); - - if (copy) - free(copy); - - return ret; -} - -int cgroup_convert_cpu_max_to_period(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - char *token, *copy = NULL, *saveptr = NULL; - int ret; - - if (strlen(in_value) == 0) { - /* There's no value to convert. Populate the setting and return */ - return cgroup_add_value_string(dst_cgc, out_setting, NULL); - } - - copy = strdup(in_value); - if (!copy) - return ECGOTHER; - - token = strtok_r(copy, " ", &saveptr); - token = strtok_r(NULL, " ", &saveptr); - - ret = cgroup_add_value_string(dst_cgc, out_setting, token); - - if (copy) - free(copy); - - return ret; -} - -int cgroup_convert_cpu_nto1(struct cgroup_controller * const out_cgc, - struct cgroup_controller * const in_cgc) -{ - char *cfs_quota = NULL, *cfs_period = NULL; - char max_line[LL_MAX] = {0}; - int i, ret = 0; - - for (i = 0; i < in_cgc->index; i++) { - if (strcmp(in_cgc->values[i]->name, CFS_QUOTA_US) == 0) - cfs_quota = in_cgc->values[i]->value; - else if (strcmp(in_cgc->values[i]->name, CFS_PERIOD_US) == 0) - cfs_period = in_cgc->values[i]->value; - } - - if (cfs_quota && cfs_period) { - if (strcmp(cfs_quota, "-1") == 0) { - snprintf(max_line, LL_MAX, "%s %s", MAX, cfs_period); - max_line[LL_MAX - 1] = '\0'; - } else { - snprintf(max_line, LL_MAX, "%s %s", cfs_quota, cfs_period); - max_line[LL_MAX - 1] = '\0'; - } - - ret = cgroup_add_value_string(out_cgc, CPU_MAX, max_line); - if (ret) - goto out; - - ret = cgroup_remove_value(in_cgc, CFS_QUOTA_US); - if (ret) - goto out; - - ret = cgroup_remove_value(in_cgc, CFS_PERIOD_US); - if (ret) - goto out; - } - -out: - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/abstraction-cpuset.c b/lib/libcgroup-3.1.0/src/abstraction-cpuset.c deleted file mode 100644 index 745847050fd..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-cpuset.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup abstraction layer for the cpuset controller - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include "abstraction-common.h" - -#include -#include - -#include -#include -#include -#include -#include - -static const char * const MEMBER = "member"; -static const char * const ROOT = "root"; - -int cgroup_convert_cpuset_to_exclusive(struct cgroup_controller * const dst_cgc, - const char * const in_value, const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - int ret; - - if (strcmp(in_value, ROOT) == 0) - ret = cgroup_add_value_string(dst_cgc, out_setting, "1"); - else - ret = cgroup_add_value_string(dst_cgc, out_setting, "0"); - - return ret; -} - -int cgroup_convert_cpuset_to_partition(struct cgroup_controller * const dst_cgc, - const char * const in_value, - const char * const out_setting, - void *in_dflt, void *out_dflt) -{ - int ret; - - if (strcmp(in_value, "1") == 0) - ret = cgroup_add_value_string(dst_cgc, out_setting, ROOT); - else - ret = cgroup_add_value_string(dst_cgc, out_setting, MEMBER); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/abstraction-map.c b/lib/libcgroup-3.1.0/src/abstraction-map.c deleted file mode 100644 index 1735e364ea7..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-map.c +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup abstraction layer mappings - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include "abstraction-common.h" -#include "abstraction-map.h" - -#include -#include - -#include -#include -#include -#include -#include - -const struct cgroup_abstraction_map cgroup_v1_to_v2_map[] = { - /* cpu controller */ - {cgroup_convert_int, "cpu.shares", (void *)1024, "cpu.weight", (void *)100}, - {cgroup_convert_cpu_quota_to_max, "cpu.cfs_quota_us", NULL, "cpu.max", NULL}, - {cgroup_convert_cpu_period_to_max, "cpu.cfs_period_us", NULL, "cpu.max", NULL}, - {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL}, - - /* cpuset controller */ - {cgroup_convert_name_only, "cpuset.effective_cpus", NULL, "cpuset.cpus.effective", NULL}, - {cgroup_convert_name_only, "cpuset.effective_mems", NULL, "cpuset.mems.effective", NULL}, - {cgroup_convert_passthrough, "cpuset.cpus", NULL, "cpuset.cpus", NULL}, - {cgroup_convert_passthrough, "cpuset.mems", NULL, "cpuset.mems", NULL}, - {cgroup_convert_cpuset_to_partition, "cpuset.cpu_exclusive", NULL, - "cpuset.cpus.partition", NULL}, - {cgroup_convert_unmappable, "cpuset.mem_exclusive", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.mem_hardwall", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.memory_migrate", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.memory_pressure", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.mem_pressure_enabled", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.memory_spread_page", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.memory_spread_slab", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.sched_load_balance", NULL, NULL, NULL}, - {cgroup_convert_unmappable, "cpuset.sched_relax_domain_level", NULL, NULL, NULL}, -}; -const int cgroup_v1_to_v2_map_sz = sizeof(cgroup_v1_to_v2_map) / sizeof(cgroup_v1_to_v2_map[0]); - -const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = { - /* cpu controller */ - {cgroup_convert_int, "cpu.weight", (void *)100, "cpu.shares", (void *)1024}, - {cgroup_convert_cpu_max_to_quota, "cpu.max", NULL, "cpu.cfs_quota_us", NULL}, - {cgroup_convert_cpu_max_to_period, "cpu.max", NULL, "cpu.cfs_period_us", NULL}, - {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL}, - - /* cpuset controller */ - {cgroup_convert_name_only, "cpuset.cpus.effective", NULL, "cpuset.effective_cpus", NULL}, - {cgroup_convert_name_only, "cpuset.mems.effective", NULL, "cpuset.effective_mems", NULL}, - {cgroup_convert_passthrough, "cpuset.cpus", NULL, "cpuset.cpus", NULL}, - {cgroup_convert_passthrough, "cpuset.mems", NULL, "cpuset.mems", NULL}, - {cgroup_convert_cpuset_to_exclusive, "cpuset.cpus.partition", NULL, - "cpuset.cpu_exclusive", NULL}, -}; -const int cgroup_v2_to_v1_map_sz = sizeof(cgroup_v2_to_v1_map) / sizeof(cgroup_v2_to_v1_map[0]); diff --git a/lib/libcgroup-3.1.0/src/abstraction-map.h b/lib/libcgroup-3.1.0/src/abstraction-map.h deleted file mode 100644 index fd2409a2204..00000000000 --- a/lib/libcgroup-3.1.0/src/abstraction-map.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Libcgroup abstraction layer mappings - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#ifndef __ABSTRACTION_MAP -#define __ABSTRACTION_MAP - -#ifdef __cplusplus -extern "C" { -#endif - -struct cgroup_abstraction_map { - /* - * if the conversion isn't a one-to-one mapping or the mathematical - * conversion is unique, create a custom conversion function. - */ - int (*cgroup_convert)(struct cgroup_controller * const dst_cgc, const char * const in_value, - const char * const out_setting, void *in_dflt, void *out_dflt); - char *in_setting; - void *in_dflt; - char *out_setting; - void *out_dflt; -}; - -extern const struct cgroup_abstraction_map cgroup_v1_to_v2_map[]; -extern const int cgroup_v1_to_v2_map_sz; - -extern const struct cgroup_abstraction_map cgroup_v2_to_v1_map[]; -extern const int cgroup_v2_to_v1_map_sz; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __ABSTRACTION_MAP */ diff --git a/lib/libcgroup-3.1.0/src/api.c b/lib/libcgroup-3.1.0/src/api.c deleted file mode 100644 index f2991a40cbb..00000000000 --- a/lib/libcgroup-3.1.0/src/api.c +++ /dev/null @@ -1,6538 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright IBM Corporation. 2007 - * - * Author: Dhaval Giani - * Author: Balbir Singh - * - * TODOs: - * 1. Add more APIs for the control groups. - * 2. Handle the configuration related APIs. - * - * Code initiated and designed by Dhaval Giani. All faults are most likely - * his mistake. - * - * Bharata B Rao is willing is take blame - * for mistakes in APIs for reading statistics. - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -const struct cgroup_library_version library_version = { - .major = CGROUP_VER_MAJOR, - .minor = CGROUP_VER_MINOR, - .release = CGROUP_VER_RELEASE, -}; - -/* - * The errno which happend the last time (have to be thread specific) - */ -__thread int last_errno; - -#define MAXLEN 256 - -/* the value have to be thread specific */ -static __thread char errtext[MAXLEN]; - -/* Task command name length */ -#define TASK_COMM_LEN 16 - -/* Check if cgroup_init has been called or not. */ -static int cgroup_initialized; - -/* List of configuration rules */ -static struct cgroup_rule_list rl; - -/* Temporary list of configuration rules (for non-cache apps) */ -static struct cgroup_rule_list trl; - -/* Lock for the list of rules (rl) */ -static pthread_rwlock_t rl_lock = PTHREAD_RWLOCK_INITIALIZER; - -/* Cgroup v2 mount path. Null if v2 isn't mounted */ -char cg_cgroup_v2_mount_path[FILENAME_MAX]; - -/* Namespace */ -__thread char *cg_namespace_table[CG_CONTROLLER_MAX]; - -pthread_rwlock_t cg_mount_table_lock = PTHREAD_RWLOCK_INITIALIZER; -struct cg_mount_table_s cg_mount_table[CG_CONTROLLER_MAX]; - -/* Cgroup v2 mount paths, with empty controllers */ -struct cg_mount_point *cg_cgroup_v2_empty_mount_paths; - -#ifdef WITH_SYSTEMD -/* Default systemd path name. Length: .slice/.scope */ -char systemd_default_cgroup[FILENAME_MAX * 2 + 1]; -#endif - -const char * const cgroup_strerror_codes[] = { - "Cgroup is not compiled in", - "Cgroup is not mounted", - "Cgroup does not exist", - "Cgroup has not been created", - "Cgroup one of the needed subsystems is not mounted", - "Cgroup, request came in from non owner", - "Cgroup controllers are bound to different mount points", - "Cgroup, operation not allowed", - "Cgroup value set exceeds maximum", - "Cgroup controller already exists", - "Cgroup value already exists", - "Cgroup invalid operation", - "Cgroup, creation of controller failed", - "Cgroup operation failed", - "Cgroup not initialized", - "Cgroup, requested group parameter does not exist", - "Cgroup generic error", - "Cgroup values are not equal", - "Cgroup controllers are different", - "Cgroup parsing failed", - "Cgroup, rules file does not exist", - "Cgroup mounting failed", - "", /* 50022 is reserved for future errors */ - "End of File or iterator", - "Failed to parse config file", - "Have multiple paths for the same namespace", - "Controller in namespace does not exist", - "Either mount or namespace keyword has to be specified in the configuration file", - "This kernel does not support this feature", - "Value setting does not succeed", - "Failed to remove a non-empty group", - "Failed to convert from cgroup v1 to/from cgroup v2", -}; - -static const char * const cgroup_ignored_tasks_files[] = { "tasks", NULL }; - -#ifndef UNIT_TEST -static int cg_get_cgroups_from_proc_cgroups(pid_t pid, char *cgroup_list[], - char *controller_list[], int list_len); - -static int cgroupv2_get_subtree_control(const char *path, const char *ctrl_name, - bool * const enabled); -#endif - -static int cg_chown(const char *filename, uid_t owner, gid_t group) -{ - if (owner == NO_UID_GID) - owner = getuid(); - if (group == NO_UID_GID) - group = getgid(); - - return chown(filename, owner, group); -} -static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group) -{ - const char *filename = fts->fts_path; - int ret = 0; - - cgroup_dbg("chown: seeing file %s\n", filename); - switch (ent->fts_info) { - case FTS_ERR: - errno = ent->fts_errno; - break; - case FTS_D: - case FTS_DC: - case FTS_NSOK: - case FTS_NS: - case FTS_DNR: - case FTS_DP: - case FTS_F: - case FTS_DEFAULT: - ret = cg_chown(filename, owner, group); - break; - } - if (ret < 0) { - cgroup_warn("cannot change owner of file %s: %s\n", filename, strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - } - return ret; -} - -/* TODO: Need to decide a better place to put this function. */ -static int cg_chown_recursive(char **path, uid_t owner, gid_t group) -{ - int ret = 0; - FTS *fts; - - cgroup_dbg("chown: path is %s\n", *path); - fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); - if (fts == NULL) { - cgroup_warn("cannot open directory %s: %s\n", path, strerror(errno)); - last_errno = errno; - return ECGOTHER; - } - - while (1) { - FTSENT *ent; - - ent = fts_read(fts); - if (!ent) { - cgroup_warn("fts_read failed\n"); - break; - } - ret = cg_chown_file(fts, ent, owner, group); - } - fts_close(fts); - - return ret; -} - -int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask) -{ - mode_t mask = -1U; - struct stat buf; - int fd; - - fd = open(path, O_RDONLY); - if (fd == -1) - goto fail; - - if (owner_is_umask) { - mode_t umask, gmask, omask; - /* - * Use owner permissions as an umask for group and others - * permissions because we trust kernel to initialize owner - * permissions to something useful. Keep SUID and SGID bits. - */ - if (fstat(fd, &buf) == -1) - goto fail; - - /* 0700 == S_IRWXU */ - umask = 0700 & buf.st_mode; - gmask = umask >> 3; - omask = gmask >> 3; - - mask = umask|gmask|omask|S_ISUID|S_ISGID|S_ISVTX; - } - - if (fchmod(fd, mode & mask)) - goto fail; - - close(fd); - - return 0; - -fail: - cgroup_warn("cannot change permissions of file %s: %s\n", path, strerror(errno)); - last_errno = errno; - - if (fd > -1) - close(fd); - - return ECGOTHER; -} - -int cg_chmod_file(FTS *fts, FTSENT *ent, mode_t dir_mode, int dirm_change, mode_t file_mode, - int filem_change, int owner_is_umask) -{ - const char *filename = fts->fts_path; - int ret = 0; - - cgroup_dbg("chmod: seeing file %s\n", filename); - - switch (ent->fts_info) { - case FTS_ERR: - errno = ent->fts_errno; - break; - case FTS_D: - case FTS_DC: - case FTS_DNR: - case FTS_DP: - if (dirm_change) - ret = cg_chmod_path(filename, dir_mode, owner_is_umask); - break; - case FTS_F: - case FTS_NSOK: - case FTS_NS: - case FTS_DEFAULT: - if (filem_change) - ret = cg_chmod_path(filename, file_mode, owner_is_umask); - break; - } - - return ret; -} - -/** - * Changes permissions of all directories and control files (i.e. all files - * except files named in ignore_list. The list must be terminated with NULL. - */ -static int cg_chmod_recursive_controller(char *path, mode_t dir_mode, int dirm_change, - mode_t file_mode, int filem_change, int owner_is_umask, - const char * const *ignore_list) -{ - int final_ret = 0; - char *fts_path[2]; - int i, ignored; - int ret = 0; - FTS *fts; - - fts_path[0] = path; - fts_path[1] = NULL; - cgroup_dbg("chmod: path is %s\n", path); - - fts = fts_open(fts_path, FTS_PHYSICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); - if (fts == NULL) { - cgroup_warn("cannot open directory %s: %s\n", fts_path, strerror(errno)); - last_errno = errno; - return ECGOTHER; - } - - while (1) { - FTSENT *ent; - - ent = fts_read(fts); - if (!ent) { - if (errno != 0) { - cgroup_dbg("fts_read failed\n"); - last_errno = errno; - final_ret = ECGOTHER; - } - break; - } - - ignored = 0; - if (ignore_list != NULL) - for (i = 0; ignore_list[i] != NULL; i++) - if (!strcmp(ignore_list[i], ent->fts_name)) { - ignored = 1; - break; - } - if (ignored) - continue; - - ret = cg_chmod_file(fts, ent, dir_mode, dirm_change, file_mode, filem_change, - owner_is_umask); - if (ret) { - cgroup_warn("cannot change file mode %s: %s\n", fts_path, strerror(errno)); - last_errno = errno; - final_ret = ECGOTHER; - } - } - fts_close(fts); - - return final_ret; -} - -int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode, int dirm_change, mode_t file_mode, - int filem_change) -{ - int final_ret = 0; - char *path; - int i, ret; - - path = malloc(FILENAME_MAX); - if (!path) { - last_errno = errno; - return ECGOTHER; - } - for (i = 0; i < cgroup->index; i++) { - if (!cg_build_path(cgroup->name, path, cgroup->controller[i]->name)) { - final_ret = ECGFAIL; - break; - } - - ret = cg_chmod_recursive_controller(path, dir_mode, dirm_change, file_mode, - filem_change, 0, NULL); - if (ret) - final_ret = ret; - } - free(path); - - return final_ret; -} - -void cgroup_set_permissions(struct cgroup *cgroup, mode_t control_dperm, mode_t control_fperm, - mode_t task_fperm) -{ - if (!cgroup) { - /* ECGROUPNOTALLOWED */ - cgroup_err("Cgroup, operation not allowed\n"); - return; - } - - cgroup->control_dperm = control_dperm; - cgroup->control_fperm = control_fperm; - cgroup->task_fperm = task_fperm; -} - -static char *cgroup_basename(const char *path) -{ - char *tmp_string; - char *base; - - tmp_string = strdup(path); - - if (!tmp_string) - return NULL; - - base = strdup(basename(tmp_string)); - - free(tmp_string); - - return base; -} - -int cgroup_test_subsys_mounted(const char *name) -{ - int i; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - if (strncmp(cg_mount_table[i].name, name, sizeof(cg_mount_table[i].name)) == 0) { - pthread_rwlock_unlock(&cg_mount_table_lock); - return 1; - } - - /* - * The user has likely requested a file like cgroup.type or - * cgroup.procs. Allow this request as long as there's a - * cgroup v2 controller mounted. - */ - if (strncmp(name, CGROUP_FILE_PREFIX, strlen(CGROUP_FILE_PREFIX)) == 0 && - cg_mount_table[i].version == CGROUP_V2) { - pthread_rwlock_unlock(&cg_mount_table_lock); - return 1; - } - } - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return 0; -} - -/** - * Free a single cgroup_rule struct. - * @param r The rule to free from memory - */ -static void cgroup_free_rule(struct cgroup_rule *r) -{ - /* Loop variable */ - int i = 0; - - /* Make sure our rule is not NULL, first. */ - if (!r) { - cgroup_warn("attempted to free NULL rule\n"); - return; - } - if (r->procname) { - free(r->procname); - r->procname = NULL; - } - /* We must free any used controller strings, too. */ - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (r->controllers[i]) - free(r->controllers[i]); - } - - free(r); -} - -/** - * Free a list of cgroup_rule structs. If rl is the main list of rules, the - * lock must be taken for writing before calling this function! - * @param rl Pointer to the list of rules to free from memory - */ -static void cgroup_free_rule_list(struct cgroup_rule_list *cg_rl) -{ - /* Temporary pointer */ - struct cgroup_rule *tmp = NULL; - - /* Make sure we're not freeing NULL memory! */ - if (!(cg_rl->head)) { - cgroup_warn("attempted to free NULL list\n"); - return; - } - - while (cg_rl->head) { - tmp = cg_rl->head; - cg_rl->head = tmp->next; - cgroup_free_rule(tmp); - } - - /* Don't leave wild pointers around! */ - cg_rl->head = NULL; - cg_rl->tail = NULL; -} - -static char *cg_skip_unused_charactors_in_rule(char *rule) -{ - char *itr; - - /* We ignore anything after a # sign as comments. */ - itr = strchr(rule, '#'); - if (itr) - *itr = '\0'; - - /* We also need to remove the newline character. */ - itr = strchr(rule, '\n'); - if (itr) - *itr = '\0'; - - /* Now, skip any leading tabs and spaces. */ - itr = rule; - while (itr && isblank(*itr)) - itr++; - - /* If there's nothing left, we can ignore this line. */ - if (!strlen(itr)) - return NULL; - - return itr; -} - -/** - * Parse the options field in the rule from the cgrules configuration file - * - * @param options Comma-separated string of options - * @param rule The rule that will contain the parsed options - * @return 0 on success, -EINVAL if the options are invalid - * TODO: Make this function thread safe! - */ -STATIC int cgroup_parse_rules_options(char *options, struct cgroup_rule * const rule) -{ - char *stok_buff = NULL; - size_t cmp_len; - int ret = 0; - - stok_buff = strtok(options, ","); - if (!stok_buff) { - cgroup_err("failed to parse options: %s\n", options); - return -EINVAL; - } - - do { - cmp_len = min(strlen(stok_buff), strlen(CGRULE_OPTION_IGNORE)); - if (strlen(stok_buff) == strlen(CGRULE_OPTION_IGNORE) && - strncmp(stok_buff, CGRULE_OPTION_IGNORE, cmp_len) == 0) { - rule->is_ignore = true; - continue; - } - - /* - * "ignore" is the only currently supported option. - * Raise an error if we get here. - */ - cgroup_err("Unsupported option: %s\n", stok_buff); - ret = -EINVAL; - break; - } while ((stok_buff = strtok(NULL, ","))); - - return ret; -} -/** - * Parse the configuration file that maps UID/GIDs to cgroups. If ever the - * configuration file is modified, applications should call this function to - * load the new configuration rules. - * - * The function caller is responsible for calling free() on each rule in the - * list. - * - * The cache parameter alters the behavior of this function. If true, this - * function will read the entire configuration file and store the results in - * rl (global rules list). If false, this function will only parse until it - * finds a rule matching the given UID or GID. It will store this rule in - * trl, as well as any children rules (rules that begin with a %) that it has. - * - * This function is NOT thread safe! - * @param filename configuration file to parse - * @param cache True to cache rules, else false - * @param muid If cache is false, the UID to match against - * @param mgid If cache is false, the GID to match against - * @return 0 on success, -1 if no cache and match found, > 0 on error. - * TODO: Make this function thread safe! - * - */ -static int cgroup_parse_rules_file(char *filename, bool cache, uid_t muid, gid_t mgid, - const char *mprocname) -{ - /* File descriptor for the configuration file */ - FILE *fp = NULL; - - /* Buffer to store the line we're working on */ - char buff[CGROUP_RULE_MAXLINE] = { '\0' }; - - /* Iterator for the line we're working on */ - char *itr = NULL; - - /* Pointer to process name in a line of the configuration file */ - char *procname = NULL; - - /* Pointer to the list that we're using */ - struct cgroup_rule_list *lst = NULL; - - /* Rule to add to the list */ - struct cgroup_rule *newrule = NULL; - - /* Structure to get GID from group name */ - struct group *grp; - - /* Structure to get UID from user name */ - struct passwd *pwd; - - /* Temporary storage for a configuration rule */ - char key[CGROUP_RULE_MAXKEY] = { '\0' }; - char user[LOGIN_NAME_MAX] = { '\0' }; - char controllers[CG_CONTROLLER_MAX] = { '\0' }; - char destination[FILENAME_MAX] = { '\0' }; - char options[CG_OPTIONS_MAX] = { '\0' }; - uid_t uid = CGRULE_INVALID; - gid_t gid = CGRULE_INVALID; - bool has_options = false; - size_t len_username; - int len_procname; - - /* The current line number */ - unsigned int linenum = 0; - - /* Did we skip the previous line? */ - bool skipped = false; - - /* Have we found a matching rule (non-cache mode)? */ - bool matched = false; - - /* Return codes */ - int ret = 0; - - /* Temporary buffer for strtok() */ - char *stok_buff = NULL; - - /* Loop variable. */ - int i = 0; - - /* Determine which list we're using. */ - if (cache) - lst = &rl; - else - lst = &trl; - - /* Open the configuration file. */ - fp = fopen(filename, "re"); - if (!fp) { - cgroup_warn("failed to open configuration file %s: %s\n", filename, - strerror(errno)); - - /* originally ret = 0, but this is parse fail, not success */ - ret = ECGRULESPARSEFAIL; - goto finish; - } - - /* Now, parse the configuration file one line at a time. */ - cgroup_dbg("Parsing configuration file %s.\n", filename); - while (fgets(buff, sizeof(buff), fp) != NULL) { - linenum++; - - itr = cg_skip_unused_charactors_in_rule(buff); - if (!itr) - continue; - - /* - * If we skipped the last rule and this rule is a continuation - * of it (begins with %), then we should skip this rule too. - */ - if (skipped && *itr == '%') { - cgroup_warn("skipped child of invalid rule, line %d.\n", linenum); - continue; - } - - /* clear the buffer. */ - grp = NULL; - pwd = NULL; - - /* - * If there is something left, it should be a rule. Otherwise, - * there's an error in the configuration file. - */ - skipped = false; - i = sscanf(itr, "%s%s%s%s", key, controllers, destination, options); - if (i < 3) { - cgroup_err("failed to parse configuration file on line %d\n", linenum); - goto parsefail; - } else if (i == 3) { - has_options = false; - } else if (i == 4) { - has_options = true; - } - - procname = strchr(key, ':'); - if (procname) { - /* : */ - procname++; /* skip ':' */ - len_username = procname - key - 1; - len_procname = strlen(procname); - if (len_procname < 0) { - cgroup_err("failed to parse configuration file on line %d\n", - linenum); - goto parsefail; - } - } else { - len_username = strlen(key); - len_procname = 0; - } - len_username = min(len_username, sizeof(user) - 1); - memset(user, '\0', sizeof(user)); - strncpy(user, key, len_username); - user[sizeof(user) - 1] = '\0'; - - /* - * Next, check the user/group. If it's a % sign, then we are - * continuing another rule and UID/GID should not be reset. - * If it's a @, we're dealing with a GID rule. If it's a *, - * then we do not need to do a lookup because the rule always - * applies (it's a wildcard). If we're using non-cache mode - * and we've found a matching rule, we only continue to parse - * if we're looking at a child rule. - */ - if ((!cache) && matched && (strncmp(user, "%", 1) != 0)) { - /* If we make it here, we finished (non-cache). */ - cgroup_dbg("Parsing of configuration file complete.\n\n"); - ret = -1; - goto close; - } - if (strncmp(user, "@", 1) == 0) { - /* New GID rule. */ - itr = &(user[1]); - grp = getgrnam(itr); - if (grp) { - uid = CGRULE_INVALID; - gid = grp->gr_gid; - } else { - cgroup_warn("Entry for %s not found. Skipping rule on line %d.\n", - itr, linenum); - skipped = true; - continue; - } - } else if (strncmp(user, "*", 1) == 0) { - /* Special wildcard rule. */ - uid = CGRULE_WILD; - gid = CGRULE_WILD; - } else if (*itr != '%') { - /* New UID rule. */ - pwd = getpwnam(user); - if (pwd) { - uid = pwd->pw_uid; - gid = CGRULE_INVALID; - } else { - cgroup_warn("Entry for %s not found. Skipping rule on line %d.\n", - user, linenum); - skipped = true; - continue; - } - } /* Else, we're continuing another rule (UID/GID are okay). */ - - /* - * If we are not caching rules, then we need to check for a - * match before doing anything else. We consider four cases: - * 1. The UID matches - * 2. The GID matches - * 3. The UID is a member of the GID, or - * 4. We're looking at the wildcard rule, which always matches. - * If none of these are true, we simply continue to the next - * line in the file. - */ - if (grp && muid != CGRULE_INVALID) { - pwd = getpwuid(muid); - if (!pwd) - continue; - - for (i = 0; grp->gr_mem[i]; i++) { - if (!(strcmp(pwd->pw_name, grp->gr_mem[i]))) - matched = true; - } - } - - if (uid == muid || gid == mgid || uid == CGRULE_WILD) - matched = true; - - if (!cache) { - if (!matched) - continue; - if (len_procname) { - char *mproc_base; - /* - * If there is a rule based on process name, - * it should be matched with mprocname. - */ - if (!mprocname) { - uid = CGRULE_INVALID; - gid = CGRULE_INVALID; - matched = false; - continue; - } - - mproc_base = cgroup_basename(mprocname); - if (strcmp(mprocname, procname) && strcmp(mproc_base, procname)) { - uid = CGRULE_INVALID; - gid = CGRULE_INVALID; - matched = false; - free(mproc_base); - continue; - } - free(mproc_base); - } - } - - /* - * Now, we're either caching rules or we found a match. - * Either way, copy everything into a new rule and push it - * into the list. - */ - newrule = calloc(1, sizeof(struct cgroup_rule)); - if (!newrule) { - cgroup_err("out of memory? Error was: %s\n", strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - goto close; - } - - newrule->uid = uid; - newrule->gid = gid; - newrule->is_ignore = false; - - len_username = min(len_username, sizeof(newrule->username) - 1); - strncpy(newrule->username, user, len_username); - newrule->username[sizeof(newrule->username) - 1] = '\0'; - - if (len_procname) { - newrule->procname = strdup(procname); - if (!newrule->procname) { - cgroup_err("strdup failed to allocate memory %s\n", - strerror(errno)); - free(newrule); - last_errno = errno; - ret = ECGOTHER; - goto close; - } - } else { - newrule->procname = NULL; - } - strncpy(newrule->destination, destination, sizeof(newrule->destination) - 1); - newrule->destination[sizeof(newrule->destination) - 1] = '\0'; - - if (has_options) { - ret = cgroup_parse_rules_options(options, newrule); - if (ret < 0) - goto destroyrule; - } - - newrule->next = NULL; - - /* Parse the controller list, and add that to newrule too. */ - stok_buff = strtok(controllers, ","); - if (!stok_buff) { - cgroup_err("failed to parse controllers on line %d\n", linenum); - goto destroyrule; - } - - i = 0; - do { - if (i >= MAX_MNT_ELEMENTS) { - cgroup_err("too many controllers listed on line %d\n", linenum); - goto destroyrule; - } - - newrule->controllers[i] = - strndup(stok_buff, strlen(stok_buff) + 1); - if (!(newrule->controllers[i])) { - cgroup_err("out of memory? Error was: %s\n", strerror(errno)); - goto destroyrule; - } - i++; - } while ((stok_buff = strtok(NULL, ","))); - - /* Now, push the rule. */ - if (lst->head == NULL) { - lst->head = newrule; - lst->tail = newrule; - } else { - lst->tail->next = newrule; - lst->tail = newrule; - } - - cgroup_dbg("Added rule %s (UID: %d, GID: %d) -> %s for controllers:", - lst->tail->username, lst->tail->uid, lst->tail->gid, - lst->tail->destination); - - for (i = 0; lst->tail->controllers[i]; i++) - cgroup_dbg(" %s", lst->tail->controllers[i]); - cgroup_dbg("\n"); - } - - /* If we make it here, there were no errors. */ - cgroup_dbg("Parsing of configuration file complete.\n\n"); - ret = (matched && !cache) ? -1 : 0; - goto close; - -destroyrule: - cgroup_free_rule(newrule); - -parsefail: - ret = ECGRULESPARSEFAIL; - -close: - fclose(fp); -finish: - return ret; -} - -/** - * Parse CGRULES_CONF_FILE and all files in CGRULES_CONF_FILE_DIR. - * If CGRULES_CONF_FILE_DIR does not exists or can not be read, parse only - * CGRULES_CONF_FILE. This way we keep the back compatibility. - * - * Original description of this function moved to cgroup_parse_rules_file. - * Also cloned and all occurences of file changed to files. - * - * Parse the configuration files that maps UID/GIDs to cgroups. If ever the - * configuration files are modified, applications should call this function to - * load the new configuration rules. The function caller is responsible for - * calling free() on each rule in the list. - * - * The cache parameter alters the behavior of this function. If true, this - * function will read the entire content of all configuration files and store - * the results in rl (global rules list). If false, this function will only - * parse until it finds a file and a rule matching the given UID or GID. - * The remaining files are skipped. It will store this rule in trl, as well as - * any children rules (rules that begin with a %) that it has. - * - * Files can be read in an random order so the first match must not be - * dependent on it. Thus construct the rules the way not to break this - * assumption. - * - * This function is NOT thread safe! - * @param cache True to cache rules, else false - * @param muid If cache is false, the UID to match against - * @param mgid If cache is false, the GID to match against - * @return 0 on success, -1 if no cache and match found, > 0 on error. - * TODO: Make this function thread safe! - */ -static int cgroup_parse_rules(bool cache, uid_t muid, gid_t mgid, const char *mprocname) -{ - /* Pointer to the list that we're using */ - struct cgroup_rule_list *lst = NULL; - - /* Directory variables */ - const char *dirname = CGRULES_CONF_DIR; - struct dirent *item; - char *tmp; - int sret; - DIR *d; - - int ret; - - /* Determine which list we're using. */ - if (cache) - lst = &rl; - else - lst = &trl; - - /* If our list already exists, clean it. */ - if (lst->head) - cgroup_free_rule_list(lst); - - pthread_rwlock_wrlock(&rl_lock); - - /* Parse CGRULES_CONF_FILE configuration file (back compatibility). */ - ret = cgroup_parse_rules_file(CGRULES_CONF_FILE, cache, muid, mgid, mprocname); - - /* - * if match (ret = -1), stop parsing other files, - * just return or ret > 0 => error - */ - if (ret != 0) { - pthread_rwlock_unlock(&rl_lock); - return ret; - } - - /* Continue parsing */ - d = opendir(dirname); - if (!d) { - cgroup_warn("Failed to open directory %s: %s\n", dirname, strerror(errno)); - - /* - * Cannot read directory. However, CGRULES_CONF_FILE is - * succesfully parsed. Thus return as a success for back - * compatibility. - */ - pthread_rwlock_unlock(&rl_lock); - - return 0; - } - - /* Read all files from CGRULES_CONF_FILE_DIR */ - do { - item = readdir(d); - if (item && (item->d_type == DT_REG || item->d_type == DT_LNK)) { - - sret = asprintf(&tmp, "%s/%s", dirname, item->d_name); - if (sret < 0) { - cgroup_err("Out of memory\n"); - - /* - * Cannot read directory. - * However, CGRULES_CONF_FILE is succesfully - * parsed. Thus return as a success for back - * compatibility. - */ - ret = 0; - goto unlock_list; - } - - cgroup_dbg("Parsing cgrules file: %s\n", tmp); - ret = cgroup_parse_rules_file(tmp, cache, muid, mgid, mprocname); - - free(tmp); - - /* Match with cache disabled? */ - if (ret != 0) - goto unlock_list; - } - if (!item && errno) { - cgroup_warn("cannot read %s: %s\n", dirname, strerror(errno)); - /* - * Cannot read an item. - * But continue for back compatibility as a success. - */ - ret = 0; - goto unlock_list; - } - } while (item != NULL); - -unlock_list: - closedir(d); - pthread_rwlock_unlock(&rl_lock); - - return ret; -} - -int cg_add_duplicate_mount(struct cg_mount_table_s *item, const char *path) -{ - struct cg_mount_point *mount, *it; - - mount = malloc(sizeof(struct cg_mount_point)); - if (!mount) { - last_errno = errno; - return ECGOTHER; - } - mount->next = NULL; - - strncpy(mount->path, path, sizeof(mount->path)); - mount->path[sizeof(mount->path)-1] = '\0'; - - /* - * Add the mount point to the end of the list. Assuming the list is - * short, no optimization is done. - */ - it = &item->mount; - while (it->next) - it = it->next; - - it->next = mount; - - return 0; -} - -/* - * Tries to find if any controller in cg_mount_table have already mounted on - * the mount_path and if mounted sets the matching controller idx share_mnt - * flag and Return 1 or 0 otherwise. - */ -static int cgroup_set_cg_mnt_tbl_shared_mnt(char *mount_path, int *mnt_tbl_idx) -{ - int i, shared_mnt = 0; - - /* Check if controllers share mount points */ - for (i = 0; i < *mnt_tbl_idx; i++) { - if (strncmp(mount_path, cg_mount_table[i].mount.path, FILENAME_MAX) == 0) { - cg_mount_table[i].shared_mnt = 1; - shared_mnt = 1; - break; - } - } - - return shared_mnt; -} - -static void cgroup_cg_mount_table_append(const char *name, const char *mount_path, - enum cg_version_t version, int *mnt_tbl_idx, - const char *mnt_opts, int shared_mnt) -{ - int i = *mnt_tbl_idx; - - strncpy(cg_mount_table[i].name, name, CONTROL_NAMELEN_MAX); - cg_mount_table[i].name[CONTROL_NAMELEN_MAX-1] = '\0'; - - strncpy(cg_mount_table[i].mount.path, mount_path, FILENAME_MAX); - cg_mount_table[i].mount.path[FILENAME_MAX-1] = '\0'; - - cg_mount_table[i].shared_mnt = shared_mnt; - cg_mount_table[i].version = version; - cg_mount_table[i].mount.next = NULL; - - cgroup_dbg("Found cgroup option %s, count %d\n", mnt_opts, i); - - (*mnt_tbl_idx)++; -} - -/** - * Process a cgroup v1 mount and add it to cg_mount_table if it's not a - * duplicate. - * - * @param controllers List of controllers from /proc/cgroups - * @param ent File system description of cgroup mount being processed - * @param mnt_tbl_idx cg_mount_table index - */ -STATIC int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent, int *mnt_tbl_idx) -{ - char *strtok_buffer = NULL, *mntopt = NULL; - int shared_mnt, duplicate; - int i, j, ret = 0; - char c = 0; - - for (i = 0; controllers[i] != NULL; i++) { - mntopt = hasmntopt(ent, controllers[i]); - - if (!mntopt) - continue; - - c = mntopt[strlen(controllers[i])]; - - if (c != '\0' && c != ',') - continue; - - cgroup_dbg("found %s in %s\n", controllers[i], ent->mnt_opts); - - /* Check if controllers share mount points */ - shared_mnt = cgroup_set_cg_mnt_tbl_shared_mnt(ent->mnt_dir, mnt_tbl_idx); - - /* Do not have duplicates in mount table */ - duplicate = 0; - for (j = 0; j < *mnt_tbl_idx; j++) { - if (strncmp(controllers[i], cg_mount_table[j].name, FILENAME_MAX) == 0) { - duplicate = 1; - break; - } - } - - if (duplicate) { - cgroup_dbg("controller %s is already mounted on %s\n", mntopt, - cg_mount_table[j].mount.path); - ret = cg_add_duplicate_mount(&cg_mount_table[j], ent->mnt_dir); - if (ret) - goto out; - /* Continue with next controller */ - continue; - } - - cgroup_cg_mount_table_append(controllers[i], ent->mnt_dir, CGROUP_V1, mnt_tbl_idx, - ent->mnt_opts, shared_mnt); - - if ((*mnt_tbl_idx) >= CG_CONTROLLER_MAX) - goto out; - } - - /* Doesn't match the controller. Check if it is a named hierarchy. */ - mntopt = hasmntopt(ent, "name"); - - if (mntopt) { - mntopt = strtok_r(mntopt, ",", &strtok_buffer); - if (!mntopt) - goto out; - -#ifdef OPAQUE_HIERARCHY - /* Ignore the opaque hierarchy. */ - if (strcmp(mntopt, OPAQUE_HIERARCHY) == 0) - goto out; -#endif - /* Check if controllers share mount points */ - shared_mnt = cgroup_set_cg_mnt_tbl_shared_mnt(ent->mnt_dir, mnt_tbl_idx); - - /* Check if it is a duplicate */ - duplicate = 0; - for (j = 0; j < *mnt_tbl_idx; j++) { - if (strncmp(mntopt, cg_mount_table[j].name, FILENAME_MAX) == 0) { - duplicate = 1; - break; - } - } - - if (duplicate) { - cgroup_dbg("controller %s is already mounted on %s\n", mntopt, - cg_mount_table[j].mount.path); - ret = cg_add_duplicate_mount(&cg_mount_table[j], ent->mnt_dir); - goto out; - } - - cgroup_cg_mount_table_append(mntopt, ent->mnt_dir, CGROUP_V1, mnt_tbl_idx, - ent->mnt_opts, shared_mnt); - } - -out: - return ret; -} - -/** - * Process a cgroup v2 mount and add it to cg_mount_table if it's not a - * duplicate. - * - * @param ent File system description of cgroup mount being processed - * @param mnt_tbl_idx cg_mount_table index - */ -STATIC int cgroup_process_v2_mnt(struct mntent *ent, int *mnt_tbl_idx) -{ - char *ret_c = NULL, line[CGV2_CONTROLLERS_LL_MAX], *stok_buff = NULL; - char *controller = NULL, *controllers = NULL; - char cgroup_controllers_path[FILENAME_MAX]; - int ret = 0, i, duplicate, shared_mnt; - FILE *fp = NULL; - - /* - * Save off this mount point. This may be used later to - * build the cg_path. - */ - strncpy(cg_cgroup_v2_mount_path, ent->mnt_dir, FILENAME_MAX-1); - cg_cgroup_v2_mount_path[FILENAME_MAX-1] = '\0'; - - /* determine what v2 controllers are available on this mount */ - snprintf(cgroup_controllers_path, FILENAME_MAX, "%s/%s", ent->mnt_dir, - CGV2_CONTROLLERS_FILE); - - fp = fopen(cgroup_controllers_path, "re"); - if (!fp) { - ret = ECGOTHER; - goto out; - } - - ret_c = fgets(line, CGV2_CONTROLLERS_LL_MAX, fp); - if (ret_c == NULL) { - struct cg_mount_point *tmp, *t; - - ret = ECGEOF; - - tmp = malloc(sizeof(struct cg_mount_point)); - if (tmp == NULL) { - last_errno = errno; - ret = ECGOTHER; - goto out; - } - - strncpy(tmp->path, cg_cgroup_v2_mount_path, sizeof(tmp->path) - 1); - tmp->path[sizeof(tmp->path)-1] = '\0'; - tmp->next = NULL; - - t = cg_cgroup_v2_empty_mount_paths; - if (t == NULL) { - cg_cgroup_v2_empty_mount_paths = tmp; - goto out; - } - - while(t->next != NULL) - t = t->next; - t->next = tmp; - - goto out; - } - - /* Remove the trailing newline */ - ret_c[strlen(ret_c) - 1] = '\0'; - - /* - * The "cgroup" controller is a pseudo-controller that has settings that a user may - * wish to read/modify. Add it to our cg_mount_table so that it can be manipulated - * like other "normal" controllers - */ - controllers = malloc(strlen(ret_c) + strlen(CGROUP_FILE_PREFIX) + 2); - if (!controllers) { - ret = ECGOTHER; - goto out; - } - - sprintf(controllers, "%s %s", ret_c, CGROUP_FILE_PREFIX); - - /* - * cgroup.controllers returns a list of available controllers in - * the following format: - * cpuset cpu io memory pids rdma - */ - controller = strtok_r(controllers, " ", &stok_buff); - do { - /* Check if controllers share mount points */ - shared_mnt = cgroup_set_cg_mnt_tbl_shared_mnt(ent->mnt_dir, mnt_tbl_idx); - - /* Do not have duplicates in mount table */ - duplicate = 0; - for (i = 0; i < *mnt_tbl_idx; i++) { - if (strncmp(cg_mount_table[i].name, controller, FILENAME_MAX) == 0) { - duplicate = 1; - break; - } - } - - if (duplicate) { - cgroup_dbg("controller %s is already mounted on %s\n", controller, - cg_mount_table[i].mount.path); - - ret = cg_add_duplicate_mount(&cg_mount_table[i], ent->mnt_dir); - if (ret) - break; - - continue; - } - - /* This controller is not in the mount table. add it */ - cgroup_cg_mount_table_append(controller, ent->mnt_dir, CGROUP_V2, mnt_tbl_idx, - controller, shared_mnt); - - if ((*mnt_tbl_idx) >= CG_CONTROLLER_MAX) - goto out; - } while ((controller = strtok_r(NULL, " ", &stok_buff))); - -out: - if (fp) - fclose(fp); - - if (controllers) - free(controllers); - - return ret; -} - -/* - * Free global variables filled by previous cgroup_init(). This function - * should be called with cg_mount_table_lock taken. - */ -static void cgroup_free_cg_mount_table(void) -{ - struct cg_mount_point *mount, *tmp; - int i; - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - mount = cg_mount_table[i].mount.next; - - while (mount) { - tmp = mount; - mount = mount->next; - free(tmp); - } - } - - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(&cg_cgroup_v2_mount_path, 0, sizeof(cg_cgroup_v2_mount_path)); - memset(&cg_cgroup_v2_empty_mount_paths, 0, sizeof(cg_cgroup_v2_empty_mount_paths)); -} - -/* - * Parses the mount options of the given mount point and checks for the - * option in the list of mount options and sets is_set accordingly. - * @mnt: Mount point name to search for mount points. - * @mnt_opt: Mount option to be searched. - * @is_set: Set to 1, when mount option is found, 0 otherwise. - * - * Returns 0, in case of success and ECGOTHER on failure. - */ -static int check_mount_point_opt(const char *mnt, const char *mnt_opt, int * const is_set) -{ - struct mntent *ent, *temp_ent = NULL; - char mntent_buffer[4 * FILENAME_MAX]; - char *mntopt = NULL; - char mnt_opt_delim; - FILE *proc_mount; - int ret = 0; - - if (!mnt || !mnt_opt || !is_set) - return ECGINVAL; - - proc_mount = setmntent(mnt, "r"); - if (!proc_mount) { - cgroup_err("cannot open %s: %s\n", mnt, strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - temp_ent = (struct mntent *) malloc(sizeof(struct mntent)); - if (!temp_ent) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - ent = getmntent_r(proc_mount, temp_ent, mntent_buffer, sizeof(mntent_buffer)); - if (!ent) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - *is_set = 0; - while((mntopt = hasmntopt(ent, mnt_opt))) { - mnt_opt_delim = mntopt[strlen(mnt_opt)]; - if (mnt_opt_delim == '\0' || mnt_opt_delim == ',') { - *is_set = 1; - break; - } - } - - if (*is_set == 0) { - cgroup_dbg("%s, not found in the list of ", mnt_opt); - cgroup_cont("mount options of %s\n", mnt); - } - -err: - if (proc_mount) - endmntent(proc_mount); - - if (temp_ent) - free(temp_ent); - - return ret; -} - -/* - * Reads /proc/cgroups and populates the controllers/subsys_name. This - * function should be called with cg_mount_table_lock taken. - */ -static int cgroup_populate_controllers(char *controllers[CG_CONTROLLER_MAX]) -{ - int hierarchy, num_cgroups, enabled; - char subsys_name[FILENAME_MAX]; - char mnt_opt[] = "subset=pid"; - FILE *proc_cgroup; - char *buf = NULL; - int mnt_opt_set; - int ret = 0; - int err, i = 0; - - proc_cgroup = fopen("/proc/cgroups", "re"); - if (!proc_cgroup) { - cgroup_warn("cannot open /proc/cgroups: %s\n", strerror(errno)); - ret = check_mount_point_opt("/proc/self/mounts", mnt_opt, &mnt_opt_set); - if (ret) - goto err; - - if (!mnt_opt_set) - ret = ECGINVAL; - /* - * /proc, mounted with subset=pid is valid. cgroup v2 doesn't - * depend on /proc/cgroups to parse the available controllers. - */ - goto err; - } - - /* - * The first line of the file has stuff we are not interested in. - * So just read it and discard the information. - */ - buf = malloc(CGV2_CONTROLLERS_LL_MAX); - if (!buf) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - if (!fgets(buf, CGV2_CONTROLLERS_LL_MAX, proc_cgroup)) { - cgroup_err("cannot read /proc/cgroups: %s\n", strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - while (!feof(proc_cgroup)) { - /* - * check Linux Kernel sources/kernel/cgroup/cgroup.c cgroup_init_early(), - * MAX_CGROUP_TYPE_NAMELEN check for details on why 32 is used. - */ - err = fscanf(proc_cgroup, "%32s %d %d %d", subsys_name, &hierarchy, &num_cgroups, - &enabled); - if (err < 0) - break; - - controllers[i] = strdup(subsys_name); - if (controllers[i] == NULL) { - last_errno = errno; - ret = ECGOTHER; - break; - } - i++; - } - -err: - if (proc_cgroup) - fclose(proc_cgroup); - - if (buf) - free(buf); - - if (ret != 0) { - for (i = 0; controllers[i]; i++) { - free(controllers[i]); - controllers[i] = NULL; - } - } - - return ret; -} - -/* - * Reads /proc/self/mounts and populates the cgroup v1/v2 mount points into the - * global cg_mount_table. - * This function should be called with cg_mount_table_lock taken. - */ -static int cgroup_populate_mount_points(char *controllers[CG_CONTROLLER_MAX]) -{ - char mntent_buffer[4 * FILENAME_MAX]; - struct mntent *ent, *temp_ent = NULL; - int found_mnt = 0; - FILE *proc_mount; - int ret = 0; - - proc_mount = fopen("/proc/self/mounts", "re"); - if (proc_mount == NULL) { - cgroup_err("cannot open /proc/self/mounts: %s\n", strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - temp_ent = (struct mntent *) malloc(sizeof(struct mntent)); - if (!temp_ent) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - while ((ent = getmntent_r(proc_mount, temp_ent, mntent_buffer, - sizeof(mntent_buffer))) != NULL) { - - if (strcmp(ent->mnt_type, "cgroup") == 0) { - if (controllers[0] == NULL) { - cgroup_err("cgroup v1 requires /proc/cgroups, check if /proc "); - cgroup_cont("is mounted with subset=pid option.\n"); - ret = ECGINVAL; - goto err; - } - - ret = cgroup_process_v1_mnt(controllers, ent, &found_mnt); - if (ret) - goto err; - - if (found_mnt >= CG_CONTROLLER_MAX) - break; - - continue; - } - - if (strcmp(ent->mnt_type, "cgroup2") == 0) { - ret = cgroup_process_v2_mnt(ent, &found_mnt); - if (ret == ECGEOF) { - /* The controllers file was empty. Ignore and move on. */ - ret = 0; - continue; - } - - if (ret) - goto err; - - if (found_mnt >= CG_CONTROLLER_MAX) - break; - } - } - - if (!found_mnt) - ret = ECGROUPNOTMOUNTED; - - if (found_mnt >= CG_CONTROLLER_MAX) { - cgroup_err("Mount points exceeds CG_CONTROLLER_MAX"); - ret = ECGMAXVALUESEXCEEDED; - /* - * There are loops in the libcgroup codebase that expect - * there to be a null name entry at the end of the - * cg_mount_table[]. - */ - cg_mount_table[CG_CONTROLLER_MAX - 1].name[0] = '\0'; - } - -err: - if (proc_mount) - fclose(proc_mount); - - if (temp_ent) - free(temp_ent); - - return ret; -} - -/** - * cgroup_init(), initializes the MOUNT_POINT. - * - * This code is theoretically thread safe now. Its not really tested so it can - * blow up. If does for you, please let us know with your test case and we can - * really make it thread safe. - */ -int cgroup_init(void) -{ - static char *controllers[CG_CONTROLLER_MAX]; - int ret = 0; - int i; - - cgroup_set_default_logger(-1); - - pthread_rwlock_wrlock(&cg_mount_table_lock); - - /* Free global variables filled by previous cgroup_init() */ - cgroup_free_cg_mount_table(); - - ret = cgroup_populate_controllers(controllers); - if (ret) - goto unlock_exit; - - ret = cgroup_populate_mount_points(controllers); - if (ret) - goto unlock_exit; - - cgroup_initialized = 1; - -unlock_exit: - for (i = 0; controllers[i]; i++) { - free(controllers[i]); - controllers[i] = NULL; - } - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} - -static int cg_test_mounted_fs(void) -{ - char mntent_buff[4 * FILENAME_MAX]; - struct mntent *temp_ent = NULL; - struct mntent *ent = NULL; - FILE *proc_mount = NULL; - int ret = 1; - - proc_mount = fopen("/proc/self/mounts", "re"); - if (proc_mount == NULL) - return 0; - - temp_ent = (struct mntent *) malloc(sizeof(struct mntent)); - if (!temp_ent) { - /* We just fail at the moment. */ - fclose(proc_mount); - return 0; - } - - ent = getmntent_r(proc_mount, temp_ent, mntent_buff, sizeof(mntent_buff)); - if (!ent) { - ret = 0; - goto done; - } - - while (strcmp(ent->mnt_type, "cgroup") != 0 && - strcmp(ent->mnt_type, "cgroup2") != 0) { - ent = getmntent_r(proc_mount, temp_ent, mntent_buff, sizeof(mntent_buff)); - if (ent == NULL) { - ret = 0; - goto done; - } - } -done: - fclose(proc_mount); - free(temp_ent); - - return ret; -} - -static inline pid_t cg_gettid(void) -{ - return syscall(__NR_gettid); -} - -static char *cg_concat_path(const char *pref, const char *suf, char *path) -{ - if ((suf[strlen(suf)-1] == '/') || ((strlen(suf) == 0) && (pref[strlen(pref)-1] == '/'))) - snprintf(path, FILENAME_MAX, "%s%s", pref, suf+((suf[0] == '/') ? 1 : 0)); - else - snprintf(path, FILENAME_MAX, "%s%s/", pref, suf+((suf[0] == '/') ? 1 : 0)); - - path[FILENAME_MAX-1] = '\0'; - - return path; -} - -/* Call with cg_mount_table_lock taken */ -/* path value have to have size at least FILENAME_MAX */ -char *cg_build_path_locked(const char *name, char *path, const char *type) -{ - /* - * len is the allocation size for path, that stores: - * cg_mount_table[i].mount.path + '/' + cg_namespace_table[i] + '/' - */ - int i, ret, len = (FILENAME_MAX * 2) + 2; - char *tmp_systemd_default_cgroup, *_path = NULL; - - /* - * systemd_default_cgroup can't be clobbered. The user may pass - * multiple cgroups, hence use temporary variable for manipulations - * for example: - * cgget -g cpu:/ -g cpu:cgrp1 -g cpu:/cgrp2 - */ - tmp_systemd_default_cgroup = calloc(1, (sizeof(char) * len)); - if (!tmp_systemd_default_cgroup) { - cgroup_err("Failed to allocate memory for tmp_systemd_default_cgroup\n"); - goto out; - } - -#ifdef WITH_SYSTEMD - /* - * If the user specifies the name as /, they are - * effectively overriding the systemd_default_cgroup but if the name - * is "/", the cgroup root path is systemd_default_cgroup - */ - if (strlen(systemd_default_cgroup) && name && name[0] == '/' && name[1] != '\0') - tmp_systemd_default_cgroup[0] = '\0'; - else - snprintf(tmp_systemd_default_cgroup, len, "%s/", systemd_default_cgroup); - - /* allocate more space for systemd_default_cgroup + '/' */ - len += (FILENAME_MAX + 1); -#endif - /* - * Recent gcc are unhappy when sizeof(dest) <= sizeof(src) with - * snprintf()'s. Alternative is to use multiple strncpy()/strcat(), - * work around it by allocating large temporary buffer _path and - * copying the constructed _path into path. - */ - _path = malloc(len); - if (!_path) { - cgroup_err("Failed to allocate memory for _path\n"); - goto out; - } - - /* - * If no type is specified, and there's a valid cgroup v2 mount, then - * build up a path to this mount (and cgroup name if supplied). - * This can be used to create a cgroup v2 cgroup that's not attached to - * any controller. - */ - if (!type && strlen(cg_cgroup_v2_mount_path) > 0) { - ret = snprintf(_path, len, "%s/%s", cg_cgroup_v2_mount_path, - tmp_systemd_default_cgroup); - if (ret >= FILENAME_MAX) - cgroup_dbg("filename too long: %s", _path); - - strncpy(path, _path, FILENAME_MAX - 1); - path[FILENAME_MAX - 1] = '\0'; - - if (name) { - char *tmp; - - tmp = strdup(path); - if (tmp == NULL) { - path = NULL; - goto out; - } - - cg_concat_path(tmp, name, path); - free(tmp); - } - goto out; - } - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - /* Two ways to successfully move forward here: - * 1. The "type" controller matches the name of a mounted - * controller - * 2. The "type" controller requested is "cgroup" and there's - * a "real" controller mounted as cgroup v2 - */ - if ((type && strcmp(cg_mount_table[i].name, type) == 0) || - (type && strcmp(type, CGROUP_FILE_PREFIX) == 0 && - cg_mount_table[i].version == CGROUP_V2)) { - - if (cg_namespace_table[i]) - ret = snprintf(_path, len, "%s/%s%s/", cg_mount_table[i].mount.path, - tmp_systemd_default_cgroup, cg_namespace_table[i]); - else - ret = snprintf(_path, len, "%s/%s", cg_mount_table[i].mount.path, - tmp_systemd_default_cgroup); - - if (ret >= FILENAME_MAX) - cgroup_dbg("filename too long: %s", _path); - - strncpy(path, _path, FILENAME_MAX - 1); - path[FILENAME_MAX - 1] = '\0'; - - if (name) { - char *tmp; - - tmp = strdup(path); - if (tmp == NULL) - break; - - cg_concat_path(tmp, name, path); - free(tmp); - } - goto out; - } - } - path = NULL; - -out: - if (_path) - free(_path); - - if (tmp_systemd_default_cgroup) - free(tmp_systemd_default_cgroup); - - return path; -} - -char *cg_build_path(const char *name, char *path, const char *type) -{ - pthread_rwlock_rdlock(&cg_mount_table_lock); - path = cg_build_path_locked(name, path, type); - pthread_rwlock_unlock(&cg_mount_table_lock); - - return path; -} - -static int cgroup_get_cg_type(const char * const path, char * const type, - size_t type_sz) -{ - char cg_type_path[FILENAME_MAX]; - char cg_type[CGV2_CONTROLLERS_LL_MAX]; - int len, err = 0; - FILE *fp = NULL; - - snprintf(cg_type_path, FILENAME_MAX, "%scgroup.type", path); - fp = fopen(cg_type_path, "re"); - if (!fp) { - if (errno == ENOENT) { - /* file cgroup.type, doesn't exist for root cgroup. */ - snprintf(type, type_sz, "cgroup.procs"); - goto out; - } else { - cgroup_warn("failed to open file %s: %s\n", cg_type_path, strerror(errno)); - err = ECGOTHER; - goto out; - } - } - - if (fgets(cg_type, CGV2_CONTROLLERS_LL_MAX, fp) == NULL) { - cgroup_warn("failed to read file %s: %s\n", cg_type_path, strerror(errno)); - err = ECGOTHER; - goto out; - } - - len = strlen(cg_type) - 1; - /* - * Append cgroup.threads to the path, if the cgroup.type is threaded - * and cgroup.procs for type domain, domain threaded. domain type is - * used for regular cgroup and domain threaded for root of threaded - * cgroup v2 subtree. Another possible type is domain invalid, it's - * an invalid state, under the threaded subtree. - */ - if (strncmp(cg_type, "domain", len) == 0 || - strncmp(cg_type, "domain threaded", len) == 0 || - strncmp(cg_type, "domain invalid", len) == 0) { - snprintf(type, type_sz, "cgroup.procs"); - } else if (strncmp(cg_type, "threaded", len) == 0) { - snprintf(type, type_sz, "cgroup.threads"); - } else { - cgroup_warn("invalid %scgroup.type: %s\n", path, cg_type); - err = ECGOTHER; - } - -out: - if (fp) - fclose(fp); - - return err; -} - -int cgroup_build_tasks_procs_path(char * const path, size_t path_sz, const char * const cg_name, - const char * const ctrl_name) -{ - enum cg_version_t version; - char cg_type[CGV2_CONTROLLERS_LL_MAX]; - int err = ECGOTHER; - - if (!cg_build_path(cg_name, path, ctrl_name)) - goto error; - - err = cgroup_get_controller_version(ctrl_name, &version); - if (err) - goto error; - - switch (version) { - case CGROUP_V1: - strncat(path, "tasks", path_sz - strlen(path)); - err = 0; - break; - case CGROUP_V2: - err = cgroup_get_cg_type(path, cg_type, sizeof(cg_type)); - if (err) - goto error; - - strncat(path, cg_type, path_sz - strlen(path)); - break; - default: - err = ECGOTHER; - break; - } - -error: - if (err) - path[0] = '\0'; - - cgroup_dbg("cgroup build procs path: %s\n", path); - - return err; -} - -STATIC int cgroupv2_controller_enabled(const char * const cg_name, const char * const ctrl_name) -{ - char path[FILENAME_MAX] = {0}; - char *parent = NULL, *dname; - enum cg_version_t version; - bool enabled; - int error; - - error = cgroup_get_controller_version(ctrl_name, &version); - if (error) - return error; - - if (version != CGROUP_V2) - return 0; - - if (ctrl_name == NULL) - /* cgroup v2 supports cgroups with no controllers. */ - return 0; - - if (strncmp(cg_name, "/", strlen(cg_name)) == 0) - /* - * The root cgroup has been requested. All version 2 - * controllers are enabled on the root cgroup. - */ - return 0; - - if (!cg_build_path(cg_name, path, ctrl_name)) - goto err; - - parent = strdup(path); - if (!parent) { - error = ECGOTHER; - goto err; - } - - dname = dirname(parent); - - error = cgroupv2_get_subtree_control(dname, ctrl_name, &enabled); - if (error) - goto err; - - if (enabled) - error = 0; -err: - if (parent) - free(parent); - - return error; -} - -static int __cgroup_attach_task_pid(char *path, pid_t tid) -{ - FILE *tasks = NULL; - int ret = 0; - - tasks = fopen(path, "we"); - if (!tasks) { - switch (errno) { - case EPERM: - ret = ECGROUPNOTOWNER; - break; - case ENOENT: - ret = ECGROUPNOTEXIST; - break; - default: - ret = ECGROUPNOTALLOWED; - } - goto err; - } - ret = fprintf(tasks, "%d", tid); - if (ret < 0) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - ret = fflush(tasks); - if (ret) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - fclose(tasks); - return 0; -err: - cgroup_warn("cannot write tid %d to %s:%s\n", tid, path, strerror(errno)); - if (tasks) - fclose(tasks); - return ret; -} - -/** - * cgroup_attach_task_pid is used to assign tasks to a cgroup. - * struct cgroup *cgroup: The cgroup to assign the thread to. - * pid_t tid: The thread to be assigned to the cgroup. - * - * returns 0 on success. - * returns ECGROUPNOTOWNER if the caller does not have access to the cgroup. - * returns ECGROUPNOTALLOWED for other causes of failure. - */ -int cgroup_attach_task_pid(struct cgroup *cgroup, pid_t tid) -{ - char path[FILENAME_MAX] = {0}; - char *controller_name; - int empty_cgroup = 0; - int i, ret = 0; - - if (!cgroup_initialized) { - cgroup_warn("libcgroup is not initialized\n"); - return ECGROUPNOTINITIALIZED; - } - - /* if the cgroup is NULL, attach the task to the root cgroup. */ - if (!cgroup) { - pthread_rwlock_rdlock(&cg_mount_table_lock); - for (i = 0; i < CG_CONTROLLER_MAX && cg_mount_table[i].name[0] != '\0'; i++) { - ret = cgroup_build_tasks_procs_path(path, sizeof(path), NULL, - cg_mount_table[i].name); - if (ret) - return ret; - - ret = __cgroup_attach_task_pid(path, tid); - if (ret) { - pthread_rwlock_unlock(&cg_mount_table_lock); - return ret; - } - } - pthread_rwlock_unlock(&cg_mount_table_lock); - } else { - for (i = 0; i < cgroup->index; i++) { - if (!cgroup_test_subsys_mounted(cgroup->controller[i]->name)) { - cgroup_warn("subsystem %s is not mounted\n", - cgroup->controller[i]->name); - return ECGROUPSUBSYSNOTMOUNTED; - } - } - - if (cgroup->index == 0) - /* Valid empty cgroup v2 with no controllers added. */ - empty_cgroup = 1; - - for (i = 0, controller_name = NULL; - empty_cgroup > 0 || i < cgroup->index; - i++, empty_cgroup--) { - - if (cgroup->controller[i]) - controller_name = cgroup->controller[i]->name; - - ret = cgroupv2_controller_enabled(cgroup->name, controller_name); - if (ret) - return ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgroup->name, - controller_name); - if (ret) - return ret; - - ret = __cgroup_attach_task_pid(path, tid); - if (ret) - return ret; - } - } - return 0; -} - -/** - * cgroup_attach_task is used to attach the current thread to a cgroup. - * struct cgroup *cgroup: The cgroup to assign the current thread to. - * - * See cg_attach_task_pid for return values. - */ -int cgroup_attach_task(struct cgroup *cgroup) -{ - pid_t tid = cg_gettid(); - int error; - - error = cgroup_attach_task_pid(cgroup, tid); - - return error; -} - -/** - * cg_mkdir_p, emulate the mkdir -p command (recursively creating paths) - * @path: path to create - */ -int cg_mkdir_p(const char *path) -{ - char *real_path = NULL; - char *tmp_path = NULL; - struct stat st; - int ret = 0; - int i = 0; - char pos; - - real_path = strdup(path); - if (!real_path) { - last_errno = errno; - return ECGOTHER; - } - - do { - while (real_path[i] != '\0' && real_path[i] == '/') - i++; - - if (real_path[i] == '\0') - break; /* The path ends with '/', ignore it. */ - - while (real_path[i] != '\0' && real_path[i] != '/') - i++; - - pos = real_path[i]; - real_path[i] = '\0'; /* Temporarily overwrite "/" */ - - /* 0775 == S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH */ - ret = mkdir(real_path, 0775); - if (ret) { - switch (errno) { - case EEXIST: - ret = 0; /* Not fatal really */ - break; - case EPERM: - ret = ECGROUPNOTOWNER; - goto done; - case EROFS: - /* - * Check if path exists, use tmp_path to - * keep Coverity happy - */ - tmp_path = real_path; - ret = stat(tmp_path, &st); - if (ret == 0) - break; /* Path exists */ - default: /* fallthrough */ - ret = ECGROUPNOTALLOWED; - goto done; - } - } - real_path[i] = pos; - } while (real_path[i]); - -done: - free(real_path); - - return ret; -} - -/* - * create_control_group() - * This is the basic function used to create the control group. This function - * just makes the group. It does not set any permissions, or any control values. - * The argument path is the fully qualified path name to make it generic. - */ -static int cg_create_control_group(const char *path) -{ - int error; - - if (!cg_test_mounted_fs()) - return ECGROUPNOTMOUNTED; - - error = cg_mkdir_p(path); - return error; -} - -/* - * set_control_value() - * This is the low level function for putting in a value in a control file. - * This function takes in the complete path and sets the value in val in that file. - */ -static int cg_set_control_value(char *path, const char *val) -{ - char *str_val_start; - char *str_val; - int ctl_file; - size_t len; - char *pos; - - if (!cg_test_mounted_fs()) - return ECGROUPNOTMOUNTED; - - ctl_file = open(path, O_RDWR | O_CLOEXEC); - - if (ctl_file == -1) { - if (errno == EPERM) { - /* - * We need to set the correct error value, does the - * group exist but we don't have the subsystem mounted - * at that point, or is it that the group does not exist. - * So we check if the tasks file exist. Before that, we - * need to extract the path. - */ - char *path_dir_end; - FILE *control_file; - char *tasks_path; - - path_dir_end = strrchr(path, '/'); - if (path_dir_end == NULL) - return ECGROUPVALUENOTEXIST; - path_dir_end = '\0'; - - /* task_path contain: $path/tasks */ - tasks_path = (char *)malloc(strlen(path) + 6 + 1); - if (tasks_path == NULL) { - last_errno = errno; - return ECGOTHER; - } - strcpy(tasks_path, path); - strcat(tasks_path, "/tasks"); - - /* Test tasks file for read flag */ - control_file = fopen(tasks_path, "re"); - if (!control_file) { - if (errno == ENOENT) { - free(tasks_path); - return ECGROUPSUBSYSNOTMOUNTED; - } - } else { - fclose(control_file); - } - - free(tasks_path); - return ECGROUPNOTALLOWED; - } - return ECGROUPVALUENOTEXIST; - } - - /* - * Split the multiline value into lines. One line is a special - * case of multiline value. - */ - str_val = strdup(val); - if (str_val == NULL) { - last_errno = errno; - close(ctl_file); - return ECGOTHER; - } - - str_val_start = str_val; - pos = str_val; - - do { - str_val = pos; - pos = strchr(str_val, '\n'); - - if (pos) { - *pos = '\0'; - ++pos; - } - - len = strlen(str_val); - if (len > 0) { - if (write(ctl_file, str_val, len) == -1) { - last_errno = errno; - free(str_val_start); - close(ctl_file); - return ECGOTHER; - } - } else - cgroup_warn("skipping empty line for %s\n", path); - } while (pos); - - if (close(ctl_file)) { - last_errno = errno; - free(str_val_start); - return ECGOTHER; - } - - free(str_val_start); - return 0; -} - -/** - * Walk the settings in controller and write their values to disk - * - * @param base The full path to the base of this cgroup - * @param controller The controller whose values are being updated - * @param ignore_non_dirty_values If set skips writing non-dirty controller settings - */ -STATIC int cgroup_set_values_recursive(const char * const base, - const struct cgroup_controller * const controller, - bool ignore_non_dirty_values) -{ - struct control_value *cv; - struct stat path_stat; - int ret, j, error = 0; - char *path = NULL; - - for (j = 0; j < controller->index; j++) { - cv = controller->values[j]; - - /* - * ignore_non_dirty_values is set while writing into - * existing cgroup to modify controller settings and - * unset during cgroup creation. The subtle difference - * is that dirty flag is unset for all the controller - * settings during cgroup creation, whereas some or all - * controller settings have the dirty flag set during - * modification. - * - * Be careful with ignore_non_dirty_values flag, setting - * it writing only the controller settings that has it - * dirty value set. - */ - if (ignore_non_dirty_values && cv->dirty == false) - continue; - - /* We don't support, writing multiline settings */ - if (strcspn(cv->value, "\n") < (strlen(cv->value) - 1)) - continue; - - ret = asprintf(&path, "%s%s", base, cv->name); - if (ret < 0) { - last_errno = errno; - error = ECGOTHER; - goto err; - } - - /* skip read-only settings */ - ret = (stat(path, &path_stat)); - if (ret < 0) { - last_errno = errno; - error = ECGROUPVALUENOTEXIST;; - goto err; - } - - if (!(path_stat.st_mode & S_IWUSR)) - continue; - - cgroup_dbg("setting %s to \"%s\", pathlen %d\n", path, cv->value, ret); - - error = cg_set_control_value(path, cv->value); - free(path); - path = NULL; - - if (error) { - /* Ignore the errors on deprecated settings */ - if (last_errno == EOPNOTSUPP) { - error = 0; - continue; - } - goto err; - } - cv->dirty = false; - } - -err: - /* - * As currently written, path should always be null as we are\ - * exiting this function, but let's check just in case, and free it - * if it's non-null - */ - if (path) - free(path); - - return error; -} - -/** - * Check if the requested cgroup controller is enabled in the specified file - * - * @param path Cgroup directory - * @param ctrl_name Name of the controller to check - * @param output parameter that indicates whether the controller is enabled - * @param file to open and parse - * 0 = cgroup.subtree_control - * 1 = cgroup.controllers - */ -STATIC int __cgroupv2_get_enabled(const char *path, const char *ctrl_name, - bool * const enabled, int file_enum) -{ - char *path_copy = NULL, *saveptr = NULL, *token, *ret_c, *filename; - int ret, error = ECGROUPNOTMOUNTED; - char buffer[FILENAME_MAX]; - FILE *fp = NULL; - - if (!path || !ctrl_name || !enabled) - return ECGOTHER; - - *enabled = false; - - switch (file_enum) { - case 0: /* cgroup.subtree_control */ - filename = CGV2_SUBTREE_CTRL_FILE; - break; - case 1: /* cgroup.controllers */ - filename = CGV2_CONTROLLERS_FILE; - break; - default: - return ECGINVAL; - } - - path_copy = (char *)malloc(FILENAME_MAX); - if (!path_copy) { - error = ECGOTHER; - goto out; - } - - ret = snprintf(path_copy, FILENAME_MAX, "%s/%s", path, filename); - if (ret < 0) { - error = ECGOTHER; - goto out; - } - - fp = fopen(path_copy, "re"); - if (!fp) { - cgroup_warn("fopen failed\n"); - last_errno = errno; - error = ECGOTHER; - goto out; - } - - ret_c = fgets(buffer, sizeof(buffer), fp); - if (ret_c == NULL) - /* The subtree control file is empty */ - goto out; - - /* Remove the trailing newline */ - ret_c[strlen(ret_c) - 1] = '\0'; - - /* - * Split the enabled controllers by " " and evaluate if the - * requested controller is enabled. - */ - token = strtok_r(buffer, " ", &saveptr); - do { - if (strncmp(ctrl_name, token, FILENAME_MAX) == 0) { - error = 0; - *enabled = true; - break; - } - } while ((token = strtok_r(NULL, " ", &saveptr))); - -out: - if (path_copy) - free(path_copy); - if (fp) - fclose(fp); - - return error; -} - -/** - * Check if the requested cgroup controller is enabled on this subtree - * - * @param path Cgroup directory - * @param ctrl_name Name of the controller to check - * @param output parameter that indicates whether the controller is enabled - */ -STATIC int cgroupv2_get_subtree_control(const char *path, const char *ctrl_name, - bool * const enabled) -{ - return __cgroupv2_get_enabled(path, ctrl_name, enabled, 0); -} -/** - * Check if the requested cgroup controller is enabled in this cgroup's cgroup.controllers file - * - * @param path Cgroup directory - * @param ctrl_name Name of the controller to check - * @param output parameter that indicates whether the controller is enabled - */ -static int cgroupv2_get_controllers(const char *path, const char *ctrl_name, - bool * const enabled) -{ - return __cgroupv2_get_enabled(path, ctrl_name, enabled, 1); -} - -/** - * Enable/Disable a controller in the cgroup v2 subtree_control file - * - * @param path Directory that contains the subtree_control file - * @param ctrl_name Name of the controller to be enabled/disabled - * @param enable Enable/Disable the given controller - */ -STATIC int cgroupv2_subtree_control(const char *path, const char *ctrl_name, bool enable) -{ - int ret, error = ECGOTHER; - char *path_copy = NULL; - char *value = NULL; - - if (!path || !ctrl_name) - return ECGOTHER; - - value = (char *)malloc(FILENAME_MAX); - if (!value) - goto out; - - path_copy = (char *)malloc(FILENAME_MAX); - if (!path_copy) - goto out; - - ret = snprintf(path_copy, FILENAME_MAX, "%s/%s", path, CGV2_SUBTREE_CTRL_FILE); - if (ret < 0) - goto out; - - if (enable) - ret = snprintf(value, FILENAME_MAX, "+%s", ctrl_name); - else - ret = snprintf(value, FILENAME_MAX, "-%s", ctrl_name); - if (ret < 0) - goto out; - - error = cg_set_control_value(path_copy, value); - if (error) - goto out; - -out: - if (value) - free(value); - if (path_copy) - free(path_copy); - return error; -} - -/** - * Recursively enable/disable a controller in the cgv2 subtree_control file - * - * @param path Directory that contains the subtree_control file - * @param ctrl_name Name of the controller to be enabled/disabled - * @param enable Enable/Disable the given controller - */ -STATIC int cgroupv2_subtree_control_recursive(char *path, const char *ctrl_name, bool enable) -{ - char *path_copy, *tmp_path, *stok_buff = NULL; - bool found_mount = false; - size_t mount_len; - int i, error = 0; - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - if (strncmp(cg_mount_table[i].name, ctrl_name, - sizeof(cg_mount_table[i].name)) == 0) { - found_mount = true; - break; - } - } - - if (!found_mount) - return ECGROUPSUBSYSNOTMOUNTED; - - path_copy = strdup(path); - if (!path_copy) - return ECGOTHER; - - /* - * Null terminate the path_copy to match the string length of the - * controller mount. We'll incrementally build up the string, subdir - * by subdir, and enable the subtree control file each step of the way - */ - mount_len = strlen(cg_mount_table[i].mount.path); - path_copy[mount_len] = '\0'; - - tmp_path = strtok_r(&path[mount_len], "/", &stok_buff); - do { - if (tmp_path) { - strcat(path_copy, "/"); - strcat(path_copy, tmp_path); - } - - error = cg_create_control_group(path_copy); - if (error) - goto out; - - error = cgroupv2_subtree_control(path_copy, ctrl_name, enable); - if (error) - goto out; - } while ((tmp_path = strtok_r(NULL, "/", &stok_buff))); - -out: - free(path_copy); - return error; -} - -/** - * cgroup_modify_cgroup modifies the cgroup control files. - * struct cgroup *cgroup: The name will be the cgroup to be modified. - * The values will be the values to be modified, those not mentioned in the - * structure will not be modified. - * - * The uids cannot be modified yet. - * - * returns 0 on success. - */ - -int cgroup_modify_cgroup(struct cgroup *cgroup) -{ - char base[FILENAME_MAX]; - int error = 0; - int i; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!cgroup) - return ECGROUPNOTALLOWED; - - for (i = 0; i < cgroup->index; i++) { - if (!cgroup_test_subsys_mounted(cgroup->controller[i]->name)) { - cgroup_warn("subsystem %s is not mounted\n", cgroup->controller[i]->name); - return ECGROUPSUBSYSNOTMOUNTED; - } - } - - for (i = 0; i < cgroup->index; i++) { - if (!cg_build_path(cgroup->name, base, cgroup->controller[i]->name)) - continue; - - error = cgroup_set_values_recursive(base, cgroup->controller[i], true); - if (error) - goto err; - } -err: - return error; -} - -int cgroup_copy_controller_values(struct cgroup_controller * const dst, - const struct cgroup_controller * const src) -{ - int i, ret = 0; - - if (!dst || !src) - return ECGFAIL; - - strncpy(dst->name, src->name, CONTROL_NAMELEN_MAX); - for (i = 0; i < src->index; i++, dst->index++) { - struct control_value *src_val = src->values[i]; - struct control_value *dst_val; - - dst->values[i] = calloc(1, sizeof(struct control_value)); - if (!dst->values[i]) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - dst_val = dst->values[i]; - strncpy(dst_val->value, src_val->value, CG_CONTROL_VALUE_MAX); - strncpy(dst_val->name, src_val->name, FILENAME_MAX); - - if (src_val->multiline_value) { - dst_val->multiline_value = strdup(src_val->multiline_value); - if (!dst_val->multiline_value) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - } else { - dst_val->multiline_value = NULL; - } - - if (src_val->prev_name) { - dst_val->prev_name = strdup(src_val->prev_name); - if (!dst_val->prev_name) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - } else { - dst_val->prev_name = NULL; - } - /* - * set dirty flag unconditionally, as we overwrite - * destination controller values. - */ - dst_val->dirty = true; - } - - return ret; - -err: - dst->index = 0; - for (i = 0; i < src->index; i++) { - if (dst->values[i]) { - if (dst->values[i]->multiline_value) - free(dst->values[i]->multiline_value); - - if (dst->values[i]->prev_name) - free(dst->values[i]->prev_name); - - free(dst->values[i]); - } - } - - return ret; -} - -/** - * @dst: Destination control group - * @src: Source from which values will be copied to dst - * - * Create a duplicate copy of src in dst. This will be useful for those who - * that intend to create new instances based on an existing control group - */ -int cgroup_copy_cgroup(struct cgroup *dst, struct cgroup *src) -{ - int ret = 0, i; - - if (!dst || !src) - return ECGROUPNOTEXIST; - - /* Should we just use the restrict keyword instead? */ - if (dst == src) - return ECGFAIL; - - cgroup_free_controllers(dst); - - for (i = 0; i < src->index; i++, dst->index++) { - struct cgroup_controller *src_ctlr = src->controller[i]; - struct cgroup_controller *dst_ctlr; - - dst->controller[i] = calloc(1, sizeof(struct cgroup_controller)); - if (!dst->controller[i]) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - dst_ctlr = dst->controller[i]; - ret = cgroup_copy_controller_values(dst_ctlr, src_ctlr); - if (ret) - goto err; - } -err: - return ret; -} - -/** - * Chown and chmod the tasks file in cg_path - * - * @param uid The UID that will own the tasks file - * @param gid The GID that will own the tasks file - * @param fperm The permissions to place on the tasks file - */ -STATIC int cgroup_chown_chmod_tasks(const char * const cg_path, uid_t uid, gid_t gid, mode_t fperm) -{ - int ret, error; - char *tasks_path = NULL; - - tasks_path = (char *)malloc(FILENAME_MAX); - if (tasks_path == NULL) - return ECGOTHER; - - ret = snprintf(tasks_path, FILENAME_MAX, "%s/tasks", cg_path); - if (ret < 0 || ret >= FILENAME_MAX) { - last_errno = errno; - error = ECGOTHER; - goto err; - } - - error = cg_chown(tasks_path, uid, gid); - if (!error && fperm != NO_PERMS) - error = cg_chmod_path(tasks_path, fperm, 1); - - if (error) { - last_errno = errno; - error = ECGOTHER; - } - -err: - if (tasks_path) - free(tasks_path); - - return error; -} - -static int _cgroup_create_cgroup(const struct cgroup * const cgroup, - const struct cgroup_controller * const controller, - int ignore_ownership) -{ - enum cg_version_t version = CGROUP_UNK; - char *fts_path[2]; - char *base = NULL; - char *path = NULL; - int error; - - fts_path[0] = (char *)malloc(FILENAME_MAX); - if (!fts_path[0]) { - last_errno = errno; - return ECGOTHER; - } - fts_path[1] = NULL; - path = fts_path[0]; - - if (controller) { - if (!cg_build_path(cgroup->name, path, controller->name)) { - error = ECGOTHER; - goto err; - } - - error = cgroup_get_controller_version(controller->name, &version); - if (error) - goto err; - - if (version == CGROUP_V2) { - char *parent, *dname; - - parent = strdup(path); - if (!parent) { - error = ECGOTHER; - goto err; - } - - dname = dirname(parent); - - error = cgroupv2_subtree_control_recursive(dname, controller->name, true); - free(parent); - if (error) - goto err; - } - } else { - if (!cg_build_path(cgroup->name, path, NULL)) { - error = ECGOTHER; - goto err; - } - } - - error = cg_create_control_group(path); - if (error) - goto err; - - base = strdup(path); - - if (!base) { - last_errno = errno; - error = ECGOTHER; - goto err; - } - - if (!ignore_ownership) { - cgroup_dbg("Changing ownership of %s\n", fts_path[0]); - error = cg_chown_recursive(fts_path, cgroup->control_uid, cgroup->control_gid); - if (!error) - error = cg_chmod_recursive_controller(fts_path[0], - cgroup->control_dperm, - cgroup->control_dperm != NO_PERMS, - cgroup->control_fperm, - cgroup->control_fperm != NO_PERMS, - 1, cgroup_ignored_tasks_files); - } - - if (error) - goto err; - - if (controller) { - error = cgroup_set_values_recursive(base, controller, false); - if (error) - goto err; - } - - if (!ignore_ownership && version == CGROUP_V1) { - error = cgroup_chown_chmod_tasks(base, cgroup->tasks_uid, cgroup->tasks_gid, - cgroup->task_fperm); - if (error) - goto err; - } -err: - if (path) - free(path); - if (base) - free(base); - - return error; -} - -/** - * cgroup_create_cgroup creates a new control group. - * struct cgroup *cgroup: The control group to be created - * - * returns 0 on success. We recommend calling cg_delete_cgroup if this - * routine fails. That should do the cleanup operation. If ECGCANTSETVALUE - * is returned, the group was created successfully but not all controller - * parameters were successfully set. - */ -int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership) -{ - int error = 0; - int i; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!cgroup) - return ECGROUPNOTALLOWED; - - for (i = 0; i < cgroup->index; i++) { - if (!cgroup_test_subsys_mounted(cgroup->controller[i]->name)) - return ECGROUPSUBSYSNOTMOUNTED; - } - - if (cgroup->index == 0) { - /* Create an empty cgroup v2 cgroup */ - error = _cgroup_create_cgroup(cgroup, NULL, ignore_ownership); - if (error) - /* - * Since we only attempted to create a single cgroup, - * _cgroup_create_cgroup() can capably undo the failure and no - * interventions are required here. - */ - return error; - } - - /* - * XX: One important test to be done is to check, if you have - * multiple subsystems mounted at one point, all of them *have* be - * on the cgroup data structure. If not, we fail. - */ - for (i = 0; i < cgroup->index; i++) { - error = _cgroup_create_cgroup(cgroup, cgroup->controller[i], ignore_ownership); - if (error) { - int del_error; - - /* - * This will remove any cgroup directories that were made, but it won't - * undo changes that have been written to the parent cgroup's - * subtree_control file. To safely undo changes there, we would need to - * save the subtree_control file's previous value and restore it. - */ - del_error = cgroup_delete_cgroup(cgroup, 1); - if (del_error) - cgroup_err("Failed to delete %s: %s\n", cgroup->name, - cgroup_strerror(del_error)); - return error; - } - } - - return 0; -} - -/** - * Obtain the calculated parent name of specified cgroup; no validation of - * the existence of the child or parent group is performed. - * - * Given the path-like hierarchy of cgroup names, this function returns the - * dirname() of the cgroup name as the likely parent name; the caller is - * responsible for validating parent as appropriate. - * - * @param cgroup The cgroup to query for parent's name - * @param parent Output, name of parent's group, or NULL if the - * provided cgroup is the root group. - * Caller is responsible to free the returned string. - * @return 0 on success, > 0 on error - */ -static int cgroup_get_parent_name(struct cgroup *cgroup, char **parent) -{ - char *pdir = NULL; - char *dir = NULL; - int ret = 0; - - dir = strdup(cgroup->name); - if (!dir) { - last_errno = errno; - return ECGOTHER; - } - cgroup_dbg("group name is %s\n", dir); - - pdir = dirname(dir); - cgroup_dbg("parent's group name is %s\n", pdir); - - /* Check for root group */ - if (strlen(cgroup->name) == 0 || !strcmp(cgroup->name, pdir)) { - cgroup_dbg("specified cgroup \"%s\" is root group\n", cgroup->name); - *parent = NULL; - } else { - *parent = strdup(pdir); - if (*parent == NULL) { - last_errno = errno; - ret = ECGOTHER; - } - } - free(dir); - - return ret; -} - -/* - * Checks if the cgroup's controller shares the mount point with any other - * controller in cg_mount_table. - * Returns 1 if shared or 0. - */ -static int is_cgrp_ctrl_shared_mnt(char *controller) -{ - int ret = 0; - int i; - - if (!controller) - return ret; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - - if (strncmp(cg_mount_table[i].name, controller, CONTROL_NAMELEN_MAX) == 0 && - cg_mount_table[i].shared_mnt) { - ret = 1; - break; - } - } - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} -/** - * Find the parent of the specified directory. It returns the parent in - * hierarchy of given controller (the parent is usually name/.. unless name - * is a mount point. It is assumed both the cgroup (and, therefore, parent) - * already exist, and will fail otherwise. - * - * When namespaces are used, a group can have different parents for - * different controllers. - * - * @param cgroup The cgroup - * @param controller The controller - * @param parent Output, name of parent's group (if the group has parent) or - * NULL, if the provided cgroup is the root group and has no parent. - * Caller is responsible to free the returned string! - * @return 0 on success, >0 on error. - */ -static int cgroup_find_parent(struct cgroup *cgroup, char *controller, char **parent) -{ - struct stat stat_child, stat_parent; - char child_path[FILENAME_MAX]; - char *parent_path = NULL; - int ret = 0; - - *parent = NULL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - if (!cg_build_path_locked(cgroup->name, child_path, controller)) { - pthread_rwlock_unlock(&cg_mount_table_lock); - return ECGFAIL; - } - pthread_rwlock_unlock(&cg_mount_table_lock); - - cgroup_dbg("path is %s\n", child_path); - - if (asprintf(&parent_path, "%s/..", child_path) < 0) - return ECGFAIL; - - cgroup_dbg("parent's name is %s\n", parent_path); - - if (stat(child_path, &stat_child) < 0) { - if (is_cgrp_ctrl_shared_mnt(controller)) { - last_errno = errno; - ret = ECGROUPNOTEXIST; - goto free_parent; - } - last_errno = errno; - ret = ECGOTHER; - goto free_parent; - } - - if (stat(parent_path, &stat_parent) < 0) { - last_errno = errno; - ret = ECGOTHER; - goto free_parent; - } - - /* Is the specified "name" a mount point? */ - if (stat_parent.st_dev != stat_child.st_dev) { - *parent = NULL; - ret = 0; - cgroup_dbg("Parent is on different device\n"); - } else { - ret = cgroup_get_parent_name(cgroup, parent); - } - -free_parent: - free(parent_path); - return ret; -} - -/** - * @cgroup: cgroup data structure to be filled with parent values and then - * passed down for creation - * @ignore_ownership: Ignore doing a chown on the newly created cgroup - * @return 0 on success, > 0 on failure. If ECGCANTSETVALUE is returned, - * the group was created - * successfully, but not all controller parameters were copied from the - * parent successfully; unfortunately, this is expected... - */ -int cgroup_create_cgroup_from_parent(struct cgroup *cgroup, int ignore_ownership) -{ - struct cgroup *parent_cgroup = NULL; - char *parent = NULL; - int ret = ECGFAIL; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - ret = cgroup_get_parent_name(cgroup, &parent); - if (ret) - return ret; - - if (parent == NULL) { - /* - * The group to create is root group! - * TODO: find better error code? - */ - return ECGFAIL; - } - - cgroup_dbg("parent is %s\n", parent); - parent_cgroup = cgroup_new_cgroup(parent); - if (!parent_cgroup) { - ret = ECGFAIL; - goto err_nomem; - } - - if (cgroup_get_cgroup(parent_cgroup)) { - ret = ECGFAIL; - goto err_parent; - } - - cgroup_dbg("got parent group for %s\n", parent_cgroup->name); - ret = cgroup_copy_cgroup(cgroup, parent_cgroup); - if (ret) - goto err_parent; - - cgroup_dbg("copied parent group %s to %s\n", parent_cgroup->name, cgroup->name); - ret = cgroup_create_cgroup(cgroup, ignore_ownership); - -err_parent: - cgroup_free(&parent_cgroup); -err_nomem: - free(parent); - return ret; -} - -/** - * Move all processes from one task file to another. - * @param input_tasks Pre-opened file to read tasks from. - * @param output_tasks Pre-opened file to write tasks to. - * @return 0 on succes, >0 on error. - */ -static int cg_move_task_files(FILE *input_tasks, FILE *output_tasks) -{ - int ret = 0; - int tids; - - while (!feof(input_tasks)) { - ret = fscanf(input_tasks, "%d", &tids); - if (ret == EOF || ret == 0) { - ret = 0; - break; - } - if (ret < 0) - break; - - ret = fprintf(output_tasks, "%d", tids); - if (ret < 0 && errno != ESRCH) - break; - - /* Flush the file, we need only one process per write() call. */ - ret = fflush(output_tasks); - if (ret < 0) { - if (errno == ESRCH) - ret = 0; - else - break; - } - } - - if (ret < 0) { - last_errno = errno; - return ECGOTHER; - } - return 0; -} - -/** - * Remove one cgroup from specific controller. The function moves all - * processes from it to given target group. - * - * The function succeeds if the group to remove is already removed - when - * cgroup_delete_cgroup is called with group with two controllers mounted - * to the same hierarchy, this function is called once for each of these - * controllers. And during the second call the group is already removed... - * - * @param cgroup_name Name of the group to remove. - * @param controller Name of the controller. - * @param target_tasks Opened tasks file of the target group, where all - * processes should be moved. - * @param flags Flag indicating whether the errors from task - * migration should be ignored (CGROUP_DELETE_IGNORE_MIGRATION) or not (0). - * @returns 0 on success, >0 on error. - */ -static int cg_delete_cgroup_controller(char *cgroup_name, char *controller, FILE *target_tasks, - int flags) -{ - char path[FILENAME_MAX]; - FILE *delete_tasks; - int ret = 0; - - cgroup_dbg("Removing group %s:%s\n", controller, cgroup_name); - - if (!(flags & CGFLAG_DELETE_EMPTY_ONLY)) { - /* Open tasks file of the group to delete. */ - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgroup_name, controller); - if (ret != 0) - return ECGROUPSUBSYSNOTMOUNTED; - - delete_tasks = fopen(path, "re"); - if (delete_tasks) { - ret = cg_move_task_files(delete_tasks, target_tasks); - if (ret != 0) { - cgroup_warn("removing tasks from %s failed: %s\n", path, - cgroup_strerror(ret)); - } - fclose(delete_tasks); - } else { - /* - * Can't open the tasks file. If the file does not exist, - * ignore it - the group has been already removed. - */ - if (errno != ENOENT) { - cgroup_err("cannot open %s: %s\n", path, strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - } - } - - if (ret != 0 && !(flags & CGFLAG_DELETE_IGNORE_MIGRATION)) - return ret; - } - - /* Remove the group. */ - if (!cg_build_path(cgroup_name, path, controller)) - return ECGROUPSUBSYSNOTMOUNTED; - - ret = rmdir(path); - if (ret == 0 || errno == ENOENT) - return 0; - - if ((flags & CGFLAG_DELETE_EMPTY_ONLY) && (errno == EBUSY)) - return ECGNONEMPTY; - - cgroup_warn("cannot remove directory %s: %s\n", path, strerror(errno)); - last_errno = errno; - - return ECGOTHER; -} - -/** - * Recursively delete one control group. Moves all tasks from the group and - * its subgroups to given task file. - * - * @param cgroup_name The group to delete. - * @param controller The controller, where to delete. - * @param target_tasks Opened file, where all tasks should be moved. - * @param flags Combination of CGFLAG_DELETE_* flags. The function assumes - * that CGFLAG_DELETE_RECURSIVE is set. - * @param delete_root Whether the group itself should be removed(1) or not(0). - */ -static int cg_delete_cgroup_controller_recursive(char *cgroup_name, char *controller, - FILE *target_tasks, int flags, int delete_root) -{ - char child_name[FILENAME_MAX + 1]; - struct cgroup_file_info info; - int level, group_len; - void *handle; - int ret; - - cgroup_dbg("Recursively removing %s:%s\n", controller, cgroup_name); - - ret = cgroup_walk_tree_begin(controller, cgroup_name, 0, &handle, &info, &level); - - if (ret == 0) - ret = cgroup_walk_tree_set_flags(&handle, CGROUP_WALK_TYPE_POST_DIR); - - if (ret != 0) { - cgroup_walk_tree_end(&handle); - return ret; - } - - group_len = strlen(info.full_path); - - /* Skip the root group, it will be handled explicitly at the end. */ - ret = cgroup_walk_tree_next(0, &handle, &info, level); - - while (ret == 0) { - if (info.type == CGROUP_FILE_TYPE_DIR && info.depth > 0) { - snprintf(child_name, sizeof(child_name), "%s/%s", cgroup_name, - info.full_path + group_len); - - ret = cg_delete_cgroup_controller(child_name, controller, target_tasks, - flags); - if (ret != 0) - break; - } - - ret = cgroup_walk_tree_next(0, &handle, &info, level); - } - if (ret == ECGEOF) { - /* Iteration finished successfully, remove the root group. */ - ret = 0; - if (delete_root) - ret = cg_delete_cgroup_controller(cgroup_name, controller, target_tasks, - flags); - } - - cgroup_walk_tree_end(&handle); - - return ret; -} - -/** - * cgroup_delete cgroup deletes a control group. - * struct cgroup *cgroup takes the group which is to be deleted. - * - * returns 0 on success. - */ -int cgroup_delete_cgroup(struct cgroup *cgroup, int ignore_migration) -{ - int flags = ignore_migration ? CGFLAG_DELETE_IGNORE_MIGRATION : 0; - - return cgroup_delete_cgroup_ext(cgroup, flags); -} - -int cgroup_delete_cgroup_ext(struct cgroup *cgroup, int flags) -{ - int first_error = 0, first_errno = 0; - int cgrp_del_on_shared_mnt = 0; - char parent_path[FILENAME_MAX]; - char *controller_name = NULL; - FILE *parent_tasks = NULL; - char *parent_name = NULL; - int delete_group = 1; - int empty_cgroup = 0; - int i, ret; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!cgroup) - return ECGROUPNOTALLOWED; - - if ((flags & CGFLAG_DELETE_RECURSIVE) - && (flags & CGFLAG_DELETE_EMPTY_ONLY)) - return ECGINVAL; - - if (cgroup->index == 0) - /* Valid empty cgroup v2 with not controllers added. */ - empty_cgroup = 1; - - for (i = 0; i < cgroup->index; i++) { - if (!cgroup_test_subsys_mounted(cgroup->controller[i]->name)) - return ECGROUPSUBSYSNOTMOUNTED; - } - - /* - * Remove the group from all controllers and in the case of cgroup - * with no controllers, perform all actions of a single controller. - */ - for (i = 0; - empty_cgroup > 0 || i < cgroup->index; i++, empty_cgroup--) { - - ret = 0; - controller_name = NULL; - - if (cgroup->controller[i]) - controller_name = cgroup->controller[i]->name; - - /* Find parent, it can be different for each controller */ - if (!(flags & CGFLAG_DELETE_EMPTY_ONLY)) { - ret = cgroup_find_parent(cgroup, controller_name, &parent_name); - if (ret) { - /* - * ECGROPNOTEXIST is returned on cgroup v1, where - * controllers share the mount points. When cgroup - * is deleted on one of symbolic link (controller) - * and they should pass on other controllers sharing - * the mount point. - * - * cgrp_del_shared_mnt serves as an extra check - * flag that gets set, when the cgroup exists and - * is deleted or else sets an error. - */ - if (first_error == 0 && - (ret != ECGROUPNOTEXIST || - (ret == ECGROUPNOTEXIST && cgrp_del_on_shared_mnt == 0))) { - first_errno = last_errno; - first_error = ECGOTHER; - } - continue; - } - - if (is_cgrp_ctrl_shared_mnt(controller_name)) - cgrp_del_on_shared_mnt = 1; - - if (parent_name == NULL) { - /* Root group is being deleted. */ - if (!(flags & CGFLAG_DELETE_RECURSIVE)) - /* root group is being deleted in non-recursive mode */ - continue; - /* - * Move all tasks to the root group and - * do not delete it afterwards. - */ - parent_name = strdup("."); - if (parent_name == NULL) { - if (first_error == 0) { - first_errno = errno; - first_error = ECGOTHER; - } - continue; - } - delete_group = 0; - } - } - - if (parent_name) { - /* Tasks need to be moved, pre-open target tasks file */ - ret = cgroup_build_tasks_procs_path(parent_path, sizeof(parent_path), - parent_name, controller_name); - if (ret != 0) { - if (first_error == 0) - first_error = ECGFAIL; - free(parent_name); - continue; - } - - parent_tasks = fopen(parent_path, "we"); - if (!parent_tasks) { - if (first_error == 0) { - cgroup_warn("cannot open tasks file %s: %s\n", parent_path, - strerror(errno)); - first_errno = errno; - first_error = ECGOTHER; - } - free(parent_name); - continue; - } - } - if (flags & CGFLAG_DELETE_RECURSIVE) { - ret = cg_delete_cgroup_controller_recursive(cgroup->name, controller_name, - parent_tasks, flags, - delete_group); - } else { - ret = cg_delete_cgroup_controller(cgroup->name, controller_name, - parent_tasks, flags); - } - - if (parent_tasks) { - fclose(parent_tasks); - parent_tasks = NULL; - } - free(parent_name); - parent_name = NULL; - /* - * If any of the controller delete fails, remember the first - * error code, but continue with next controller and try remove - * the group from all of them. - */ - if (ret) { - /* - * ECGNONEMPTY is more or less not an error, but an - * indication that something was not removed. - * Therefore it should be replaced by any other error. - */ - if (ret != ECGNONEMPTY && - (first_error == 0 || first_errno == ECGNONEMPTY)) { - first_errno = last_errno; - first_error = ret; - } - } - } - - /* - * Restore the last_errno to the first errno from - * cg_delete_cgroup_controller[_ext]. - */ - if (first_errno != 0) - last_errno = first_errno; - - return first_error; -} - -/* - * This function should really have more checks, but this version will assume - * that the callers have taken care of everything. Including the locking. - */ -static int cg_rd_ctrl_file(const char *subsys, const char *cgroup, const char *file, char **value) -{ - char path[FILENAME_MAX]; - FILE *ctrl_file = NULL; - int ret; - - if (!cg_build_path_locked(cgroup, path, subsys)) - return ECGFAIL; - - strncat(path, file, sizeof(path) - strlen(path)); - ctrl_file = fopen(path, "re"); - if (!ctrl_file) - return ECGROUPVALUENOTEXIST; - - *value = calloc(CG_CONTROL_VALUE_MAX, 1); - if (!*value) { - fclose(ctrl_file); - last_errno = errno; - return ECGOTHER; - } - - /* Using %as crashes when we try to read from files like memory.stat */ - ret = fread(*value, 1, CG_CONTROL_VALUE_MAX-1, ctrl_file); - if (ret < 0) { - free(*value); - *value = NULL; - } else { - /* Remove trailing \n */ - if (ret > 0 && (*value)[ret-1] == '\n') - (*value)[ret-1] = '\0'; - } - - fclose(ctrl_file); - - return 0; -} - -/* - * Call this function with required locks taken. - */ -int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, struct cgroup_controller *cgc, - int cg_index) -{ - char path[FILENAME_MAX+1]; - struct stat stat_buffer; - char *ctrl_value = NULL; - char *ctrl_name = NULL; - char *ctrl_file = NULL; - char *tmp_path = NULL; - char *d_name = NULL; - char *buffer = NULL; - int tmp_len = 0; - int error = 0; - - d_name = strdup(ctrl_dir->d_name); - - if (!strcmp(d_name, ".") || !strcmp(d_name, "..")) { - error = ECGINVAL; - goto fill_error; - } - - /* - * This part really needs to be optimized out. Probably use some - * sort of a flag, but this is fine for now. - */ - cg_build_path_locked(cgroup->name, path, cg_mount_table[cg_index].name); - strncat(path, d_name, sizeof(path) - strlen(path)); - - error = stat(path, &stat_buffer); - - if (error) { - error = ECGFAIL; - goto fill_error; - } - - /* - * We have already stored the tasks_uid & tasks_gid. This check is - * to avoid the overwriting of the values stored in - * control_uid & cotrol_gid. tasks file will have the uid and gid of - * the user who is capable of putting a task to this cgroup. - * control_uid and control_gid is meant for the users who are capable - * of managing the cgroup shares. - * - * The strstr() function will return the pointer to the - * beginning of the sub string "/tasks". - */ - tmp_len = strlen(path) - strlen("/tasks"); - - /* tmp_path would be pointing to the last six characters */ - tmp_path = (char *)path + tmp_len; - - /* - * Checking to see, if this is actually a 'tasks' file We need to - * compare the last 6 bytes - */ - if (strcmp(tmp_path, "/tasks")) { - cgroup->control_uid = stat_buffer.st_uid; - cgroup->control_gid = stat_buffer.st_gid; - } - - ctrl_name = strtok_r(d_name, ".", &buffer); - - if (!ctrl_name) { - error = ECGFAIL; - goto fill_error; - } - - ctrl_file = strtok_r(NULL, ".", &buffer); - - if (!ctrl_file) { - error = ECGINVAL; - goto fill_error; - } - - if (strcmp(ctrl_name, cg_mount_table[cg_index].name) == 0) { - error = cg_rd_ctrl_file(cg_mount_table[cg_index].name, cgroup->name, - ctrl_dir->d_name, &ctrl_value); - if (error || !ctrl_value) - goto fill_error; - - if (cgroup_add_value_string(cgc, ctrl_dir->d_name, ctrl_value)) { - error = ECGFAIL; - goto fill_error; - } - } -fill_error: - if (ctrl_value) - free(ctrl_value); - free(d_name); - - return error; -} - -/* - * cgroup_get_cgroup reads the cgroup data from the filesystem. - * struct cgroup has the name of the group to be populated - * - * return 0 on success. - */ -int cgroup_get_cgroup(struct cgroup *cgroup) -{ - char cgrp_ctrl_path[FILENAME_MAX]; - struct dirent *ctrl_dir = NULL; - char mnt_path[FILENAME_MAX]; - int initial_controller_cnt; - char *control_path = NULL; - int controller_cnt = 0; - DIR *dir = NULL; - int error; - int i, j; - int ret; - - if (!cgroup_initialized) { - /* ECGROUPNOTINITIALIZED */ - return ECGROUPNOTINITIALIZED; - } - - if (!cgroup) { - /* ECGROUPNOTALLOWED */ - return ECGROUPNOTALLOWED; - } - - initial_controller_cnt = cgroup->index; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - for (i = 0; i < CG_CONTROLLER_MAX && cg_mount_table[i].name[0] != '\0'; i++) { - struct cgroup_controller *cgc; - struct stat stat_buffer; - int mnt_path_len; - - if (initial_controller_cnt > 0) { - bool skip_this_controller = true; - - /* - * The user has specified a list of controllers they are interested - * in. Only operate on the specified controllers - */ - for (j = 0; j < cgroup->index; j++) { - if (strncmp(cg_mount_table[i].name, cgroup->controller[j]->name, - CONTROL_NAMELEN_MAX) == 0) - skip_this_controller = false; - } - - if (skip_this_controller) - continue; - } - - if (!cg_build_path_locked(NULL, mnt_path, cg_mount_table[i].name)) - continue; - - mnt_path_len = strlen(mnt_path); - strncat(mnt_path, cgroup->name, FILENAME_MAX - mnt_path_len - 1); - mnt_path[sizeof(mnt_path) - 1] = '\0'; - - if (access(mnt_path, F_OK)) - continue; - - if (!cg_build_path_locked(cgroup->name, cgrp_ctrl_path, cg_mount_table[i].name)) { - /* This fails when the cgroup does not exist for that controller. */ - continue; - } - - /* Get the uid and gid information. */ - if (cg_mount_table[i].version == CGROUP_V1) { - ret = asprintf(&control_path, "%s/tasks", cgrp_ctrl_path); - - if (ret < 0) { - last_errno = errno; - error = ECGOTHER; - goto unlock_error; - } - - if (stat(control_path, &stat_buffer)) { - last_errno = errno; - free(control_path); - error = ECGOTHER; - goto unlock_error; - } - - cgroup->tasks_uid = stat_buffer.st_uid; - cgroup->tasks_gid = stat_buffer.st_gid; - - free(control_path); - } else { /* cgroup v2 */ - bool enabled; - - error = cgroupv2_get_controllers(cgrp_ctrl_path, cg_mount_table[i].name, - &enabled); - if (error == ECGROUPNOTMOUNTED) { - /* - * This controller isn't enabled. Only hide it from the - * user if they've chosen to view all enabled controllers. - * - * If they've specified the controllers they're interested in - * and we've made it this far, then they are explicitly - * interested in this controller and we should not remove it. - */ - if (initial_controller_cnt == 0) { - controller_cnt++; - continue; - } - } else if (error) { - goto unlock_error; - } - } - - if (initial_controller_cnt) - cgc = cgroup_get_controller(cgroup, cg_mount_table[i].name); - else - cgc = cgroup_add_controller(cgroup, cg_mount_table[i].name); - if (!cgc) { - error = ECGINVAL; - goto unlock_error; - } - - dir = opendir(cgrp_ctrl_path); - if (!dir) { - last_errno = errno; - error = ECGOTHER; - goto unlock_error; - } - - controller_cnt++; - - while ((ctrl_dir = readdir(dir)) != NULL) { - /* Skip over non regular files */ - if (ctrl_dir->d_type != DT_REG) - continue; - - error = cgroup_fill_cgc(ctrl_dir, cgroup, cgc, i); - for (j = 0; j < cgc->index; j++) - cgc->values[j]->dirty = false; - - if (error == ECGFAIL) { - closedir(dir); - goto unlock_error; - } - } - closedir(dir); - - if (!strcmp(cgc->name, "memory")) { - /* - * Make sure that memory.limit_in_bytes is placed before - * memory.memsw.limit_in_bytes in the list of values - */ - int memsw_limit = -1; - int mem_limit = -1; - - for (j = 0; j < cgc->index; j++) { - if (!strcmp(cgc->values[j]->name, "memory.memsw.limit_in_bytes")) - memsw_limit = j; - else if (!strcmp(cgc->values[j]->name, "memory.limit_in_bytes")) - mem_limit = j; - } - - if (memsw_limit >= 0 && memsw_limit < mem_limit) { - struct control_value *val = cgc->values[memsw_limit]; - - cgc->values[memsw_limit] = cgc->values[mem_limit]; - cgc->values[mem_limit] = val; - } - } - } - - /* - * Check if the group really exists or not. The cgroup->index controller count can't - * be used in this case because cgroup v2 allows controllers to be enabled/disabled in - * the subtree_control file. Rather, cgroup_get_cgroup() tracks the number of possible - * controllers in the controller_cnt variable and uses that to determine if the cgroup - * exists or not. - */ - if (!controller_cnt) { - error = ECGROUPNOTEXIST; - goto unlock_error; - } - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return 0; - -unlock_error: - pthread_rwlock_unlock(&cg_mount_table_lock); - /* - * XX: Need to figure out how to cleanup? Cleanup just the stuff - * we added, or the whole structure. - */ - cgroup_free_controllers(cgroup); - cgroup = NULL; - - return error; -} - -/** - * cg_prepare_cgroup Process the selected rule. Prepare the cgroup structure - * which can be used to add the task to destination cgroup. - * - * returns 0 on success. - */ -static int cg_prepare_cgroup(struct cgroup *cgroup, pid_t pid, const char *dest, - const char * const controllers[]) -{ - struct cgroup_controller *cptr = NULL; - const char *controller = NULL; - int ret = 0, i; - - /* Fill in cgroup details. */ - cgroup_dbg("Will move pid %d to cgroup '%s'\n", pid, dest); - - strncpy(cgroup->name, dest, FILENAME_MAX); - cgroup->name[FILENAME_MAX-1] = '\0'; - - /* Scan all the controllers */ - for (i = 0; i < CG_CONTROLLER_MAX; i++) { - int j = 0; - - if (!controllers[i]) - return 0; - controller = controllers[i]; - - /* If first string is "*" that means all the mounted controllers. */ - if (strcmp(controller, "*") == 0) { - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (j = 0; j < CG_CONTROLLER_MAX && - cg_mount_table[j].name[0] != '\0'; j++) { - cgroup_dbg("Adding controller %s\n", cg_mount_table[j].name); - cptr = cgroup_add_controller(cgroup, cg_mount_table[j].name); - if (!cptr) { - cgroup_warn("adding controller '%s' failed\n", - cg_mount_table[j].name); - pthread_rwlock_unlock(&cg_mount_table_lock); - cgroup_free_controllers(cgroup); - return ECGROUPNOTALLOWED; - } - } - pthread_rwlock_unlock(&cg_mount_table_lock); - return ret; - } - - /* It is individual controller names and not "*" */ - cgroup_dbg("Adding controller %s\n", controller); - cptr = cgroup_add_controller(cgroup, controller); - if (!cptr) { - cgroup_warn("adding controller '%s' failed\n", controller); - cgroup_free_controllers(cgroup); - return ECGROUPNOTALLOWED; - } - } - - return ret; -} - -/** - * Determines if the rule is a wildcard rule and if so, compares the wildcard - * rule against the new process. If the new process matches the wildcard rule, - * then this function returns true. Otherwise it returns false. - * - * @param rule_procname The procname field of the rule - * @param procname The name of the new process - * @return True if the procname matches the rule. False otherwise - */ -STATIC bool cgroup_compare_wildcard_procname(const char * const rule_procname, - const char * const procname) -{ - size_t rule_strlen = strlen(rule_procname); - - if (rule_procname[rule_strlen - 1] != '*') - /* This rule does not end in a wildcard */ - return false; - - /* Compare the two strings up to the asterisk */ - if (strncmp(rule_procname, procname, rule_strlen - 1) != 0) - /* The strings did not match */ - return false; - - /* All checks passed. The wildcarded process matched this rule */ - return true; -} - -static int cgroup_find_matching_destination(char *cgroup_list[], const char * const rule_dest, - int *matching_index) -{ - size_t rule_strlen = strlen(rule_dest); - int ret = -ENODATA; - int i; - - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (cgroup_list[i] == NULL) - break; - - if (rule_dest[rule_strlen - 1] == '/') { - /* - * Avoid a weird corner case where given a rule dest - * like 'folder/', we _don't_ want to match 'folder1' - */ - if (strlen(cgroup_list[i]) >= rule_strlen && - cgroup_list[i][rule_strlen - 1] != '/') - continue; - - /* - * Strip off the '/' at the end of the rule, as - * the destination from the cgroup_list will not - * have a trailing '/' - */ - rule_strlen--; - } - - if (strncmp(rule_dest, cgroup_list[i], - rule_strlen) == 0) { - *matching_index = i; - ret = 0; - break; - } - } - - return ret; -} - -static int cgroup_find_matching_controller(char * const *rule_controllers, - const char * const pid_controller, int *matching_index) -{ - int ret = -ENODATA; - int i; - - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (rule_controllers[i] == NULL) - break; - - if (strlen(rule_controllers[i]) != strlen(pid_controller)) - continue; - - if (strncmp(pid_controller, rule_controllers[i], strlen(pid_controller)) == 0) { - *matching_index = i; - ret = 0; - break; - } - } - - return ret; -} - -/** - * Evaluates if rule is an ignore rule and the pid/procname match this rule. - * If rule is an ignore rule and the pid/procname match this rule, then this - * function returns true. Otherwise it returns false. - * - * @param rule The rule being evaluated - * @param pid PID of the process being compared - * @param procname Process name of the process being compared - * @return True if the rule is an ignore rule and this pid/procname - * match the rule. False otherwise - */ -STATIC bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule, pid_t pid, - const char * const procname) -{ - char *controller_list[MAX_MNT_ELEMENTS] = { '\0' }; - char *cgroup_list[MAX_MNT_ELEMENTS] = { '\0' }; - int rule_matching_controller_idx; - int cgroup_list_matching_idx; - bool found_match = false; - char *token, *saveptr; - int ret, i; - - if (!rule->is_ignore) - /* Immediately return if the 'ignore' option is not set */ - return false; - - ret = cg_get_cgroups_from_proc_cgroups(pid, cgroup_list, controller_list, - MAX_MNT_ELEMENTS); - if (ret < 0) - goto out; - - ret = cgroup_find_matching_destination(cgroup_list, rule->destination, - &cgroup_list_matching_idx); - if (ret < 0) - /* No cgroups matched */ - goto out; - - token = strtok_r(controller_list[cgroup_list_matching_idx], ",", &saveptr); - while (token != NULL) { - - ret = cgroup_find_matching_controller(rule->controllers, token, - &rule_matching_controller_idx); - if (ret == 0) - /* We found a matching controller */ - break; - - token = strtok_r(NULL, ",", &saveptr); - } - - if (!rule->procname) { - /* - * The rule procname is empty, thus it's a wildcard and - * all processes match. - */ - found_match = true; - goto out; - } - - if (!strcmp(rule->procname, procname)) { - found_match = true; - goto out; - } - - if (cgroup_compare_wildcard_procname(rule->procname, procname)) - found_match = true; - -out: - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (controller_list[i]) - free(controller_list[i]); - if (cgroup_list[i]) - free(cgroup_list[i]); - } - - return found_match; -} - -static struct cgroup_rule *cgroup_find_matching_rule_uid_gid(uid_t uid, gid_t gid, - struct cgroup_rule *rule) -{ - /* Temporary user data */ - struct passwd *usr = NULL; - - /* Temporary group data */ - struct group *grp = NULL; - - /* Temporary string pointer */ - char *sp = NULL; - - /* Loop variable */ - int i = 0; - - while (rule) { - /* Skip "%" which indicates continuation of previous rule. */ - if (rule->username[0] == '%') { - rule = rule->next; - continue; - } - /* The wildcard rule always matches. */ - if ((rule->uid == CGRULE_WILD) && (rule->gid == CGRULE_WILD)) - return rule; - - /* This is the simple case of the UID matching. */ - if (rule->uid == uid) - return rule; - - /* This is the simple case of the GID matching. */ - if (rule->gid == gid) - return rule; - - /* If this is a group rule, the UID might be a member. */ - if (rule->username[0] == '@') { - /* Get the group data. */ - sp = &(rule->username[1]); - grp = getgrnam(sp); - if (!grp) { - rule = rule->next; - continue; - } - - /* Get the data for UID. */ - usr = getpwuid(uid); - if (!usr) { - rule = rule->next; - continue; - } - - /* If UID is a member of group, we matched. */ - for (i = 0; grp->gr_mem[i]; i++) { - if (!(strcmp(usr->pw_name, grp->gr_mem[i]))) - return rule; - } - } - - /* If we haven't matched, try the next rule. */ - rule = rule->next; - } - - /* If we get here, no rules matched. */ - return NULL; -} - -/** - * Finds the first rule in the cached list that matches the given UID, GID - * or PROCESS NAME, and returns a pointer to that rule. - * This function uses rl_lock. - * - * This function may NOT be thread safe. - * @param uid The UID to match - * @param gid The GID to match - * @param procname The PROCESS NAME to match - * @return Pointer to the first matching rule, or NULL if no match - * TODO: Determine thread-safeness and fix if not safe. - */ -static struct cgroup_rule *cgroup_find_matching_rule(uid_t uid, gid_t gid, pid_t pid, - const char *procname) -{ - /* Return value */ - struct cgroup_rule *ret = rl.head; - char *base = NULL; - - pthread_rwlock_wrlock(&rl_lock); - while (ret) { - ret = cgroup_find_matching_rule_uid_gid(uid, gid, ret); - if (!ret) - break; - if (cgroup_compare_ignore_rule(ret, pid, procname)) - /* - * This pid matched a rule that instructs the - * cgrules daemon to ignore this process. - */ - break; - if (ret->is_ignore) { - /* - * The rule currently being examined is an ignore - * rule, but it didn't match this pid. Move on to - * the next rule - */ - ret = ret->next; - continue; - } - if (!procname) - /* If procname is NULL, return a rule matching UID or GID. */ - break; - if (!ret->procname) - /* If no process name in a rule, that means wildcard */ - break; - if (!strcmp(ret->procname, procname)) - break; - - base = cgroup_basename(procname); - if (!strcmp(ret->procname, base)) - /* Check a rule of basename. */ - break; - if (cgroup_compare_wildcard_procname(ret->procname, procname)) - break; - ret = ret->next; - free(base); - base = NULL; - } - pthread_rwlock_unlock(&rl_lock); - - if (base) - free(base); - - return ret; -} - -/* - * Procedure the existence of cgroup "prefix" is in subsystem - * controller_name return 0 on success - */ -int cgroup_exist_in_subsystem(char *controller_name, char *prefix) -{ - char path[FILENAME_MAX]; - char *ret_path; - DIR *dir; - int ret; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - ret_path = cg_build_path_locked(prefix, path, controller_name); - pthread_rwlock_unlock(&cg_mount_table_lock); - if (!ret_path) { - ret = 1; - goto end; - } - - dir = opendir(path); - if (dir == NULL) { - /* cgroup in wanted subsystem does not exist */ - ret = 1; - } else { - /* cgroup in wanted subsystem exists */ - ret = 0; - closedir(dir); - } -end: - return ret; -} - -/* - * Auxiliary function return a pointer to the string which is copy of - * input string and end with the slash - */ -char *cgroup_copy_with_slash(char *input) -{ - int len = strlen(input); - char *output; - - /* If input does not end with '/', allocate one more space for it */ - if ((input[len-1]) != '/') - len = len+1; - - output = (char *)malloc(sizeof(char)*(len+1)); - if (output == NULL) - return NULL; - - strcpy(output, input); - output[len-1] = '/'; - output[len] = '\0'; - - return output; -} - -/* Add controller to a group if it is not exists create it */ -static int add_controller(struct cgroup **pgroup, char *group_name, - char controller_name[FILENAME_MAX]) -{ - struct cgroup_controller *controller = NULL; - struct cgroup *group = pgroup[0]; - int ret = 0; - - if (group == NULL) { - /* It is the first controllerc the group have to be created */ - group = cgroup_new_cgroup(group_name); - if (group == NULL) { - ret = ECGFAIL; - goto end; - } - pgroup[0] = group; - } - - controller = cgroup_add_controller(group, controller_name); - if (controller == NULL) { - cgroup_free(&group); - ret = ECGFAIL; - } -end: - return ret; -} - -/* - * Create control group based given template if the group already don't exist - * dest is template name with substitute variables tmp is used cgrules rule. - */ -static int cgroup_create_template_group(char *orig_group_name, struct cgroup_rule *tmp, int flags) -{ - - struct cgroup *template_group = NULL; - char *template_name = NULL; /* Name of the template. */ - char *group_name = NULL; /* Name of the group based on */ - /* template variables are substituted.*/ - char *template_position; /* Denotes directory in template */ - /* path which is investigated. */ - char *group_position; /* Denotes directory in cgroup path */ - /* which is investigated. */ - - int ret = 0; - int exist; - int i; - - /* Template name and group name have to have '/' sign at the end */ - template_name = cgroup_copy_with_slash(tmp->destination); - if (template_name == NULL) { - ret = ECGOTHER; - last_errno = errno; - goto end; - } - group_name = cgroup_copy_with_slash(orig_group_name); - if (group_name == NULL) { - ret = ECGOTHER; - last_errno = errno; - free(template_name); - template_name = NULL; - goto end; - } - - /* Set start positions */ - template_position = strchr(template_name, '/'); - group_position = strchr(group_name, '/'); - - /* - * Go recursively through whole path to template group and create - * given directory if it does not exist yet - */ - while ((group_position != NULL) && (template_position != NULL)) { - /* Set new subpath */ - group_position[0] = '\0'; - template_position[0] = '\0'; - template_group = NULL; - - /* Test for which controllers wanted group does not exist */ - i = 0; - while (tmp->controllers[i] != NULL) { - exist = cgroup_exist_in_subsystem(tmp->controllers[i], group_name); - - if (exist != 0) { - /* The cgroup does not exist */ - ret = add_controller(&template_group, group_name, - tmp->controllers[i]); - if (ret != 0) - goto while_end; - } - i++; - } - - if (template_group != NULL) { - /* New group have to be created */ - if (strcmp(group_name, template_name) == 0) { - /* The prefix cgroup without template */ - ret = cgroup_create_cgroup(template_group, 0); - } else { - /* Use template to create relevant cgroup */ - ret = cgroup_config_create_template_group(template_group, - template_name, flags); - } - - if (ret != 0) { - cgroup_free(&template_group); - goto while_end; - } - cgroup_dbg("Group %s created - based on template %s\n", group_name, - template_name); - - cgroup_free(&template_group); - } - template_position[0] = '/'; - group_position[0] = '/'; - template_position = strchr(++template_position, '/'); - group_position = strchr(++group_position, '/'); - } - -while_end: - if ((template_position != NULL) && (template_position[0] == '\0')) - template_position[0] = '/'; - if ((group_position != NULL) && (group_position[0] == '\0')) - group_position[0] = '/'; - -end: - if (group_name != NULL) - free(group_name); - if (template_name != NULL) - free(template_name); - - return ret; -} - -int cgroup_change_cgroup_flags(uid_t uid, gid_t gid, const char *procname, pid_t pid, int flags) -{ - /* Temporary pointer to a rule */ - struct cgroup_rule *tmp = NULL; - - /* Temporary variables for destination substitution */ - char newdest[FILENAME_MAX]; - struct passwd *user_info; - struct group *group_info; - int available; - int written; - int i, j; - - /* Return codes */ - int ret = 0; - - /* We need to check this before doing anything else! */ - if (!cgroup_initialized) { - cgroup_warn("libcgroup is not initialized\n"); - ret = ECGROUPNOTINITIALIZED; - goto finished; - } - - /* - * User had asked to find the matching rule (if one exist) in the - * cached rules but the list might be empty due to the inactive - * cgrulesengd. Lets emulate its behaviour of caching the rules by - * reloading the rules from the configuration file. - */ - if ((flags & CGFLAG_USECACHE) && (rl.head == NULL)) { - cgroup_warn("no cached rules found, trying to reload from %s.\n", - CGRULES_CONF_FILE); - - ret = cgroup_reload_cached_rules(); - if (ret != 0) - goto finished; - } - - /* - * If the user did not ask for cached rules, we must parse the - * configuration to find a matching rule (if one exists). - * Else, we'll find the first match in the cached list (rl). - */ - if (!(flags & CGFLAG_USECACHE)) { - cgroup_dbg("Not using cached rules for PID %d.\n", pid); - ret = cgroup_parse_rules(false, uid, gid, procname); - - /* The configuration file has an error! We must exit now. */ - if (ret != -1 && ret != 0) { - cgroup_err("failed to parse the configuration rules\n"); - goto finished; - } - - /* We did not find a matching rule, so we're done. */ - if (ret == 0) { - cgroup_dbg("No rule found to match PID: %d, UID: %d, GID: %d\n", - pid, uid, gid); - goto finished; - } - - /* Otherwise, we did match a rule and it's in trl. */ - tmp = trl.head; - } else { - /* Find the first matching rule in the cached list. */ - tmp = cgroup_find_matching_rule(uid, gid, pid, procname); - if (!tmp) { - cgroup_dbg("No rule found to match PID: %d, UID: %d, GID: %d\n", - pid, uid, gid); - ret = 0; - goto finished; - } - } - cgroup_dbg("Found matching rule %s for PID: %d, UID: %d, GID: %d\n", - tmp->username, pid, uid, gid); - - if (tmp->is_ignore) { - /* - * This rule has instructed us that this pid is not to be - * processed and should be ignored - */ - cgroup_dbg("Matching rule is an ignore rule\n"); - ret = 0; - goto finished; - } - - /* If we are here, then we found a matching rule, so execute it. */ - do { - cgroup_dbg("Executing rule %s for PID %d... ", tmp->username, pid); - - /* Destination substitutions */ - for (j = i = 0; i < strlen(tmp->destination) && - (j < FILENAME_MAX - 2); ++i, ++j) { - if (tmp->destination[i] == '%') { - /* How many bytes did we write / error check */ - written = 0; - /* How many bytes can we write */ - available = FILENAME_MAX - j - 2; - /* Substitution */ - switch (tmp->destination[++i]) { - case 'U': - written = snprintf(newdest+j, available, "%d", uid); - break; - case 'u': - user_info = getpwuid(uid); - if (user_info) { - written = snprintf(newdest + j, available, "%s", - user_info->pw_name); - } else { - written = snprintf(newdest + j, available, "%d", - uid); - } - break; - case 'G': - written = snprintf(newdest + j, available, "%d", gid); - break; - case 'g': - group_info = getgrgid(gid); - if (group_info) { - written = snprintf(newdest + j, available, "%s", - group_info->gr_name); - } else { - written = snprintf(newdest + j, available, "%d", - gid); - } - break; - case 'P': - written = snprintf(newdest + j, available, "%d", pid); - break; - case 'p': - if (procname) { - written = snprintf(newdest + j, available, "%s", - procname); - } else { - written = snprintf(newdest + j, available, "%d", - pid); - } - break; - } - written = min(written, available); - /* - * written<1 only when either error occurred - * during snprintf or if no substitution was made - * at all. In both cases, we want to just copy - * input string. - */ - if (written < 1) { - newdest[j] = '%'; - if (available > 1) - newdest[++j] = tmp->destination[i]; - } else { - /* - * In next iteration, we will write just - * after the substitution, but j will get - * incremented in the meantime. - */ - j += written - 1; - } - } else { - if (tmp->destination[i] == '\\') - ++i; - newdest[j] = tmp->destination[i]; - } - } - - newdest[j] = 0; - if (strcmp(newdest, tmp->destination) != 0) { - /* Destination tag contains templates */ - - cgroup_dbg("control group %s is template\n", newdest); - ret = cgroup_create_template_group(newdest, tmp, flags); - if (ret) { - cgroup_warn("failed to create cgroup based on template %s\n", - newdest); - goto finished; - } - } - - /* Apply the rule */ - ret = cgroup_change_cgroup_path(newdest, pid, - (const char * const *)tmp->controllers); - if (ret) { - cgroup_warn("failed to apply the rule. Error was: %d\n", ret); - goto finished; - } - cgroup_dbg("OK!\n"); - - /* - * Now, check for multi-line rules. As long as the "next" - * rule starts with '%', it's actually part of the rule that - * we just executed. - */ - tmp = tmp->next; - } while (tmp && (tmp->username[0] == '%')); - -finished: - return ret; -} - -int cgroup_change_cgroup_uid_gid_flags(uid_t uid, gid_t gid, pid_t pid, int flags) -{ - return cgroup_change_cgroup_flags(uid, gid, NULL, pid, flags); -} - -/** - * Provides backwards-compatibility with older versions of the API. - * This function is deprecated, and cgroup_change_cgroup_uid_gid_flags() - * should be used instead. In fact, this function simply calls the newer - * one with flags set to 0 (none). - * @param uid The UID to match - * @param gid The GID to match - * @param pid The PID of the process to move - * @return 0 on success, > 0 on error - */ -int cgroup_change_cgroup_uid_gid(uid_t uid, gid_t gid, pid_t pid) -{ - return cgroup_change_cgroup_uid_gid_flags(uid, gid, pid, 0); -} - -/** - * Changes the cgroup of a program based on the path provided. In this case, - * the user must already know into which cgroup the task should be placed and - * no rules will be parsed. - * - * returns 0 on success. - */ -int cgroup_change_cgroup_path(const char *dest, pid_t pid, const char *const controllers[]) -{ - struct dirent *task_dir = NULL; - char path[FILENAME_MAX]; - struct cgroup cgroup; - int nr, ret; - pid_t tid; - DIR *dir; - - if (!cgroup_initialized) { - cgroup_warn("libcgroup is not initialized\n"); - return ECGROUPNOTINITIALIZED; - } - memset(&cgroup, 0, sizeof(struct cgroup)); - - - if (is_cgroup_mode_unified() && !controllers) { - /* - * Do not require the user to pass in an array of controller strings on - * cgroup v2 systems. The hierarchy will be the same regardless of - * whether controllers are provided or not. - */ - strncpy(cgroup.name, dest, FILENAME_MAX); - cgroup.name[FILENAME_MAX-1] = '\0'; - } else { - if (!controllers) - return ECGINVAL; - - ret = cg_prepare_cgroup(&cgroup, pid, dest, controllers); - if (ret) - return ret; - } - - /* Add process to cgroup */ - ret = cgroup_attach_task_pid(&cgroup, pid); - if (ret) { - cgroup_warn("cgroup_attach_task_pid failed: %d\n", ret); - goto finished; - } - - /* Add all threads to cgroup */ - snprintf(path, FILENAME_MAX, "/proc/%d/task/", pid); - dir = opendir(path); - if (!dir) { - last_errno = errno; - ret = ECGOTHER; - goto finished; - } - - while ((task_dir = readdir(dir)) != NULL) { - nr = sscanf(task_dir->d_name, "%i", &tid); - if (nr < 1) - continue; - - if (tid == pid) - continue; - - ret = cgroup_attach_task_pid(&cgroup, tid); - if (ret) { - cgroup_warn("cgroup_attach_task_pid failed: %d\n", ret); - break; - } - } - - closedir(dir); - -finished: - cgroup_free_controllers(&cgroup); - - return ret; -} - -/** - * Changes the cgroup of all running PIDs based on the rules in the config file. - * If a rules exists for a PID, then the PID is placed in the correct group. - * - * This function may be called after creating new control groups to move - * running PIDs into the newly created control groups. - * @return 0 on success, < 0 on error - */ -int cgroup_change_all_cgroups(void) -{ - struct dirent *pid_dir = NULL; - char *path = "/proc/"; - DIR *dir; - - dir = opendir(path); - if (!dir) - return -ECGOTHER; - - while ((pid_dir = readdir(dir)) != NULL) { - int err, pid; - uid_t euid; - gid_t egid; - char *procname = NULL; - - err = sscanf(pid_dir->d_name, "%i", &pid); - if (err < 1) - continue; - - err = cgroup_get_uid_gid_from_procfs(pid, &euid, &egid); - if (err) - continue; - - err = cgroup_get_procname_from_procfs(pid, &procname); - if (err) - continue; - - err = cgroup_change_cgroup_flags(euid, egid, procname, pid, CGFLAG_USECACHE); - if (err) - cgroup_dbg("cgroup change pid %i failed\n", pid); - - free(procname); - } - - closedir(dir); - return 0; -} - -/** - * Print the cached rules table. This function should be called only after - * first calling cgroup_parse_config(), but it will work with an empty rule - * list. - * @param fp The file stream to print to - */ -void cgroup_print_rules_config(FILE *fp) -{ - /* Iterator */ - struct cgroup_rule *itr = NULL; - - /* Loop variable */ - int i = 0; - - pthread_rwlock_rdlock(&rl_lock); - - if (!(rl.head)) { - fprintf(fp, "The rules table is empty.\n\n"); - pthread_rwlock_unlock(&rl_lock); - return; - } - - itr = rl.head; - while (itr) { - fprintf(fp, "Rule: %s", itr->username); - if (itr->procname) - fprintf(fp, ":%s", itr->procname); - fprintf(fp, "\n"); - - if (itr->uid == CGRULE_WILD) - fprintf(fp, " UID: any\n"); - else if (itr->uid == CGRULE_INVALID) - fprintf(fp, " UID: N/A\n"); - else - fprintf(fp, " UID: %d\n", itr->uid); - - if (itr->gid == CGRULE_WILD) - fprintf(fp, " GID: any\n"); - else if (itr->gid == CGRULE_INVALID) - fprintf(fp, " GID: N/A\n"); - else - fprintf(fp, " GID: %d\n", itr->gid); - - fprintf(fp, " DEST: %s\n", itr->destination); - - fprintf(fp, " CONTROLLERS:\n"); - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (itr->controllers[i]) - fprintf(fp, " %s\n", itr->controllers[i]); - } - fprintf(fp, " OPTIONS:\n"); - if (itr->is_ignore) - fprintf(fp, " IS_IGNORE: True\n"); - else - fprintf(fp, " IS_IGNORE: False\n"); - fprintf(fp, "\n"); - itr = itr->next; - } - pthread_rwlock_unlock(&rl_lock); -} - -/** - * Reloads the rules list, using the given configuration file. - * This function is probably NOT thread safe (calls cgroup_parse_rules()). - * @return 0 on success, > 0 on failure - */ -int cgroup_reload_cached_rules(void) -{ - /* Return codes */ - int ret = 0; - - cgroup_dbg("Reloading cached rules from %s.\n", CGRULES_CONF_FILE); - ret = cgroup_parse_rules(true, CGRULE_INVALID, CGRULE_INVALID, NULL); - if (ret) { - cgroup_warn("error parsing configuration file '%s': %d\n", CGRULES_CONF_FILE, ret); - ret = ECGRULESPARSEFAIL; - goto finished; - } - - #ifdef CGROUP_DEBUG - cgroup_print_rules_config(stdout); - #endif -finished: - return ret; -} - -/** - * Initializes the rules cache. - * @return 0 on success, > 0 on error - */ -int cgroup_init_rules_cache(void) -{ - /* Return codes */ - int ret = 0; - - /* Attempt to read the configuration file and cache the rules. */ - ret = cgroup_parse_rules(true, CGRULE_INVALID, CGRULE_INVALID, NULL); - if (ret) { - cgroup_dbg("Could not initialize rule cache, error was: %d\n", ret); - } - - return ret; -} - -/** - * cgroup_get_current_controller_path - * @pid: pid of the current process for which the path is to be determined - * @controller: name of the controller for which to determine current path - * @current_path: a pointer that is filled with the value of the current - * path as seen in /proc//cgroup - */ -int cgroup_get_current_controller_path(pid_t pid, const char *controller, char **current_path) -{ - FILE *pid_cgroup_fd = NULL; - enum cg_version_t version; - enum cg_setup_mode_t mode; - bool unified = false; - char *path = NULL; - int ret; - - if (!cgroup_initialized) { - cgroup_warn("libcgroup is not initialized\n"); - return ECGROUPNOTINITIALIZED; - } - - if (!current_path) - return ECGOTHER; - - mode = cgroup_setup_mode(); - if (mode == CGROUP_MODE_LEGACY && !controller) - return ECGOTHER; - - /* - * both unified/hybrid can have the controller mounted as - * cgroup v2 version. - */ - if (!controller) { - unified = true; - } else { - ret = cgroup_get_controller_version(controller, &version); - if (ret) { - cgroup_warn("Failed to get version of the controller: %s\n", controller); - ret = ECGINVAL; - goto cleanup_path; - } - unified = (version == CGROUP_V2); - } - - ret = asprintf(&path, "/proc/%d/cgroup", pid); - if (ret <= 0) { - cgroup_warn("cannot allocate memory (/proc/pid/cgroup) ret %d\n", ret); - return ret; - } - - ret = ECGROUPNOTEXIST; - pid_cgroup_fd = fopen(path, "re"); - if (!pid_cgroup_fd) - goto cleanup_path; - - /* - * Why do we grab the cg_mount_table_lock?, the reason is that the - * cgroup of a pid can change via the cgroup_attach_task_pid() call. - * To make sure, we return consitent and safe results, we acquire the - * lock upfront. We can optimize by acquiring and releasing - * the lock in the while loop, but that will be more expensive. - */ - pthread_rwlock_rdlock(&cg_mount_table_lock); - while (!feof(pid_cgroup_fd)) { - char controllers[FILENAME_MAX]; - char cgroup_path[FILENAME_MAX]; - char *savedptr; - char *token; - int num; - - /* - * with unified mode, the /proc/pid/cgroup the output is - * similar to that of cgroup legacy and hybrid modes: - * hierarchy-ID:controller-list:cgroup-path - * - * the difference is that in cgroup v2: - * - hierarchy-ID is always 0 (one hierarchy allowed) - * - controller-list is empty - */ - if (mode == CGROUP_MODE_UNIFIED || unified) { - ret = fscanf(pid_cgroup_fd, "%d::%4096s\n", &num, cgroup_path); - if (ret != 2) { - /* - * we are interested only in unified format - * line, skip this line. - */ - if (unified) { - ret = fscanf(pid_cgroup_fd, "%*[^\n]\n"); - if (ret == 0) - continue; - } - - cgroup_warn("read failed for pid_cgroup_fd ret %d\n", ret); - last_errno = errno; - ret = ECGOTHER; - goto done; - } - - /* check if the controller is enabled in cgroup v2 */ - if (controller) { - ret = cgroupv2_controller_enabled(cgroup_path, controller); - if (ret) - goto done; - } - - *current_path = strdup(cgroup_path); - if (!*current_path) { - last_errno = errno; - ret = ECGOTHER; - goto done; - } - ret = 0; - goto done; - } - - /* - * 4096 == FILENAME_MAX, keeping the coverity happy with precision - * for the cgroup_path. - */ - ret = fscanf(pid_cgroup_fd, "%d:%[^:]:%4096s\n", &num, controllers, cgroup_path); - /* - * Magic numbers like "3" seem to be integrating into my daily - * life, I need some magic to help make them disappear :) - */ - if (ret != 3) { - cgroup_warn("read failed for pid_cgroup_fd ret %d\n", ret); - last_errno = errno; - ret = ECGOTHER; - goto done; - } - - token = strtok_r(controllers, ",", &savedptr); - while (token) { - if (strncmp(controller, token, strlen(controller) + 1) == 0) { - *current_path = strdup(cgroup_path); - if (!*current_path) { - last_errno = errno; - ret = ECGOTHER; - goto done; - } - ret = 0; - goto done; - } - token = strtok_r(NULL, ",", &savedptr); - } - } - -done: - pthread_rwlock_unlock(&cg_mount_table_lock); - fclose(pid_cgroup_fd); -cleanup_path: - free(path); - - return ret; -} - -const char *cgroup_strerror(int code) -{ - int idx = code % ECGROUPNOTCOMPILED; - - if (code == ECGOTHER) { -#ifdef STRERROR_R_CHAR_P - return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); -#else - return strerror_r(cgroup_get_last_errno(), errtext, sizeof (errtext)) ? - "unknown error" : errtext; -#endif - } - if (idx >= sizeof(cgroup_strerror_codes)/sizeof(cgroup_strerror_codes[0])) - return "Invalid error code"; - - return cgroup_strerror_codes[idx]; -} - -/** - * Return last errno, which caused ECGOTHER error. - */ -int cgroup_get_last_errno(void) -{ - return last_errno; -} - -static int cg_walk_node(FTS *fts, FTSENT *ent, const int depth, struct cgroup_file_info *info, - int dir) -{ - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - cgroup_dbg("seeing file %s\n", ent->fts_path); - - info->path = ent->fts_name; - info->parent = ent->fts_parent->fts_name; - info->full_path = ent->fts_path; - info->depth = ent->fts_level; - info->type = CGROUP_FILE_TYPE_OTHER; - - if (depth && (info->depth > depth)) - return 0; - - switch (ent->fts_info) { - case FTS_DNR: - case FTS_ERR: - errno = ent->fts_errno; - break; - case FTS_D: - if (dir & CGROUP_WALK_TYPE_PRE_DIR) - info->type = CGROUP_FILE_TYPE_DIR; - break; - case FTS_DC: - case FTS_NSOK: - case FTS_NS: - case FTS_DP: - if (dir & CGROUP_WALK_TYPE_POST_DIR) - info->type = CGROUP_FILE_TYPE_DIR; - break; - case FTS_F: - info->type = CGROUP_FILE_TYPE_FILE; - break; - case FTS_DEFAULT: - break; - } - return ret; -} - -int cgroup_walk_tree_next(int depth, void **handle, struct cgroup_file_info *info, int base_level) -{ - struct cgroup_tree_handle *entry; - FTSENT *ent; - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - entry = (struct cgroup_tree_handle *) *handle; - - ent = fts_read(entry->fts); - if (!ent) - return ECGEOF; - if (!base_level && depth) - base_level = ent->fts_level + depth; - - ret = cg_walk_node(entry->fts, ent, base_level, info, entry->flags); - - *handle = entry; - return ret; -} - -int cgroup_walk_tree_end(void **handle) -{ - struct cgroup_tree_handle *entry; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - entry = (struct cgroup_tree_handle *) *handle; - - fts_close(entry->fts); - free(entry); - *handle = NULL; - - return 0; -} - -/* TODO: Need to decide a better place to put this function. */ -int cgroup_walk_tree_begin(const char *controller, const char *base_path, int depth, void **handle, - struct cgroup_file_info *info, int *base_level) -{ - struct cgroup_tree_handle *entry; - char full_path[FILENAME_MAX]; - char *cg_path[2]; - FTSENT *ent; - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - cgroup_dbg("path is %s\n", base_path); - - if (!cg_build_path(base_path, full_path, controller)) - return ECGOTHER; - - entry = calloc(sizeof(struct cgroup_tree_handle), 1); - - if (!entry) { - last_errno = errno; - *handle = NULL; - return ECGOTHER; - } - - entry->flags |= CGROUP_WALK_TYPE_PRE_DIR; - - *base_level = 0; - cg_path[0] = full_path; - cg_path[1] = NULL; - - entry->fts = fts_open(cg_path, FTS_LOGICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); - if (entry->fts == NULL) { - free(entry); - last_errno = errno; - *handle = NULL; - return ECGOTHER; - } - ent = fts_read(entry->fts); - if (!ent) { - cgroup_warn("fts_read failed\n"); - fts_close(entry->fts); - free(entry); - *handle = NULL; - return ECGINVAL; - } - if (!*base_level && depth) - *base_level = ent->fts_level + depth; - - ret = cg_walk_node(entry->fts, ent, *base_level, info, entry->flags); - if (ret != 0) { - fts_close(entry->fts); - free(entry); - *handle = NULL; - } else { - *handle = entry; - } - return ret; -} - -int cgroup_walk_tree_set_flags(void **handle, int flags) -{ - struct cgroup_tree_handle *entry; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - if ((flags & CGROUP_WALK_TYPE_PRE_DIR) && - (flags & CGROUP_WALK_TYPE_POST_DIR)) - return ECGINVAL; - - entry = (struct cgroup_tree_handle *) *handle; - entry->flags = flags; - - *handle = entry; - return 0; -} - -/* - * This parses a stat line which is in the form of (name value) pair - * separated by a space. - */ -static int cg_read_stat(FILE *fp, struct cgroup_stat *cgroup_stat) -{ - char *saveptr = NULL; - ssize_t read_bytes; - char *line = NULL; - size_t len = 0; - char *token; - int ret = 0; - - read_bytes = getline(&line, &len, fp); - if (read_bytes == -1) { - ret = ECGEOF; - goto out_free; - } - - token = strtok_r(line, " ", &saveptr); - if (!token) { - ret = ECGINVAL; - goto out_free; - } - strncpy(cgroup_stat->name, token, FILENAME_MAX - 1); - - token = strtok_r(NULL, " ", &saveptr); - if (!token) { - ret = ECGINVAL; - goto out_free; - } - strncpy(cgroup_stat->value, token, CG_VALUE_MAX - 1); - -out_free: - free(line); - - return ret; -} - -int cgroup_read_value_end(void **handle) -{ - FILE *fp; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - fp = (FILE *)*handle; - fclose(fp); - *handle = NULL; - - return 0; -} - -int cgroup_read_value_next(void **handle, char *buffer, int max) -{ - char *ret_c; - int ret = 0; - FILE *fp; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!buffer || !handle) - return ECGINVAL; - - fp = (FILE *)*handle; - ret_c = fgets(buffer, max, fp); - if (ret_c == NULL) - ret = ECGEOF; - - return ret; -} - -int cgroup_read_value_begin(const char * const controller, const char *path, - const char * const name, void **handle, char *buffer, int max) -{ - char stat_file[FILENAME_MAX + sizeof(name)]; - char stat_path[FILENAME_MAX]; - char *ret_c = NULL; - int ret = 0; - FILE *fp; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!buffer || !handle) - return ECGINVAL; - - if (!cg_build_path(path, stat_path, controller)) - return ECGOTHER; - - snprintf(stat_file, sizeof(stat_file), "%s/%s", stat_path, - name); - fp = fopen(stat_file, "re"); - if (!fp) { - cgroup_warn("fopen failed\n"); - last_errno = errno; - *handle = NULL; - return ECGOTHER; - } - - ret_c = fgets(buffer, max, fp); - if (ret_c == NULL) - ret = ECGEOF; - - *handle = fp; - - return ret; -} - -int cgroup_read_stats_end(void **handle) -{ - FILE *fp; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - fp = (FILE *)*handle; - if (fp == NULL) - return ECGINVAL; - - fclose(fp); - - return 0; -} - -int cgroup_read_stats_next(void **handle, struct cgroup_stat *cgroup_stat) -{ - FILE *fp; - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle || !cgroup_stat) - return ECGINVAL; - - fp = (FILE *)*handle; - ret = cg_read_stat(fp, cgroup_stat); - *handle = fp; - - return ret; -} - -/* TODO: Need to decide a better place to put this function. */ -int cgroup_read_stats_begin(const char *controller, const char *path, void **handle, - struct cgroup_stat *cgroup_stat) -{ - char stat_file[FILENAME_MAX + sizeof(".stat")]; - char stat_path[FILENAME_MAX]; - int ret = 0; - FILE *fp; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!cgroup_stat || !handle) - return ECGINVAL; - - if (!cg_build_path(path, stat_path, controller)) - return ECGOTHER; - - snprintf(stat_file, sizeof(stat_file), "%s/%s.stat", stat_path, controller); - - fp = fopen(stat_file, "re"); - if (!fp) { - cgroup_warn("fopen failed\n"); - return ECGINVAL; - } - - ret = cg_read_stat(fp, cgroup_stat); - *handle = fp; - - return ret; -} - -int cgroup_get_task_end(void **handle) -{ - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!*handle) - return ECGINVAL; - - fclose((FILE *) *handle); - *handle = NULL; - - return 0; -} - -int cgroup_get_task_next(void **handle, pid_t *pid) -{ - int ret; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - ret = fscanf((FILE *) *handle, "%u", pid); - - if (ret != 1) { - if (ret == EOF) - return ECGEOF; - last_errno = errno; - return ECGOTHER; - } - - return 0; -} - -int cgroup_get_task_begin(const char *cgroup, const char *controller, void **handle, pid_t *pid) -{ - char path[FILENAME_MAX]; - char *fullpath = NULL; - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!cg_build_path(cgroup, path, controller)) - return ECGOTHER; - - ret = asprintf(&fullpath, "%s/tasks", path); - - if (ret < 0) { - last_errno = errno; - return ECGOTHER; - } - - *handle = (void *) fopen(fullpath, "re"); - free(fullpath); - - if (!*handle) { - last_errno = errno; - return ECGOTHER; - } - ret = cgroup_get_task_next(handle, pid); - - return ret; -} - -int cgroup_get_controller_end(void **handle) -{ - int *pos = (int *) *handle; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!pos) - return ECGINVAL; - - free(pos); - *handle = NULL; - - return 0; -} - -int cgroup_get_controller_next(void **handle, struct cgroup_mount_point *info) -{ - int *pos = (int *) *handle; - int ret = 0; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!pos) - return ECGINVAL; - - if (!info) - return ECGINVAL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - if (cg_mount_table[*pos].name[0] == '\0') { - ret = ECGEOF; - goto out_unlock; - } - - if (strncmp(cg_mount_table[*pos].name, CGROUP_FILE_PREFIX, CONTROL_NAMELEN_MAX) == 0) - /* - * For now, hide the "cgroup" pseudo-controller from the user. This may be - * worth revisiting in the future. - */ - (*pos)++; - - if (cg_mount_table[*pos].name[0] == '\0') { - ret = ECGEOF; - goto out_unlock; - } - - strncpy(info->name, cg_mount_table[*pos].name, FILENAME_MAX - 1); - info->name[FILENAME_MAX - 1] = '\0'; - - strncpy(info->path, cg_mount_table[*pos].mount.path, FILENAME_MAX - 1); - info->path[FILENAME_MAX - 1] = '\0'; - - (*pos)++; - *handle = pos; - -out_unlock: - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} - -int cgroup_get_controller_begin(void **handle, struct cgroup_mount_point *info) -{ - int *pos; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!info) - return ECGINVAL; - - pos = malloc(sizeof(int)); - - if (!pos) { - last_errno = errno; - return ECGOTHER; - } - - *pos = 0; - - *handle = pos; - - return cgroup_get_controller_next(handle, info); -} - -/** - * Get process data (euid and egid) from /proc//status file. - * @param pid: The process id - * @param euid: The uid of param pid - * @param egid: The gid of param pid - * @return 0 on success, > 0 on error. - */ -int cgroup_get_uid_gid_from_procfs(pid_t pid, uid_t *euid, gid_t *egid) -{ - char path[FILENAME_MAX]; - uid_t ruid, suid, fsuid; - gid_t rgid, sgid, fsgid; - bool found_euid = false; - bool found_egid = false; - char buf[4092]; - FILE *f; - - sprintf(path, "/proc/%d/status", pid); - f = fopen(path, "re"); - if (!f) - return ECGROUPNOTEXIST; - - while (fgets(buf, sizeof(buf), f)) { - if (!strncmp(buf, "Uid:", 4)) { - if (sscanf((buf + strlen("Uid:") + 1), "%d%d%d%d", - &ruid, euid, &suid, &fsuid) != 4) - break; - cgroup_dbg("Scanned proc values are %d %d %d %d\n", - ruid, *euid, suid, fsuid); - found_euid = true; - } else if (!strncmp(buf, "Gid:", 4)) { - if (sscanf((buf + strlen("Gid:") + 1), "%d%d%d%d", - &rgid, egid, &sgid, &fsgid) != 4) - break; - cgroup_dbg("Scanned proc values are %d %d %d %d\n", - rgid, *egid, sgid, fsgid); - found_egid = true; - } - if (found_euid && found_egid) - break; - } - fclose(f); - if (!found_euid || !found_egid) { - /* - * This method doesn't match the file format of - * /proc//status. The format has been changed and we - * should catch up the change. - */ - cgroup_warn("invalid file format of /proc/%d/status\n", pid); - return ECGFAIL; - } - return 0; -} - -/** - * Given a pid, this function will return the controllers and cgroups that - * the pid is a member of. The caller is expected to allocate the - * controller_list[] and cgroup_list[] arrays as well as null each entry in - * the arrays. This function will allocate the necessary memory for each - * string within the arrays. - * - * @param pid The process id - * @param cgroup_list[] An array of char pointers to hold the cgroups - * @param controller_list[] An array of char pointers to hold the list - * of controllers - * @param list_len The size of the arrays - */ -STATIC int cg_get_cgroups_from_proc_cgroups(pid_t pid, char *cgroup_list[], - char *controller_list[], int list_len) -{ - char path[FILENAME_MAX]; - char *stok_buff = NULL; - size_t buff_len; - char buf[4092]; - int ret = 0; - int idx = 0; - FILE *f; - -#ifdef UNIT_TEST - sprintf(path, "%s", TEST_PROC_PID_CGROUP_FILE); -#else - sprintf(path, "/proc/%d/cgroup", pid); -#endif - f = fopen(path, "re"); - if (!f) - return ECGROUPNOTEXIST; - - while (fgets(buf, sizeof(buf), f)) { - /* - * Each line in /proc/{pid}/cgroup is like the following: - * - * {cg#}:{controller}:{cgname} - * - * e.g. - * 7:devices:/user.slice - */ - - /* Read in the cgroup number. we don't care about it */ - stok_buff = strtok(buf, ":"); - /* Read in the controller name */ - stok_buff = strtok(NULL, ":"); - - /* - * After this point, we have allocated memory. if we return - * an error code after this, it's up to us to free the memory - * we allocated - */ - controller_list[idx] = strndup(stok_buff, strlen(stok_buff) + 1); - - /* Read in the cgroup name */ - stok_buff = strtok(NULL, ":"); - - if (stok_buff == NULL) { - /* - * An empty controller is reported on some kernels. - * It may look like this: - * 0::/user.slice/user-1000.slice/session-1.scope - * - * Ignore this controller and move on. Note that we - * need to free the controller list entry we made. - */ - free(controller_list[idx]); - controller_list[idx] = NULL; - continue; - } - - buff_len = strlen(stok_buff); - if (stok_buff[buff_len - 1] == '\n') - buff_len--; /* Don't copy the trailing newline char */ - - /* Read in the cgroup name */ - if (buff_len > 1) { - /* Strip off the leading '/' for every cgroup but the root cgroup */ - cgroup_list[idx] = malloc(buff_len); - snprintf(cgroup_list[idx], buff_len, "%s", &stok_buff[1]); - } else { - /* Retain the leading '/' since we're in the root cgroup */ - cgroup_list[idx] = strndup(stok_buff, buff_len); - } - - idx++; - if (idx >= list_len) { - cgroup_warn("Maximum mount elements reached. Consider increasing "); - cgroup_warn("MAX_MNT_ELEMENTS\n"); - break; - } - } - fclose(f); - return ret; -} - -/** - * Get process name from /proc//status file. - * @param pid: The process id - * @param pname_status : The process name - * @return 0 on success, > 0 on error. - */ -static int cg_get_procname_from_proc_status(pid_t pid, char **procname_status) -{ - char path[FILENAME_MAX]; - int ret = ECGFAIL; - char buf[4092]; - FILE *f; - int len; - - sprintf(path, "/proc/%d/status", pid); - f = fopen(path, "re"); - if (!f) - return ECGROUPNOTEXIST; - - while (fgets(buf, sizeof(buf), f)) { - if (!strncmp(buf, "Name:", 5)) { - len = strlen(buf); - if (buf[len - 1] == '\n') - buf[len - 1] = '\0'; - *procname_status = strdup(buf + strlen("Name:") + 1); - if (*procname_status == NULL) { - last_errno = errno; - ret = ECGOTHER; - break; - } - ret = 0; - break; - } - } - fclose(f); - return ret; -} - -/** - * Get process name from /proc//cmdline file. - * This function is mainly for getting a script name (shell, perl, etc). - * A script name is written into the second or later argument of - * /proc//cmdline. This function gets each argument and - * compares it to a process name taken from /proc//status. - * @param pid: The process id - * @param pname_status : The process name taken from /proc//status - * @param pname_cmdline: The process name taken from /proc//cmdline - * @return 0 on success, > 0 on error. - */ -static int cg_get_procname_from_proc_cmdline(pid_t pid, const char *pname_status, - char **pname_cmdline) -{ - char pid_cwd_path[FILENAME_MAX]; - char pid_cmd_path[FILENAME_MAX]; - char buf_pname[FILENAME_MAX]; - char buf_cwd[FILENAME_MAX]; - int ret = ECGFAIL; - int len = 0; - int c = 0; - FILE *f; - - memset(buf_cwd, '\0', sizeof(buf_cwd)); - sprintf(pid_cwd_path, "/proc/%d/cwd", pid); - - if (readlink(pid_cwd_path, buf_cwd, sizeof(buf_cwd)) < 0) - return ECGROUPNOTEXIST; - - /* readlink doesn't append a null */ - buf_cwd[FILENAME_MAX - 1] = '\0'; - - sprintf(pid_cmd_path, "/proc/%d/cmdline", pid); - f = fopen(pid_cmd_path, "re"); - if (!f) - return ECGROUPNOTEXIST; - - while (c != EOF) { - c = fgetc(f); - if ((c != EOF) && (c != '\0') && (len < FILENAME_MAX - 1)) { - buf_pname[len] = c; - len++; - continue; - } - buf_pname[len] = '\0'; - - if (len == FILENAME_MAX - 1) - while ((c != EOF) && (c != '\0')) - c = fgetc(f); - - /* - * The taken process name from /proc//status is - * shortened to 15 characters if it is over. So the name - * should be compared by its length. - */ - if (strncmp(pname_status, basename(buf_pname), TASK_COMM_LEN - 1)) { - len = 0; - continue; - } - - if (buf_pname[0] == '/') { - *pname_cmdline = strdup(buf_pname); - if (*pname_cmdline == NULL) { - last_errno = errno; - ret = ECGOTHER; - break; - } - ret = 0; - break; - } - - strcat(buf_cwd, "/"); - strcat(buf_cwd, buf_pname); - if (!realpath(buf_cwd, pid_cmd_path)) { - last_errno = errno; - ret = ECGOTHER; - break; - } - - *pname_cmdline = strdup(pid_cmd_path); - if (*pname_cmdline == NULL) { - last_errno = errno; - ret = ECGOTHER; - break; - } - ret = 0; - break; - } - fclose(f); - return ret; -} - -/** - * Get a process name from /proc file system. - * This function allocates memory for a process name, writes a process - * name onto it. So a caller should free the memory when unusing it. - * @param pid: The process id - * @param procname: The process name - * @return 0 on success, > 0 on error. - */ -int cgroup_get_procname_from_procfs(pid_t pid, char **procname) -{ - char path[FILENAME_MAX]; - char buf[FILENAME_MAX]; - char *pname_cmdline; - char *pname_status; - int ret; - - ret = cg_get_procname_from_proc_status(pid, &pname_status); - if (ret) - return ret; - - /* Get the full patch of process name from /proc//exe. */ - memset(buf, '\0', sizeof(buf)); - snprintf(path, FILENAME_MAX, "/proc/%d/exe", pid); - if (readlink(path, buf, sizeof(buf)) < 0) { - /* - * readlink() fails if a kernel thread, and a process name - * is taken from /proc//status. - */ - *procname = pname_status; - return 0; - } - /* readlink doesn't append a null */ - buf[FILENAME_MAX - 1] = '\0'; - - if (!strncmp(pname_status, basename(buf), TASK_COMM_LEN - 1)) { - /* - * The taken process name from /proc//status is - * shortened to 15 characters if it is over. So the name - * should be compared by its length. - */ - free(pname_status); - *procname = strdup(buf); - if (*procname == NULL) { - last_errno = errno; - return ECGOTHER; - } - return 0; - } - - /* - * The above strncmp() is not 0 if a shell script, because - * /proc//exe links a shell command (/bin/bash etc.) and the - * pname_status represents a shell script name. Then the full path - * of a shell script is taken from /proc//cmdline. - */ - ret = cg_get_procname_from_proc_cmdline(pid, pname_status, &pname_cmdline); - if (!ret) { - *procname = pname_cmdline; - free(pname_status); - return 0; - } - - /* - * The above strncmp() is not 0 also if executing a symbolic link, - * /proc/pid/exe points to real executable name then. Return it as - * the last resort. - */ - free(pname_status); - *procname = strdup(buf); - if (*procname == NULL) { - last_errno = errno; - return ECGOTHER; - } - - return 0; -} - -int cgroup_register_unchanged_process(pid_t pid, int flags) -{ - char buff[sizeof(CGRULE_SUCCESS_STORE_PID)]; - struct sockaddr_un addr; - size_t ret_len; - int ret = 1; - int sk; - - sk = socket(PF_UNIX, SOCK_STREAM, 0); - if (sk < 0) - return 1; - - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, CGRULE_CGRED_SOCKET_PATH); - - if (connect(sk, (struct sockaddr *)&addr, - sizeof(addr.sun_family) + strlen(CGRULE_CGRED_SOCKET_PATH)) < 0) { - /* If the daemon does not work, this function returns 0 as success. */ - ret = 0; - goto close; - } - if (write(sk, &pid, sizeof(pid)) < 0) - goto close; - - if (write(sk, &flags, sizeof(flags)) < 0) - goto close; - - ret_len = read(sk, buff, sizeof(buff)); - if (ret_len != sizeof(buff)) - goto close; - - if (strncmp(buff, CGRULE_SUCCESS_STORE_PID, sizeof(buff))) - goto close; - - ret = 0; -close: - close(sk); - - return ret; -} - -int cgroup_get_subsys_mount_point(const char *controller, char **mount_point) -{ - int ret = ECGROUPNOTEXIST; - int i; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!controller) - return ECGINVAL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - if (strncmp(cg_mount_table[i].name, controller, FILENAME_MAX)) - continue; - - *mount_point = strdup(cg_mount_table[i].mount.path); - - if (!*mount_point) { - last_errno = errno; - ret = ECGOTHER; - goto out_exit; - } - - ret = 0; - break; - } -out_exit: - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} - -int cgroup_get_all_controller_end(void **handle) -{ - FILE *proc_cgroup = (FILE *) *handle; - - if (!proc_cgroup) - return ECGINVAL; - - fclose(proc_cgroup); - *handle = NULL; - - return 0; -} - -int cgroup_get_all_controller_next(void **handle, struct controller_data *info) -{ - FILE *proc_cgroup = (FILE *) *handle; - int hierarchy, num_cgroups, enabled; - char subsys_name[FILENAME_MAX]; - int err = 0; - - if (!proc_cgroup) - return ECGINVAL; - - if (!info) - return ECGINVAL; - - /* - * check Linux Kernel sources/kernel/cgroup/cgroup.c cgroup_init_early(), - * MAX_CGROUP_TYPE_NAMELEN check for details on why 32 is used. - */ - err = fscanf(proc_cgroup, "%32s %d %d %d\n", subsys_name, &hierarchy, &num_cgroups, - &enabled); - - if (err != 4) - return ECGEOF; - - strncpy(info->name, subsys_name, FILENAME_MAX); - info->name[FILENAME_MAX-1] = '\0'; - info->hierarchy = hierarchy; - info->num_cgroups = num_cgroups; - info->enabled = enabled; - - return 0; -} - -int cgroup_get_all_controller_begin(void **handle, struct controller_data *info) -{ - FILE *proc_cgroup = NULL; - char buf[FILENAME_MAX]; - int ret; - - if (!info) - return ECGINVAL; - - proc_cgroup = fopen("/proc/cgroups", "re"); - if (!proc_cgroup) { - last_errno = errno; - return ECGOTHER; - } - - if (!fgets(buf, FILENAME_MAX, proc_cgroup)) { - last_errno = errno; - fclose(proc_cgroup); - *handle = NULL; - return ECGOTHER; - } - *handle = proc_cgroup; - - ret = cgroup_get_all_controller_next(handle, info); - if (ret != 0) { - fclose(proc_cgroup); - *handle = NULL; - } - - return ret; -} - -static int pid_compare(const void *a, const void *b) -{ - const pid_t *pid1, *pid2; - - pid1 = (pid_t *) a; - pid2 = (pid_t *) b; - - return (*pid1 - *pid2); -} - -/* pids needs to be completely uninitialized so that we can set it up - * - * Caller must free up pids. - */ -int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size) -{ - char cgroup_path[FILENAME_MAX]; - int tot_procs = 16; - pid_t *tmp_list; - FILE *procs; - int n = 0; - int err; - - cg_build_path(name, cgroup_path, controller); - strncat(cgroup_path, "/cgroup.procs", FILENAME_MAX-strlen(cgroup_path)); - - procs = fopen(cgroup_path, "r"); - if (!procs) { - last_errno = errno; - *pids = NULL; - *size = 0; - if (errno == ENOENT) - return ECGROUPUNSUPP; - else - return ECGOTHER; - } - - /* Keep doubling the memory allocated if needed */ - tmp_list = malloc(sizeof(pid_t) * tot_procs); - if (!tmp_list) { - last_errno = errno; - fclose(procs); - return ECGOTHER; - } - - while (!feof(procs)) { - while (!feof(procs) && n < tot_procs) { - pid_t pid; - - err = fscanf(procs, "%u", &pid); - if (err == EOF) - break; - tmp_list[n] = pid; - n++; - } - if (!feof(procs)) { - pid_t *orig_list = tmp_list; - - tot_procs *= 2; - tmp_list = realloc(tmp_list, sizeof(pid_t) * tot_procs); - if (!tmp_list) { - last_errno = errno; - fclose(procs); - free(orig_list); - *pids = NULL; - *size = 0; - return ECGOTHER; - } - } - } - fclose(procs); - - *size = n; - qsort(tmp_list, n, sizeof(pid_t), &pid_compare); - *pids = tmp_list; - - return 0; -} - -int cgroup_dictionary_create(struct cgroup_dictionary **dict, - int flags) -{ - if (!dict) - return ECGINVAL; - - *dict = (struct cgroup_dictionary *) calloc(1, sizeof(struct cgroup_dictionary)); - if (!*dict) { - last_errno = errno; - return ECGOTHER; - } - (*dict)->flags = flags; - - return 0; -} - -int cgroup_dictionary_add(struct cgroup_dictionary *dict, const char *name, const char *value) -{ - struct cgroup_dictionary_item *it; - - if (!dict) - return ECGINVAL; - - it = (struct cgroup_dictionary_item *) malloc(sizeof(struct cgroup_dictionary_item)); - if (!it) { - last_errno = errno; - return ECGOTHER; - } - - it->next = NULL; - it->name = name; - it->value = value; - - if (dict->tail) { - dict->tail->next = it; - dict->tail = it; - } else { - /* It is the first item */ - dict->tail = it; - dict->head = it; - } - - return 0; -} - -int cgroup_dictionary_free(struct cgroup_dictionary *dict) -{ - struct cgroup_dictionary_item *it; - - if (!dict) - return ECGINVAL; - - it = dict->head; - while (it) { - struct cgroup_dictionary_item *del = it; - - it = it->next; - if (!(dict->flags & CG_DICT_DONT_FREE_ITEMS)) { - free((void *)del->value); - free((void *)del->name); - } - free(del); - } - free(dict); - - return 0; -} - -int cgroup_dictionary_iterator_begin(struct cgroup_dictionary *dict, void **handle, - const char **name, const char **value) -{ - struct cgroup_dictionary_iterator *iter; - - *handle = NULL; - - if (!dict) - return ECGINVAL; - - iter = (struct cgroup_dictionary_iterator *) - malloc(sizeof(struct cgroup_dictionary_iterator)); - if (!iter) { - last_errno = errno; - return ECGOTHER; - } - - iter->item = dict->head; - *handle = iter; - - return cgroup_dictionary_iterator_next(handle, name, value); -} - -int cgroup_dictionary_iterator_next(void **handle, const char **name, const char **value) -{ - struct cgroup_dictionary_iterator *iter; - - if (!handle) - return ECGINVAL; - - iter = *handle; - - if (!iter) - return ECGINVAL; - - if (!iter->item) - return ECGEOF; - - *name = iter->item->name; - *value = iter->item->value; - iter->item = iter->item->next; - - return 0; -} - -void cgroup_dictionary_iterator_end(void **handle) -{ - if (!handle) - return; - - free(*handle); - *handle = NULL; -} - -int cgroup_get_subsys_mount_point_begin(const char *controller, void **handle, char *path) -{ - int i; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - if (!handle || !path || !controller) - return ECGINVAL; - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) - if (strcmp(controller, cg_mount_table[i].name) == 0) - break; - - if (cg_mount_table[i].name[0] == '\0') { - /* The controller is not mounted at all */ - *handle = NULL; - *path = '\0'; - return ECGEOF; - } - - /* - * 'handle' is pointer to struct cg_mount_point, which should be - * returned next. - */ - *handle = cg_mount_table[i].mount.next; - strcpy(path, cg_mount_table[i].mount.path); - - return 0; -} - -int cgroup_get_subsys_mount_point_next(void **handle, char *path) -{ - struct cg_mount_point *it; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - if (!handle || !path) - return ECGINVAL; - - it = *handle; - if (!it) { - *handle = NULL; - *path = '\0'; - return ECGEOF; - } - - *handle = it->next; - strcpy(path, it->path); - - return 0; -} - -int cgroup_get_subsys_mount_point_end(void **handle) -{ - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (!handle) - return ECGINVAL; - - *handle = NULL; - - return 0; -} - -int cgroup_get_controller_version(const char * const controller, enum cg_version_t * const version) -{ - int i; - - if (!version) - return ECGINVAL; - - if (!controller && strlen(cg_cgroup_v2_mount_path) > 0) { - *version = CGROUP_V2; - return 0; - } - - if (!controller) - return ECGINVAL; - - *version = CGROUP_UNK; - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - if (strncmp(cg_mount_table[i].name, controller, - sizeof(cg_mount_table[i].name)) == 0) { - *version = cg_mount_table[i].version; - return 0; - } - } - - return ECGROUPNOTEXIST; -} - -static int search_and_append_mnt_path(struct cg_mount_point **mount_point, char *path) -{ - struct cg_mount_point *mnt_point, *mnt_tmp, *mnt_prev; - - mnt_tmp = *mount_point; - while(mnt_tmp) { - if (strcmp(mnt_tmp->path, path) == 0) - return ECGVALUEEXISTS; - - mnt_prev = mnt_tmp; - mnt_tmp = mnt_tmp->next; - } - - mnt_point = malloc(sizeof(struct cg_mount_point)); - if (mnt_point == NULL) { - last_errno = errno; - return ECGOTHER; - } - - strncpy(mnt_point->path, path, FILENAME_MAX - 1); - mnt_point->path[FILENAME_MAX - 1] = '\0'; - - mnt_point->next = NULL; - - if (*mount_point == NULL) - *mount_point = mnt_point; - else - mnt_prev->next = mnt_point; - - return 0; -} - -/** - * List the mount paths, that matches the specified version - * - * @param cgrp_version The cgroup type/version - * @param mount_paths Holds the list of mount paths - * @return 0 success and list of mounts paths in mount_paths - * ECGOTHER on failure and mount_paths is NULL. - */ -int cgroup_list_mount_points(const enum cg_version_t cgrp_version, char ***mount_paths) -{ - struct cg_mount_point *mount_point, *mnt_tmp = NULL; - char **mnt_paths = NULL; - int i, idx = 0; - int ret; - - if (!cgroup_initialized) - return ECGROUPNOTINITIALIZED; - - if (cgrp_version != CGROUP_V1 && cgrp_version != CGROUP_V2) - return ECGINVAL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - if (cg_mount_table[i].version != cgrp_version) - continue; - - mount_point = &cg_mount_table[i].mount; - while (mount_point) { - ret = search_and_append_mnt_path(&mnt_tmp, mount_point->path); - if (ret != 0 && ret != ECGVALUEEXISTS) - goto err; - - /* Avoid adding duplicate mount points */ - if (ret != ECGVALUEEXISTS) - idx++; - - mount_point = mount_point->next; - } - } - - /* - * Cgroup v2 can be mounted without any controller and these mount - * paths are not part of the cg_mount_table. Check and append - * them to mnt_paths. - */ - if (cgrp_version == CGROUP_V2 && cg_cgroup_v2_empty_mount_paths ) { - mount_point = cg_cgroup_v2_empty_mount_paths; - while(mount_point) { - ret = search_and_append_mnt_path(&mnt_tmp, mount_point->path); - if (ret) - goto err; - - idx++; - mount_point = mount_point->next; - } - } - - mnt_paths = malloc(sizeof(char*) * (idx + 1)); - if (mnt_paths == NULL) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - for (i = 0, mount_point = mnt_tmp; - mount_point; - mount_point = mount_point->next, i++) { - - mnt_paths[i] = strdup(mount_point->path); - if (mnt_paths[i] == NULL) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - } - mnt_paths[i] = '\0'; - - ret = 0; - *mount_paths = mnt_paths; - -err: - pthread_rwlock_unlock(&cg_mount_table_lock); - - while(mnt_tmp) { - mount_point = mnt_tmp; - mnt_tmp = mnt_tmp->next; - free(mount_point); - } - - if (ret != 0 && mnt_paths) { - for (i = 0; i < idx; i++) - free(mnt_paths[i]); - free(mnt_paths); - *mount_paths = NULL; - } - - return ret; -} - -const struct cgroup_library_version *cgroup_version(void) -{ - return &library_version; -} - -/** - * Finds the current cgroup setup mode (legacy/unified/hybrid). - * Returns unknown of failure and setup mode on success. - */ -enum cg_setup_mode_t cgroup_setup_mode(void) -{ -#define CGROUP2_SUPER_MAGIC 0x63677270 -#define CGROUP_SUPER_MAGIC 0x27E0EB - - unsigned int cg_setup_mode_bitmask = 0U; - enum cg_setup_mode_t setup_mode; - struct statfs cgrp_buf; - int i, ret = 0; - - if (!cgroup_initialized) { - return ECGROUPNOTINITIALIZED; - } - - setup_mode = CGROUP_MODE_UNK; - - pthread_rwlock_wrlock(&cg_mount_table_lock); - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - ret = statfs(cg_mount_table[i].mount.path, &cgrp_buf); - if (ret) { - setup_mode = CGROUP_MODE_UNK; - cgroup_err("Failed to get stats of '%s'\n", cg_mount_table[i].mount.path); - goto out; - } - - if (cgrp_buf.f_type == CGROUP2_SUPER_MAGIC) - cg_setup_mode_bitmask |= (1U << 0); - else if (cgrp_buf.f_type == CGROUP_SUPER_MAGIC) - cg_setup_mode_bitmask |= (1U << 1); - } - - if (cg_cgroup_v2_empty_mount_paths) - cg_setup_mode_bitmask |= (1U << 0); - - if (cg_setup_mode_bitmask & (1U << 0) && cg_setup_mode_bitmask & (1U << 1)) - setup_mode = CGROUP_MODE_HYBRID; - else if (cg_setup_mode_bitmask & (1U << 0)) - setup_mode = CGROUP_MODE_UNIFIED; - else if (cg_setup_mode_bitmask & (1U << 1)) - setup_mode = CGROUP_MODE_LEGACY; - -out: - pthread_rwlock_unlock(&cg_mount_table_lock); - return setup_mode; -} - -int cgroup_get_controller_count(struct cgroup *cgroup) -{ - if (!cgroup) - return -1; - - return cgroup->index; -} - -struct cgroup_controller *cgroup_get_controller_by_index(struct cgroup *cgroup, int index) -{ - if (!cgroup) - return NULL; - - if (index >= cgroup->index) - return NULL; - - return cgroup->controller[index]; -} - -char *cgroup_get_controller_name(struct cgroup_controller *controller) -{ - if (!controller) - return NULL; - - return controller->name; -} diff --git a/lib/libcgroup-3.1.0/src/config.c b/lib/libcgroup-3.1.0/src/config.c deleted file mode 100644 index 767857841c7..00000000000 --- a/lib/libcgroup-3.1.0/src/config.c +++ /dev/null @@ -1,2300 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright IBM Corporation. 2007 - * - * Authors: Balbir Singh - * Dhaval Giani - * - * TODOs: - * 1. Implement our own hashing scheme - * - * Code initiated and designed by Balbir Singh. All faults are most likely - * his mistake. - * - * Cleanup and changes to use the "official" structures and functions made - * by Dhaval Giani. All faults will still be Balbir's mistake :) - */ - -#include "tools/tools-common.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -unsigned int MAX_CGROUPS = 64; /* NOTE: This value changes dynamically */ -unsigned int MAX_TEMPLATES = 64;/* NOTE: This value changes dynamically */ - -enum tc_switch_t { - CGROUP, - TEMPLATE, -}; - -extern FILE *yyin; -extern int yyparse(void); - -static struct cgroup default_group; -static int default_group_set; - -/* - * The basic global data structures. - * - * config_mount_table -> Where what controller is mounted - * table_index -> Where in the table are we. - * config_table_lock -> Serializing access to config_mount_table. - * cgroup_table -> Which cgroups have to be created. - * cgroup_table_index -> Where in the cgroup_table we are. - */ -static struct cg_mount_table_s config_mount_table[CG_CONTROLLER_MAX]; -static struct cg_mount_table_s config_namespace_table[CG_CONTROLLER_MAX]; -static int config_table_index; -static int namespace_table_index; -static pthread_rwlock_t config_table_lock = PTHREAD_RWLOCK_INITIALIZER; -static pthread_rwlock_t namespace_table_lock = PTHREAD_RWLOCK_INITIALIZER; -static struct cgroup *config_cgroup_table; -static int cgroup_table_index; - -/* - * template structures filled by cgroup_parse_config when the configuration - * file is parsing (analogous to config_cgroup_table and cgroup_table_index - * for cgroups) - */ -static struct cgroup *config_template_table; -static int config_template_table_index; - -/* - * template structures used for templates cache, config_template_table and - * cgroup_template_table_index are rewritten in each cgroup_parse_config - * thus not only if we want to reload template cache - */ -static struct cgroup *template_table; -static int template_table_index; -static struct cgroup_string_list *template_files; - - -/* Needed for the type while mounting cgroupfs. */ -#define CGROUP_FILESYSTEM "cgroup" - -#ifdef WITH_SYSTEMD -/* Directory that holds dynamically created internal libcgroup files */ -static const char * const systemd_def_cgrp_file_dir = "/var/run/libcgroup/"; - -/* File that stores the relative delegated systemd cgroup path */ -static const char * const systemd_default_cgroup_file = "/var/run/libcgroup/systemd"; - -/* Lock that protects systemd_default_cgroup_file */ -static pthread_rwlock_t systemd_default_cgroup_lock = PTHREAD_RWLOCK_INITIALIZER; - -/* - * cgroup_systemd_opts is dynamically allocated, hence having head - * and tail helps in traversing. - */ -static struct cgroup_systemd_opts *cgroup_systemd_opts_head = NULL; -static struct cgroup_systemd_opts *cgroup_systemd_opts_tail = NULL; - -static int config_create_slice_scope(char * const tmp_systemd_default_cgroup); -#endif - -/* - * NOTE: All these functions return 1 on success and not 0 as is the - * library convention - */ -/* - * This call just sets the name of the cgroup. It will always be called in - * the end, because the parser will work bottom up. It works for cgroup and - * templates tables based on flag variable: - * CGROUP ... cgroup - * TEMPLATE ... template - */ -int config_insert_cgroup(char *cg_name, int flag) -{ - - struct cgroup *config_cgroup; - struct cgroup *config_table; - unsigned int *max; - int *table_index; - - switch (flag) { - case CGROUP: - table_index = &cgroup_table_index; - config_table = config_cgroup_table; - max = &MAX_CGROUPS; - break; - case TEMPLATE: - table_index = &config_template_table_index; - config_table = config_template_table; - max = &MAX_TEMPLATES; - break; - default: - return 0; - } - - if (*table_index >= *max - 1) { - struct cgroup *newblk; - unsigned int oldlen; - - if (*max >= INT_MAX) { - last_errno = ENOMEM; - return 0; - } - oldlen = *max; - *max *= 2; - - newblk = realloc(config_table, (*max * sizeof(struct cgroup))); - if (!newblk) { - last_errno = ENOMEM; - return 0; - } - - memset(newblk + oldlen, 0, (*max - oldlen) * sizeof(struct cgroup)); - init_cgroup_table(newblk + oldlen, *max - oldlen); - config_table = newblk; - switch (flag) { - case CGROUP: - config_cgroup_table = config_table; - break; - case TEMPLATE: - config_template_table = config_table; - break; - default: - return 0; - } - cgroup_dbg("maximum %d\n", *max); - cgroup_dbg("reallocated config_table to %p\n", config_table); - } - - config_cgroup = &config_table[*table_index]; - strncpy(config_cgroup->name, cg_name, FILENAME_MAX - 1); - - /* Since this will be the last part to be parsed. */ - *table_index = *table_index + 1; - free(cg_name); - - return 1; -} - -/* - * This call just sets the name of the cgroup. It will always be called in - * the end, because the parser will work bottom up. - */ -int cgroup_config_insert_cgroup(char *cg_name) -{ - int ret; - - ret = config_insert_cgroup(cg_name, CGROUP); - return ret; -} - -/* - * This call just sets the name of the template. It will always be called - * in the end, because the parser will work bottom up. - */ -int template_config_insert_cgroup(char *cg_name) -{ - int ret; - - ret = config_insert_cgroup(cg_name, TEMPLATE); - return ret; -} - -/* - * This function sets the various controller's control files. It will always - * append values for config_cgroup/template_table_index entry in the - * config_cgroup/template_table. The index is incremented in - * cgroup/template_config_insert_cgroup. - * flag variable switch between cgroup/templates variables: - * CGROUP ... cgroup - * TEMPLATE ... template - */ -int config_parse_controller_options(char *controller, struct cgroup_dictionary *values, int flag) -{ - struct cgroup_controller *cgc; - struct cgroup *config_cgroup; - const char *name, *value; - void *iter = NULL; - int *table_index; - int error; - - switch (flag) { - case CGROUP: - table_index = &cgroup_table_index; - config_cgroup = &config_cgroup_table[*table_index]; - break; - case TEMPLATE: - table_index = &config_template_table_index; - config_cgroup = &config_template_table[*table_index]; - break; - default: - return 0; - } - - cgroup_dbg("Adding controller %s\n", controller); - cgc = cgroup_add_controller(config_cgroup, controller); - if (!cgc) - goto parse_error; - - /* - * Did we just specify the controller to create the correct set of - * directories, without setting any values? - */ - if (!values) - goto done; - - error = cgroup_dictionary_iterator_begin(values, &iter, &name, &value); - while (error == 0) { - cgroup_dbg("[1] name value pair being processed is %s=%s\n", name, value); - if (!name) - goto parse_error; - error = cgroup_add_value_string(cgc, name, value); - if (error) - goto parse_error; - error = cgroup_dictionary_iterator_next(&iter, &name, &value); - } - cgroup_dictionary_iterator_end(&iter); - iter = NULL; - - if (error != ECGEOF) - goto parse_error; - -done: - free(controller); - - return 1; - -parse_error: - free(controller); - cgroup_dictionary_iterator_end(&iter); - cgroup_delete_cgroup(config_cgroup, 1); - *table_index = *table_index - 1; - - return 0; -} - -/* - * This function sets the various controller's control files. It will always - * append values for cgroup_table_index entry in the cgroup_table. - * The index is incremented in cgroup_config_insert_cgroup - */ - -int cgroup_config_parse_controller_options(char *controller, struct cgroup_dictionary *values) -{ - int ret; - - ret = config_parse_controller_options(controller, values, CGROUP); - return ret; -} - -/* - * This function sets the various controller's control files. It will always - * append values for config_template_table_index entry in the - * config_template_table. - * The index is incremented in template_config_insert_cgroup - */ - -int template_config_parse_controller_options(char *controller, struct cgroup_dictionary *values) -{ - int ret; - - ret = config_parse_controller_options(controller, values, TEMPLATE); - return ret; -} - -/* - * Sets the tasks file's uid and gid for cgroup and templates tables based - * on flag variable: - * CGROUP ... cgroup - * TEMPLATE ... template - */ -int config_group_task_perm(char *perm_type, char *value, int flag) -{ - struct group *group, *group_buffer; - struct passwd *pw, *pw_buffer; - char buffer[CGROUP_BUFFER_LEN]; - struct cgroup *config_cgroup; - long val = atoi(value); - int table_index; - - switch (flag) { - case CGROUP: - table_index = cgroup_table_index; - config_cgroup = &config_cgroup_table[table_index]; - break; - case TEMPLATE: - table_index = config_template_table_index; - config_cgroup = &config_template_table[table_index]; - break; - default: - return 0; - } - - if (!strcmp(perm_type, "uid")) { - if (!val) { - pw = (struct passwd *) malloc(sizeof(struct passwd)); - if (!pw) - goto group_task_error; - - getpwnam_r(value, pw, buffer, CGROUP_BUFFER_LEN, &pw_buffer); - if (pw_buffer == NULL) { - free(pw); - goto group_task_error; - } - - val = pw->pw_uid; - free(pw); - } - config_cgroup->tasks_uid = val; - } - - if (!strcmp(perm_type, "gid")) { - if (!val) { - group = (struct group *) malloc(sizeof(struct group)); - - if (!group) - goto group_task_error; - - if (getgrnam_r(value, group, buffer, - CGROUP_BUFFER_LEN, &group_buffer) != 0) { - free(group); - goto group_task_error; - } - - val = group->gr_gid; - free(group); - } - config_cgroup->tasks_gid = val; - } - - if (!strcmp(perm_type, "fperm")) { - char *endptr; - - val = strtol(value, &endptr, 8); - if (*endptr) - goto group_task_error; - config_cgroup->task_fperm = val; - } - - free(perm_type); - free(value); - - return 1; - -group_task_error: - free(perm_type); - free(value); - cgroup_delete_cgroup(config_cgroup, 1); - table_index--; - - return 0; -} - -/* - * Sets the tasks file's uid and gid - */ -int cgroup_config_group_task_perm(char *perm_type, char *value) -{ - int ret; - - ret = config_group_task_perm(perm_type, value, CGROUP); - return ret; -} - -/* - * Sets the tasks file's uid and gid for templates - */ -int template_config_group_task_perm(char *perm_type, char *value) -{ - int ret; - - ret = config_group_task_perm(perm_type, value, TEMPLATE); - return ret; -} - -/* - * Sets the admin file's uid and gid for cgroup and templates tables based - * on flag variable: - * CGROUP ... cgroup - * TEMPLATE ... templates - */ -int config_group_admin_perm(char *perm_type, char *value, int flag) -{ - struct group *group, *group_buffer; - struct passwd *pw, *pw_buffer; - char buffer[CGROUP_BUFFER_LEN]; - struct cgroup *config_cgroup; - long val = atoi(value); - int table_index; - - switch (flag) { - case CGROUP: - table_index = cgroup_table_index; - config_cgroup = &config_cgroup_table[table_index]; - break; - case TEMPLATE: - table_index = config_template_table_index; - config_cgroup = &config_template_table[table_index]; - break; - default: - return 0; - } - - if (!strcmp(perm_type, "uid")) { - if (!val) { - pw = (struct passwd *) malloc(sizeof(struct passwd)); - if (!pw) - goto admin_error; - - getpwnam_r(value, pw, buffer, CGROUP_BUFFER_LEN, &pw_buffer); - if (pw_buffer == NULL) { - free(pw); - goto admin_error; - } - - val = pw->pw_uid; - free(pw); - } - config_cgroup->control_uid = val; - } - - if (!strcmp(perm_type, "gid")) { - if (!val) { - group = (struct group *) malloc(sizeof(struct group)); - if (!group) - goto admin_error; - - if (getgrnam_r(value, group, buffer, CGROUP_BUFFER_LEN, - &group_buffer) != 0) { - free(group); - goto admin_error; - } - - val = group->gr_gid; - free(group); - } - config_cgroup->control_gid = val; - } - - if (!strcmp(perm_type, "fperm")) { - char *endptr; - - val = strtol(value, &endptr, 8); - if (*endptr) - goto admin_error; - config_cgroup->control_fperm = val; - } - - if (!strcmp(perm_type, "dperm")) { - char *endptr; - - val = strtol(value, &endptr, 8); - if (*endptr) - goto admin_error; - config_cgroup->control_dperm = val; - } - - free(perm_type); - free(value); - - return 1; - -admin_error: - free(perm_type); - free(value); - cgroup_delete_cgroup(config_cgroup, 1); - table_index--; - - return 0; -} - -/* - * Set the control file's uid and gid - */ -int cgroup_config_group_admin_perm(char *perm_type, char *value) -{ - int ret; - - ret = config_group_admin_perm(perm_type, value, CGROUP); - return ret; -} - -/* - * Set the control file's uid and gid for templates - */ -int template_config_group_admin_perm(char *perm_type, char *value) -{ - int ret; - - ret = config_group_admin_perm(perm_type, value, TEMPLATE); - return ret; -} - -/* - * The moment we have found the controller's information insert it into - * the config_mount_table. - */ -int cgroup_config_insert_into_mount_table(char *name, char *mount_point) -{ - int i; - - if (config_table_index >= CG_CONTROLLER_MAX) - return 0; - - pthread_rwlock_wrlock(&config_table_lock); - - /* Merge controller names with the same mount point */ - for (i = 0; i < config_table_index; i++) { - if (strcmp(config_mount_table[i].mount.path, mount_point) == 0) { - char *cname = config_mount_table[i].name; - - strncat(cname, ",", FILENAME_MAX - strlen(cname) - 1); - strncat(cname, name, FILENAME_MAX - strlen(cname) - 1); - goto done; - } - } - - strncpy(config_mount_table[config_table_index].name, name, CONTROL_NAMELEN_MAX - 1); - config_mount_table[config_table_index].name[CONTROL_NAMELEN_MAX - 1] = '\0'; - - strncpy(config_mount_table[config_table_index].mount.path, mount_point, FILENAME_MAX - 1); - config_mount_table[config_table_index].mount.path[FILENAME_MAX - 1] = '\0'; - - config_mount_table[config_table_index].mount.next = NULL; - config_table_index++; -done: - pthread_rwlock_unlock(&config_table_lock); - free(name); - free(mount_point); - - return 1; -} - -/* - * Cleanup all the data from the config_mount_table - */ -void cgroup_config_cleanup_mount_table(void) -{ - memset(&config_mount_table, 0, sizeof(struct cg_mount_table_s) * CG_CONTROLLER_MAX); -} - -/* - * The moment we have found the controller's information insert it into - * the config_mount_table. - */ -int cgroup_config_insert_into_namespace_table(char *name, char *nspath) -{ - char *ns_tbl_name, *ns_tbl_path; - if (namespace_table_index >= CG_CONTROLLER_MAX) - return 0; - - pthread_rwlock_wrlock(&namespace_table_lock); - - ns_tbl_name = config_namespace_table[namespace_table_index].name; - strncpy(ns_tbl_name, name, CONTROL_NAMELEN_MAX - 1); - ns_tbl_name[CONTROL_NAMELEN_MAX - 1 ] = '\0'; - - ns_tbl_path = config_namespace_table[namespace_table_index].mount.path; - strncpy(ns_tbl_path, nspath, FILENAME_MAX - 1); - ns_tbl_path[FILENAME_MAX - 1] = '\0'; - - config_namespace_table[namespace_table_index].mount.next = NULL; - namespace_table_index++; - - pthread_rwlock_unlock(&namespace_table_lock); - free(name); - free(nspath); - return 1; -} - -/* - * Cleanup all the data from the config_mount_table - */ -void cgroup_config_cleanup_namespace_table(void) -{ - memset(&config_namespace_table, 0, sizeof(struct cg_mount_table_s) * CG_CONTROLLER_MAX); -} - -/** - * Add necessary options for mount. Currently only 'none' option is added - * for mounts with only 'name=xxx' and without real controller. - */ -static int cgroup_config_ajdust_mount_options(struct cg_mount_table_s *mount, unsigned long *flags) -{ - char *opts = strdup(mount->name); - char *controller = NULL; - char *save = NULL; - int name_only = 1; - char *token; - - *flags = 0; - if (opts == NULL) - return ECGFAIL; - - token = strtok_r(opts, ",", &save); - while (token != NULL) { - if (strncmp(token, "name=", 5) != 0) { - name_only = 0; - - if (!controller) { - controller = strdup(token); - if (controller == NULL) - break; - - strncpy(mount->name, controller, sizeof(mount->name)); - mount->name[sizeof(mount->name)-1] = '\0'; - } - - if (strncmp(token, "nodev", strlen("nodev")) == 0) - *flags |= MS_NODEV; - - if (strncmp(token, "noexec", strlen("noexec")) == 0) - *flags |= MS_NOEXEC; - - if (strncmp(token, "nosuid", strlen("nosuid")) == 0) - *flags |= MS_NOSUID; - - } else if (!name_only) { - /* - * We have controller + name=, do the right thing, - * since we are rebuilding mount->name - */ - strncat(mount->name, ",", FILENAME_MAX - strlen(mount->name)-1); - strncat(mount->name, token, FILENAME_MAX - strlen(mount->name) - 1); - } - token = strtok_r(NULL, ",", &save); - } - - free(controller); - free(opts); - - if (name_only) { - strncat(mount->name, ",", FILENAME_MAX - strlen(mount->name)-1); - strncat(mount->name, "none", FILENAME_MAX - strlen(mount->name) - 1); - } - - return 0; -} - -/* - * Start mounting the mount table - */ -static int cgroup_config_mount_fs(void) -{ - unsigned long flags; - struct stat buff; - int error; - int ret; - int i; - - for (i = 0; i < config_table_index; i++) { - struct cg_mount_table_s *curr = &(config_mount_table[i]); - - ret = stat(curr->mount.path, &buff); - if (ret < 0 && errno != ENOENT) { - cgroup_err("cannot access %s: %s\n", curr->mount.path, strerror(errno)); - last_errno = errno; - error = ECGOTHER; - goto out_err; - } - - if (errno == ENOENT) { - ret = cg_mkdir_p(curr->mount.path); - if (ret) { - cgroup_err("cannot create directory %s\n", curr->mount.path); - error = ret; - goto out_err; - } - } else if (!S_ISDIR(buff.st_mode)) { - cgroup_err("%s already exists but it is not a directory\n", - curr->mount.path); - errno = ENOTDIR; - last_errno = errno; - error = ECGOTHER; - goto out_err; - } - - error = cgroup_config_ajdust_mount_options(curr, &flags); - if (error) - goto out_err; - - ret = mount(CGROUP_FILESYSTEM, curr->mount.path, CGROUP_FILESYSTEM, flags, - curr->name); - - if (ret < 0) { - cgroup_err("cannot mount %s to %s: %s\n", curr->name, curr->mount.path, - strerror(errno)); - error = ECGMOUNTFAIL; - goto out_err; - } - } - - return 0; -out_err: - /* - * If we come here, we have failed. Since we have touched only - * mountpoints prior to i, we shall operate on only them now. - */ - config_table_index = i; - - return error; -} - -static int convert_controller_versions(struct cgroup *cgroup) -{ - enum cg_version_t current_version, convert_version; - struct cgroup *cgrp_cpy, *convert_cgrp = NULL; - struct cgroup_controller *cgc; - int i, j, ret; - - if (!cgroup) - return ECGINVAL; - - /* no controllers added */ - if (cgroup->index == 0) - return ECGINVAL; - - cgrp_cpy = cgroup_new_cgroup(cgroup->name); - if (!cgrp_cpy) { - cgroup_err("Failed to create cgroup %s\n", cgroup->name); - return ECGROUPNOTCREATED; - } - - /* copy the non-controllers details */ - cgrp_cpy->index = 0; - - ret = cgroup_set_uid_gid(cgrp_cpy, - cgroup->tasks_uid, cgroup->tasks_gid, - cgroup->control_uid, cgroup->control_gid); - /* cgroup existence is checked, so ignore ret value. */ - - cgroup_set_permissions(cgrp_cpy, cgroup->control_dperm, - cgroup->control_fperm, cgroup->task_fperm); - - for (i = 0; i < cgroup->index; i++) { - /* - * the controller version settings read from cgconfig.conf, - * may mismatch with the system's controller version. Hence - * assign the convert version (expected version) to the - * system's version of the controller and current version - * to the opposite of convert version. - */ - convert_version = cgroup->controller[i]->version; - current_version = convert_version == CGROUP_V1 ? CGROUP_V2 : CGROUP_V1; - - cgc = cgroup_add_controller(cgrp_cpy, cgroup->controller[i]->name); - if (!cgc) { - cgroup_err("Failed to allocated controller.\n"); - ret = ECGFAIL; - goto err; - } - - for (j = 0; j < cgroup->controller[i]->index; j++) { - ret = cgroup_add_value_string(cgc, - cgroup->controller[i]->values[j]->name, - cgroup->controller[i]->values[j]->value); - if (ret) { - cgroup_err("Failed to add setting to %s\n", cgc->name); - goto err; - } - } - - /* - * There might be more than one controller parsed from the - * cgconfig.conf file, let's create cgroup with one controller - * and see if it fails and if it does, let's try converting - * it and retry the cgroup creation, otherwise move on to - * the next controller. - */ - ret = cgroup_create_cgroup(cgrp_cpy, 0); - if (!ret) - goto next_controller; - - /* - * The controller version != cgroup->controller[i] version, - * let try to convert the controller to the current version - * and retry. - */ - convert_cgrp = cgroup_new_cgroup(cgroup->name); - if (!convert_cgrp) { - cgroup_err("Failed to created cgroup %s\n", cgroup->name); - ret = ECGROUPNOTCREATED; - goto err; - } - ret = cgroup_convert_cgroup(convert_cgrp, convert_version, cgrp_cpy, - current_version); - if (ret) { - cgroup_err("Conversion of controller failed.\n"); - goto err; - } - - ret = cgroup_create_cgroup(convert_cgrp, 0); - if (ret) { - cgroup_err("Failed to create cgroup %s\n", cgroup->name); - goto err; - } - cgroup_free(&convert_cgrp); -next_controller: - cgroup_free_controller(cgc); - cgrp_cpy->index = 0; - } - - ret = 0; -err: - cgroup_free(&convert_cgrp); - cgroup_free(&cgrp_cpy); - return ret; -} -/* - * Actually create the groups once the parsing has been finished - */ -static int cgroup_config_create_groups(void) -{ - int error = 0; - int i; - - for (i = 0; i < cgroup_table_index; i++) { - struct cgroup *cgroup = &config_cgroup_table[i]; - - error = cgroup_create_cgroup(cgroup, 0); - cgroup_dbg("creating group %s, error %d\n", cgroup->name, error); - if (error) { - /* - * Attempt to convert the controller version - * and retry. - */ - error = convert_controller_versions(cgroup); - if (error) - return error; - } - } - - return error; -} - -/* - * Destroy the cgroups - */ -static int cgroup_config_destroy_groups(void) -{ - int error = 0, ret = 0; - int i; - - for (i = 0; i < cgroup_table_index; i++) { - struct cgroup *cgroup = &config_cgroup_table[i]; - - error = cgroup_delete_cgroup_ext(cgroup, CGFLAG_DELETE_RECURSIVE | - CGFLAG_DELETE_IGNORE_MIGRATION); - if (error) - /* store the error, but continue deleting the rest */ - ret = error; - } - - return ret; -} - -/* - * Unmount the controllers - */ -static int cgroup_config_unmount_controllers(void) -{ - int error; - int i; - - for (i = 0; i < config_table_index; i++) { - /* We ignore failures and ensure that all mounted containers are unmounted */ - error = umount(config_mount_table[i].mount.path); - if (error < 0) - cgroup_dbg("Unmount failed\n"); - error = rmdir(config_mount_table[i].mount.path); - if (error < 0) - cgroup_dbg("rmdir failed\n"); - } - - return 0; -} - -static int config_validate_namespaces(void) -{ - char *namespace = NULL; - char *mount_path = NULL; - int j, subsys_count; - int error = 0; - int i; - - pthread_rwlock_wrlock(&cg_mount_table_lock); - for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { - /* - * If we get the path in the first run, then we are good, - * else we will need to go for two loops. This should be - * optimized in the future - */ - mount_path = cg_mount_table[i].mount.path; - - /* - * Setup the namespace for the subsystems having the same - * mount point. - */ - if (!cg_namespace_table[i]) { - namespace = NULL; - } else { - namespace = cg_namespace_table[i]; - if (!namespace) { - last_errno = errno; - error = ECGOTHER; - goto out_error; - } - } - - /* - * We want to handle all the subsytems that are mounted - * together. So initialize j to start from the next point - * in the mount table. - */ - - j = i + 1; - - /* - * Search through the mount table to locate which subsystems - * are mounted together. - */ - while (!strncmp(cg_mount_table[j].mount.path, mount_path, FILENAME_MAX)) { - if (!namespace && cg_namespace_table[j]) { - /* In case namespace is not setup, set it up */ - namespace = cg_namespace_table[j]; - if (!namespace) { - last_errno = errno; - error = ECGOTHER; - goto out_error; - } - } - j++; - } - subsys_count = j; - - /* If there is no namespace, then continue on :) */ - if (!namespace) { - i = subsys_count - 1; - continue; - } - - /* - * Validate/setup the namespace - * If no namespace is specified, copy the namespace we have - * stored. If a namespace is specified, confirm if it is the - * same as we have stored. If not, we fail. - */ - for (j = i; j < subsys_count; j++) { - if (!cg_namespace_table[j]) { - cg_namespace_table[j] = strdup(namespace); - if (!cg_namespace_table[j]) { - last_errno = errno; - error = ECGOTHER; - goto out_error; - } - } else if (strcmp(namespace, cg_namespace_table[j])) { - error = ECGNAMESPACEPATHS; - goto out_error; - } - } - /* i++ in the for loop will increment it */ - i = subsys_count - 1; - } -out_error: - pthread_rwlock_unlock(&cg_mount_table_lock); - - return error; -} - -/* - * Should always be called after cgroup_init() has been called - * - * NOT to be called outside the library. Is handled internally when we are - * looking to load namespace configurations. - * - * This function will order the namespace table in the same fashion as how - * the mou table is setup. - * - * Also it will setup namespaces for all the controllers mounted. In case a - * controller does not have a namespace assigned to it, it will set it to null. - */ -static int config_order_namespace_table(void) -{ - int error = 0; - int i = 0; - - pthread_rwlock_wrlock(&cg_mount_table_lock); - /* Set everything to NULL */ - for (i = 0; i < CG_CONTROLLER_MAX; i++) - cg_namespace_table[i] = NULL; - - memset(cg_namespace_table, 0, CG_CONTROLLER_MAX * sizeof(cg_namespace_table[0])); - - /* Now fill up the namespace table looking at the table we have otherwise. */ - for (i = 0; i < namespace_table_index; i++) { - int j; - int flag = 0; - - for (j = 0; cg_mount_table[j].name[0] != '\0'; j++) { - if (strncmp(config_namespace_table[i].name, cg_mount_table[j].name, - CONTROL_NAMELEN_MAX) == 0) { - - flag = 1; - - if (cg_namespace_table[j]) { - error = ECGNAMESPACEPATHS; - goto error_out; - } - - cg_namespace_table[j] = strdup( - config_namespace_table[i].mount.path); - if (!cg_namespace_table[j]) { - last_errno = errno; - error = ECGOTHER; - goto error_out; - } - } - } - if (!flag) { - error = ECGNAMESPACECONTROLLER; - break; - } - } -error_out: - pthread_rwlock_unlock(&cg_mount_table_lock); - - return error; -} - -/** - * Free all memory allocated during cgroup_parse_config(), namely - * config_cgroup_table and config_template_table. - */ -static void cgroup_free_config(void) -{ - int i; - - if (config_cgroup_table) { - for (i = 0; i < cgroup_table_index; i++) - cgroup_free_controllers(&config_cgroup_table[i]); - free(config_cgroup_table); - config_cgroup_table = NULL; - } - - config_table_index = 0; - if (config_template_table) { - for (i = 0; i < config_template_table_index; i++) - cgroup_free_controllers(&config_template_table[i]); - - free(config_template_table); - config_template_table = NULL; - } - config_template_table_index = 0; - - cgroup_cleanup_systemd_opts(); -} - -/** - * Applies default permissions/uid/gid to all groups in config file. - */ -static void cgroup_config_apply_default(void) -{ - int i; - - if (config_cgroup_table) { - for (i = 0; i < cgroup_table_index; i++) { - struct cgroup *c = &config_cgroup_table[i]; - - if (c->control_dperm == NO_PERMS) - c->control_dperm = default_group.control_dperm; - if (c->control_fperm == NO_PERMS) - c->control_fperm = default_group.control_fperm; - if (c->control_gid == NO_UID_GID) - c->control_gid = default_group.control_gid; - if (c->control_uid == NO_UID_GID) - c->control_uid = default_group.control_uid; - if (c->task_fperm == NO_PERMS) - c->task_fperm = default_group.task_fperm; - if (c->tasks_gid == NO_UID_GID) - c->tasks_gid = default_group.tasks_gid; - if (c->tasks_uid == NO_UID_GID) - c->tasks_uid = default_group.tasks_uid; - } - } -} - -static int cgroup_parse_config(const char *pathname) -{ - int ret; - - yyin = fopen(pathname, "re"); - - if (!yyin) { - cgroup_err("failed to open file %s\n", pathname); - last_errno = errno; - return ECGOTHER; - } - - config_cgroup_table = calloc(MAX_CGROUPS, sizeof(struct cgroup)); - if (!config_cgroup_table) { - ret = ECGFAIL; - goto err; - } - - config_template_table = calloc(MAX_TEMPLATES, sizeof(struct cgroup)); - if (!config_template_table) { - ret = ECGFAIL; - goto err; - } - - /* Clear all internal variables so this function can be called twice. */ - init_cgroup_table(config_cgroup_table, MAX_CGROUPS); - init_cgroup_table(config_template_table, MAX_TEMPLATES); - memset(config_namespace_table, 0, sizeof(config_namespace_table)); - memset(config_mount_table, 0, sizeof(config_mount_table)); - config_table_index = 0; - namespace_table_index = 0; - cgroup_table_index = 0; - config_template_table_index = 0; - - if (!default_group_set) { - /* init the default cgroup */ - init_cgroup_table(&default_group, 1); - } - - /* Parser calls longjmp() on really fatal error (like out-of-memory). */ - ret = setjmp(parser_error_env); - if (!ret) - ret = yyparse(); - if (ret) { - /* Either yyparse failed or longjmp() was called. */ - cgroup_err("failed to parse file %s\n", pathname); - ret = ECGCONFIGPARSEFAIL; - goto err; - } - -err: - if (yyin) - fclose(yyin); - if (ret) - cgroup_free_config(); - - return ret; -} - -int _cgroup_config_compare_groups(const void *p1, const void *p2) -{ - const struct cgroup *g1 = p1; - const struct cgroup *g2 = p2; - - return strcmp(g1->name, g2->name); -} - -static void cgroup_config_sort_groups(void) -{ - qsort(config_cgroup_table, cgroup_table_index, sizeof(struct cgroup), - _cgroup_config_compare_groups); -} - -/* - * The main function which does all the setup of the data structures and finally creates the - * cgroups - */ -int cgroup_config_load_config(const char *pathname) -{ -#ifdef WITH_SYSTEMD - /* slice[FILENAME_MAX] + '/' + scope[FILENAME_MAX] */ - char tmp_systemd_default_cgroup[FILENAME_MAX * 2 + 1] = "\0"; -#endif - int namespace_enabled = 0; - int mount_enabled = 0; - int tmp_errno; - int error; - int ret; - - ret = cgroup_parse_config(pathname); - if (ret != 0) - return ret; - - namespace_enabled = (config_namespace_table[0].name[0] != '\0'); - mount_enabled = (config_mount_table[0].name[0] != '\0'); - - /* The configuration should have namespace or mount, not both. */ - if (namespace_enabled && mount_enabled) { - free(config_cgroup_table); - return ECGMOUNTNAMESPACE; - } - - error = cgroup_config_mount_fs(); - if (error) - goto err_mnt; - - error = cgroup_init(); - if (error == ECGROUPNOTMOUNTED && cgroup_table_index == 0 - && config_template_table_index == 0) { - /* The config file seems to be empty. */ - error = 0; - goto err_mnt; - } - if (error) - goto err_mnt; - - /* - * The very first thing is to sort the namespace table. If we fail - * we unmount everything and get out. - */ - - error = config_order_namespace_table(); - if (error) - goto err_mnt; - - error = config_validate_namespaces(); - if (error) - goto err_mnt; - -#ifdef WITH_SYSTEMD - error = config_create_slice_scope(tmp_systemd_default_cgroup); - if (!error) { - error = ECGROUPPARSEFAIL; - goto err_mnt; - } -#endif - - cgroup_config_apply_default(); - error = cgroup_config_create_groups(); - cgroup_dbg("creating all cgroups now, error=%d\n", error); - if (error) - goto err_grp; - -#ifdef WITH_SYSTEMD - /* - * Setting up systemd_default_cgroup, during creation - * of slice/scopes, clobbers the path returned by cg_build_path(), - * by appending the systemd_default_cgroup to it and - * its required only after all of the slices/scopes are created. - * The user might also set setdefault in more than one systemd - * delegate settings, in that case the last parsed one overwrites - * the systemd_default_cgroup. - */ - if (strlen(tmp_systemd_default_cgroup)) - snprintf(systemd_default_cgroup, sizeof(systemd_default_cgroup), - "%s", tmp_systemd_default_cgroup); -#endif - - cgroup_free_config(); - - return 0; -err_grp: - /* - * Save off the error that has already occurred. The errno from - * cgroup_config_destroy_groups() is secondary to the original error that was reported, - * and thus can be discarded; - */ - tmp_errno = last_errno; - cgroup_config_destroy_groups(); - last_errno = tmp_errno; -err_mnt: - cgroup_config_unmount_controllers(); - cgroup_free_config(); - - return error; -} - -/* unmounts given mount, but only if it is empty */ -static int cgroup_config_try_unmount(struct cg_mount_table_s *mount_info) -{ - struct cg_mount_point *mount = &(mount_info->mount); - char *controller, *controller_list; - struct cgroup_file_info info; - void *handle = NULL; - char *saveptr = NULL; - int ret, lvl; - - /* parse the first controller name from list of controllers */ - controller_list = strdup(mount_info->name); - if (!controller_list) { - last_errno = errno; - return ECGOTHER; - } - controller = strtok_r(controller_list, ",", &saveptr); - if (!controller) { - free(controller_list); - return ECGINVAL; - } - - /* check if the hierarchy is empty */ - ret = cgroup_walk_tree_begin(controller, "/", 0, &handle, &info, &lvl); - free(controller_list); - if (ret == ECGCONTROLLEREXISTS) - return 0; - if (ret) - return ret; - - /* skip the first found directory, it's '/' */ - ret = cgroup_walk_tree_next(0, &handle, &info, lvl); - /* find any other subdirectory */ - while (ret == 0) { - if (info.type == CGROUP_FILE_TYPE_DIR) - break; - ret = cgroup_walk_tree_next(0, &handle, &info, lvl); - } - cgroup_walk_tree_end(&handle); - if (ret == 0) { - cgroup_dbg("won't unmount %s: hieararchy is not empty\n", mount_info->name); - return 0; /* the hieararchy is not empty */ - } - if (ret != ECGEOF) - return ret; - - /* - * ret must be ECGEOF now = there is only root group in the - * hierarchy -> unmount all mount points. - */ - ret = 0; - while (mount) { - int err; - - cgroup_dbg("unmounting %s at %s\n", mount_info->name, mount->path); - err = umount(mount->path); - if (err && !ret) { - ret = ECGOTHER; - last_errno = errno; - } - mount = mount->next; - } - return ret; -} - -int cgroup_config_unload_config(const char *pathname, int flags) -{ - int namespace_enabled = 0; - int mount_enabled = 0; - int ret, i, error; - - cgroup_dbg("%s: parsing %s\n", __func__, pathname); - ret = cgroup_parse_config(pathname); - if (ret) - goto err; - - namespace_enabled = (config_namespace_table[0].name[0] != '\0'); - mount_enabled = (config_mount_table[0].name[0] != '\0'); - /* The configuration should have namespace or mount, not both. */ - if (namespace_enabled && mount_enabled) { - free(config_cgroup_table); - return ECGMOUNTNAMESPACE; - } - - ret = config_order_namespace_table(); - if (ret) - goto err; - - ret = config_validate_namespaces(); - if (ret) - goto err; - - /* Delete the groups in reverse order, i.e. subgroups first, then parents. */ - cgroup_config_sort_groups(); - for (i = cgroup_table_index-1; i >= 0; i--) { - struct cgroup *cgroup = &config_cgroup_table[i]; - - cgroup_dbg("removing %s\n", pathname); - error = cgroup_delete_cgroup_ext(cgroup, flags); - if (error && !ret) - /* store the error, but continue deleting the rest */ - ret = error; - } - - /* Delete templates */ - for (i = 0; i < config_template_table_index; i++) { - struct cgroup *cgroup = &config_template_table[i]; - - cgroup_dbg("removing %s\n", pathname); - error = cgroup_delete_cgroup_ext(cgroup, flags); - if (error && !ret) - ret = error; /* store the error, but continue deleting the rest */ - } - config_template_table_index = 0; - - if (mount_enabled) { - for (i = 0; i < config_table_index; i++) { - struct cg_mount_table_s *m = &(config_mount_table[i]); - - cgroup_dbg("unmounting %s\n", m->name); - error = cgroup_config_try_unmount(m); - if (error && !ret) - ret = error; - } - } -err: - cgroup_free_config(); - - return ret; -} - -static int cgroup_config_unload_controller(const struct cgroup_mount_point *mount_info) -{ - struct cgroup_controller *cgc = NULL; - struct cgroup *cgroup = NULL; - enum cg_version_t version; - char path[FILENAME_MAX]; - int ret, error; - void *handle; - - cgroup = cgroup_new_cgroup("."); - if (cgroup == NULL) - return ECGFAIL; - - cgc = cgroup_add_controller(cgroup, mount_info->name); - if (cgc == NULL) { - ret = ECGFAIL; - goto out_error; - } - - ret = cgroup_delete_cgroup_ext(cgroup, CGFLAG_DELETE_RECURSIVE); - if (ret != 0) - goto out_error; - - ret = cgroup_get_controller_version(mount_info->name, &version); - if (ret != 0) - goto out_error; - - if (version == CGROUP_V2) - /* do not unmount the controller */ - goto out_error; - - /* unmount everything */ - ret = cgroup_get_subsys_mount_point_begin(mount_info->name, &handle, path); - while (ret == 0) { - error = umount(path); - if (error) { - cgroup_warn("cannot unmount controller %s on %s: %s\n", mount_info->name, - path, strerror(errno)); - last_errno = errno; - ret = ECGOTHER; - goto out_error; - } - ret = cgroup_get_subsys_mount_point_next(&handle, path); - } - - cgroup_get_subsys_mount_point_end(&handle); - if (ret == ECGEOF) - ret = 0; -out_error: - if (cgroup) - cgroup_free(&cgroup); - - return ret; -} - -int cgroup_unload_cgroups(void) -{ - struct cgroup_mount_point info; - void *ctrl_handle = NULL; - char *curr_path = NULL; - int error = 0; - int ret = 0; - - error = cgroup_init(); - - if (error) { - ret = error; - goto out_error; - } - - error = cgroup_get_controller_begin(&ctrl_handle, &info); - while (error == 0) { - if (!curr_path || strcmp(info.path, curr_path) != 0) { - if (curr_path) - free(curr_path); - - curr_path = strdup(info.path); - if (!curr_path) - goto out_errno; - - error = cgroup_config_unload_controller(&info); - if (error) { - /* remember the error and continue unloading the rest. */ - cgroup_warn("cannot clear controller %s\n", info.name); - ret = error; - error = 0; - } - } - error = cgroup_get_controller_next(&ctrl_handle, &info); - } - if (error == ECGEOF) - error = 0; - if (error) - ret = error; -out_error: - if (curr_path) - free(curr_path); - cgroup_get_controller_end(&ctrl_handle); - - return ret; - -out_errno: - last_errno = errno; - cgroup_get_controller_end(&ctrl_handle); - - return ECGOTHER; -} - -/** - * Defines the default group. The parser puts content of 'default { }' to - * topmost group in config_cgroup_table. - * This function copies the permissions from it to our default cgroup. - */ -int cgroup_config_define_default(void) -{ - struct cgroup *config_cgroup = &config_cgroup_table[cgroup_table_index]; - - init_cgroup_table(&default_group, 1); - if (config_cgroup->control_dperm != NO_PERMS) - default_group.control_dperm = config_cgroup->control_dperm; - if (config_cgroup->control_fperm != NO_PERMS) - default_group.control_fperm = config_cgroup->control_fperm; - if (config_cgroup->control_gid != NO_UID_GID) - default_group.control_gid = config_cgroup->control_gid; - if (config_cgroup->control_uid != NO_UID_GID) - default_group.control_uid = config_cgroup->control_uid; - if (config_cgroup->task_fperm != NO_PERMS) - default_group.task_fperm = config_cgroup->task_fperm; - if (config_cgroup->tasks_gid != NO_UID_GID) - default_group.tasks_gid = config_cgroup->tasks_gid; - if (config_cgroup->tasks_uid != NO_UID_GID) - default_group.tasks_uid = config_cgroup->tasks_uid; - - /* - * Reset all changes made by 'default { }' to the topmost group so - * it can be used by following 'group { }'. - */ - init_cgroup_table(config_cgroup, 1); - - return 0; -} - -int cgroup_config_set_default(struct cgroup *new_default) -{ - if (!new_default) - return ECGINVAL; - - init_cgroup_table(&default_group, 1); - - default_group.control_dperm = new_default->control_dperm; - default_group.control_fperm = new_default->control_fperm; - default_group.control_gid = new_default->control_gid; - default_group.control_uid = new_default->control_uid; - default_group.task_fperm = new_default->task_fperm; - default_group.tasks_gid = new_default->tasks_gid; - default_group.tasks_uid = new_default->tasks_uid; - default_group_set = 1; - - return 0; -} - -/** - * Reloads the templates list, using the given configuration file. - * @return 0 on success, > 0 on failure - */ -int cgroup_reload_cached_templates(char *pathname) -{ - int ret = 0; - int i; - - if (template_table) { - /* template structures have to be free */ - for (i = 0; i < template_table_index; i++) - cgroup_free_controllers(&template_table[i]); - - free(template_table); - template_table = NULL; - } - template_table_index = 0; - - if ((config_template_table_index != 0) || (config_table_index != 0)) { - /* config template structures have to be free as well*/ - cgroup_free_config(); - } - - /* reloading data to config template structures */ - cgroup_dbg("Reloading cached templates from %s.\n", pathname); - ret = cgroup_parse_config(pathname); - if (ret) { - cgroup_dbg("Could not reload template cache, error was: %d\n", ret); - return ret; - } - - /* copy data to templates cache structures */ - template_table_index = config_template_table_index; - template_table = calloc(template_table_index, sizeof(struct cgroup)); - if (template_table == NULL) { - ret = ECGOTHER; - return ret; - } - - for (i = 0; i < template_table_index; i++) { - cgroup_copy_cgroup(&template_table[i], &config_template_table[i]); - strcpy((template_table[i]).name, (config_template_table[i]).name); - template_table[i].tasks_uid = config_template_table[i].tasks_uid; - template_table[i].tasks_gid = config_template_table[i].tasks_gid; - template_table[i].task_fperm = config_template_table[i].task_fperm; - template_table[i].control_uid = config_template_table[i].control_uid; - template_table[i].control_gid = config_template_table[i].control_gid; - template_table[i].control_fperm = config_template_table[i].control_fperm; - template_table[i].control_dperm = config_template_table[i].control_dperm; - } - - return ret; -} - -/** - * Initializes the templates cache. - * @return 0 on success, > 0 on error - */ -int cgroup_init_templates_cache(char *pathname) -{ - int ret = 0; - int i; - - if (template_table) { - /* template structures have to be free */ - for (i = 0; i < template_table_index; i++) - cgroup_free_controllers(&template_table[i]); - - free(template_table); - template_table = NULL; - } - template_table_index = 0; - - if ((config_template_table_index != 0) || (config_table_index != 0)) { - /* config structures have to be clean */ - cgroup_free_config(); - } - - cgroup_dbg("Loading cached templates from %s.\n", pathname); - /* Attempt to read the configuration file and cache the rules. */ - ret = cgroup_parse_config(pathname); - if (ret) { - cgroup_dbg("Could not initialize rule cache, error was: %d\n", ret); - return ret; - } - - /* copy template data to templates cache structures */ - template_table_index = config_template_table_index; - template_table = calloc(template_table_index, sizeof(struct cgroup)); - if (template_table == NULL) { - ret = ECGOTHER; - return ret; - } - - for (i = 0; i < template_table_index; i++) { - cgroup_copy_cgroup(&template_table[i], &config_template_table[i]); - strcpy((template_table[i]).name, (config_template_table[i]).name); - template_table[i].tasks_uid = config_template_table[i].tasks_uid; - template_table[i].tasks_gid = config_template_table[i].tasks_gid; - template_table[i].task_fperm = config_template_table[i].task_fperm; - template_table[i].control_uid = config_template_table[i].control_uid; - template_table[i].control_gid = config_template_table[i].control_gid; - template_table[i].control_fperm = config_template_table[i].control_fperm; - template_table[i].control_dperm = config_template_table[i].control_dperm; - } - - return ret; -} - -/** - * Setting source files of templates. This function has to be called before - * any call of cgroup_load_templates_cache_from_files. - * @param tmpl_files - */ -void cgroup_templates_cache_set_source_files(struct cgroup_string_list *tmpl_files) -{ - template_files = tmpl_files; -} - -/** - * Appending cgroup templates parsed by parser to template_table - * @param offset number of templates already in the table - */ -int cgroup_add_cgroup_templates(int offset) -{ - int i, ti, ret; - - for (i = 0; i < config_template_table_index; i++) { - ti = i + offset; - ret = cgroup_copy_cgroup(&template_table[ti], &config_template_table[i]); - if (ret) - return ret; - - strcpy((template_table[ti]).name, (config_template_table[i]).name); - template_table[ti].tasks_uid = config_template_table[i].tasks_uid; - template_table[ti].tasks_gid = config_template_table[i].tasks_gid; - template_table[ti].task_fperm = config_template_table[i].task_fperm; - template_table[ti].control_uid = config_template_table[i].control_uid; - template_table[ti].control_gid = config_template_table[i].control_gid; - template_table[ti].control_fperm = config_template_table[i].control_fperm; - template_table[ti].control_dperm = config_template_table[i].control_dperm; - } - - return 0; -} - -/** - * Expand template table based on new number of parsed templates, - * i.e. on value of config_template_table_index. Change value of - * template_table_index. - * @return 0 on success, < 0 on error - */ -int cgroup_expand_template_table(void) -{ - int i; - - template_table = realloc(template_table, - (template_table_index + config_template_table_index) - *sizeof(struct cgroup)); - if (template_table == NULL) - return -ECGOTHER; - - for (i = 0; i < config_template_table_index; i++) - template_table[i + template_table_index].index = 0; - - template_table_index += config_template_table_index; - - return 0; -} - -/** - * Load the templates cache from files. Before calling this function, - * cgroup_templates_cache_set_source_files has to be called first. - * @param file_index index of file which was unable to be parsed - * @return 0 on success, > 0 on error - */ -int cgroup_load_templates_cache_from_files(int *file_index) -{ - int template_table_last_index; - char *pathname; - int i, j; - int ret; - - if (!template_files) { - /* source files has not been set */ - cgroup_dbg("Template source files have not been set. Using only %s\n", - CGCONFIG_CONF_FILE); - - if (template_table_index == 0) - /* the rules cache is empty */ - return cgroup_init_templates_cache(CGCONFIG_CONF_FILE); - else - /* cache is not empty */ - return cgroup_reload_cached_templates(CGCONFIG_CONF_FILE); - } - - if (template_table) { - /* template structures have to be free */ - for (i = 0; i < template_table_index; i++) - cgroup_free_controllers(&template_table[i]); - - free(template_table); - template_table = NULL; - } - template_table_index = 0; - - if ((config_template_table_index != 0) || (config_table_index != 0)) { - /* config structures have to be clean before parsing */ - cgroup_free_config(); - } - - for (j = 0; j < template_files->count; j++) { - pathname = template_files->items[j]; - - cgroup_dbg("Parsing templates from %s.\n", pathname); - /* Attempt to read the configuration file and cache the rules. */ - ret = cgroup_parse_config(pathname); - if (ret) { - cgroup_dbg("Could not initialize rule cache, error was: %d\n", ret); - *file_index = j; - return ret; - } - - if (config_template_table_index > 0) { - template_table_last_index = template_table_index; - ret = cgroup_expand_template_table(); - if (ret) { - cgroup_dbg("Could not expand template table, error was: %d\n", - -ret); - *file_index = j; - return -ret; - } - - /* copy template data to templates cache structures */ - cgroup_dbg("Copying templates to template table from %s.\n", pathname); - ret = cgroup_add_cgroup_templates(template_table_last_index); - if (ret) { - cgroup_dbg("Unable to copy cgroup\n"); - *file_index = j; - return ret; - } - cgroup_dbg("Templates to template table copied\n"); - } - } - - return 0; -} - -/* - * Create a given cgroup, based on template configuration if it is present - * if the template is not present cgroup is creted using cgroup_create_cgroup - */ -int cgroup_config_create_template_group(struct cgroup *cgroup, char *template_name, int flags) -{ - struct cgroup *aux_cgroup = NULL; - struct cgroup_controller *cgc; - char buffer[FILENAME_MAX]; - struct cgroup *t_cgroup; - int i, j, k; - int ret = 0; - int found; - - /* - * If the user did not ask for cached rules, we must parse the - * configuration file and prepare template structures now. - * We use CGCONFIG_CONF_FILE by default - */ - if (!(flags & CGFLAG_USE_TEMPLATE_CACHE)) { - int fileindex; - - /* the rules cache is empty */ - ret = cgroup_load_templates_cache_from_files( - &fileindex); - if (ret != 0) { - if (fileindex < 0) { - cgroup_dbg("Template source files have not been set\n"); - } else { - cgroup_dbg("Failed to load template rules from %s. ", - template_files->items[fileindex]); - } - } - - if (ret != 0) { - cgroup_dbg("Failed initialize templates cache.\n"); - return ret; - } - } - - for (i = 0; cgroup->controller[i] != NULL; i++) { - /* - * for each controller we have to add to cgroup structure - * either template cgroup or empty controller. - */ - - found = 0; - /* look for relevant template - test name x controller pair */ - for (j = 0; j < template_table_index; j++) { - - t_cgroup = &template_table[j]; - if (strcmp(t_cgroup->name, template_name) != 0) { - /* template name does not match skip template */ - continue; - } - - /* template name match */ - for (k = 0; t_cgroup->controller[k] != NULL; k++) { - if (strcmp((cgroup->controller[i])->name, - (t_cgroup->controller[k])->name) != 0) { - /* controller name does not match */ - continue; - } - - /* - * name and controller match template found - * variables substituted in template - */ - strncpy(buffer, t_cgroup->name, FILENAME_MAX-1); - buffer[sizeof(buffer) - 1] = '\0'; - strncpy(t_cgroup->name, cgroup->name, FILENAME_MAX-1); - t_cgroup->name[sizeof(t_cgroup->name) - 1] = '\0'; - - ret = cgroup_create_cgroup(t_cgroup, flags); - - strncpy(t_cgroup->name, buffer, FILENAME_MAX-1); - t_cgroup->name[sizeof(t_cgroup->name) - 1] = '\0'; - if (ret) { - cgroup_dbg("creating group %s, error %d\n", cgroup->name, - ret); - goto end; - } else { - /* go to new controller */ - j = template_table_index; - found = 1; - continue; - } - - } - } - - if (found == 1) - continue; - - /* - * no template is present for given name x controller pair - * add controller to result cgroup. - */ - aux_cgroup = cgroup_new_cgroup(cgroup->name); - if (!aux_cgroup) { - ret = ECGINVAL; - fprintf(stderr, "cgroup %s can't be created\n", cgroup->name); - goto end; - } - cgc = cgroup_add_controller(aux_cgroup, (cgroup->controller[i])->name); - if (cgc == NULL) { - ret = ECGINVAL; - fprintf(stderr, "cgroup %s can't be created\n", cgroup->name); - goto end; - } - ret = cgroup_create_cgroup(aux_cgroup, flags); - if (ret) { - ret = ECGINVAL; - fprintf(stderr, "cgroup %s can't be created\n", cgroup->name); - goto end; - } - } - -end: - cgroup_free(&aux_cgroup); - return ret; -} - -#ifdef WITH_SYSTEMD -int cgroup_add_systemd_opts(const char * const config, const char * const value) -{ - struct cgroup_systemd_opts *curr = cgroup_systemd_opts_tail; - int len; - - if (strcmp(config, "slice") == 0) { - snprintf(curr->slice_name, FILENAME_MAX, "%s", value); - - len = strlen(curr->slice_name) - 6; - if (strcmp(curr->slice_name + len, ".slice")) - goto err; - - } else if (strcmp(config, "scope") == 0) { - snprintf(curr->scope_name, FILENAME_MAX, "%s", value); - - len = strlen(curr->scope_name) - 6; - if (strcmp(curr->scope_name + len, ".scope")) - goto err; - - } else if (strcmp(config, "setdefault") == 0 && strcasecmp(value, "yes") == 0) { - curr->setdefault = 1; - } else if (strcmp(config, "pid") == 0) { - /* - * If the atoi() fails, the pid value is zero and also - * avoid allowing init task (systemd). - */ - curr->pid = atoi(value); - if (curr->pid <= 1) - goto err; - } else - goto err; - - return 1; -err: - cgroup_err("Invalid systemd configuration %s value %s\n", config, value); - cgroup_cleanup_systemd_opts(); - return 0; -} - -int cgroup_alloc_systemd_opts(const char * const config, const char * const value) -{ - struct cgroup_systemd_opts *new_cgrp_systemd_opts; - - /* - * check for the allowed systemd configurations. We don't - * check for values, they will be checked by systemd anyway. - */ - if (strcmp(config, "slice") != 0 && - strcmp(config, "scope") != 0 && - strcmp(config, "setdefault") != 0 && - strcmp(config, "pid") != 0) { - cgroup_err("Invalid systemd configuration %s\n", config); - goto err; - } - - new_cgrp_systemd_opts = calloc(1, sizeof(struct cgroup_systemd_opts)); - if (!new_cgrp_systemd_opts) { - cgroup_err("Failed to allocate memory for cgroup_systemd_opts\n"); - goto err; - } - - if (!cgroup_systemd_opts_head) - cgroup_systemd_opts_tail = cgroup_systemd_opts_head = new_cgrp_systemd_opts; - else { - cgroup_systemd_opts_tail->next = new_cgrp_systemd_opts; - cgroup_systemd_opts_tail = new_cgrp_systemd_opts; - } - - return cgroup_add_systemd_opts(config, value); -err: - cgroup_cleanup_systemd_opts(); - return 0; -} - -void cgroup_cleanup_systemd_opts(void) -{ - struct cgroup_systemd_opts *curr, *next; - - for (curr = cgroup_systemd_opts_head; curr; curr = next) { - next = curr->next; - free(curr); - } - - cgroup_systemd_opts_head = cgroup_systemd_opts_tail = NULL; -} - -/* - * Helper function to remove the systemd_default_cgroup_file. - * systemd_default_cgroup_lock is expected to be held by the - * caller. - */ -static int remove_systemd_default_cgroup_file(void) -{ - int ret; - - ret = unlink(systemd_default_cgroup_file); - if (ret < 0 && errno != ENOENT) { - cgroup_err("Failed to remove %s\n", systemd_default_cgroup_file); - return 0; - } - - return 1; -} -/* - * Helper function to create systemd_default_cgroup_file and write systemd - * default cgroup slice/scope into it. This file will be read by - * cgroup_set_default_systemd_cgroup() for setting - * systemd_default_cgroup used to form the cgroup path. - */ -int cgroup_write_systemd_default_cgroup(const char * const slice, - const char * const scope) -{ - FILE *systemd_def_cgrp_f; - int ret, len; - - pthread_rwlock_wrlock(&systemd_default_cgroup_lock); - - ret = mkdir(systemd_def_cgrp_file_dir, 0755); - if (ret != 0 && errno != EEXIST) { - cgroup_err("Failed to create directory %s\n", systemd_def_cgrp_file_dir); - ret = 0; - goto out; - } - - systemd_def_cgrp_f = fopen(systemd_default_cgroup_file, "w"); - if (!systemd_def_cgrp_f) { - cgroup_err("Failed to create file %s\n", systemd_default_cgroup_file); - ret = 0; - goto out; - } - - len = strlen(slice) + strlen(scope) + 1; - - ret = fprintf(systemd_def_cgrp_f, "%s/%s", slice, scope); - fclose(systemd_def_cgrp_f); - if (ret != len) { - cgroup_err("Incomplete systemd default cgroup written to %s\n", - systemd_default_cgroup_file); - ret = remove_systemd_default_cgroup_file(); - /* Ignore the return value, we are already in error path */ - ret = 0; - goto out; - } - - ret = 1; -out: - pthread_rwlock_unlock(&systemd_default_cgroup_lock); - return ret; -} - -/** - * Create the systemd slice and scope. The slice/scope are parsed and available in - * the cgroup_systemd_opts_head list. This function skips the slice and scope creation - * if previously created. - * - * Returns 1 on success and 0 on failure. - */ -static int config_create_slice_scope(char * const tmp_systemd_default_cgroup) -{ - struct cgroup_systemd_opts *curr, *def = NULL; - struct cgroup_systemd_scope_opts scope_opts; - int ret = 0; - - if (!tmp_systemd_default_cgroup) - return 0; - - if (cgroup_set_default_scope_opts(&scope_opts)) - return 0; - - pthread_rwlock_wrlock(&systemd_default_cgroup_lock); - ret = remove_systemd_default_cgroup_file(); - pthread_rwlock_unlock(&systemd_default_cgroup_lock); - if (!ret) - return 0; - - for (curr = cgroup_systemd_opts_head; curr; curr = curr->next) { - - if (!strlen(curr->slice_name)) { - cgroup_err("Invalid systemd setting, missing slice name.\n"); - goto err; - } - - if (!strlen(curr->scope_name)) { - cgroup_err("Invalid systemd setting, missing scope name.\n"); - goto err; - } - - /* incase of multiple setdefault configurations, set it to latest scope */ - if (curr->setdefault) - def = curr; - - if (curr->pid) - scope_opts.pid = curr->pid; - - ret = cgroup_create_scope(curr->scope_name, curr->slice_name, &scope_opts); - if (ret) - goto err; - - cgroup_dbg("Created systemd slice %s scope %s default %d pid %d\n", - curr->slice_name, curr->scope_name, curr->setdefault, curr->pid); - } - - if (def) { - if (!cgroup_write_systemd_default_cgroup(def->slice_name, def->scope_name)) - goto err; - - snprintf(tmp_systemd_default_cgroup, sizeof(systemd_default_cgroup), - "%s/%s", def->slice_name, def->scope_name); - - cgroup_dbg("Setting/Writing systemd default cgroup %s to file %s\n", - tmp_systemd_default_cgroup, systemd_default_cgroup_file); - - } - - return 1; -err: - return 0; -} - -/* - * This function builds the canonical path for the systemd default cgroup - * based on the cgroup setup mode and if the cgroup doesn't exist removes - * the systemd default cgroup file. This function expects the caller to be - * holding the systemd_default_cgroup_lock. - */ -static bool systemd_default_cgroup_exists(void) -{ - char path[FILENAME_MAX] = "\0"; - char cgrp_procs_path[FILENAME_MAX + 13]; /* 13 = strlen(/cgroup.procs) */ - bool exists = false; - - switch (cgroup_setup_mode()) { - case CGROUP_MODE_HYBRID: - /* - * check for empty cgroup v2, the most common usage in - * the hybrid case. - */ - if (cg_build_path("", path, NULL)) - break; - case CGROUP_MODE_UNIFIED: - /* fallthrough */ - case CGROUP_MODE_LEGACY: - cg_build_path("", path, "cpu"); - /* fallthrough */ - case CGROUP_MODE_UNK: - break; - } - - if (!strlen(path)) { - cgroup_dbg("Unable to form canonical path for %s", systemd_default_cgroup); - goto err; - } - - snprintf(cgrp_procs_path, sizeof(cgrp_procs_path), "%s/cgroup.procs", path); - if (access(cgrp_procs_path, F_OK)) { - /* - * systemd has already removed the scope cgroup, hence delete - * the file too. - */ - cgroup_dbg("%s doesn't exists, deleting %s", path, systemd_default_cgroup_file); - unlink(systemd_default_cgroup_file); - goto err; - } - - exists = true; -err: - return exists; -} - -int cgroup_set_default_systemd_cgroup(void) -{ - FILE *systemd_def_cgrp_f; - size_t len; - - pthread_rwlock_wrlock(&systemd_default_cgroup_lock); - - systemd_def_cgrp_f = fopen(systemd_default_cgroup_file, "r"); - if (!systemd_def_cgrp_f) { - cgroup_dbg("Unable to read %s ", systemd_default_cgroup_file); - goto err; - } - - len = fread(systemd_default_cgroup, sizeof(char), FILENAME_MAX, systemd_def_cgrp_f); - fclose(systemd_def_cgrp_f); - /* at the minimum it should be .slice/.scope == 15 */ - if (len < 15) { - cgroup_dbg("Malformed systemd default cgroup %s", systemd_default_cgroup); - goto err; - } - - if (systemd_default_cgroup_exists()) { - pthread_rwlock_unlock(&systemd_default_cgroup_lock); - return 1; - } -err: - pthread_rwlock_unlock(&systemd_default_cgroup_lock); - cgroup_dbg(", continuing without systemd default cgroup.\n", systemd_default_cgroup); - systemd_default_cgroup[0] = '\0'; - - return 0; -} -#else -int cgroup_add_systemd_opts(const char * const config, const char * const value) -{ - return 1; -} - -int cgroup_alloc_systemd_opts(const char * const config, const char * const value) -{ - return 1; -} - -void cgroup_cleanup_systemd_opts(void) { } - -int cgroup_set_default_systemd_cgroup(void) -{ - return 0; -} -#endif diff --git a/lib/libcgroup-3.1.0/src/daemon/Makefile.am b/lib/libcgroup-3.1.0/src/daemon/Makefile.am deleted file mode 100644 index 2616294e234..00000000000 --- a/lib/libcgroup-3.1.0/src/daemon/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -@CODE_COVERAGE_RULES@ - -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/include - -if WITH_DAEMON - -sbin_PROGRAMS = cgrulesengd -cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h ../tools/tools-common.h ../tools/tools-common.c -cgrulesengd_LIBS = $(CODE_COVERAGE_LIBS) -cgrulesengd_CFLAGS = $(CODE_COVERAGE_CFLAGS) -cgrulesengd_LDADD = $(top_builddir)/src/libcgroup.la -lrt -cgrulesengd_LDFLAGS = -L$(top_builddir)/src/.libs - -endif diff --git a/lib/libcgroup-3.1.0/src/daemon/Makefile.in b/lib/libcgroup-3.1.0/src/daemon/Makefile.in deleted file mode 100644 index df55f69cf7a..00000000000 --- a/lib/libcgroup-3.1.0/src/daemon/Makefile.in +++ /dev/null @@ -1,732 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WITH_DAEMON_TRUE@sbin_PROGRAMS = cgrulesengd$(EXEEXT) -subdir = src/daemon -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(sbindir)" -PROGRAMS = $(sbin_PROGRAMS) -am__cgrulesengd_SOURCES_DIST = cgrulesengd.c cgrulesengd.h \ - ../tools/tools-common.h ../tools/tools-common.c -am__dirstamp = $(am__leading_dot)dirstamp -@WITH_DAEMON_TRUE@am_cgrulesengd_OBJECTS = \ -@WITH_DAEMON_TRUE@ cgrulesengd-cgrulesengd.$(OBJEXT) \ -@WITH_DAEMON_TRUE@ ../tools/cgrulesengd-tools-common.$(OBJEXT) -cgrulesengd_OBJECTS = $(am_cgrulesengd_OBJECTS) -@WITH_DAEMON_TRUE@cgrulesengd_DEPENDENCIES = \ -@WITH_DAEMON_TRUE@ $(top_builddir)/src/libcgroup.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -cgrulesengd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgrulesengd_CFLAGS) \ - $(CFLAGS) $(cgrulesengd_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ../tools/$(DEPDIR)/cgrulesengd-tools-common.Po \ - ./$(DEPDIR)/cgrulesengd-cgrulesengd.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(cgrulesengd_SOURCES) -DIST_SOURCES = $(am__cgrulesengd_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/include -@WITH_DAEMON_TRUE@cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h ../tools/tools-common.h ../tools/tools-common.c -@WITH_DAEMON_TRUE@cgrulesengd_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_DAEMON_TRUE@cgrulesengd_CFLAGS = $(CODE_COVERAGE_CFLAGS) -@WITH_DAEMON_TRUE@cgrulesengd_LDADD = $(top_builddir)/src/libcgroup.la -lrt -@WITH_DAEMON_TRUE@cgrulesengd_LDFLAGS = -L$(top_builddir)/src/.libs -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/daemon/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/daemon/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-sbinPROGRAMS: $(sbin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-sbinPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(sbindir)" && rm -f $$files - -clean-sbinPROGRAMS: - @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -../tools/$(am__dirstamp): - @$(MKDIR_P) ../tools - @: > ../tools/$(am__dirstamp) -../tools/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) ../tools/$(DEPDIR) - @: > ../tools/$(DEPDIR)/$(am__dirstamp) -../tools/cgrulesengd-tools-common.$(OBJEXT): ../tools/$(am__dirstamp) \ - ../tools/$(DEPDIR)/$(am__dirstamp) - -cgrulesengd$(EXEEXT): $(cgrulesengd_OBJECTS) $(cgrulesengd_DEPENDENCIES) $(EXTRA_cgrulesengd_DEPENDENCIES) - @rm -f cgrulesengd$(EXEEXT) - $(AM_V_CCLD)$(cgrulesengd_LINK) $(cgrulesengd_OBJECTS) $(cgrulesengd_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f ../tools/*.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@../tools/$(DEPDIR)/cgrulesengd-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgrulesengd-cgrulesengd.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -cgrulesengd-cgrulesengd.o: cgrulesengd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -MT cgrulesengd-cgrulesengd.o -MD -MP -MF $(DEPDIR)/cgrulesengd-cgrulesengd.Tpo -c -o cgrulesengd-cgrulesengd.o `test -f 'cgrulesengd.c' || echo '$(srcdir)/'`cgrulesengd.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgrulesengd-cgrulesengd.Tpo $(DEPDIR)/cgrulesengd-cgrulesengd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgrulesengd.c' object='cgrulesengd-cgrulesengd.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -c -o cgrulesengd-cgrulesengd.o `test -f 'cgrulesengd.c' || echo '$(srcdir)/'`cgrulesengd.c - -cgrulesengd-cgrulesengd.obj: cgrulesengd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -MT cgrulesengd-cgrulesengd.obj -MD -MP -MF $(DEPDIR)/cgrulesengd-cgrulesengd.Tpo -c -o cgrulesengd-cgrulesengd.obj `if test -f 'cgrulesengd.c'; then $(CYGPATH_W) 'cgrulesengd.c'; else $(CYGPATH_W) '$(srcdir)/cgrulesengd.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgrulesengd-cgrulesengd.Tpo $(DEPDIR)/cgrulesengd-cgrulesengd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgrulesengd.c' object='cgrulesengd-cgrulesengd.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -c -o cgrulesengd-cgrulesengd.obj `if test -f 'cgrulesengd.c'; then $(CYGPATH_W) 'cgrulesengd.c'; else $(CYGPATH_W) '$(srcdir)/cgrulesengd.c'; fi` - -../tools/cgrulesengd-tools-common.o: ../tools/tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -MT ../tools/cgrulesengd-tools-common.o -MD -MP -MF ../tools/$(DEPDIR)/cgrulesengd-tools-common.Tpo -c -o ../tools/cgrulesengd-tools-common.o `test -f '../tools/tools-common.c' || echo '$(srcdir)/'`../tools/tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../tools/$(DEPDIR)/cgrulesengd-tools-common.Tpo ../tools/$(DEPDIR)/cgrulesengd-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../tools/tools-common.c' object='../tools/cgrulesengd-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -c -o ../tools/cgrulesengd-tools-common.o `test -f '../tools/tools-common.c' || echo '$(srcdir)/'`../tools/tools-common.c - -../tools/cgrulesengd-tools-common.obj: ../tools/tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -MT ../tools/cgrulesengd-tools-common.obj -MD -MP -MF ../tools/$(DEPDIR)/cgrulesengd-tools-common.Tpo -c -o ../tools/cgrulesengd-tools-common.obj `if test -f '../tools/tools-common.c'; then $(CYGPATH_W) '../tools/tools-common.c'; else $(CYGPATH_W) '$(srcdir)/../tools/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../tools/$(DEPDIR)/cgrulesengd-tools-common.Tpo ../tools/$(DEPDIR)/cgrulesengd-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../tools/tools-common.c' object='../tools/cgrulesengd-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgrulesengd_CFLAGS) $(CFLAGS) -c -o ../tools/cgrulesengd-tools-common.obj `if test -f '../tools/tools-common.c'; then $(CYGPATH_W) '../tools/tools-common.c'; else $(CYGPATH_W) '$(srcdir)/../tools/tools-common.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(sbindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f ../tools/$(DEPDIR)/$(am__dirstamp) - -rm -f ../tools/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -f ../tools/$(DEPDIR)/cgrulesengd-tools-common.Po - -rm -f ./$(DEPDIR)/cgrulesengd-cgrulesengd.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-sbinPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ../tools/$(DEPDIR)/cgrulesengd-tools-common.Po - -rm -f ./$(DEPDIR)/cgrulesengd-cgrulesengd.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-sbinPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-sbinPROGRAMS install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS - -.PRECIOUS: Makefile - -@CODE_COVERAGE_RULES@ - -# 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/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.c b/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.c deleted file mode 100644 index 51988de50b6..00000000000 --- a/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.c +++ /dev/null @@ -1,1290 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright Red Hat Inc. 2008 - * - * Author: Steve Olivieri - * Author: Vivek Goyal - * - * Some part of the programs have been derived from Dhaval Giani's posting - * for daemon to place the task in right container. Original copyright notice - * follows. - * - * Copyright IBM Corporation, 2007 - * Author: Dhaval Giani linux.vnet.ibm.com> - * Derived from test_cn_proc.c by Matt Helsley - * Original copyright notice follows - * - * Copyright (C) Matt Helsley, IBM Corp. 2005 - * Derived from fcctl.c by Guillaume Thouvenin - * Original copyright notice follows: - * - * Copyright (C) 2005 BULL SA. - * Written by Guillaume Thouvenin bull.net> - * - * TODO Stop using netlink for communication (or at least rewrite that part). - */ - -#include "../libcgroup-internal.h" -#include "../tools/tools-common.h" -#include "cgrulesengd.h" -#include "libcgroup.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#define NUM_PER_REALLOCATIOM (100) - -/* list of config files from CGCONFIG_CONF_FILE and CGCONFIG_CONF_DIR */ -static struct cgroup_string_list template_files; - -/* Log file, NULL if logging to file is disabled */ -FILE *logfile; - -/* Log facility, 0 if logging to syslog is disabled */ -int logfacility; - -/* Current log level */ -int loglevel; - -/* Owner of the socket, -1 means no change */ -uid_t socket_user = -1; - -/* Owner of the socket, -1 means no change */ -gid_t socket_group = -1; - -/** - * Prints the usage information for this program and, optionally, an error - * message. This function uses vfprintf. - * @param fd The file stream to print to - * @param msg The error message to print (printf style) - * @param ... Any args to msg (printf style) - */ -static void usage(FILE *fd, const char *msg, ...) -{ - /* List of args to msg */ - va_list ap; - - /* Put all args after msg into the list. */ - va_start(ap, msg); - - if (msg) - vfprintf(fd, msg, ap); - fprintf(fd, "\n"); - fprintf(fd, "cgrulesengd -- a daemon for the cgroups rules engine\n\n"); - fprintf(fd, "Usage : cgrulesengd [options]\n\n"); - fprintf(fd, " options :\n"); - fprintf(fd, " -q | --quiet\t\t quiet mode\n"); - fprintf(fd, " -v | --verbose\t\t verbose mode\n"); - fprintf(fd, " -f | --logfile=\t write log to file\n"); - fprintf(fd, " -s[facility] | --syslog=[facility]\t write log to syslog\n"); - fprintf(fd, " -n | --nodaemon\t\t don't fork daemon\n"); - fprintf(fd, " -d | --debug\t\t same as -v -v -n -f -\n"); - fprintf(fd, " -Q | --nolog\t\t disable logging\n"); - fprintf(fd, " -u | --socket-user= set"); - fprintf(fd, " " CGRULE_CGRED_SOCKET_PATH " socket user\n"); - fprintf(fd, " -g | --socket-group= set"); - fprintf(fd, " " CGRULE_CGRED_SOCKET_PATH " socket group\n"); - fprintf(fd, " -h | --help\t\t show this help\n\n"); - va_end(ap); -} - -/** - * Prints a formatted message (like vprintf()) to all log destinations. - * Flushes the file stream's buffer so that the message is immediately - * readable. - * @param level The log level (LOG_EMERG ... LOG_DEBUG) - * @param format The format for the message (vprintf style) - * @param ap Any args to format (vprintf style) - */ -void flog_write(int level, const char *format, va_list ap) -{ - int copy = 0; - va_list cap; - - /* Check the log level */ - if (level > loglevel) - return; - - /* copy the argument list if needed - it can be processed only once */ - if (logfile && logfacility) { - copy = 1; - va_copy(cap, ap); - } - - if (logfile) { - /* Print the message to the given stream. */ - vfprintf(logfile, format, ap); - - /* - * Flush the stream's buffer, so the data - * is readable immediately. - */ - fflush(logfile); - } - - if (logfacility) { - if (copy) { - vsyslog(LOG_MAKEPRI(logfacility, level), format, cap); - va_end(cap); - } else { - vsyslog(LOG_MAKEPRI(logfacility, level), format, ap); - } - } -} - -/** - * Prints a formatted message (like printf()) to all log destinations. - * Flushes the file stream's buffer so that the message is immediately - * readable. - * @param level The log level (LOG_EMERG ... LOG_DEBUG) - * @param format The format for the message (printf style) - * @param ... Any args to format (printf style) - */ -void flog(int level, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - flog_write(level, format, ap); - va_end(ap); -} - -/** - * Libcgroup logging callback. It must translate libcgroup log levels - * to cgrulesengd native (=syslog). - */ -void flog_cgroup(void *userdata, int cgroup_level, const char *format, va_list ap) -{ - int level = 0; - - switch (cgroup_level) { - case CGROUP_LOG_ERROR: - level = LOG_ERR; - break; - case CGROUP_LOG_WARNING: - level = LOG_WARNING; - break; - case CGROUP_LOG_INFO: - level = LOG_INFO; - break; - case CGROUP_LOG_DEBUG: - level = LOG_DEBUG; - break; - } - flog_write(level, format, ap); -} - -struct parent_info { - __u64 timestamp; - pid_t pid; -}; - -struct array_parent_info { - int index; - int num_allocation; - struct parent_info **parent_info; -}; - -struct array_parent_info array_pi; - -static int cgre_store_parent_info(pid_t pid) -{ - struct parent_info *info; - struct timespec tp; - __u64 uptime_ns; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) < 0) { - flog(LOG_WARNING, "Failed to get time\n"); - return 1; - } - uptime_ns = ((__u64)tp.tv_sec * 1000 * 1000 * 1000) + tp.tv_nsec; - - if (array_pi.index >= array_pi.num_allocation) { - int alloc = array_pi.num_allocation + NUM_PER_REALLOCATIOM; - void *new_array = realloc(array_pi.parent_info, sizeof(info) * alloc); - if (!new_array) { - flog(LOG_WARNING, "Failed to allocate memory\n"); - return 1; - } - array_pi.parent_info = new_array; - array_pi.num_allocation = alloc; - } - - info = calloc(1, sizeof(struct parent_info)); - if (!info) { - flog(LOG_WARNING, "Failed to allocate memory\n"); - return 1; - } - info->timestamp = uptime_ns; - info->pid = pid; - - array_pi.parent_info[array_pi.index] = info; - array_pi.index++; - - return 0; -} - -static void cgre_remove_old_parent_info(__u64 key_timestamp) -{ - int i, j; - - for (i = 0; i < array_pi.index; i++) { - if (key_timestamp < array_pi.parent_info[i]->timestamp) - continue; - - free(array_pi.parent_info[i]); - for (j = i; j < array_pi.index - 1; j++) - array_pi.parent_info[j] = array_pi.parent_info[j + 1]; - array_pi.index--; - i--; - } -} - -static int cgre_was_parent_changed_when_forking(const struct proc_event *ev) -{ - __u64 timestamp_parent; - __u64 timestamp_child; - pid_t parent_pid; - int i; - - parent_pid = ev->event_data.fork.parent_pid; - timestamp_child = ev->timestamp_ns; - - cgre_remove_old_parent_info(timestamp_child); - - for (i = 0; i < array_pi.index; i++) { - if (parent_pid != array_pi.parent_info[i]->pid) - continue; - - timestamp_parent = array_pi.parent_info[i]->timestamp; - if (timestamp_child > timestamp_parent) - continue; - - return 1; - } - - return 0; -} - -struct unchanged_pid { - pid_t pid; - int flags; -} unchanged_pid_t; - -struct array_unchanged { - int index; - int num_allocation; - struct unchanged_pid *proc; -}; - -struct array_unchanged array_unch; - -static int cgre_store_unchanged_process(pid_t pid, int flags) -{ - int i; - - for (i = 0; i < array_unch.index; i++) { - if (array_unch.proc[i].pid != pid) - continue; - /* pid is stored already. */ - return 0; - } - - if (array_unch.index >= array_unch.num_allocation) { - int alloc = array_unch.num_allocation + NUM_PER_REALLOCATIOM; - void *new_array = realloc(array_unch.proc, sizeof(unchanged_pid_t) * alloc); - if (!new_array) { - flog(LOG_WARNING, "Failed to allocate memory\n"); - return 1; - } - array_unch.proc = new_array; - array_unch.num_allocation = alloc; - } - array_unch.proc[array_unch.index].pid = pid; - array_unch.proc[array_unch.index].flags = flags; - array_unch.index++; - - flog(LOG_DEBUG, "Store the unchanged process (PID: %d, FLAGS: %d)\n", pid, flags); - - return 0; -} - -static void cgre_remove_unchanged_process(pid_t pid) -{ - int i, j; - - for (i = 0; i < array_unch.index; i++) { - if (array_unch.proc[i].pid != pid) - continue; - - for (j = i; j < array_unch.index - 1; j++) - memcpy(&array_unch.proc[j], &array_unch.proc[j + 1], - sizeof(struct unchanged_pid)); - array_unch.index--; - flog(LOG_DEBUG, "Remove the unchanged process (PID: %d)\n", pid); - return; - } -} - -static int cgre_is_unchanged_process(pid_t pid) -{ - int i; - - for (i = 0; i < array_unch.index; i++) { - if (array_unch.proc[i].pid != pid) - continue; - return 1; - } - - return 0; -} - -static int cgre_is_unchanged_child(pid_t pid) -{ - int i; - - for (i = 0; i < array_unch.index; i++) { - if (array_unch.proc[i].pid != pid) - continue; - if (array_unch.proc[i].flags & CGROUP_DAEMON_UNCHANGE_CHILDREN) - return 1; - break; - } - - return 0; -} - -/** - * Process an event from the kernel, and determine the correct UID/GID/PID - * to pass to libcgroup. Then, libcgroup will decide the cgroup to move - * the PID to, if any. - * @param ev The event to process - * @param type The type of event to process (part of ev) - * @return 0 on success, > 0 on failure - */ -int cgre_process_event(const struct proc_event *ev, const int type) -{ - pid_t pid = 0, log_pid = 0; - uid_t euid, log_uid = 0; - gid_t egid, log_gid = 0; - pid_t ppid, cpid; - char *procname; - - int ret = 0; - - switch (type) { - case PROC_EVENT_UID: - case PROC_EVENT_GID: - /* - * If the unchanged process, the daemon should not change - * the cgroup of the process. - */ - if (cgre_is_unchanged_process(ev->event_data.id.process_pid)) - return 0; - pid = ev->event_data.id.process_pid; - break; - case PROC_EVENT_FORK: - ppid = ev->event_data.fork.parent_pid; - cpid = ev->event_data.fork.child_pid; - if (cgre_is_unchanged_child(ppid)) { - if (cgre_store_unchanged_process(cpid, CGROUP_DAEMON_UNCHANGE_CHILDREN)) - return 1; - } - - /* - * If this process was forked while changing parent's - * cgroup, this process's cgroup also should be changed. - */ - if (!cgre_was_parent_changed_when_forking(ev)) - return 0; - pid = ev->event_data.fork.child_pid; - break; - case PROC_EVENT_EXIT: - cgre_remove_unchanged_process(ev->event_data.exit.process_pid); - return 0; - case PROC_EVENT_EXEC: - /* - * If the unchanged process, the daemon should not change - * the cgroup of the process. - */ - if (cgre_is_unchanged_process(ev->event_data.exec.process_pid)) - return 0; - pid = ev->event_data.exec.process_pid; - break; - default: - break; - } - - ret = cgroup_get_uid_gid_from_procfs(pid, &euid, &egid); - if (ret == ECGROUPNOTEXIST) - /* - * cgroup_get_uid_gid_from_procfs() returns ECGROUPNOTEXIST - * if a process finished and that is not a problem. - */ - return 0; - else if (ret) - return ret; - - ret = cgroup_get_procname_from_procfs(pid, &procname); - if (ret == ECGROUPNOTEXIST) - return 0; - else if (ret) - return ret; - - /* - * Now that we have the UID, the GID, and the PID, we can make a - * call to libcgroup to change the cgroup for this PID. - */ - log_pid = pid; - switch (type) { - case PROC_EVENT_UID: - log_uid = ev->event_data.id.e.euid; - log_gid = egid; - euid = ev->event_data.id.e.euid; - break; - case PROC_EVENT_GID: - log_uid = euid; - log_gid = ev->event_data.id.e.egid; - egid = ev->event_data.id.e.egid; - break; - case PROC_EVENT_FORK: - log_uid = euid; - log_gid = egid; - break; - case PROC_EVENT_EXEC: - log_uid = euid; - log_gid = egid; - break; - default: - break; - } - - ret = cgroup_change_cgroup_flags(euid, egid, procname, pid, CGFLAG_USECACHE); - if (ret == ECGOTHER) { - /* - * A process finished already but we may have missed - * changing it, make sure to apply to forked children. - */ - if (cgroup_get_last_errno() == ESRCH || cgroup_get_last_errno() == ENOENT) - ret = cgre_store_parent_info(pid); - else - ret = 0; - } else if (ret) { - flog(LOG_WARNING, "Cgroup change for PID: %d, UID: %d, GID: %d, ", log_pid, - log_uid, log_gid); - flog(LOG_WARNING, "PROCNAME: %s FAILED! (Error Code: %d)\n", procname, ret); - } else { - flog(LOG_INFO, "Cgroup change for PID: %d, UID: %d, GID: %d, PROCNAME: %s OK\n", - log_pid, log_uid, log_gid, procname); - ret = cgre_store_parent_info(pid); - } - free(procname); - - return ret; -} - -/** - * Handle a netlink message. - * In the event of PROC_EVENT_UID or PROC_EVENT_GID, we pass the event along - * to cgre_process_event for further processing. All other events are ignored. - * @param cn_hdr The netlink message - * @return 0 on success, > 0 on error - */ -static int cgre_handle_msg(struct cn_msg *cn_hdr) -{ - /* The event to consider */ - struct proc_event *ev; - - /* Return codes */ - int ret = 0; - - /* Get the event data. We only care about two event types. */ - ev = (struct proc_event *)cn_hdr->data; - switch (ev->what) { - case PROC_EVENT_UID: - flog(LOG_DEBUG, "UID Event: PID = %d, tGID = %d, rUID = %d, eUID = %d\n", - ev->event_data.id.process_pid, ev->event_data.id.process_tgid, - ev->event_data.id.r.ruid, ev->event_data.id.e.euid); - ret = cgre_process_event(ev, PROC_EVENT_UID); - break; - case PROC_EVENT_GID: - flog(LOG_DEBUG, "GID Event: PID = %d, tGID = %d, rGID = %d, eGID = %d\n", - ev->event_data.id.process_pid, ev->event_data.id.process_tgid, - ev->event_data.id.r.rgid, ev->event_data.id.e.egid); - ret = cgre_process_event(ev, PROC_EVENT_GID); - break; - case PROC_EVENT_FORK: - ret = cgre_process_event(ev, PROC_EVENT_FORK); - break; - case PROC_EVENT_EXIT: - ret = cgre_process_event(ev, PROC_EVENT_EXIT); - break; - case PROC_EVENT_EXEC: - flog(LOG_DEBUG, "EXEC Event: PID = %d, tGID = %d\n", - ev->event_data.exec.process_pid, ev->event_data.exec.process_tgid); - ret = cgre_process_event(ev, PROC_EVENT_EXEC); - break; - default: - break; - } - - return ret; -} - -static int cgre_receive_netlink_msg(int sk_nl) -{ - struct sockaddr_nl from_nla; - socklen_t from_nla_len; - struct cn_msg *cn_hdr; - struct nlmsghdr *nlh; - char buff[BUFF_SIZE]; - size_t recv_len; - - memset(buff, 0, sizeof(buff)); - from_nla_len = sizeof(from_nla); - recv_len = recvfrom(sk_nl, buff, sizeof(buff), 0, (struct sockaddr *)&from_nla, - &from_nla_len); - if (recv_len == ENOBUFS) { - flog(LOG_ERR, "ERROR: NETLINK BUFFER FULL, MESSAGE DROPPED!\n"); - return 0; - } - - if (recv_len < 1) - return 0; - - if (from_nla_len != sizeof(from_nla)) { - flog(LOG_ERR, "Bad address size reading netlink socket\n"); - return 0; - } - - if (from_nla.nl_groups != CN_IDX_PROC || from_nla.nl_pid != 0) - return 0; - - nlh = (struct nlmsghdr *)buff; - while (NLMSG_OK(nlh, recv_len)) { - cn_hdr = NLMSG_DATA(nlh); - - if (nlh->nlmsg_type == NLMSG_NOOP) { - nlh = NLMSG_NEXT(nlh, recv_len); - continue; - } - if ((nlh->nlmsg_type == NLMSG_ERROR) || (nlh->nlmsg_type == NLMSG_OVERRUN)) - break; - if (cgre_handle_msg(cn_hdr) < 0) - return 1; - if (nlh->nlmsg_type == NLMSG_DONE) - break; - nlh = NLMSG_NEXT(nlh, recv_len); - } - - return 0; -} - -static void cgre_receive_unix_domain_msg(int sk_unix) -{ - struct sockaddr_un caddr; - char path[FILENAME_MAX]; - struct stat buff_stat; - socklen_t caddr_len; - size_t ret_len; - int fd_client; - int flags; - pid_t pid; - - caddr_len = sizeof(caddr); - fd_client = accept(sk_unix, (struct sockaddr *)&caddr, &caddr_len); - if (fd_client < 0) { - flog(LOG_WARNING, "Warning: 'accept' command error: %s\n", strerror(errno)); - return; - } - - ret_len = read(fd_client, &pid, sizeof(pid)); - if (ret_len != sizeof(pid)) { - flog(LOG_WARNING, "Warning: 'read' command error: %s\n", strerror(errno)); - goto close; - } - - sprintf(path, "/proc/%d", pid); - if (stat(path, &buff_stat)) { - flog(LOG_WARNING, "Warning: there is no such process (PID: %d)\n", pid); - goto close; - } - - ret_len = read(fd_client, &flags, sizeof(flags)); - if (ret_len != sizeof(flags)) { - flog(LOG_WARNING, "Warning: error reading daemon socket: %s\n", strerror(errno)); - goto close; - } - - if (flags == CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS) - cgre_remove_unchanged_process(pid); - else if (cgre_store_unchanged_process(pid, flags)) - goto close; - - if (write(fd_client, CGRULE_SUCCESS_STORE_PID, sizeof(CGRULE_SUCCESS_STORE_PID)) < 0) { - flog(LOG_WARNING, "Warning: cannot write to daemon socket: %s\n", strerror(errno)); - goto close; - } - -close: - close(fd_client); -} - -static int cgre_create_netlink_socket_process_msg(void) -{ - int sk_nl = 0, sk_unix = 0, sk_max; - enum proc_cn_mcast_op *mcop_msg; - struct sockaddr_nl my_nla; - struct sockaddr_un saddr; - struct nlmsghdr *nl_hdr; - struct cn_msg *cn_hdr; - char buff[BUFF_SIZE]; - fd_set fds, readfds; - sigset_t sigset; - int rc = -1; - - /* - * Create an endpoint for communication. Use the kernel user interface - * device (PF_NETLINK) which is a datagram oriented service (SOCK_DGRAM). - * The protocol used is the connector protocol (NETLINK_CONNECTOR) - */ - sk_nl = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); - if (sk_nl == -1) { - flog(LOG_ERR, "Error: error opening netlink socket: %s\n", strerror(errno)); - return rc; - } - - my_nla.nl_family = AF_NETLINK; - my_nla.nl_groups = CN_IDX_PROC; - my_nla.nl_pid = getpid(); - my_nla.nl_pad = 0; - - if (bind(sk_nl, (struct sockaddr *)&my_nla, sizeof(my_nla)) < 0) { - flog(LOG_ERR, "Error: error binding netlink socket: %s\n", strerror(errno)); - goto close_and_exit; - } - - nl_hdr = (struct nlmsghdr *)buff; - cn_hdr = (struct cn_msg *)NLMSG_DATA(nl_hdr); - mcop_msg = (enum proc_cn_mcast_op *)&cn_hdr->data[0]; - flog(LOG_DEBUG, "Sending proc connector: PROC_CN_MCAST_LISTEN...\n"); - memset(buff, 0, sizeof(buff)); - *mcop_msg = PROC_CN_MCAST_LISTEN; - - /* fill the netlink header */ - nl_hdr->nlmsg_len = SEND_MESSAGE_LEN; - nl_hdr->nlmsg_type = NLMSG_DONE; - nl_hdr->nlmsg_flags = 0; - nl_hdr->nlmsg_seq = 0; - nl_hdr->nlmsg_pid = getpid(); - - /* fill the connector header */ - cn_hdr->id.idx = CN_IDX_PROC; - cn_hdr->id.val = CN_VAL_PROC; - cn_hdr->seq = 0; - cn_hdr->ack = 0; - cn_hdr->len = sizeof(enum proc_cn_mcast_op); - flog(LOG_DEBUG, "Sending netlink message len=%d, cn_msg len=%d\n", nl_hdr->nlmsg_len, - (int) sizeof(struct cn_msg)); - - if (send(sk_nl, nl_hdr, nl_hdr->nlmsg_len, 0) != nl_hdr->nlmsg_len) { - flog(LOG_ERR, "Error: failed to send netlink message (mcast ctl op): %s\n", - strerror(errno)); - goto close_and_exit; - } - flog(LOG_DEBUG, "Message sent\n"); - - /* Setup Unix domain socket. */ - sk_unix = socket(PF_UNIX, SOCK_STREAM, 0); - if (sk_unix < 0) { - flog(LOG_ERR, "Error creating UNIX socket: %s\n", strerror(errno)); - goto close_and_exit; - } - - memset(&saddr, 0, sizeof(saddr)); - saddr.sun_family = AF_UNIX; - strcpy(saddr.sun_path, CGRULE_CGRED_SOCKET_PATH); - unlink(CGRULE_CGRED_SOCKET_PATH); - - if (bind(sk_unix, (struct sockaddr *)&saddr, - sizeof(saddr.sun_family) + strlen(CGRULE_CGRED_SOCKET_PATH)) < 0) { - flog(LOG_ERR, "Error binding UNIX socket %s: %s\n", CGRULE_CGRED_SOCKET_PATH, - strerror(errno)); - goto close_and_exit; - } - - if (listen(sk_unix, 1) < 0) { - flog(LOG_ERR, "Error listening on UNIX socket %s: %s\n", CGRULE_CGRED_SOCKET_PATH, - strerror(errno)); - goto close_and_exit; - } - - /* change the owner */ - if (chown(CGRULE_CGRED_SOCKET_PATH, socket_user, socket_group) < 0) { - flog(LOG_ERR, "Error changing %s socket owner: %s\n", CGRULE_CGRED_SOCKET_PATH, - strerror(errno)); - goto close_and_exit; - } - - flog(LOG_DEBUG, "Socket %s owner successfully set to %d:%d\n", CGRULE_CGRED_SOCKET_PATH, - (int) socket_user, (int) socket_group); - - if (chmod(CGRULE_CGRED_SOCKET_PATH, 0660) < 0) { - flog(LOG_ERR, "Error changing %s socket permissions: %s\n", - CGRULE_CGRED_SOCKET_PATH, strerror(errno)); - goto close_and_exit; - } - - FD_ZERO(&readfds); - FD_SET(sk_nl, &readfds); - FD_SET(sk_unix, &readfds); - if (sk_nl < sk_unix) - sk_max = sk_unix; - else - sk_max = sk_nl; - - sigemptyset(&sigset); - sigaddset(&sigset, SIGUSR2); - for (;;) { - /* - * For avoiding the deadlock and "Interrupted system call" - * error, restrict the effective range of SIGUSR2 signal. - */ - sigprocmask(SIG_UNBLOCK, &sigset, NULL); - sigprocmask(SIG_BLOCK, &sigset, NULL); - - memcpy(&fds, &readfds, sizeof(fd_set)); - if (select(sk_max + 1, &fds, NULL, NULL, NULL) < 0) { - flog(LOG_ERR, "Selecting error: %s\n", strerror(errno)); - goto close_and_exit; - } - - if (FD_ISSET(sk_nl, &fds)) { - if (cgre_receive_netlink_msg(sk_nl)) - break; - } - - if (FD_ISSET(sk_unix, &fds)) - cgre_receive_unix_domain_msg(sk_unix); - } - -close_and_exit: - if (sk_nl >= 0) - close(sk_nl); - if (sk_unix >= 0) - close(sk_unix); - - return rc; -} - -/** - * Start logging. Opens syslog and/or log file and sets log level. - * @param logp Path of the log file, NULL if no log file was specified - * @param logf Syslog facility, NULL if no facility was specified - * @param logv Log verbosity, 1 is the default, 0 = no logging, 4 = everything - */ -static void cgre_start_log(const char *logp, int logf, int logv) -{ - /* Current system time */ - time_t tm; - - /* Log levels */ - int loglevels[] = { - LOG_EMERG, /* -q */ - LOG_ERR, /* default */ - LOG_WARNING, /* -v */ - LOG_INFO, /* -vv */ - LOG_DEBUG /* -vvv */ - }; - - /* Set default logging destination if nothing was specified */ - if (!logp && !logf) - logf = LOG_DAEMON; - - /* Open log file */ - if (logp) { - if (strcmp("-", logp) == 0) { - logfile = stdout; - } else { - logfile = fopen(logp, "a"); - if (!logfile) { - fprintf(stderr, "Failed to open log file %s,", logp); - fprintf(stderr, " error: %s. Continuing anyway.\n", - strerror(errno)); - logfile = stdout; - } - } - } else - logfile = NULL; - - /* Open syslog */ - if (logf) { - openlog("CGRE", LOG_CONS | LOG_PID, logf); - logfacility = logf; - } else - logfacility = 0; - - /* Set the log level */ - if (logv < 0) - logv = 0; - if (logv >= sizeof(loglevels)/sizeof(int)) - logv = sizeof(loglevels)/sizeof(int)-1; - - loglevel = loglevels[logv]; - cgroup_set_logger(flog_cgroup, CGROUP_LOG_DEBUG, NULL); - - flog(LOG_DEBUG, "CGroup Rules Engine Daemon log started\n"); - - tm = time(0); - flog(LOG_DEBUG, "Current time: %s\n", ctime(&tm)); - flog(LOG_DEBUG, "Opened log file: %s, log facility: %d,log level: %d\n", logp, logfacility, - loglevel); -} - -/** - * Turns this program into a daemon. In doing so, we fork() and kill the - * parent process. Note too that stdout, stdin, and stderr are closed in - * daemon mode, and a file descriptor for a log file is opened. - * @param logp Path of the log file, NULL if no log file was specified - * @param logf Syslog facility, 0 if no facility was specified - * @param daemon False to turn off daemon mode (no fork, leave FDs open) - * @param logv Log verbosity, 1 is the default, 0 = no logging, 5 = everything - * @return 0 on success, > 0 on error - */ -int cgre_start_daemon(const char *logp, const int logf, const unsigned char daemon, const int logv) -{ - /* PID returned from the fork() */ - pid_t pid; - - /* Fork and die. */ - if (daemon) { - pid = fork(); - if (pid < 0) { - openlog("CGRE", LOG_CONS, LOG_DAEMON|LOG_WARNING); - syslog(LOG_DAEMON|LOG_WARNING, "Failed to fork, error: %s", - strerror(errno)); - closelog(); - - fprintf(stderr, "Failed to fork(), %s\n", strerror(errno)); - return 1; - } else if (pid > 0) { - exit(EXIT_SUCCESS); - } - } else { - flog(LOG_DEBUG, "Not using daemon mode\n"); - pid = getpid(); - } - - cgre_start_log(logp, logf, logv); - - if (!daemon) { - /* We can skip the rest, since we're not becoming a daemon. */ - flog(LOG_INFO, "Proceeding with PID %d\n", getpid()); - return 0; - } - - /* Get a new SID for the child. */ - if (setsid() < 0) { - flog(LOG_ERR, "Failed to get a new SID, error: %s\n", strerror(errno)); - return 2; - } - - /* Change to the root directory. */ - if (chdir("/") < 0) { - flog(LOG_ERR, "Failed to chdir to /, error: %s\n", strerror(errno)); - return 3; - } - - /* Close standard file descriptors. */ - close(STDIN_FILENO); - if (logfile != stdout) - close(STDOUT_FILENO); - close(STDERR_FILENO); - - /* If we make it this far, we're a real daemon! Or we chose not to. */ - flog(LOG_INFO, "Proceeding with PID %d\n", getpid()); - - return 0; -} - -/** - * Catch the SIGUSR2 signal and reload the rules configuration. - * This function makes use of the logfile and flog() to print the new rules. - * @param signum The signal that we caught (always SIGUSR2) - */ -void cgre_flash_rules(int signum) -{ - /* Current time */ - time_t tm = time(0); - - int fileindex; - - flog(LOG_INFO, "Reloading rules configuration\n"); - flog(LOG_DEBUG, "Current time: %s\n", ctime(&tm)); - - /* Ask libcgroup to reload the rules table. */ - cgroup_reload_cached_rules(); - - /* Print the results of the new table to our log file. */ - if (logfile && loglevel >= LOG_INFO) { - cgroup_print_rules_config(logfile); - fprintf(logfile, "\n"); - } - - /* Ask libcgroup to reload the template rules table. */ - cgroup_load_templates_cache_from_files(&fileindex); -} - -/** - * Catch the SIGUSR1 signal and reload the rules configuration. - * This function makes use of the logfile and flog() to print the new rules. - * @param signum The signal that we caught (always SIGUSR1) - */ -void cgre_flash_templates(int signum) -{ - /* Current time */ - time_t tm = time(0); - - int fileindex; - - flog(LOG_INFO, "Reloading templates configuration.\n"); - flog(LOG_DEBUG, "Current time: %s\n", ctime(&tm)); - - /* Ask libcgroup to reload the templates table. */ - cgroup_load_templates_cache_from_files(&fileindex); -} - -/** - * Catch the SIGTERM and SIGINT signals so that we can exit gracefully. - * Before exiting, this function makes use of the logfile and flog(). - * @param signum The signal that we caught (SIGTERM, SIGINT) - */ -void cgre_catch_term(int signum) -{ - /* Current time */ - time_t tm = time(0); - - flog(LOG_INFO, "Stopped CGroup Rules Engine Daemon at %s\n", ctime(&tm)); - - /* Close the log file, if we opened one */ - if (logfile && logfile != stdout) - fclose(logfile); - - /* Close syslog */ - if (logfacility) - closelog(); - - exit(EXIT_SUCCESS); -} - -/** - * Parse the syslog facility as received on command line. - * @param arg Command line argument with the syslog facility - * @return the syslog facility (e.g. LOG_DAEMON) or 0 on error - */ -static int cgre_parse_syslog_facility(const char *arg) -{ - if (arg == NULL) - return 0; - - if (strlen(arg) > 1) - return 0; - - switch (arg[0]) { - case '0': - return LOG_LOCAL0; - case '1': - return LOG_LOCAL1; - case '2': - return LOG_LOCAL2; - case '3': - return LOG_LOCAL3; - case '4': - return LOG_LOCAL4; - case '5': - return LOG_LOCAL5; - case '6': - return LOG_LOCAL6; - case '7': - return LOG_LOCAL7; - case 'D': - return LOG_DAEMON; - default: - return 0; - } -} - -int main(int argc, char *argv[]) -{ - /* Patch to the log file */ - const char *logp = NULL; - - /* Syslog facility */ - int facility = 0; - - /* Verbose level */ - int verbosity = 1; - - /* For catching signals */ - struct sigaction sa; - - /* Should we daemonize? */ - unsigned char daemon = 1; - - /* Return codes */ - int ret = 0; - - struct passwd *pw; - struct group *gr; - - /* Command line arguments */ - const char *short_options = "hvqf:s::ndQu:g:"; - struct option long_options[] = { - {"help", no_argument, NULL, 'h'}, - {"verbose", no_argument, NULL, 'v'}, - {"quiet", no_argument, NULL, 'q'}, - {"logfile", required_argument, NULL, 'f'}, - {"syslog", optional_argument, NULL, 's'}, - {"nodaemon", no_argument, NULL, 'n'}, - {"debug", no_argument, NULL, 'd'}, - {"nolog", no_argument, NULL, 'Q'}, - {"socket-user", required_argument, NULL, 'u'}, - {"socket-group", required_argument, NULL, 'g'}, - {NULL, 0, NULL, 0} - }; - - int fileindex; - - /* Make sure the user is root. */ - if (getuid() != 0) { - fprintf(stderr, "Error: Only root can start/stop the control"); - fprintf(stderr, " group rules engine daemon\n"); - ret = 1; - goto finished; - } - - /* - * Check environment variable CGROUP_LOGLEVEL. If it's set to - * DEBUG, set appropriate verbosity level. - */ - char *level_str = getenv("CGROUP_LOGLEVEL"); - - if (level_str != NULL) { - if (cgroup_parse_log_level_str(level_str) == CGROUP_LOG_DEBUG) { - verbosity = 4; - logp = "-"; - } - } - - while (1) { - int c; - - c = getopt_long(argc, argv, short_options, long_options, NULL); - if (c == -1) - break; - - switch (c) { - case 'h': /* --help */ - usage(stdout, "Help:\n"); - ret = 0; - goto finished; - - case 'v': /* --verbose */ - verbosity++; - break; - - case 'q': /* --quiet */ - verbosity--; - break; - - case 'Q': /* --nolog */ - verbosity = 0; - break; - - case 'f': /* --logfile= */ - logp = optarg; - break; - - case 's': /* --syslog=[facility] */ - if (optarg) { - facility = cgre_parse_syslog_facility(optarg); - if (facility == 0) { - fprintf(stderr, "Unknown syslog facility: %s\n", optarg); - ret = 2; - goto finished; - } - } else { - facility = LOG_DAEMON; - } - break; - - case 'n': /* --no-fork */ - daemon = 0; - break; - - case 'd': /* --debug */ - /* same as -vvn */ - daemon = 0; - verbosity = 4; - logp = "-"; - break; - case 'u': /* --socket-user */ - pw = getpwnam(optarg); - if (pw == NULL) { - usage(stderr, "Cannot find user %s", optarg); - ret = 3; - goto finished; - } - socket_user = pw->pw_uid; - flog(LOG_DEBUG, "Using socket user %s id %d\n", optarg, (int)socket_user); - break; - case 'g': /* --socket-group */ - gr = getgrnam(optarg); - if (gr == NULL) { - usage(stderr, "Cannot find group %s", optarg); - ret = 3; - goto finished; - } - socket_group = gr->gr_gid; - flog(LOG_DEBUG, "Using socket group %s id %d\n", optarg, - (int)socket_group); - break; - default: - usage(stderr, ""); - ret = 2; - goto finished; - } - } - - /* Initialize libcgroup. */ - ret = cgroup_init(); - if (ret != 0) { - fprintf(stderr, "Error: libcgroup initialization failed, %s\n", - cgroup_strerror(ret)); - goto finished; - } - - /* Ask libcgroup to load the configuration rules. */ - ret = cgroup_string_list_init(&template_files, CGCONFIG_CONF_FILES_LIST_MINIMUM_SIZE); - if (ret) { - fprintf(stderr, "%s: cannot init file list, out of memory?\n", argv[0]); - goto finished_without_temp_files; - } - /* first add CGCONFIG_CONF_FILE into file list */ - ret = cgroup_string_list_add_item(&template_files, CGCONFIG_CONF_FILE); - if (ret) { - fprintf(stderr, "%s: cannot add file to list, out of memory?\n", argv[0]); - goto finished; - } - - /* then read CGCONFIG_CONF_DIR directory for additional config files */ - cgroup_string_list_add_directory(&template_files, CGCONFIG_CONF_DIR, argv[0]); - - ret = cgroup_init_rules_cache(); - if (ret != 0) { - fprintf(stderr, "Error: libcgroup failed to initialize rules"); - fprintf(stderr, "cache from %s. %s\n", CGRULES_CONF_FILE, cgroup_strerror(ret)); - goto finished; - } - - /* ask libcgroup to load template rules as well */ - cgroup_templates_cache_set_source_files(&template_files); - ret = cgroup_load_templates_cache_from_files(&fileindex); - if (ret != 0) { - if (fileindex < 0) - fprintf(stderr, "Error: Template source files have not been set\n"); - else - fprintf(stderr, "Error: Failed to initialize template rules from %s.%s\n", - template_files.items[fileindex], cgroup_strerror(-ret)); - goto finished; - } - - /* Now, start the daemon. */ - ret = cgre_start_daemon(logp, facility, daemon, verbosity); - if (ret < 0) { - fprintf(stderr, "Error: Failed to launch the daemon, %s\n", cgroup_strerror(ret)); - goto finished; - } - - /* - * Set up the signal handler to reload the cached rules upon - * reception of a SIGUSR2 signal. - */ - memset(&sa, 0, sizeof(sa)); - sa.sa_handler = &cgre_flash_rules; - sigemptyset(&sa.sa_mask); - ret = sigaction(SIGUSR2, &sa, NULL); - if (ret) { - flog(LOG_ERR, "Failed to set up signal handler for SIGUSR2. Error: %s\n", - strerror(errno)); - goto finished; - } - - /* - * Set up the signal handler to reload templates cache upon - * reception of a SIGUSR1 signal. - */ - sa.sa_handler = &cgre_flash_templates; - ret = sigaction(SIGUSR1, &sa, NULL); - if (ret) { - flog(LOG_ERR, "Failed to set up signal handler for SIGUSR1. Error: %s\n", - strerror(errno)); - goto finished; - } - - /* - * Set up the signal handler to catch SIGINT and SIGTERM so that - * we can exit gracefully - */ - sa.sa_handler = &cgre_catch_term; - ret = sigaction(SIGINT, &sa, NULL); - ret |= sigaction(SIGTERM, &sa, NULL); - if (ret) { - flog(LOG_ERR, "Failed to set up the signal handler. Error: %s\n", strerror(errno)); - goto finished; - } - - /* Print the configuration to the log file, or stdout. */ - if (logfile && loglevel >= LOG_INFO) - cgroup_print_rules_config(logfile); - - /* Scan for running applications with rules */ - ret = cgroup_change_all_cgroups(); - if (ret) - flog(LOG_WARNING, "Failed to initialize running tasks.\n"); - - flog(LOG_INFO, "Started the CGroup Rules Engine Daemon.\n"); - - /* We loop endlesly in this function, unless we encounter an error. */ - ret = cgre_create_netlink_socket_process_msg(); - -finished: - cgroup_string_list_free(&template_files); - -finished_without_temp_files: - if (logfile && logfile != stdout) - fclose(logfile); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.h b/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.h deleted file mode 100644 index 70ad3981ecb..00000000000 --- a/lib/libcgroup-3.1.0/src/daemon/cgrulesengd.h +++ /dev/null @@ -1,122 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright Red Hat Inc. 2008 - * - * Author: Steve Olivieri - */ - -#ifndef _CGRULESENGD_H -#define _CGRULESENGD_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include "config.h" -#include "libcgroup.h" - -#include -#include - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#ifndef __USE_GNU -#define __USE_GNU -#endif - -/* The following ten macros are all for the Netlink code. */ -#define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + sizeof(enum proc_cn_mcast_op))) -#define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + sizeof(struct proc_event))) - -#define SEND_MESSAGE_SIZE (NLMSG_SPACE(SEND_MESSAGE_LEN)) -#define RECV_MESSAGE_SIZE (NLMSG_SPACE(RECV_MESSAGE_LEN)) - -#define BUFF_SIZE (max(max(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE), 1024)) -#define MIN_RECV_SIZE (min(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE)) - -#define PROC_CN_MCAST_LISTEN (1) -#define PROC_CN_MCAST_IGNORE (2) - -/** - * Prints the usage information for this program and, optionally, - * an error message. This function uses vfprintf. - * @param fd The file stream to print to - * @param msg The error message to print (printf style) - * @param ... Any args to msg (printf style) - */ -void cgre_usage(FILE *fd, const char *msg, ...); - -/** - * Prints a formatted message (like printf()) to all log destinations. - * Flushes the file stream's buffer so that the message is immediately - * readable. - * @param level The log level (LOG_EMERG ... LOG_DEBUG) - * @param format The format for the message (printf style) - * @param ... Any args to format (printf style) - */ -void flog(int level, const char *msg, ...); - -/** - * Process an event from the kernel, and determine the correct UID/GID/PID - * to pass to libcgroup. Then, libcgroup will decide the cgroup to move - * the PID to, if any. - * @param ev The event to process - * @param type The type of event to process (part of ev) - * @return 0 on success, > 0 on failure - */ -int cgre_process_event(const struct proc_event *ev, const int type); - -/** - * Handle a netlink message. - * In the event of PROC_EVENT_UID or PROC_EVENT_GID, we pass the event - * along to cgre_process_event for further processing. All other events - * are ignored. - * @param cn_hdr The netlink message - * @return 0 on success, > 0 on error - */ -int cgre_handle_message(struct cn_msg *cn_hdr); - -/** - * Turns this program into a daemon. In doing so, we fork() and kill the - * parent process. Note too that stdout, stdin, and stderr are closed in - * daemon mode, and a file descriptor for a log file is opened. - * @param logp Path of the log file, NULL if no log file was specified - * @param logf Syslog facility, NULL if no facility was specified - * @param daemon False to turn off daemon mode (no fork, leave FDs open) - * @param logv Log verbosity: - * 2 is the default, 0 = no logging, 5 = everything - * @return 0 on success, > 0 on error - */ -int cgre_start_daemon(const char *logp, const int logf, const unsigned char daemon, - const int logv); - -/** - * Catch the SIGUSR2 signal and reload the rules configuration. - * This function makes use of the logfile and flog() to print the new rules. - * @param signum The signal that we caught (always SIGUSR2) - */ -void cgre_flash_rules(int signum); - -/** - * Catch the SIGUSR1 signal and reload the rules configuration. - * This function makes use of the logfile and flog() to print the new rules. - * @param signum The signal that we caught (always SIGUSR1) - */ -void cgre_flash_templates(int signum); - -/** - * Catch the SIGTERM and SIGINT signal so that we can exit gracefully. - * Before exiting, this function makes use of the logfile and flog(). - * @param signum The signal that we caught (SIGTERM, SIGINT) - */ -void cgre_catch_term(int signum); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _CGRULESENGD_H */ diff --git a/lib/libcgroup-3.1.0/src/lex.c b/lib/libcgroup-3.1.0/src/lex.c deleted file mode 100644 index 7cae1bbadd7..00000000000 --- a/lib/libcgroup-3.1.0/src/lex.c +++ /dev/null @@ -1,1851 +0,0 @@ - -#line 2 "lex.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 17 -#define YY_END_OF_BUFFER 18 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[75] = - { 0, - 0, 0, 18, 16, 2, 1, 16, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 2, 3, 4, 0, - 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 3, 3, 3, 4, 4, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 8, 14, 6, 14, 7, 14, 9, 5, 14, - 14, 14, 14, 14, 14, 14, 13, 14, 12, 14, - 14, 11, 10, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 5, 1, 6, 1, 1, 1, - 1, 7, 1, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, - 1, 1, 1, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 1, 6, 1, 1, 6, 1, 8, 6, 9, 10, - - 11, 12, 13, 6, 14, 6, 15, 16, 17, 18, - 19, 20, 6, 21, 22, 23, 24, 6, 6, 6, - 25, 6, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[26] = - { 0, - 1, 1, 2, 1, 1, 3, 1, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3 - } ; - -static const flex_int16_t yy_base[79] = - { 0, - 0, 24, 95, 96, 96, 96, 90, 0, 83, 81, - 70, 71, 81, 77, 62, 19, 30, 84, 83, 80, - 96, 0, 66, 70, 62, 56, 62, 57, 55, 54, - 58, 31, 72, 71, 70, 69, 68, 55, 60, 43, - 48, 54, 47, 40, 47, 41, 42, 35, 38, 34, - 34, 0, 44, 0, 38, 0, 37, 0, 0, 32, - 34, 42, 26, 40, 37, 23, 0, 35, 0, 30, - 23, 0, 0, 96, 36, 25, 39, 42 - } ; - -static const flex_int16_t yy_def[79] = - { 0, - 74, 1, 74, 74, 74, 74, 75, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 74, 77, 78, 75, - 74, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 74, 77, 77, 77, 78, 78, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 0, 74, 74, 74, 74 - } ; - -static const flex_int16_t yy_nxt[122] = - { 0, - 4, 5, 6, 7, 4, 8, 4, 9, 8, 10, - 8, 8, 11, 8, 8, 8, 12, 13, 8, 14, - 8, 15, 16, 8, 8, 17, 30, 22, 18, 31, - 19, 32, 32, 73, 33, 33, 20, 20, 20, 34, - 72, 34, 36, 71, 36, 70, 69, 68, 67, 66, - 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, - 55, 54, 53, 52, 51, 50, 49, 48, 47, 37, - 37, 35, 35, 35, 46, 45, 44, 43, 42, 41, - 40, 39, 38, 21, 37, 35, 29, 28, 27, 26, - 25, 24, 23, 21, 74, 3, 74, 74, 74, 74, - - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74 - } ; - -static const flex_int16_t yy_chk[122] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 16, 76, 2, 16, - 2, 17, 32, 71, 17, 32, 75, 75, 75, 77, - 70, 77, 78, 68, 78, 66, 65, 64, 63, 62, - 61, 60, 57, 55, 53, 51, 50, 49, 48, 47, - 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, - 36, 35, 34, 33, 31, 30, 29, 28, 27, 26, - 25, 24, 23, 20, 19, 18, 15, 14, 13, 12, - 11, 10, 9, 7, 3, 74, 74, 74, 74, 74, - - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "lex.l" -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright IBM Corporation. 2007 - * - * Authors: Balbir Singh - */ -#line 9 "lex.l" -#include -#include -#include -#include "parse.h" -#pragma GCC diagnostic ignored "-Wunused-function" - -int line_no = 1; -jmp_buf parser_error_env; - -#define YY_FATAL_ERROR(msg) \ - do { \ - fprintf(stderr, "%s\n", msg); \ - longjmp(parser_error_env, 1); \ - } while(0); -#line 510 "lex.c" -#define YY_NO_INPUT 1 -#line 512 "lex.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 27 "lex.l" - -#line 732 "lex.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 75 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 96 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 28 "lex.l" -{line_no++;} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 29 "lex.l" -{/* DO NOTHING */} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 30 "lex.l" -{/* Comments */} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 31 "lex.l" -{/* Comments */} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 32 "lex.l" -{return MOUNT;} - YY_BREAK -case 6: -YY_RULE_SETUP -#line 33 "lex.l" -{return TASK;} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 34 "lex.l" -{return ADMIN;} - YY_BREAK -case 8: -YY_RULE_SETUP -#line 35 "lex.l" -{return PERM;} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 36 "lex.l" -{return GROUP;} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 37 "lex.l" -{return NAMESPACE;} - YY_BREAK -case 11: -YY_RULE_SETUP -#line 38 "lex.l" -{return TEMPLATE;} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 39 "lex.l" -{return SYSTEMD;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 40 "lex.l" -{yylval.name = strdup(yytext); return DEFAULT;} - YY_BREAK -case 14: -YY_RULE_SETUP -#line 41 "lex.l" -{yylval.name = strdup(yytext); return ID;} - YY_BREAK -case 15: -/* rule 15 can match eol */ -YY_RULE_SETUP -#line 42 "lex.l" -{yylval.name = strdup(yytext+1); yylval.name[strlen(yylval.name)-1] = '\0'; return ID; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 43 "lex.l" -{return yytext[0];} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 44 "lex.l" -ECHO; - YY_BREAK -#line 877 "lex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 75 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 75 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 74); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 44 "lex.l" - - - diff --git a/lib/libcgroup-3.1.0/src/lex.l b/lib/libcgroup-3.1.0/src/lex.l deleted file mode 100644 index 5f680fc839c..00000000000 --- a/lib/libcgroup-3.1.0/src/lex.l +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright IBM Corporation. 2007 - * - * Authors: Balbir Singh - */ - -%{ -#include -#include -#include -#include "parse.h" -#pragma GCC diagnostic ignored "-Wunused-function" - -int line_no = 1; -jmp_buf parser_error_env; - -#define YY_FATAL_ERROR(msg) \ - do { \ - fprintf(stderr, "%s\n", msg); \ - longjmp(parser_error_env, 1); \ - } while(0); -%} - -%option nounput noinput - -%% -\n {line_no++;} -[ \t] {/* DO NOTHING */} -^[ \t]*#.*[ \t]* {/* Comments */} -^\*.*[ \t]* {/* Comments */} -"mount" {return MOUNT;} -"task" {return TASK;} -"admin" {return ADMIN;} -"perm" {return PERM;} -"group" {return GROUP;} -"namespace" {return NAMESPACE;} -"template" {return TEMPLATE;} -"systemd" {return SYSTEMD;} -"default" {yylval.name = strdup(yytext); return DEFAULT;} -[a-zA-Z0-9_\-\/\.\,\%\@\\]+ {yylval.name = strdup(yytext); return ID;} -\"[^"]*\" {yylval.name = strdup(yytext+1); yylval.name[strlen(yylval.name)-1] = '\0'; return ID; } -. {return yytext[0];} -%% - diff --git a/lib/libcgroup-3.1.0/src/libcgroup-internal.h b/lib/libcgroup-3.1.0/src/libcgroup-internal.h deleted file mode 100644 index 1c423e1d7ba..00000000000 --- a/lib/libcgroup-3.1.0/src/libcgroup-internal.h +++ /dev/null @@ -1,427 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright IBM Corporation. 2008 - * - * Author: Dhaval Giani - */ - -#ifndef __LIBCG_INTERNAL - -#define __LIBCG_INTERNAL - -#ifdef __cplusplus -extern "C" { -#endif - -#include "config.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#define MAX_MNT_ELEMENTS 16 /* Maximum number of mount points/controllers */ -#define MAX_GROUP_ELEMENTS 128 /* Estimated number of groups created */ - -#define CG_CONTROL_VALUE_MAX 4096 /* Maximum length of a value */ - -#define CG_NV_MAX 100 -#define CG_CONTROLLER_MAX 100 -#define CG_OPTIONS_MAX 100 - -/* - * Max number of mounted hierarchies. Event if one controller is mounted - * per hier, it can not exceed CG_CONTROLLER_MAX - */ -#define CG_HIER_MAX CG_CONTROLLER_MAX - -#define CONTROL_NAMELEN_MAX 32 /* Maximum length of a controller's name */ - -/* Definitions for the uid and gid members of a cgroup_rules */ -#define CGRULE_INVALID ((uid_t) -1) -#define CGRULE_WILD ((uid_t) -2) - -#define CGRULE_SUCCESS_STORE_PID "SUCCESS_STORE_PID" -#define CGRULE_OPTION_IGNORE "ignore" /* Definitions for the cgrules options field */ - -#define CGCONFIG_CONF_FILE "/etc/cgconfig.conf" -/* Minimum number of file in template file list for cgrulesengd */ -#define CGCONFIG_CONF_FILES_LIST_MINIMUM_SIZE 4 -#define CGCONFIG_CONF_DIR "/etc/cgconfig.d" - -#define CGRULES_CONF_FILE "/etc/cgrules.conf" -#define CGRULES_CONF_DIR "/etc/cgrules.d" -#define CGRULES_MAX_FIELDS_PER_LINE 3 - -#define CGROUP_BUFFER_LEN (5 * FILENAME_MAX) - -/* Maximum length of a key(:) in the daemon config file */ -#define CGROUP_RULE_MAXKEY (LOGIN_NAME_MAX + FILENAME_MAX + 1) - -/* Maximum length of a line in the daemon config file */ -#define CGROUP_RULE_MAXLINE (FILENAME_MAX + CGROUP_RULE_MAXKEY + CG_CONTROLLER_MAX + 3) - -#define CGROUP_FILE_PREFIX "cgroup" - -/* cgroup v2 files */ -#define CGV2_CONTROLLERS_FILE "cgroup.controllers" -#define CGV2_SUBTREE_CTRL_FILE "cgroup.subtree_control" - -/* maximum line length when reading the cgroup.controllers file */ -#define CGV2_CONTROLLERS_LL_MAX 100 - -#define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, "Error: " x) -#define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, "Warning: " x) -#define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, "Info: " x) -#define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x) -#define cgroup_cont(x...) cgroup_log(CGROUP_LOG_CONT, x) - -#define CGROUP_DEFAULT_LOGLEVEL CGROUP_LOG_ERROR - -#define max(x, y) ((y) < (x)?(x):(y)) -#define min(x, y) ((y) > (x)?(x):(y)) - -struct control_value { - char name[FILENAME_MAX]; - char value[CG_CONTROL_VALUE_MAX]; - - /* cgget uses this field for values that span multiple lines */ - char *multiline_value; - - /* - * The abstraction layer uses prev_name when there's an - * N->1 or 1->N relationship between cgroup v1 and v2 settings. - */ - char *prev_name; - - bool dirty; -}; - -struct cgroup_controller { - char name[CONTROL_NAMELEN_MAX]; - struct control_value *values[CG_NV_MAX]; - struct cgroup *cgroup; - int index; - enum cg_version_t version; -}; - -struct cgroup { - char name[FILENAME_MAX]; - struct cgroup_controller *controller[CG_CONTROLLER_MAX]; - int index; - uid_t tasks_uid; - gid_t tasks_gid; - mode_t task_fperm; - uid_t control_uid; - gid_t control_gid; - mode_t control_fperm; - mode_t control_dperm; -}; - -struct cg_mount_point { - char path[FILENAME_MAX]; - struct cg_mount_point *next; -}; - -struct cg_mount_table_s { - /** Controller name. */ - char name[CONTROL_NAMELEN_MAX]; - /** - * List of mount points, at least one mount point is there for sure. - */ - struct cg_mount_point mount; - int index; - int shared_mnt; - enum cg_version_t version; -}; - -struct cgroup_rules_data { - pid_t pid; /* pid of the process which needs to change group */ - - /* Details of user under consideration for destination cgroup */ - struct passwd *pw; - /* Gid of the process */ - gid_t gid; -}; - -/* A rule that maps UID/GID to a cgroup */ -struct cgroup_rule { - uid_t uid; - gid_t gid; - bool is_ignore; - char *procname; - char username[LOGIN_NAME_MAX]; - char destination[FILENAME_MAX]; - char *controllers[MAX_MNT_ELEMENTS]; - struct cgroup_rule *next; -}; - -/* Container for a list of rules */ -struct cgroup_rule_list { - struct cgroup_rule *head; - struct cgroup_rule *tail; - int len; -}; - -/* The walk_tree handle */ -struct cgroup_tree_handle { - FTS *fts; - int flags; -}; - -/** - * Internal item of dictionary. Linked list is sufficient for now - we need - * only 'add' operation and simple iterator. In future, this might be easily - * rewritten to dynamic array when random access is needed, just keep in mind - * that the order is important and the iterator should return the items in - * the order they were added there. - */ -struct cgroup_dictionary_item { - const char *name; - const char *value; - struct cgroup_dictionary_item *next; -}; - -/* Flags for cgroup_dictionary_create */ -/** - * All items (i.e. both name and value strings) stored in the dictionary - * should *NOT* be free()d on cgroup_dictionary_free(), only the dictionary - * helper structures (i.e. underlying linked list) should be freed. - */ -#define CG_DICT_DONT_FREE_ITEMS 1 - -/** - * Dictionary of (name, value) items. - * The dictionary keeps its order, iterator iterates in the same order as - * the items were added there. It is *not* hash-style structure, it does - * not provide random access to its items nor quick search. This structure - * should be opaque to users of the dictionary, underlying data structure - * might change anytime and without warnings. - */ -struct cgroup_dictionary { - struct cgroup_dictionary_item *head; - struct cgroup_dictionary_item *tail; - int flags; -}; - -/** Opaque iterator of an dictionary. */ -struct cgroup_dictionary_iterator { - struct cgroup_dictionary_item *item; -}; - -/** - * per thread errno variable, to be used when return code is ECGOTHER - */ -extern __thread int last_errno; - -/** - * 'Exception handler' for lex parser. - */ -extern jmp_buf parser_error_env; - -/* Internal API */ -char *cg_build_path(const char *name, char *path, const char *type); -int cgroup_get_uid_gid_from_procfs(pid_t pid, uid_t *euid, gid_t *egid); -int cgroup_get_procname_from_procfs(pid_t pid, char **procname); -int cg_mkdir_p(const char *path); -struct cgroup *create_cgroup_from_name_value_pairs(const char *name, - struct control_value *name_value, int nv_number); -void init_cgroup_table(struct cgroup *cgroups, size_t count); - -/* - * Main mounting structures - * - * cg_mount_table_lock must be held to access: - * cg_mount_table - * cg_cgroup_v2_mount_path - */ -extern struct cg_mount_table_s cg_mount_table[CG_CONTROLLER_MAX]; -extern char cg_cgroup_v2_mount_path[FILENAME_MAX]; -extern pthread_rwlock_t cg_mount_table_lock; - -/* - * config related structures - */ -extern __thread char *cg_namespace_table[CG_CONTROLLER_MAX]; - -/* - * Default systemd cgroup used by the cg_build_path_locked() and tools - * setting the default cgroup path. - */ -extern char systemd_default_cgroup[FILENAME_MAX * 2 + 1]; - -/* - * config related API - */ -int cgroup_config_insert_cgroup(char *cg_name); -int cgroup_config_parse_controller_options(char *controller, struct cgroup_dictionary *values); -int template_config_insert_cgroup(char *cg_name); -int template_config_parse_controller_options(char *controller, struct cgroup_dictionary *values); -int template_config_group_task_perm(char *perm_type, char *value); -int template_config_group_admin_perm(char *perm_type, char *value); -int cgroup_config_group_task_perm(char *perm_type, char *value); -int cgroup_config_group_admin_perm(char *perm_type, char *value); -int cgroup_config_insert_into_mount_table(char *name, char *mount_point); -int cgroup_config_insert_into_namespace_table(char *name, char *mount_point); -void cgroup_config_cleanup_mount_table(void); -void cgroup_config_cleanup_namespace_table(void); -int cgroup_config_define_default(void); - -/** - * Create an empty dictionary. - */ -extern int cgroup_dictionary_create(struct cgroup_dictionary **dict, int flags); - -/** - * Add an item to existing dictionary. - */ -extern int cgroup_dictionary_add(struct cgroup_dictionary *dict, const char *name, - const char *value); -/** - * Fully destroy existing dictionary. Depending on flags passed to - * cgroup_dictionary_create(), names and values might get destroyed too. - */ -extern int cgroup_dictionary_free(struct cgroup_dictionary *dict); - -/** - * Start iterating through a dictionary. The items are returned in the same - * order as they were added using cgroup_dictionary_add(). - */ -extern int cgroup_dictionary_iterator_begin(struct cgroup_dictionary *dict, void **handle, - const char **name, const char **value); -/** - * Continue iterating through the dictionary. - */ -extern int cgroup_dictionary_iterator_next(void **handle, const char **name, const char **value); - -/** - * Finish iteration through the dictionary. - */ -extern void cgroup_dictionary_iterator_end(void **handle); - -/** - * Changes permissions for given path. If owner_is_umask is specified then - * it uses owner permissions as a mask for group and others permissions. - * - * @param path Patch to chmod. - * @param mode File permissions to set. - * @param owner_is_umask Flag whether path owner permissions should be used - * as a mask for group and - * others permissions. - */ -int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask); - -/** - * Build the path to the tasks or cgroup.procs file - * - * @param path Output variable that will contain the path. Must be of size - * FILENAME_MAX or larger - * @param path_sz Size of the path string - * @param cg_name Cgroup name - * @param ctrl_name Controller name - */ -int cgroup_build_tasks_procs_path(char * const path, size_t path_sz, const char * const cg_name, - const char * const ctrl_name); - -/** - * Build the full path to the controller/setting - * - * @param setting Cgroup virtual filename/setting (optional) - * @param path Output variable to contain the concatenated path - * @param controller Cgroup controller name - * - * @return If successful, a valid pointer to the concatenated path - * - * @note The cg_mount_table_lock must be held prior to calling this function - */ -char *cg_build_path_locked(const char *setting, char *path, const char *controller); - -/** - * Given a cgroup controller and a setting within it, populate the setting's value - * - * @param ctrl_dir dirent representation of the setting, e.g. memory.stat - * @param cgroup current cgroup - * @param cgc current cgroup controller - * @param cg_index Index into the cg_mount_table of the cgroup - * - * @note The cg_mount_table_lock must be held prior to calling this function - */ -int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, struct cgroup_controller *cgc, - int cg_index); - -/** - * Given a controller name, test if it's mounted - * - * @param ctrl_name Controller name - * @return 1 if mounted, 0 if not mounted - */ -int cgroup_test_subsys_mounted(const char *ctrl_name); - -/** - * Create a duplicate copy of values under the specified controller - * - * @dst: Destination controller - * @src: Source controller from which values will be copied to dst - * - * @return 0 on a successful copy, ECGOTHER if the copy failed - */ -int cgroup_copy_controller_values(struct cgroup_controller * const dst, - const struct cgroup_controller * const src); - -/** - * Remove a name/value pair from a controller. - * - * @param controller - * @param name The name of the name/value pair to be removed - * @return 0 on success. ECGROUPNOTEXIST if name does not exist. - */ -int cgroup_remove_value(struct cgroup_controller * const controller, const char * const name); - -/** - * Free the specified controller from the group. - * @param ctrl - * - * Note it's up to the caller to decrement the cgroup's index - */ -void cgroup_free_controller(struct cgroup_controller *ctrl); - -/** - * Functions that are defined as STATIC can be placed within the UNIT_TEST - * ifdef. This will allow them to be included in the unit tests while - * remaining static in a normal libcgroup library build. - */ -#ifdef UNIT_TEST - -#define TEST_PROC_PID_CGROUP_FILE "test-procpidcgroup" - -int cgroup_parse_rules_options(char *options, struct cgroup_rule * const rule); -int cg_get_cgroups_from_proc_cgroups(pid_t pid, char *cgroup_list[], char *controller_list[], - int list_len); -bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule, pid_t pid, - const char * const procname); -bool cgroup_compare_wildcard_procname(const char * const rule_procname, - const char * const procname); -int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent, int *mnt_tbl_idx); -int cgroup_process_v2_mnt(struct mntent *ent, int *mnt_tbl_idx); -int cgroup_set_values_recursive(const char * const base, - const struct cgroup_controller * const controller, - bool ignore_non_dirty_failures); -int cgroup_chown_chmod_tasks(const char * const cg_path, uid_t uid, gid_t gid, mode_t fperm); -int cgroupv2_subtree_control(const char *path, const char *ctrl_name, bool enable); -int cgroupv2_get_subtree_control(const char *path, const char *ctrl_name, bool * const enabled); -int cgroupv2_controller_enabled(const char * const cg_name, const char * const ctrl_name); - -#endif /* UNIT_TEST */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/lib/libcgroup-3.1.0/src/libcgroup.map b/lib/libcgroup-3.1.0/src/libcgroup.map deleted file mode 100644 index b48c71ca988..00000000000 --- a/lib/libcgroup-3.1.0/src/libcgroup.map +++ /dev/null @@ -1,164 +0,0 @@ -CGROUP_0.32 { -global: - cgroup_init; - cgroup_attach_task; - cgroup_modify_cgroup; - cgroup_create_cgroup; - cgroup_delete_cgroup; - cgroup_attach_task_pid; - cgroup_get_cgroup; - cgroup_create_cgroup_from_parent; - cgroup_copy_cgroup; - cgroup_change_cgroup_uid_gid; - cgroup_change_cgroup_path; - cgroup_new_cgroup; - cgroup_add_controller; - cgroup_free; - cgroup_free_controllers; - cgroup_add_value_string; - cgroup_add_value_int64; - cgroup_add_value_uint64; - cgroup_add_value_bool; - cgroup_compare_cgroup; - cgroup_compare_controllers; - cgroup_set_uid_gid; - cgroup_get_uid_gid; - cgroup_get_value_string; - cgroup_set_value_string; - cgroup_get_value_int64; - cgroup_set_value_int64; - cgroup_get_value_uint64; - cgroup_set_value_uint64; - cgroup_get_value_bool; - cgroup_set_value_bool; - cgroup_change_cgroup_uid_gid_flags; - cgroup_print_rules_config; - cgroup_reload_cached_rules; - cgroup_init_rules_cache; - cgroup_get_current_controller_path; - cgroup_config_load_config; -local: - *; -}; - -CGROUP_0.32.1 { -global: - cgroup_strerror; -} CGROUP_0.32; - -CGROUP_0.33 { -global: - cgroup_get_last_errno; - cgroup_walk_tree_begin; - cgroup_walk_tree_next; - cgroup_walk_tree_end; -} CGROUP_0.32.1; - -CGROUP_0.34 { -global: - cgroup_get_task_begin; - cgroup_get_task_end; - cgroup_get_task_next; - cgroup_read_stats_begin; - cgroup_read_stats_next; - cgroup_read_stats_end; - cgroup_walk_tree_set_flags; - cgroup_get_controller_end; - cgroup_get_controller_next; - cgroup_get_controller_begin; - cgroup_unload_cgroups; - cgroup_get_controller; - cgroup_get_uid_gid_from_procfs; - cgroup_get_subsys_mount_point; - cgroup_get_procname_from_procfs; - cgroup_register_unchanged_process; - cgroup_change_cgroup_flags; -} CGROUP_0.33; - -CGROUP_0.35 { -global: - create_cgroup_from_name_value_pairs; - cgroup_delete_cgroup_ext; - cgroup_get_all_controller_begin; - cgroup_get_all_controller_next; - cgroup_get_all_controller_end; - cgroup_get_value_name_count; - cgroup_get_value_name; -} CGROUP_0.34; - -CGROUP_0.36 { -} CGROUP_0.35; - -CGROUP_0.37 { - cgroup_get_procs; - cgroup_read_value_begin; - cgroup_read_value_next; - cgroup_read_value_end; - cg_chmod_recursive; -} CGROUP_0.36; - -CGROUP_0.38 { - cgroup_get_subsys_mount_point_begin; - cgroup_get_subsys_mount_point_next; - cgroup_get_subsys_mount_point_end; - cgroup_set_permissions; - cgroup_config_unload_config; - cgroup_config_set_default; -} CGROUP_0.37; - -CGROUP_0.39 { - cgroup_reload_cached_templates; - cgroup_init_templates_cache; - cgroup_config_create_template_group; - cgroup_change_all_cgroups; - cgroup_set_logger; - cgroup_set_default_logger; - cgroup_set_loglevel; - cgroup_log; - cgroup_parse_log_level_str; -} CGROUP_0.38; - -CGROUP_0.40 { - cgroup_templates_cache_set_source_files; - cgroup_load_templates_cache_from_files; -} CGROUP_0.39; - -CGROUP_0.41 { -} CGROUP_0.40; - -CGROUP_0.42 { - cgroup_add_all_controllers; -} CGROUP_0.41; - -CGROUP_2.0 { - cgroup_build_tasks_procs_path; - cg_build_path_locked; - cgroup_fill_cgc; - cgroup_test_subsys_mounted; - cg_mount_table; - cg_mount_table_lock; - cgroup_get_controller_version; -} CGROUP_0.42; - -CGROUP_3.0 { - cgroup_convert_cgroup; - cgroup_cgxget; - cgroup_cgxset; - cgroup_version; - cgroup_list_mount_points; - - /* libcgroup 3.0.1 */ - cgroup_setup_mode; - cgroup_create_scope; - cgroup_set_default_scope_opts; - cgroup_get_controller_count; - cgroup_get_controller_by_index; - cgroup_get_controller_name; - cgroup_create_scope2; - cgroup_set_default_systemd_cgroup; - cgroup_write_systemd_default_cgroup; - cgroup_setup_mode; - is_cgroup_mode_legacy; - is_cgroup_mode_hybrid; - is_cgroup_mode_unified; -} CGROUP_2.0; diff --git a/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread b/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread deleted file mode 100755 index 15946336aab..00000000000 Binary files a/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread and /dev/null differ diff --git a/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread.c b/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread.c deleted file mode 100644 index 1b3b06e4359..00000000000 --- a/lib/libcgroup-3.1.0/src/libcgroup_systemd_idle_thread.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -#define SECS_PER_DAY (60 * 60 *24) - -int main(void) -{ - while(1) - sleep(1 * SECS_PER_DAY); - - return 0; -} diff --git a/lib/libcgroup-3.1.0/src/log.c b/lib/libcgroup-3.1.0/src/log.c deleted file mode 100644 index 93cecd480ba..00000000000 --- a/lib/libcgroup-3.1.0/src/log.c +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright Red Hat, Inc. 2012 - * - * Author: Jan Safranek - */ - -#include -#include - -#include -#include -#include -#include -#include - -static cgroup_logger_callback cgroup_logger; -static void *cgroup_logger_userdata; -static int cgroup_loglevel; - -static void cgroup_default_logger(void *userdata, int level, const char *fmt, - va_list ap) -{ - vfprintf(stdout, fmt, ap); -} - -void cgroup_log(int level, const char *fmt, ...) -{ - va_list ap; - - if (!cgroup_logger) - return; - - if (level > cgroup_loglevel) - return; - - va_start(ap, fmt); - cgroup_logger(cgroup_logger_userdata, level, fmt, ap); - va_end(ap); -} - -void cgroup_set_logger(cgroup_logger_callback logger, int loglevel, - void *userdata) -{ - cgroup_logger = logger; - cgroup_set_loglevel(loglevel); - cgroup_logger_userdata = userdata; -} - -void cgroup_set_default_logger(int level) -{ - if (!cgroup_logger) - cgroup_set_logger(cgroup_default_logger, level, NULL); -} - -int cgroup_parse_log_level_str(const char *levelstr) -{ - char *end; - long level; - - errno = 0; - - /* try to parse integer first */ - level = strtol(levelstr, &end, 10); - if (end != levelstr && *end == '\0') - return level; - - if (strcasecmp(levelstr, "ERROR") == 0) - return CGROUP_LOG_ERROR; - if (strcasecmp(levelstr, "WARNING") == 0) - return CGROUP_LOG_WARNING; - if (strcasecmp(levelstr, "INFO") == 0) - return CGROUP_LOG_INFO; - if (strcasecmp(levelstr, "DEBUG") == 0) - return CGROUP_LOG_DEBUG; - - return CGROUP_DEFAULT_LOGLEVEL; -} - -void cgroup_set_loglevel(int loglevel) -{ - if (loglevel != -1) - cgroup_loglevel = loglevel; - else { - char *level_str = getenv("CGROUP_LOGLEVEL"); - - if (level_str != NULL) - cgroup_loglevel = cgroup_parse_log_level_str(level_str); - else - cgroup_loglevel = CGROUP_DEFAULT_LOGLEVEL; - } -} diff --git a/lib/libcgroup-3.1.0/src/pam/Makefile.am b/lib/libcgroup-3.1.0/src/pam/Makefile.am deleted file mode 100644 index 017ef68f5fa..00000000000 --- a/lib/libcgroup-3.1.0/src/pam/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AM_CPPFLAGS = -I $(top_srcdir)/include -I$(top_builddir)/include - -if WITH_PAM - -pamlib_LTLIBRARIES = pam_cgroup.la -pam_cgroup_la_SOURCES = pam_cgroup.c -pam_cgroup_la_LDFLAGS = -module -avoid-version -pam_cgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la -lpam - -endif diff --git a/lib/libcgroup-3.1.0/src/pam/Makefile.in b/lib/libcgroup-3.1.0/src/pam/Makefile.in deleted file mode 100644 index 9b0239de142..00000000000 --- a/lib/libcgroup-3.1.0/src/pam/Makefile.in +++ /dev/null @@ -1,697 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/pam -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pamlibdir)" -LTLIBRARIES = $(pamlib_LTLIBRARIES) -@WITH_PAM_TRUE@pam_cgroup_la_DEPENDENCIES = \ -@WITH_PAM_TRUE@ $(top_builddir)/src/libcgroup.la -am__pam_cgroup_la_SOURCES_DIST = pam_cgroup.c -@WITH_PAM_TRUE@am_pam_cgroup_la_OBJECTS = pam_cgroup.lo -pam_cgroup_la_OBJECTS = $(am_pam_cgroup_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -pam_cgroup_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(pam_cgroup_la_LDFLAGS) $(LDFLAGS) -o $@ -@WITH_PAM_TRUE@am_pam_cgroup_la_rpath = -rpath $(pamlibdir) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/pam_cgroup.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(pam_cgroup_la_SOURCES) -DIST_SOURCES = $(am__pam_cgroup_la_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I $(top_srcdir)/include -I$(top_builddir)/include -@WITH_PAM_TRUE@pamlib_LTLIBRARIES = pam_cgroup.la -@WITH_PAM_TRUE@pam_cgroup_la_SOURCES = pam_cgroup.c -@WITH_PAM_TRUE@pam_cgroup_la_LDFLAGS = -module -avoid-version -@WITH_PAM_TRUE@pam_cgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la -lpam -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/pam/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/pam/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-pamlibLTLIBRARIES: $(pamlib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(pamlib_LTLIBRARIES)'; test -n "$(pamlibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(pamlibdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pamlibdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pamlibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pamlibdir)"; \ - } - -uninstall-pamlibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pamlib_LTLIBRARIES)'; test -n "$(pamlibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pamlibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pamlibdir)/$$f"; \ - done - -clean-pamlibLTLIBRARIES: - -test -z "$(pamlib_LTLIBRARIES)" || rm -f $(pamlib_LTLIBRARIES) - @list='$(pamlib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -pam_cgroup.la: $(pam_cgroup_la_OBJECTS) $(pam_cgroup_la_DEPENDENCIES) $(EXTRA_pam_cgroup_la_DEPENDENCIES) - $(AM_V_CCLD)$(pam_cgroup_la_LINK) $(am_pam_cgroup_la_rpath) $(pam_cgroup_la_OBJECTS) $(pam_cgroup_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_cgroup.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pamlibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pamlibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/pam_cgroup.Plo - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-pamlibLTLIBRARIES - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/pam_cgroup.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pamlibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-pamlibLTLIBRARIES \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man \ - install-pamlibLTLIBRARIES install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ - uninstall-pamlibLTLIBRARIES - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/src/pam/pam_cgroup.c b/lib/libcgroup-3.1.0/src/pam/pam_cgroup.c deleted file mode 100644 index b268effeed1..00000000000 --- a/lib/libcgroup-3.1.0/src/pam/pam_cgroup.c +++ /dev/null @@ -1,153 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/* - * Copyright RedHat Inc. 2008 - * - * Author: Vivek Goyal - * - * Derived from pam_limits.c. Original Copyright notice follows. - * - * Copyright (c) Cristian Gafton, 1996-1997, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, and the entire permission notice in its entirety, - * including the disclaimer of warranties. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * ALTERNATIVELY, this product may be distributed under the terms of - * the GNU Public License, in which case the provisions of the GPL are - * required INSTEAD OF the above restrictions. (This clause is - * necessary due to a potential bad interaction between the GPL and - * the restrictions contained in a BSD-style copyright.) - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * End of original copyright notice. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Module defines - */ -#define PAM_SM_SESSION - -#include -#include -#include -#include - -/* argument parsing */ -#define PAM_DEBUG_ARG 0x0001 - -static int _pam_parse(const pam_handle_t *pamh, int argc, const char **argv) -{ - int ctrl = 0; - - /* step through arguments */ - for (ctrl = 0; argc-- > 0; ++argv) { - if (!strcmp(*argv, "debug")) - ctrl |= PAM_DEBUG_ARG; - else - pam_syslog(pamh, LOG_ERR, "unknown option: %s", *argv); - } - - return ctrl; -} - -/* now the session stuff */ -PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) -{ - struct passwd *pwd; - char *user_name; - int ctrl, ret; - pid_t pid; - - D(("called.")); - - ctrl = _pam_parse(pamh, argc, argv); - - ret = pam_get_item(pamh, PAM_USER, (void *) &user_name); - if (user_name == NULL || ret != PAM_SUCCESS) { - pam_syslog(pamh, LOG_ERR, "open_session - error recovering username"); - return PAM_SESSION_ERR; - } - - pwd = pam_modutil_getpwnam(pamh, user_name); - if (!pwd) { - if (ctrl & PAM_DEBUG_ARG) - pam_syslog(pamh, LOG_ERR, "open_session username '%s' does not exist", - user_name); - return PAM_SESSION_ERR; - } - - D(("user name is %s", user_name)); - - /* Initialize libcg */ - ret = cgroup_init(); - if (ret) { - if (ctrl & PAM_DEBUG_ARG) - pam_syslog(pamh, LOG_ERR, "libcgroup initialization failed"); - return PAM_SESSION_ERR; - } - - D(("Initialized libcgroup successfuly.")); - - /* Determine the pid of the task */ - pid = getpid(); - - /* - * Note: We are using default gid here. Is there a way to - * determine under what egid service will be provided? - */ - ret = cgroup_change_cgroup_uid_gid_flags(pwd->pw_uid, pwd->pw_gid, pid, CGFLAG_USECACHE); - if (ret) { - if (ctrl & PAM_DEBUG_ARG) { - pam_syslog(pamh, LOG_ERR, "Change of cgroup for process with username"); - pam_syslog(pamh, LOG_ERR, "%s failed.\n", user_name); - } - return PAM_SESSION_ERR; - } - - if (ctrl & PAM_DEBUG_ARG) { - pam_syslog(pamh, LOG_DEBUG, "Changed cgroup for process %d with username %s.\n", - pid, user_name); - } - - return PAM_SUCCESS; -} - -PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) -{ - D(("called pam_cgroup close session")); - - /* nothing to do yet */ - return PAM_SUCCESS; -} diff --git a/lib/libcgroup-3.1.0/src/parse.c b/lib/libcgroup-3.1.0/src/parse.c deleted file mode 100644 index b977df0aeeb..00000000000 --- a/lib/libcgroup-3.1.0/src/parse.c +++ /dev/null @@ -1,2061 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output, and Bison version. */ -#define YYBISON 30802 - -/* Bison version string. */ -#define YYBISON_VERSION "3.8.2" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* First part of user prologue. */ -#line 11 "parse.y" - -#include -#include -#include -#include -#include - -int yylex(void); -extern int line_no; -extern char *yytext; - -static void yyerror(const char *s) -{ - fprintf(stderr, "error at line number %d at %s:%s\n", line_no, yytext, s); -} - -int yywrap(void) -{ - return 1; -} - - -#line 94 "parse.c" - -# ifndef YY_CAST -# ifdef __cplusplus -# define YY_CAST(Type, Val) static_cast (Val) -# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) -# else -# define YY_CAST(Type, Val) ((Type) (Val)) -# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) -# endif -# endif -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - ID = 258, /* ID */ - MOUNT = 259, /* MOUNT */ - GROUP = 260, /* GROUP */ - PERM = 261, /* PERM */ - TASK = 262, /* TASK */ - ADMIN = 263, /* ADMIN */ - NAMESPACE = 264, /* NAMESPACE */ - DEFAULT = 265, /* DEFAULT */ - TEMPLATE = 266, /* TEMPLATE */ - SYSTEMD = 267 /* SYSTEMD */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif -/* Token kinds. */ -#define YYEMPTY -2 -#define YYEOF 0 -#define YYerror 256 -#define YYUNDEF 257 -#define ID 258 -#define MOUNT 259 -#define GROUP 260 -#define PERM 261 -#define TASK 262 -#define ADMIN 263 -#define NAMESPACE 264 -#define DEFAULT 265 -#define TEMPLATE 266 -#define SYSTEMD 267 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 36 "parse.y" - - char *name; - char chr; - int val; - struct cgroup_dictionary *values; - -#line 178 "parse.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - - -int yyparse (void); - - -#endif /* !YY_YY_PARSE_H_INCLUDED */ -/* Symbol kind. */ -enum yysymbol_kind_t -{ - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_ID = 3, /* ID */ - YYSYMBOL_MOUNT = 4, /* MOUNT */ - YYSYMBOL_GROUP = 5, /* GROUP */ - YYSYMBOL_PERM = 6, /* PERM */ - YYSYMBOL_TASK = 7, /* TASK */ - YYSYMBOL_ADMIN = 8, /* ADMIN */ - YYSYMBOL_NAMESPACE = 9, /* NAMESPACE */ - YYSYMBOL_DEFAULT = 10, /* DEFAULT */ - YYSYMBOL_TEMPLATE = 11, /* TEMPLATE */ - YYSYMBOL_SYSTEMD = 12, /* SYSTEMD */ - YYSYMBOL_13_ = 13, /* '{' */ - YYSYMBOL_14_ = 14, /* '}' */ - YYSYMBOL_15_ = 15, /* '=' */ - YYSYMBOL_16_ = 16, /* ';' */ - YYSYMBOL_YYACCEPT = 17, /* $accept */ - YYSYMBOL_start = 18, /* start */ - YYSYMBOL_default = 19, /* default */ - YYSYMBOL_default_conf = 20, /* default_conf */ - YYSYMBOL_group = 21, /* group */ - YYSYMBOL_group_name = 22, /* group_name */ - YYSYMBOL_group_conf = 23, /* group_conf */ - YYSYMBOL_template = 24, /* template */ - YYSYMBOL_template_conf = 25, /* template_conf */ - YYSYMBOL_template_task_or_admin = 26, /* template_task_or_admin */ - YYSYMBOL_namevalue_conf = 27, /* namevalue_conf */ - YYSYMBOL_task_namevalue_conf = 28, /* task_namevalue_conf */ - YYSYMBOL_admin_namevalue_conf = 29, /* admin_namevalue_conf */ - YYSYMBOL_template_task_namevalue_conf = 30, /* template_task_namevalue_conf */ - YYSYMBOL_template_admin_namevalue_conf = 31, /* template_admin_namevalue_conf */ - YYSYMBOL_task_or_admin = 32, /* task_or_admin */ - YYSYMBOL_admin_conf = 33, /* admin_conf */ - YYSYMBOL_task_conf = 34, /* task_conf */ - YYSYMBOL_template_admin_conf = 35, /* template_admin_conf */ - YYSYMBOL_template_task_conf = 36, /* template_task_conf */ - YYSYMBOL_mountvalue_conf = 37, /* mountvalue_conf */ - YYSYMBOL_mount = 38, /* mount */ - YYSYMBOL_namespace_conf = 39, /* namespace_conf */ - YYSYMBOL_namespace = 40, /* namespace */ - YYSYMBOL_systemdvalue_conf = 41, /* systemdvalue_conf */ - YYSYMBOL_systemd = 42 /* systemd */ -}; -typedef enum yysymbol_kind_t yysymbol_kind_t; - - - - -#ifdef short -# undef short -#endif - -/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure - and (if available) are included - so that the code can choose integer types of a good width. */ - -#ifndef __PTRDIFF_MAX__ -# include /* INFRINGES ON USER NAME SPACE */ -# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_STDINT_H -# endif -#endif - -/* Narrow types that promote to a signed type and that can represent a - signed or unsigned integer of at least N bits. In tables they can - save space and decrease cache pressure. Promoting to a signed type - helps avoid bugs in integer arithmetic. */ - -#ifdef __INT_LEAST8_MAX__ -typedef __INT_LEAST8_TYPE__ yytype_int8; -#elif defined YY_STDINT_H -typedef int_least8_t yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef __INT_LEAST16_MAX__ -typedef __INT_LEAST16_TYPE__ yytype_int16; -#elif defined YY_STDINT_H -typedef int_least16_t yytype_int16; -#else -typedef short yytype_int16; -#endif - -/* Work around bug in HP-UX 11.23, which defines these macros - incorrectly for preprocessor constants. This workaround can likely - be removed in 2023, as HPE has promised support for HP-UX 11.23 - (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of - . */ -#ifdef __hpux -# undef UINT_LEAST8_MAX -# undef UINT_LEAST16_MAX -# define UINT_LEAST8_MAX 255 -# define UINT_LEAST16_MAX 65535 -#endif - -#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST8_MAX <= INT_MAX) -typedef uint_least8_t yytype_uint8; -#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX -typedef unsigned char yytype_uint8; -#else -typedef short yytype_uint8; -#endif - -#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST16_MAX <= INT_MAX) -typedef uint_least16_t yytype_uint16; -#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX -typedef unsigned short yytype_uint16; -#else -typedef int yytype_uint16; -#endif - -#ifndef YYPTRDIFF_T -# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -# define YYPTRDIFF_T __PTRDIFF_TYPE__ -# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -# elif defined PTRDIFF_MAX -# ifndef ptrdiff_t -# include /* INFRINGES ON USER NAME SPACE */ -# endif -# define YYPTRDIFF_T ptrdiff_t -# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -# else -# define YYPTRDIFF_T long -# define YYPTRDIFF_MAXIMUM LONG_MAX -# endif -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM \ - YY_CAST (YYPTRDIFF_T, \ - (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ - ? YYPTRDIFF_MAXIMUM \ - : YY_CAST (YYSIZE_T, -1))) - -#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - - -/* Stored state numbers (used for stacks). */ -typedef yytype_uint8 yy_state_t; - -/* State numbers in computations. */ -typedef int yy_state_fast_t; - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - - -#ifndef YY_ATTRIBUTE_PURE -# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define YY_ATTRIBUTE_PURE -# endif -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# else -# define YY_ATTRIBUTE_UNUSED -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YY_USE(E) ((void) (E)) -#else -# define YY_USE(E) /* empty */ -#endif - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ -# define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") -# define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") -#endif -#ifndef YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_END -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if !defined yyoverflow - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* !defined yyoverflow */ - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yy_state_t yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 151 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 17 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 26 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 48 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 165 - -/* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 267 - - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_int8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, - 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 13, 2, 14, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12 -}; - -#if YYDEBUG -/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = -{ - 0, 55, 55, 59, 63, 67, 71, 75, 80, 85, - 95, 101, 120, 124, 130, 140, 150, 161, 181, 191, - 201, 213, 222, 235, 251, 264, 270, 279, 291, 300, - 312, 321, 333, 342, 355, 364, 375, 386, 397, 408, - 420, 429, 440, 452, 461, 472, 484, 493, 504 -}; -#endif - -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) - -#if YYDEBUG || 0 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; - -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "\"end of file\"", "error", "\"invalid token\"", "ID", "MOUNT", "GROUP", - "PERM", "TASK", "ADMIN", "NAMESPACE", "DEFAULT", "TEMPLATE", "SYSTEMD", - "'{'", "'}'", "'='", "';'", "$accept", "start", "default", - "default_conf", "group", "group_name", "group_conf", "template", - "template_conf", "template_task_or_admin", "namevalue_conf", - "task_namevalue_conf", "admin_namevalue_conf", - "template_task_namevalue_conf", "template_admin_namevalue_conf", - "task_or_admin", "admin_conf", "task_conf", "template_admin_conf", - "template_task_conf", "mountvalue_conf", "mount", "namespace_conf", - "namespace", "systemdvalue_conf", "systemd", YY_NULLPTR -}; - -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) -{ - return yytname[yysymbol]; -} -#endif - -#define YYPACT_NINF (-62) - -#define yypact_value_is_default(Yyn) \ - ((Yyn) == YYPACT_NINF) - -#define YYTABLE_NINF (-1) - -#define yytable_value_is_error(Yyn) \ - 0 - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -62, 3, -62, -11, 43, -7, -3, 44, 47, -62, - -62, -62, -62, -62, -62, 46, -62, -62, 48, 59, - 57, 52, 61, 39, 2, -2, 53, 6, 54, 55, - 42, 56, 14, 63, 58, -62, 62, 64, 15, 67, - 65, -62, 49, -62, 66, 68, 16, 69, 70, -62, - 60, 71, 75, 49, 73, -62, 72, 79, 74, 76, - 77, 75, 51, 80, -62, 78, 81, -62, 82, 84, - 19, 83, 75, -62, 85, 87, 89, -62, 20, 90, - 91, 86, 75, -62, 92, -62, 93, 94, -62, -62, - 21, -62, 95, 22, 96, 23, -62, 99, 102, -62, - 24, -62, 97, 103, -62, 104, 100, 106, 109, 101, - 88, 105, 28, 107, 29, -62, -62, 108, 110, 114, - 112, -62, 111, 115, 116, -62, 118, 113, 122, 120, - 117, 124, -62, -62, 119, 89, -62, 121, 87, 123, - 130, 125, -62, 126, 131, 127, -62, -62, 36, -62, - 37, -62, 128, 102, -62, 129, 99, -62, -62, -62, - 38, -62, 41, -62, -62 -}; - -/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_int8 yydefact[] = -{ - 8, 0, 1, 0, 0, 0, 0, 0, 0, 4, - 2, 6, 3, 5, 7, 0, 12, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, - 0, 45, 0, 9, 0, 0, 0, 0, 0, 48, - 0, 0, 25, 0, 0, 11, 0, 0, 0, 0, - 0, 25, 0, 0, 17, 0, 0, 40, 0, 0, - 0, 0, 25, 43, 0, 0, 0, 10, 0, 0, - 0, 0, 25, 46, 0, 41, 0, 0, 14, 16, - 0, 44, 0, 0, 0, 0, 18, 0, 0, 20, - 0, 47, 0, 0, 15, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 19, 23, 0, 0, 0, - 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, - 0, 0, 24, 26, 0, 0, 28, 0, 0, 0, - 0, 0, 21, 0, 0, 0, 22, 27, 0, 29, - 0, 30, 0, 0, 32, 0, 0, 36, 37, 31, - 0, 33, 0, 38, 39 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -61, -55, -16, -20, -12, 98, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_uint8 yydefgoto[] = -{ - 0, 1, 9, 29, 10, 18, 38, 11, 46, 81, - 70, 93, 95, 112, 114, 60, 121, 125, 142, 146, - 24, 12, 27, 13, 32, 14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 78, 36, 15, 2, 37, 34, 19, 3, 4, 40, - 20, 90, 5, 6, 7, 8, 35, 48, 54, 63, - 41, 100, 87, 87, 87, 106, 109, 87, 49, 55, - 64, 127, 130, 88, 96, 104, 107, 110, 115, 109, - 106, 130, 128, 131, 127, 44, 16, 21, 45, 23, - 157, 158, 163, 17, 33, 164, 58, 59, 79, 80, - 22, 25, 26, 28, 31, 30, 50, 42, 39, 43, - 56, 47, 65, 51, 68, 52, 67, 53, 69, 61, - 57, 62, 74, 150, 84, 66, 72, 75, 73, 76, - 92, 77, 94, 82, 83, 124, 102, 89, 85, 86, - 99, 91, 111, 97, 98, 113, 117, 118, 101, 103, - 105, 108, 122, 116, 120, 119, 123, 134, 137, 148, - 126, 139, 129, 143, 132, 135, 133, 136, 140, 138, - 141, 145, 144, 152, 155, 147, 162, 149, 153, 151, - 156, 160, 154, 0, 159, 161, 0, 0, 0, 0, - 0, 71 -}; - -static const yytype_int16 yycheck[] = -{ - 61, 3, 13, 0, 6, 3, 13, 4, 5, 3, - 13, 72, 9, 10, 11, 12, 14, 3, 3, 3, - 14, 82, 3, 3, 3, 3, 3, 3, 14, 14, - 14, 3, 3, 14, 14, 14, 14, 14, 14, 3, - 3, 3, 14, 14, 3, 3, 3, 3, 6, 3, - 14, 14, 14, 10, 15, 14, 7, 8, 7, 8, - 13, 13, 3, 6, 3, 13, 3, 13, 15, 14, - 3, 15, 3, 15, 3, 13, 16, 13, 3, 13, - 15, 13, 3, 138, 3, 15, 13, 13, 16, 13, - 3, 14, 3, 13, 16, 7, 3, 14, 16, 15, - 14, 16, 3, 13, 13, 3, 3, 3, 16, 15, - 15, 15, 3, 16, 8, 15, 15, 3, 3, 135, - 15, 3, 15, 3, 16, 13, 16, 16, 15, 13, - 8, 7, 15, 3, 3, 16, 156, 16, 13, 16, - 13, 153, 16, -1, 16, 16, -1, -1, -1, -1, - -1, 53 -}; - -/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of - state STATE-NUM. */ -static const yytype_int8 yystos[] = -{ - 0, 18, 0, 4, 5, 9, 10, 11, 12, 19, - 21, 24, 38, 40, 42, 13, 3, 10, 22, 13, - 13, 3, 13, 3, 37, 13, 3, 39, 6, 20, - 13, 3, 41, 15, 3, 14, 3, 6, 23, 15, - 3, 14, 13, 14, 3, 6, 25, 15, 3, 14, - 3, 15, 13, 13, 3, 14, 3, 15, 7, 8, - 32, 13, 13, 3, 14, 3, 15, 16, 3, 3, - 27, 32, 13, 16, 3, 13, 13, 14, 27, 7, - 8, 26, 13, 16, 3, 16, 15, 3, 14, 14, - 27, 16, 3, 28, 3, 29, 14, 13, 13, 14, - 27, 16, 3, 15, 14, 15, 3, 14, 15, 3, - 14, 3, 30, 3, 31, 14, 16, 3, 3, 15, - 8, 33, 3, 15, 7, 34, 15, 3, 14, 15, - 3, 14, 16, 16, 3, 13, 16, 3, 13, 3, - 15, 8, 35, 3, 15, 7, 36, 16, 29, 16, - 28, 16, 3, 13, 16, 3, 13, 14, 14, 16, - 31, 16, 30, 14, 14 -}; - -/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr1[] = -{ - 0, 17, 18, 18, 18, 18, 18, 18, 18, 19, - 20, 21, 22, 22, 23, 23, 23, 24, 25, 25, - 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, - 30, 30, 31, 31, 32, 32, 33, 34, 35, 36, - 37, 37, 38, 39, 39, 40, 41, 41, 42 -}; - -/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr2[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 0, 4, - 4, 5, 1, 1, 4, 5, 4, 5, 4, 5, - 4, 5, 5, 4, 5, 0, 4, 5, 4, 5, - 4, 5, 4, 5, 5, 5, 4, 4, 4, 4, - 4, 5, 4, 4, 5, 4, 4, 5, 4 -}; - - -enum { YYENOMEM = -2 }; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - - - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Kind, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) -{ - FILE *yyoutput = yyo; - YY_USE (yyoutput); - if (!yyvaluep) - return; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - - yy_symbol_value_print (yyo, yykind, yyvaluep); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule) -{ - int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)]); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - - - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep) -{ - YY_USE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - -/* Lookahead token kind. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - yy_state_fast_t yystate = 0; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; - - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; - - /* The state stack: array, bottom, top. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; - - /* The semantic value stack: array, bottom, top. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; - - int yyn; - /* The return value of yyparse. */ - int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yychar = YYEMPTY; /* Cause a token to be read. */ - - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yysetstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST (yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - YYNOMEM; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); - if (! yyptr) - YYNOMEM; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - /* Discard the shifted token. */ - yychar = YYEMPTY; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: /* start: start group */ -#line 56 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1290 "parse.c" - break; - - case 3: /* start: start mount */ -#line 60 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1298 "parse.c" - break; - - case 4: /* start: start default */ -#line 64 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1306 "parse.c" - break; - - case 5: /* start: start namespace */ -#line 68 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1314 "parse.c" - break; - - case 6: /* start: start template */ -#line 72 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1322 "parse.c" - break; - - case 7: /* start: start systemd */ -#line 76 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1330 "parse.c" - break; - - case 8: /* start: %empty */ -#line 80 "parse.y" - { - (yyval.val) = 1; - } -#line 1338 "parse.c" - break; - - case 9: /* default: DEFAULT '{' default_conf '}' */ -#line 86 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if ((yyval.val)) { - cgroup_config_define_default(); - } - } -#line 1349 "parse.c" - break; - - case 10: /* default_conf: PERM '{' task_or_admin '}' */ -#line 96 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - } -#line 1357 "parse.c" - break; - - case 11: /* group: GROUP group_name '{' group_conf '}' */ -#line 102 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if ((yyval.val)) { - (yyval.val) = cgroup_config_insert_cgroup((yyvsp[-3].name)); - if (!(yyval.val)) { - fprintf(stderr, "failed to insert group check size and memory"); - (yyval.val) = ECGOTHER; - return (yyval.val); - } - } else { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1377 "parse.c" - break; - - case 12: /* group_name: ID */ -#line 121 "parse.y" - { - (yyval.name) = (yyvsp[0].name); - } -#line 1385 "parse.c" - break; - - case 13: /* group_name: DEFAULT */ -#line 125 "parse.y" - { - (yyval.name) = (yyvsp[0].name); - } -#line 1393 "parse.c" - break; - - case 14: /* group_conf: ID '{' namevalue_conf '}' */ -#line 131 "parse.y" - { - (yyval.val) = cgroup_config_parse_controller_options((yyvsp[-3].name), (yyvsp[-1].values)); - cgroup_dictionary_free((yyvsp[-1].values)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1407 "parse.c" - break; - - case 15: /* group_conf: group_conf ID '{' namevalue_conf '}' */ -#line 141 "parse.y" - { - (yyval.val) = cgroup_config_parse_controller_options((yyvsp[-3].name), (yyvsp[-1].values)); - cgroup_dictionary_free((yyvsp[-1].values)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1421 "parse.c" - break; - - case 16: /* group_conf: PERM '{' task_or_admin '}' */ -#line 151 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1434 "parse.c" - break; - - case 17: /* template: TEMPLATE ID '{' template_conf '}' */ -#line 162 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if ((yyval.val)) { - (yyval.val) = template_config_insert_cgroup((yyvsp[-3].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGOTHER; - return (yyval.val); - } - } else { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1454 "parse.c" - break; - - case 18: /* template_conf: ID '{' namevalue_conf '}' */ -#line 182 "parse.y" - { - (yyval.val) = template_config_parse_controller_options((yyvsp[-3].name), (yyvsp[-1].values)); - cgroup_dictionary_free((yyvsp[-1].values)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1468 "parse.c" - break; - - case 19: /* template_conf: template_conf ID '{' namevalue_conf '}' */ -#line 192 "parse.y" - { - (yyval.val) = template_config_parse_controller_options((yyvsp[-3].name), (yyvsp[-1].values)); - cgroup_dictionary_free((yyvsp[-1].values)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1482 "parse.c" - break; - - case 20: /* template_conf: PERM '{' template_task_or_admin '}' */ -#line 202 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1495 "parse.c" - break; - - case 21: /* template_task_or_admin: TASK '{' template_task_namevalue_conf '}' template_admin_conf */ -#line 214 "parse.y" - { - (yyval.val) = (yyvsp[-2].val) && (yyvsp[0].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1508 "parse.c" - break; - - case 22: /* template_task_or_admin: ADMIN '{' template_admin_namevalue_conf '}' template_task_conf */ -#line 223 "parse.y" - { - (yyval.val) = (yyvsp[-2].val) && (yyvsp[0].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1521 "parse.c" - break; - - case 23: /* namevalue_conf: ID '=' ID ';' */ -#line 236 "parse.y" - { - struct cgroup_dictionary *dict; - int ret; - ret = cgroup_dictionary_create(&dict, 0); - if (ret == 0) - ret = cgroup_dictionary_add(dict, (yyvsp[-3].name), (yyvsp[-1].name)); - if (ret) { - fprintf(stderr, "parsing failed at line number %d:%s\n", line_no, - cgroup_strerror(ret)); - (yyval.values) = NULL; - cgroup_dictionary_free(dict); - return ECGCONFIGPARSEFAIL; - } - (yyval.values) = dict; - } -#line 1541 "parse.c" - break; - - case 24: /* namevalue_conf: namevalue_conf ID '=' ID ';' */ -#line 252 "parse.y" - { - int ret = 0; - ret = cgroup_dictionary_add((yyvsp[-4].values), (yyvsp[-3].name), (yyvsp[-1].name)); - if (ret != 0) { - fprintf(stderr, "parsing failed at line number %d: %s\n", line_no, - cgroup_strerror(ret)); - (yyval.values) = NULL; - return ECGCONFIGPARSEFAIL; - } - (yyval.values) = (yyvsp[-4].values); - } -#line 1557 "parse.c" - break; - - case 25: /* namevalue_conf: %empty */ -#line 264 "parse.y" - { - (yyval.values) = NULL; - } -#line 1565 "parse.c" - break; - - case 26: /* task_namevalue_conf: ID '=' ID ';' */ -#line 271 "parse.y" - { - (yyval.val) = cgroup_config_group_task_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1578 "parse.c" - break; - - case 27: /* task_namevalue_conf: task_namevalue_conf ID '=' ID ';' */ -#line 280 "parse.y" - { - (yyval.val) = (yyvsp[-4].val) && cgroup_config_group_task_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1591 "parse.c" - break; - - case 28: /* admin_namevalue_conf: ID '=' ID ';' */ -#line 292 "parse.y" - { - (yyval.val) = cgroup_config_group_admin_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1604 "parse.c" - break; - - case 29: /* admin_namevalue_conf: admin_namevalue_conf ID '=' ID ';' */ -#line 301 "parse.y" - { - (yyval.val) = (yyvsp[-4].val) && cgroup_config_group_admin_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1617 "parse.c" - break; - - case 30: /* template_task_namevalue_conf: ID '=' ID ';' */ -#line 313 "parse.y" - { - (yyval.val) = template_config_group_task_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1630 "parse.c" - break; - - case 31: /* template_task_namevalue_conf: template_task_namevalue_conf ID '=' ID ';' */ -#line 322 "parse.y" - { - (yyval.val) = (yyvsp[-4].val) && template_config_group_task_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1643 "parse.c" - break; - - case 32: /* template_admin_namevalue_conf: ID '=' ID ';' */ -#line 334 "parse.y" - { - (yyval.val) = template_config_group_admin_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1656 "parse.c" - break; - - case 33: /* template_admin_namevalue_conf: template_admin_namevalue_conf ID '=' ID ';' */ -#line 343 "parse.y" - { - (yyval.val) = (yyvsp[-4].val) && template_config_group_admin_perm((yyvsp[-3].name), (yyvsp[-1].name)); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1669 "parse.c" - break; - - case 34: /* task_or_admin: TASK '{' task_namevalue_conf '}' admin_conf */ -#line 356 "parse.y" - { - (yyval.val) = (yyvsp[-2].val) && (yyvsp[0].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1682 "parse.c" - break; - - case 35: /* task_or_admin: ADMIN '{' admin_namevalue_conf '}' task_conf */ -#line 365 "parse.y" - { - (yyval.val) = (yyvsp[-2].val) && (yyvsp[0].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1695 "parse.c" - break; - - case 36: /* admin_conf: ADMIN '{' admin_namevalue_conf '}' */ -#line 376 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1708 "parse.c" - break; - - case 37: /* task_conf: TASK '{' task_namevalue_conf '}' */ -#line 387 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1721 "parse.c" - break; - - case 38: /* template_admin_conf: ADMIN '{' template_admin_namevalue_conf '}' */ -#line 398 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1734 "parse.c" - break; - - case 39: /* template_task_conf: TASK '{' template_task_namevalue_conf '}' */ -#line 409 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1747 "parse.c" - break; - - case 40: /* mountvalue_conf: ID '=' ID ';' */ -#line 421 "parse.y" - { - if (!cgroup_config_insert_into_mount_table((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_config_cleanup_mount_table(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1760 "parse.c" - break; - - case 41: /* mountvalue_conf: mountvalue_conf ID '=' ID ';' */ -#line 430 "parse.y" - { - if (!cgroup_config_insert_into_mount_table((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_config_cleanup_mount_table(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1773 "parse.c" - break; - - case 42: /* mount: MOUNT '{' mountvalue_conf '}' */ -#line 441 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1786 "parse.c" - break; - - case 43: /* namespace_conf: ID '=' ID ';' */ -#line 453 "parse.y" - { - if (!cgroup_config_insert_into_namespace_table((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_config_cleanup_namespace_table(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1799 "parse.c" - break; - - case 44: /* namespace_conf: namespace_conf ID '=' ID ';' */ -#line 462 "parse.y" - { - if (!cgroup_config_insert_into_namespace_table((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_config_cleanup_namespace_table(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1812 "parse.c" - break; - - case 45: /* namespace: NAMESPACE '{' namespace_conf '}' */ -#line 473 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1825 "parse.c" - break; - - case 46: /* systemdvalue_conf: ID '=' ID ';' */ -#line 485 "parse.y" - { - if (!cgroup_alloc_systemd_opts((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_cleanup_systemd_opts(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1838 "parse.c" - break; - - case 47: /* systemdvalue_conf: systemdvalue_conf ID '=' ID ';' */ -#line 494 "parse.y" - { - if (!cgroup_add_systemd_opts((yyvsp[-3].name), (yyvsp[-1].name))) { - cgroup_cleanup_systemd_opts(); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - (yyval.val) = 1; - } -#line 1851 "parse.c" - break; - - case 48: /* systemd: SYSTEMD '{' systemdvalue_conf '}' */ -#line 505 "parse.y" - { - (yyval.val) = (yyvsp[-1].val); - if (!(yyval.val)) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - (yyval.val) = ECGCONFIGPARSEFAIL; - return (yyval.val); - } - } -#line 1864 "parse.c" - break; - - -#line 1868 "parse.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; - yyerror (YY_("syntax error")); - } - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - ++yynerrs; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - /* Pop stack until we find a state that shifts the error token. */ - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturnlab; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturnlab; - - -/*-----------------------------------------------------------. -| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | -`-----------------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - goto yyreturnlab; - - -/*----------------------------------------------------------. -| yyreturnlab -- parsing is finished, clean up and return. | -`----------------------------------------------------------*/ -yyreturnlab: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - - return yyresult; -} - -#line 514 "parse.y" - diff --git a/lib/libcgroup-3.1.0/src/parse.h b/lib/libcgroup-3.1.0/src/parse.h deleted file mode 100644 index 8ca26d6aedc..00000000000 --- a/lib/libcgroup-3.1.0/src/parse.h +++ /dev/null @@ -1,112 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - ID = 258, /* ID */ - MOUNT = 259, /* MOUNT */ - GROUP = 260, /* GROUP */ - PERM = 261, /* PERM */ - TASK = 262, /* TASK */ - ADMIN = 263, /* ADMIN */ - NAMESPACE = 264, /* NAMESPACE */ - DEFAULT = 265, /* DEFAULT */ - TEMPLATE = 266, /* TEMPLATE */ - SYSTEMD = 267 /* SYSTEMD */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif -/* Token kinds. */ -#define YYEMPTY -2 -#define YYEOF 0 -#define YYerror 256 -#define YYUNDEF 257 -#define ID 258 -#define MOUNT 259 -#define GROUP 260 -#define PERM 261 -#define TASK 262 -#define ADMIN 263 -#define NAMESPACE 264 -#define DEFAULT 265 -#define TEMPLATE 266 -#define SYSTEMD 267 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 36 "parse.y" - - char *name; - char chr; - int val; - struct cgroup_dictionary *values; - -#line 98 "parse.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - - -int yyparse (void); - - -#endif /* !YY_YY_PARSE_H_INCLUDED */ diff --git a/lib/libcgroup-3.1.0/src/parse.y b/lib/libcgroup-3.1.0/src/parse.y deleted file mode 100644 index 01752857dc8..00000000000 --- a/lib/libcgroup-3.1.0/src/parse.y +++ /dev/null @@ -1,514 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright IBM Corporation. 2007 - * - * Authors: Balbir Singh - * - * NOTE: The grammar has been modified, not to be the most efficient, but - * to allow easy updation of internal data structures. - */ - -%{ -#include -#include -#include -#include -#include - -int yylex(void); -extern int line_no; -extern char *yytext; - -static void yyerror(const char *s) -{ - fprintf(stderr, "error at line number %d at %s:%s\n", line_no, yytext, s); -} - -int yywrap(void) -{ - return 1; -} - -%} - -%token ID MOUNT GROUP PERM TASK ADMIN NAMESPACE DEFAULT TEMPLATE SYSTEMD - -%union { - char *name; - char chr; - int val; - struct cgroup_dictionary *values; -} -%type group_name -%type mountvalue_conf mount task_namevalue_conf admin_namevalue_conf -%type admin_conf task_conf task_or_admin group_conf group start -%type namespace namespace_conf default default_conf -%type namevalue_conf -%type template template_conf -%type template_task_or_admin template_task_namevalue_conf -%type template_admin_namevalue_conf template_task_conf -%type template_admin_conf -%type systemdvalue_conf systemd -%start start -%% - -start : start group - { - $$ = $1; - } - | start mount - { - $$ = $1; - } - | start default - { - $$ = $1; - } - | start namespace - { - $$ = $1; - } - | start template - { - $$ = $1; - } - | start systemd - { - $$ = $1; - } - | - { - $$ = 1; - } - ; - -default : DEFAULT '{' default_conf '}' - { - $$ = $3; - if ($$) { - cgroup_config_define_default(); - } - } - ; - -default_conf - : PERM '{' task_or_admin '}' - { - $$ = $3; - } - ; - -group : GROUP group_name '{' group_conf '}' - { - $$ = $4; - if ($$) { - $$ = cgroup_config_insert_cgroup($2); - if (!$$) { - fprintf(stderr, "failed to insert group check size and memory"); - $$ = ECGOTHER; - return $$; - } - } else { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -group_name - : ID - { - $$ = $1; - } - | DEFAULT - { - $$ = $1; - } - -group_conf - : ID '{' namevalue_conf '}' - { - $$ = cgroup_config_parse_controller_options($1, $3); - cgroup_dictionary_free($3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | group_conf ID '{' namevalue_conf '}' - { - $$ = cgroup_config_parse_controller_options($2, $4); - cgroup_dictionary_free($4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | PERM '{' task_or_admin '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template : TEMPLATE ID '{' template_conf '}' - { - $$ = $4; - if ($$) { - $$ = template_config_insert_cgroup($2); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGOTHER; - return $$; - } - } else { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - - -template_conf - : ID '{' namevalue_conf '}' - { - $$ = template_config_parse_controller_options($1, $3); - cgroup_dictionary_free($3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | template_conf ID '{' namevalue_conf '}' - { - $$ = template_config_parse_controller_options($2, $4); - cgroup_dictionary_free($4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | PERM '{' template_task_or_admin '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template_task_or_admin - : TASK '{' template_task_namevalue_conf '}' template_admin_conf - { - $$ = $3 && $5; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | ADMIN '{' template_admin_namevalue_conf '}' template_task_conf - { - $$ = $3 && $5; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - - -namevalue_conf - : ID '=' ID ';' - { - struct cgroup_dictionary *dict; - int ret; - ret = cgroup_dictionary_create(&dict, 0); - if (ret == 0) - ret = cgroup_dictionary_add(dict, $1, $3); - if (ret) { - fprintf(stderr, "parsing failed at line number %d:%s\n", line_no, - cgroup_strerror(ret)); - $$ = NULL; - cgroup_dictionary_free(dict); - return ECGCONFIGPARSEFAIL; - } - $$ = dict; - } - | namevalue_conf ID '=' ID ';' - { - int ret = 0; - ret = cgroup_dictionary_add($1, $2, $4); - if (ret != 0) { - fprintf(stderr, "parsing failed at line number %d: %s\n", line_no, - cgroup_strerror(ret)); - $$ = NULL; - return ECGCONFIGPARSEFAIL; - } - $$ = $1; - } - | - { - $$ = NULL; - } - ; - -task_namevalue_conf - : ID '=' ID ';' - { - $$ = cgroup_config_group_task_perm($1, $3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | task_namevalue_conf ID '=' ID ';' - { - $$ = $1 && cgroup_config_group_task_perm($2, $4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -admin_namevalue_conf - : ID '=' ID ';' - { - $$ = cgroup_config_group_admin_perm($1, $3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | admin_namevalue_conf ID '=' ID ';' - { - $$ = $1 && cgroup_config_group_admin_perm($2, $4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template_task_namevalue_conf - : ID '=' ID ';' - { - $$ = template_config_group_task_perm($1, $3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | template_task_namevalue_conf ID '=' ID ';' - { - $$ = $1 && template_config_group_task_perm($2, $4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template_admin_namevalue_conf - : ID '=' ID ';' - { - $$ = template_config_group_admin_perm($1, $3); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | template_admin_namevalue_conf ID '=' ID ';' - { - $$ = $1 && template_config_group_admin_perm($2, $4); - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - - -task_or_admin - : TASK '{' task_namevalue_conf '}' admin_conf - { - $$ = $3 && $5; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - | ADMIN '{' admin_namevalue_conf '}' task_conf - { - $$ = $3 && $5; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -admin_conf: ADMIN '{' admin_namevalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -task_conf: TASK '{' task_namevalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template_admin_conf: ADMIN '{' template_admin_namevalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -template_task_conf: TASK '{' template_task_namevalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -mountvalue_conf - : ID '=' ID ';' - { - if (!cgroup_config_insert_into_mount_table($1, $3)) { - cgroup_config_cleanup_mount_table(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - | mountvalue_conf ID '=' ID ';' - { - if (!cgroup_config_insert_into_mount_table($2, $4)) { - cgroup_config_cleanup_mount_table(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - ; - -mount : MOUNT '{' mountvalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -namespace_conf - : ID '=' ID ';' - { - if (!cgroup_config_insert_into_namespace_table($1, $3)) { - cgroup_config_cleanup_namespace_table(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - | namespace_conf ID '=' ID ';' - { - if (!cgroup_config_insert_into_namespace_table($2, $4)) { - cgroup_config_cleanup_namespace_table(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - ; - -namespace : NAMESPACE '{' namespace_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; - -systemdvalue_conf - : ID '=' ID ';' - { - if (!cgroup_alloc_systemd_opts($1, $3)) { - cgroup_cleanup_systemd_opts(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - | systemdvalue_conf ID '=' ID ';' - { - if (!cgroup_add_systemd_opts($2, $4)) { - cgroup_cleanup_systemd_opts(); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - $$ = 1; - } - ; - -systemd : SYSTEMD '{' systemdvalue_conf '}' - { - $$ = $3; - if (!$$) { - fprintf(stderr, "parsing failed at line number %d\n", line_no); - $$ = ECGCONFIGPARSEFAIL; - return $$; - } - } - ; -%% diff --git a/lib/libcgroup-3.1.0/src/python/Makefile.am b/lib/libcgroup-3.1.0/src/python/Makefile.am deleted file mode 100644 index 71092d5cb57..00000000000 --- a/lib/libcgroup-3.1.0/src/python/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Libcgroup Python Bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# -@CODE_COVERAGE_RULES@ - -PY_DISTUTILS = \ - VERSION_RELEASE="@PACKAGE_VERSION@" \ - CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include ${AM_CPPFLAGS} ${CPPLAGS} -O2" \ - CFLAGS="$(CODE_COVERAGE_CFLAGS) ${AM_CFLAGS} ${CFLAGS}" \ - LDFLAGS="$(CODE_COVERAGE_LIBS) ${AM_LDFLAGS} ${LDFLAGS}" \ - ${PYTHON} ${srcdir}/setup.py - -# support silent builds -PY_BUILD_0 = @echo " PYTHON " $@; ${PY_DISTUTILS} -q build -PY_BUILD_1 = ${PY_DISTUTILS} build -PY_BUILD_ = ${PY_BUILD_0} -PY_BUILD = ${PY_BUILD_@AM_V@} - -PY_INSTALL = ${PY_DISTUTILS} install - -EXTRA_DIST = cgroup.pxd libcgroup.pyx setup.py - -all-local: build - -build: ../libcgroup.la cgroup.pxd libcgroup.pyx setup.py - [ ${srcdir} == ${builddir} ] || cp ${srcdir}/libcgroup.pyx ${builddir} - ${PY_BUILD} && touch build - -install-exec-local: build - ${PY_INSTALL} --install-lib=${DESTDIR}/${pyexecdir} \ - --record=${DESTDIR}/${pyexecdir}/install_files.txt - -uninstall-local: - cat ${DESTDIR}/${pyexecdir}/install_files.txt | xargs ${RM} -f - ${RM} -f ${DESTDIR}/${pyexecdir}/install_files.txt - -clean-local: - [ ${srcdir} == ${builddir} ] || ${RM} -f ${builddir}/libcgroup.pyx - ${RM} -rf libcgroup.c build libcgroup.egg-info dist diff --git a/lib/libcgroup-3.1.0/src/python/Makefile.in b/lib/libcgroup-3.1.0/src/python/Makefile.in deleted file mode 100644 index 12a4831ea2a..00000000000 --- a/lib/libcgroup-3.1.0/src/python/Makefile.in +++ /dev/null @@ -1,517 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/python -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -PY_DISTUTILS = \ - VERSION_RELEASE="@PACKAGE_VERSION@" \ - CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include ${AM_CPPFLAGS} ${CPPLAGS} -O2" \ - CFLAGS="$(CODE_COVERAGE_CFLAGS) ${AM_CFLAGS} ${CFLAGS}" \ - LDFLAGS="$(CODE_COVERAGE_LIBS) ${AM_LDFLAGS} ${LDFLAGS}" \ - ${PYTHON} ${srcdir}/setup.py - - -# support silent builds -PY_BUILD_0 = @echo " PYTHON " $@; ${PY_DISTUTILS} -q build -PY_BUILD_1 = ${PY_DISTUTILS} build -PY_BUILD_ = ${PY_BUILD_0} -PY_BUILD = ${PY_BUILD_@AM_V@} -PY_INSTALL = ${PY_DISTUTILS} install -EXTRA_DIST = cgroup.pxd libcgroup.pyx setup.py -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/python/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/python/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile all-local -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-exec-local - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-local - -.MAKE: install-am install-strip - -.PHONY: all all-am all-local check check-am clean clean-generic \ - clean-libtool clean-local cscopelist-am ctags-am distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-exec-local install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am uninstall-local - -.PRECIOUS: Makefile - - -# SPDX-License-Identifier: LGPL-2.1-only -# -# Libcgroup Python Bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# -@CODE_COVERAGE_RULES@ - -all-local: build - -build: ../libcgroup.la cgroup.pxd libcgroup.pyx setup.py - [ ${srcdir} == ${builddir} ] || cp ${srcdir}/libcgroup.pyx ${builddir} - ${PY_BUILD} && touch build - -install-exec-local: build - ${PY_INSTALL} --install-lib=${DESTDIR}/${pyexecdir} \ - --record=${DESTDIR}/${pyexecdir}/install_files.txt - -uninstall-local: - cat ${DESTDIR}/${pyexecdir}/install_files.txt | xargs ${RM} -f - ${RM} -f ${DESTDIR}/${pyexecdir}/install_files.txt - -clean-local: - [ ${srcdir} == ${builddir} ] || ${RM} -f ${builddir}/libcgroup.pyx - ${RM} -rf libcgroup.c build libcgroup.egg-info dist - -# 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/lib/libcgroup-3.1.0/src/python/cgroup.pxd b/lib/libcgroup-3.1.0/src/python/cgroup.pxd deleted file mode 100644 index e591876a94a..00000000000 --- a/lib/libcgroup-3.1.0/src/python/cgroup.pxd +++ /dev/null @@ -1,133 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Libcgroup Python Bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -# cython: language_level = 3str - -from posix.types cimport pid_t, uid_t, gid_t, mode_t -from libcpp cimport bool - -cdef extern from "libcgroup.h": - cdef struct cgroup: - pass - - cdef struct cgroup_controller: - pass - - cdef enum cg_version_t: - CGROUP_UNK - CGROUP_V1 - CGROUP_V2 - CGROUP_DISK - - cdef enum cg_setup_mode_t: - CGROUP_MODE_UNK - CGROUP_MODE_LEGACY - CGROUP_MODE_HYBRID - CGROUP_MODE_UNIFIED - - cdef struct cgroup_library_version: - unsigned int major - unsigned int minor - unsigned int release - - cdef enum cgroup_systemd_mode_t: - CGROUP_SYSTEMD_MODE_FAIL - CGROUP_SYSTEMD_MODE_REPLACE - CGROUP_SYSTEMD_MODE_ISOLATE - CGROUP_SYSTEMD_MODE_IGNORE_DEPS - CGROUP_SYSTEMD_MODE_IGNORE_REQS - - cdef struct cgroup_systemd_scope_opts: - int delegated - cgroup_systemd_mode_t mode - pid_t pid - - cdef enum cgroup_log_level: - CGROUP_LOG_CONT - CGROUP_LOG_ERROR - CGROUP_LOG_WARNING - CGROUP_LOG_INFO - CGROUP_LOG_DEBUG - - int cgroup_init() - const cgroup_library_version * cgroup_version() - - cgroup *cgroup_new_cgroup(const char *name) - int cgroup_create_cgroup(cgroup *cg, int ignore_ownership) - int cgroup_convert_cgroup(cgroup *out_cg, cg_version_t out_version, - cgroup *in_cg, cg_version_t in_version) - void cgroup_free(cgroup **cg) - - cgroup_controller *cgroup_add_controller(cgroup *cg, const char *name) - int cgroup_add_all_controllers(cgroup *cg) - cgroup_controller *cgroup_get_controller(cgroup *cg, const char *name) - - int cgroup_add_value_string(cgroup_controller *cgc, const char *name, - const char *value) - int cgroup_get_value_string(cgroup_controller *cgc, const char *name, - char **value) - char *cgroup_get_value_name(cgroup_controller *cgc, int index) - int cgroup_get_value_name_count(cgroup_controller *cgc) - - int cgroup_cgxget(cgroup ** cg, cg_version_t version, - bint ignore_unmappable) - - int cgroup_cgxset(const cgroup * const cg, cg_version_t version, - bint ignore_unmappable) - - int cgroup_list_mount_points(const cg_version_t cgrp_version, - char ***mount_paths) - - cg_setup_mode_t cgroup_setup_mode() - - int cgroup_create_scope(const char * const scope_name, const char * const slice_name, - const cgroup_systemd_scope_opts * const opts) - - int cgroup_get_cgroup(cgroup *cg) - - int cgroup_delete_cgroup(cgroup *cg, int ignore_migration) - - int cgroup_get_controller_count(cgroup *cgroup) - - cgroup_controller *cgroup_get_controller_by_index(cgroup *cgroup, int index) - - char *cgroup_get_controller_name(cgroup_controller *controller) - - int cgroup_attach_task(cgroup * cgroup) - int cgroup_attach_task_pid(cgroup * cgroup, pid_t pid) - - int cgroup_set_uid_gid(cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid, uid_t control_uid, - gid_t control_gid) - - void cgroup_set_permissions(cgroup *cgroup, mode_t control_dperm, mode_t control_fperm, - mode_t task_fperm) - - int cgroup_create_scope2(cgroup *cgroup, int ignore_ownership, - const cgroup_systemd_scope_opts * const opts) - - int cgroup_set_default_systemd_cgroup() - int cgroup_write_systemd_default_cgroup(const char * const slice_name, - const char * const scope_name) - - int cgroup_compare_cgroup(cgroup *cgroup_a, cgroup *cgroup_b) - - int cgroup_get_procs(char *name, char *controller, pid_t **pids, int *size) - - bool is_cgroup_mode_legacy() - - bool is_cgroup_mode_hybrid() - - bool is_cgroup_mode_unified() - - int cgroup_get_current_controller_path(pid_t pid, const char *controller, - char **current_path) - - int cgroup_change_cgroup_path(const char *dest, pid_t pid, const char * const controllers[]) - - void cgroup_set_default_logger(int log_level) -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/src/python/libcgroup.pyx b/lib/libcgroup-3.1.0/src/python/libcgroup.pyx deleted file mode 100644 index 407963ab86d..00000000000 --- a/lib/libcgroup-3.1.0/src/python/libcgroup.pyx +++ /dev/null @@ -1,821 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Libcgroup Python Bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -# cython: language_level = 3str - -""" Python bindings for the libcgroup library -""" - -__author__ = 'Tom Hromatka ' -__date__ = "25 October 2021" - -from posix.types cimport pid_t, mode_t -from libc.stdlib cimport malloc, free -from libc.string cimport strcpy -cimport cgroup - -CONTROL_NAMELEN_MAX = 32 - -cdef class Version: - CGROUP_UNK = cgroup.CGROUP_UNK - CGROUP_V1 = cgroup.CGROUP_V1 - CGROUP_V2 = cgroup.CGROUP_V2 - CGROUP_DISK = cgroup.CGROUP_DISK - -cdef class Mode: - CGROUP_MODE_UNK = cgroup.CGROUP_MODE_UNK - CGROUP_MODE_LEGACY = cgroup.CGROUP_MODE_LEGACY - CGROUP_MODE_HYBRID = cgroup.CGROUP_MODE_HYBRID - CGROUP_MODE_UNIFIED = cgroup.CGROUP_MODE_UNIFIED - -cdef class SystemdMode: - CGROUP_SYSTEMD_MODE_FAIL = cgroup.CGROUP_SYSTEMD_MODE_FAIL - CGROUP_SYSTEMD_MODE_REPLACE = cgroup.CGROUP_SYSTEMD_MODE_REPLACE - CGROUP_SYSTEMD_MODE_ISOLATE = cgroup.CGROUP_SYSTEMD_MODE_ISOLATE - CGROUP_SYSTEMD_MODE_IGNORE_DEPS = cgroup.CGROUP_SYSTEMD_MODE_IGNORE_DEPS - CGROUP_SYSTEMD_MODE_IGNORE_REQS = cgroup.CGROUP_SYSTEMD_MODE_IGNORE_REQS - -cdef class LogLevel: - CGROUP_LOG_CONT = cgroup.CGROUP_LOG_CONT - CGROUP_LOG_ERROR = cgroup.CGROUP_LOG_ERROR - CGROUP_LOG_WARNING = cgroup.CGROUP_LOG_WARNING - CGROUP_LOG_INFO = cgroup.CGROUP_LOG_INFO - CGROUP_LOG_DEBUG = cgroup.CGROUP_LOG_DEBUG - - -def c_str(string): - return bytes(string, "ascii") - - -def indent(in_str, cnt): - leading_indent = cnt * ' ' - return ''.join(leading_indent + line for line in in_str.splitlines(True)) - - -class Controller: - def __init__(self, name): - self.name = name - # self.settings maps to - # struct control_value *values[CG_NV_MAX]; - self.settings = dict() - - def __str__(self): - out_str = "Controller {}\n".format(self.name) - - for setting_key in self.settings: - out_str += indent("{} = {}\n".format(setting_key, - self.settings[setting_key]), 4) - - return out_str - - def __eq__(self, other): - if not isinstance(other, Controller): - return False - - if self.name != other.name: - return False - - if self.settings != other.settings: - return False - - return True - - -cdef class Cgroup: - """ Python object representing a libcgroup cgroup """ - cdef cgroup.cgroup * _cgp - cdef public: - object name, controllers, version - - @staticmethod - def cgroup_init(): - ret = cgroup.cgroup_init() - if ret != 0: - raise RuntimeError("Failed to initialize libcgroup: {}".format(ret)) - - def __cinit__(self, name, version): - Cgroup.cgroup_init() - - self._cgp = cgroup.cgroup_new_cgroup(c_str(name)) - if self._cgp == NULL: - raise RuntimeError("Failed to create cgroup {}".format(name)) - - def __init__(self, name, version): - """Initialize this cgroup instance - - Arguments: - name - Name of this cgroup - version - Version of this cgroup - - Note: - Does not modify the cgroup sysfs. Does not read from the cgroup sysfs - """ - self.name = name - self.controllers = dict() - self.version = version - - def __str__(self): - out_str = "Cgroup {}\n".format(self.name) - for ctrl_key in self.controllers: - out_str += indent(str(self.controllers[ctrl_key]), 4) - - return out_str - - def __eq__(self, other): - if not isinstance(other, Cgroup): - return False - - if self.name != other.name: - return False - - if self.version != other.version: - return False - - if self.controllers != other.controllers: - return False - - if not self.compare(other): - return False - - return True - - @staticmethod - def library_version(): - cdef const cgroup.cgroup_library_version * version - - version = cgroup.cgroup_version() - return [version.major, version.minor, version.release] - - def add_controller(self, ctrl_name): - """Add a controller to the Cgroup instance - - Arguments: - ctrl_name - name of the controller - - Description: - Adds a controller to the Cgroup instance - - Note: - Does not modify the cgroup sysfs - """ - cdef cgroup.cgroup_controller * cgcp - - cgcp = cgroup.cgroup_add_controller(self._cgp, - c_str(ctrl_name)) - if cgcp == NULL: - raise RuntimeError("Failed to add controller {} to cgroup".format( - ctrl_name)) - - self.controllers[ctrl_name] = Controller(ctrl_name) - - def add_all_controllers(self): - """Add all enabled controllers to the Cgroup instance - - Description: - Adds all enabled controllers (i.e. all controllers in the cgroup's cgroup.controllers - file) to the Cgroup instance - - Note: - Reads from the cgroup sysfs - """ - ret = cgroup.cgroup_add_all_controllers(self._cgp) - if ret != 0: - raise RuntimeError("Failed to add all controllers to cgroup") - - ctrl_cnt = cgroup.cgroup_get_controller_count(self._cgp) - for i in range(0, ctrl_cnt): - ctrl_ptr = cgroup.cgroup_get_controller_by_index(self._cgp, i) - ctrl_name = cgroup.cgroup_get_controller_name(ctrl_ptr).decode('ascii') - self.controllers[ctrl_name] = Controller(ctrl_name) - - self._pythonize_cgroup() - - def add_setting(self, setting_name, setting_value=None): - """Add a setting to the Cgroup/Controller instance - - Arguments: - setting_name - name of the cgroup setting, e.g. 'cpu.shares' - setting_value (optional) - value - - Description: - Adds a setting/value pair to the Cgroup/Controller instance - - Note: - Does not modify the cgroup sysfs - """ - cdef cgroup.cgroup_controller *cgcp - - ctrl_name = setting_name.split('.')[0] - - cgcp = cgroup.cgroup_get_controller(self._cgp, - c_str(ctrl_name)) - if cgcp == NULL: - self.add_controller(ctrl_name) - - cgcp = cgroup.cgroup_get_controller(self._cgp, - c_str(ctrl_name)) - if cgcp == NULL: - raise RuntimeError("Failed to get controller {}".format( - ctrl_name)) - - if setting_value is None: - ret = cgroup.cgroup_add_value_string(cgcp, - c_str(setting_name), NULL) - else: - ret = cgroup.cgroup_add_value_string(cgcp, - c_str(setting_name), c_str(setting_value)) - if ret != 0: - raise RuntimeError("Failed to add setting {}: {}".format( - setting_name, ret)) - - def _pythonize_cgroup(self): - """ - Given a populated self._cgp, populate the equivalent Python fields - """ - cdef char *setting_name - cdef char *setting_value - - for ctrlr_key in self.controllers: - cgcp = cgroup.cgroup_get_controller(self._cgp, - c_str(self.controllers[ctrlr_key].name)) - if cgcp == NULL: - raise RuntimeError("Failed to get controller {}".format( - ctrlr_key)) - - self.controllers[ctrlr_key] = Controller(ctrlr_key) - setting_cnt = cgroup.cgroup_get_value_name_count(cgcp) - - for i in range(0, setting_cnt): - setting_name = cgroup.cgroup_get_value_name(cgcp, i) - - ret = cgroup.cgroup_get_value_string(cgcp, - setting_name, &setting_value) - if ret != 0: - raise RuntimeError("Failed to get value {}: {}".format( - setting_name, ret)) - - name = setting_name.decode("ascii") - value = setting_value.decode("ascii").strip() - self.controllers[ctrlr_key].settings[name] = value - - def convert(self, out_version): - """Convert this cgroup to another cgroup version - - Arguments: - out_version - Version to convert to - - Return: - Returns the converted cgroup instance - - Description: - Convert this cgroup instance to a cgroup instance of a different - cgroup version - - Note: - Does not modify the cgroup sysfs. Does not read from the cgroup sysfs - """ - out_cgp = Cgroup(self.name, out_version) - ret = cgroup.cgroup_convert_cgroup(out_cgp._cgp, - out_version, self._cgp, self.version) - if ret != 0: - raise RuntimeError("Failed to convert cgroup: {}".format(ret)) - - for ctrlr_key in self.controllers: - out_cgp.controllers[ctrlr_key] = Controller(ctrlr_key) - - out_cgp._pythonize_cgroup() - - return out_cgp - - def cgxget(self, ignore_unmappable=False): - """Read the requested settings from the cgroup sysfs - - Arguments: - ignore_unmappable - Ignore cgroup settings that can't be converted - from one version to another - - Return: - Returns the cgroup instance that represents the settings read from - sysfs - - Description: - Given this cgroup instance, read the settings/values from the - cgroup sysfs. If the read was successful, the settings are - returned in the return value - - Note: - Reads from the cgroup sysfs - """ - cdef bint ignore - - if ignore_unmappable: - ignore = 1 - else: - ignore = 0 - - ret = cgroup.cgroup_cgxget(&self._cgp, self.version, ignore) - if ret != 0: - raise RuntimeError("cgxget failed: {}".format(ret)) - - self._pythonize_cgroup() - - def cgxset(self, ignore_unmappable=False): - """Write this cgroup to the cgroup sysfs - - Arguments: - ignore_unmappable - Ignore cgroup settings that can't be converted - from one version to another - - Description: - Write the settings/values in this cgroup instance to the cgroup sysfs - - Note: - Writes to the cgroup sysfs - """ - if ignore_unmappable: - ignore = 1 - else: - ignore = 0 - - ret = cgroup.cgroup_cgxset(self._cgp, self.version, ignore) - if ret != 0: - raise RuntimeError("cgxset failed: {}".format(ret)) - - def create(self, ignore_ownership=True): - """Write this cgroup to the cgroup sysfs - - Arguments: - ignore_ownership - if true, all errors are ignored when setting ownership - of the group and its tasks file - - Return: - None - """ - ret = cgroup.cgroup_create_cgroup(self._cgp, ignore_ownership) - if ret != 0: - raise RuntimeError("Failed to create cgroup: {}".format(ret)) - - @staticmethod - def mount_points(version): - """List cgroup mount points of the specified version - - Arguments: - version - It specifies the cgroup version - - Return: - The cgroup mount points in a list - - Description: - Parse the /proc/mounts and list the cgroup mount points matching the - version - """ - cdef char **a - - Cgroup.cgroup_init() - - mount_points = [] - ret = cgroup.cgroup_list_mount_points(version, &a) - if ret is not 0: - raise RuntimeError("cgroup_list_mount_points failed: {}".format(ret)) - - i = 0 - while a[i]: - mount_points.append((a[i]).decode("utf-8")) - i = i + 1 - return mount_points - - @staticmethod - def cgroup_mode(): - """Get the cgroup mode (legacy, hybrid, or unified) - - Return: - The cgroup mode enumeration - """ - Cgroup.cgroup_init() - return cgroup.cgroup_setup_mode() - - @staticmethod - def create_scope(scope_name='libcgroup.scope', slice_name='libcgroup.slice', delegated=True, - systemd_mode=SystemdMode.CGROUP_SYSTEMD_MODE_FAIL, pid=None): - """Create a systemd scope - - Arguments: - scope_name - name of the scope to be created - slice_name - name of the slice where the scope should reside - delegated - if true, then systemd will not manage the cgroup aspects of the scope. It - is up to the user to manage the cgroup settings - systemd_mode - setting to tell systemd how to handle creation of this scope and - resolve conflicts if the scope and/or slice exist - pid - pid of the process to place in the scope. If None is provided, libcgroup will - place a dummy process in the scope - - Description: - Create a systemd scope under slice_name. If delegated is true, then systemd will - not manage the cgroup aspects of the scope. - """ - cdef cgroup.cgroup_systemd_scope_opts opts - - Cgroup.cgroup_init() - - if delegated: - opts.delegated = 1 - else: - opts.delegated = 0 - - opts.mode = systemd_mode - if pid: - opts.pid = pid - else: - opts.pid = -1 - - ret = cgroup.cgroup_create_scope(c_str(scope_name), c_str(slice_name), &opts) - if ret is not 0: - raise RuntimeError("cgroup_create_scope failed: {}".format(ret)) - - def get(self): - """Get the cgroup information from the cgroup sysfs - - Description: - Read the cgroup data from the cgroup sysfs filesystem - """ - cdef cgroup.cgroup_controller *ctrl_ptr - - ret = cgroup.cgroup_get_cgroup(self._cgp) - if ret is not 0: - raise RuntimeError("cgroup_get_cgroup failed: {}".format(ret)) - - ctrl_cnt = cgroup.cgroup_get_controller_count(self._cgp) - for i in range(0, ctrl_cnt): - ctrl_ptr = cgroup.cgroup_get_controller_by_index(self._cgp, i) - ctrl_name = cgroup.cgroup_get_controller_name(ctrl_ptr).decode('ascii') - self.controllers[ctrl_name] = Controller(ctrl_name) - - self._pythonize_cgroup() - - def delete(self, ignore_migration=True): - """Delete the cgroup from the cgroup sysfs - - Arguments: - ignore_migration - ignore errors caused by migration of tasks to parent cgroup - - Description: - Delete the cgroup from the cgroup sysfs filesystem - """ - ret = cgroup.cgroup_delete_cgroup(self._cgp, ignore_migration) - if ret is not 0: - raise RuntimeError("cgroup_delete_cgroup failed: {}".format(ret)) - - def attach(self, pid=None, root_cgroup=False): - """Attach a process to a cgroup - - Arguments: - pid - pid to be attached. If none, then the current pid is attached - root_cgroup - if True, then the pid will be attached to the root cgroup - - Description: - Attach a process to a cgroup - """ - if pid is None: - if root_cgroup: - ret = cgroup.cgroup_attach_task(NULL) - else: - ret = cgroup.cgroup_attach_task(self._cgp) - else: - if root_cgroup: - ret = cgroup.cgroup_attach_task_pid(NULL, pid) - else: - ret = cgroup.cgroup_attach_task_pid(self._cgp, pid) - - if ret is not 0: - raise RuntimeError("cgroup_attach_task failed: {}".format(ret)) - - def set_uid_gid(self, tasks_uid, tasks_gid, ctrl_uid, ctrl_gid): - """Set the desired owning uid/gid for the tasks file and the entire cgroup hierarchy - - Arguments: - tasks_uid - uid that should own the tasks file - tasks_gid - gid that should own the tasks file - ctrl_uid - uid to recursively apply to the entire cgroup hierarchy - ctrl_gid - gid to recursively apply to the entire cgroup hierarchy - - Note: - Does not modify the cgroup sysfs. Does not read from the cgroup sysfs. Applies the - provided uids and gids to the appropriate uid/gid fields in the cgroup struct. - """ - ret = cgroup.cgroup_set_uid_gid(self._cgp, tasks_uid, tasks_gid, ctrl_uid, ctrl_gid) - if ret is not 0: - raise RuntimeError("cgroup_set_uid_gid failed: {}".format(ret)) - - def set_permissions(self, dir_mode, ctrl_mode, task_mode): - """Set the permission bits on the cgroup - - Arguments: - dir_mode - permissions to set on the cgroup directory - ctrl_mode - permissions to set on the files in the directory, except tasks - task_mode - permissions to set on the tasks file - - Note: - Does not modify the cgroup sysfs. Does not read from the cgroup sysfs. Only the - in-memory cgroup structure is updated. - - The mode parameters are expected to be of a form defined in the Python stat module [1], - e.g. stat.S_IWUSR. - - [1] https://docs.python.org/3/library/stat.html - """ - cdef mode_t dmode = dir_mode - cdef mode_t cmode = ctrl_mode - cdef mode_t tmode = task_mode - - cgroup.cgroup_set_permissions(self._cgp, dmode, cmode, tmode) - - def create_scope2(self, ignore_ownership=True, delegated=True, - systemd_mode=SystemdMode.CGROUP_SYSTEMD_MODE_FAIL, pid=None): - """Create a systemd scope using the cgroup instance - - Arguments: - ignore_ownership - if true, do not modify the owning user/group for the cgroup directory - and control files - delegated - if true, then systemd will not manage the cgroup aspects of the scope. It - is up to the user to manage the cgroup settings - systemd_mode - setting to tell systemd how to handle creation of this scope and - resolve conflicts if the scope and/or slice exist - pid - pid of the process to place in the scope. If None is provided, libcgroup will - place a dummy process in the scope - - Description: - Create a systemd scope using the cgroup instance in this class. If delegated is true, - then systemd will not manage the cgroup aspects of the scope. - """ - cdef cgroup.cgroup_systemd_scope_opts opts - - if delegated: - opts.delegated = 1 - else: - opts.delegated = 0 - - opts.mode = systemd_mode - if pid: - opts.pid = pid - else: - opts.pid = -1 - - ret = cgroup.cgroup_create_scope2(self._cgp, ignore_ownership, &opts) - if ret is not 0: - raise RuntimeError("cgroup_create_scope2 failed: {}".format(ret)) - - @staticmethod - def _set_default_systemd_cgroup(): - """Set systemd_default_cgroup - - Arguments: - None - - Description: - Reads /run/libcgroup/systemd and if the file exists, sets the - systemd_default_cgroup. Then on all the paths constructed, has - the systemd_default_cgroup appended to it. This is used when - cgroup sub-tree is constructed for systemd delegation. - """ - Cgroup.cgroup_init() - ret = cgroup.cgroup_set_default_systemd_cgroup() - - if ret != 1: - raise RuntimeError('Failed to set the default systemd cgroup') - - @staticmethod - def write_default_systemd_scope(slice_name, scope_name, set_default=True): - """Write the provided slice and scope to the libcgroup /var/run file - - Arguments: - slice_name - Slice name, e.g. libcgroup.slice - scope_name - Scope name, e.g. database.scope - set_default - If true, set this as the default path for libcgroup APIs - and tools - - Description: - Write the provided slice and scope to the libcgroup var/run file. This - convenience function provides a mechanism for setting a slice/scope as - the default path within libcgroup. Any API or cmdline operation will - utilize this path as the "root" cgroup, but it can be overridden on a - case-by-case basis. - - So if the default slice/scope is set to "libcgroup.slice/database.scope", - and the user wants to access "libcgroup.slice/database.scope/foo", then - they can use the following: - - # Within libcgroup, this will expand to - # libcgroup.slice/database.scope/foo - cg = Cgroup('foo') - """ - ret = cgroup.cgroup_write_systemd_default_cgroup(c_str(slice_name), - c_str(scope_name)) - if ret != 1: - raise RuntimeError("Failed to write the default slice/scope") - - if set_default: - Cgroup._set_default_systemd_cgroup() - - @staticmethod - def clear_default_systemd_scope(): - """Clear/Remove the default slice/scope from libcgroup - - Description: - Delete the default slice/scope from the libcgroup var/run file. - Also delete the internal global variable within libcgroup so that - the default path is restored back to the root cgroup - """ - try: - Cgroup.write_default_systemd_scope('', '', set_default=False) - except RuntimeError: - pass - - try: - Cgroup._set_default_systemd_cgroup() - except RuntimeError: - pass - - cdef compare(self, Cgroup other): - """Compare this cgroup instance with another cgroup instance - - Arguments: - other - other cgroup instance to be compared - - Return: - Returns true if the cgroups are equal. False otherwise - - Description: - Invokes the libcgroup C function, cgroup_compare_cgroup(). - cgroup_compare_cgroup() walks through the cgroup and compares the - cgroup, its controllers, and the values/settings within the - controller. - """ - ret = cgroup.cgroup_compare_cgroup(self._cgp, other._cgp) - if ret == 0: - return True - else: - return False - - def get_processes(self): - """Get the processes in this cgroup - - Return: - Returns an integer list of PIDs - - Description: - Invokes the libcgroup C function, cgroup_get_procs(). - cgroup_get_procs() reads each controller's cgroup.procs file - in the cgroup sysfs. The results are then combined together - into a standard Python list of integers. - - Note: - Reads from the cgroup sysfs - """ - pid_list = list() - cdef pid_t *pids - cdef int size - - if len(self.controllers) == 0: - ret = cgroup.cgroup_get_procs(c_str(self.name), NULL, &pids, &size) - if ret is not 0: - raise RuntimeError("cgroup_get_procs failed: {}".format(ret)) - - for i in range(0, size): - pid_list.append(int(pids[i])) - - for ctrl_key in self.controllers: - ret = cgroup.cgroup_get_procs(c_str(self.name), - c_str(self.controllers[ctrl_key].name), &pids, &size) - if ret is not 0: - raise RuntimeError("cgroup_get_procs failed: {}".format(ret)) - - for i in range(0, size): - pid_list.append(int(pids[i])) - - # Remove duplicates - pid_list = [*set(pid_list)] - - return pid_list - - @staticmethod - def is_cgroup_mode_legacy(): - """Check if the current setup mode is legacy (v1) - - Return: - True if the mode is legacy, else false - """ - return cgroup.is_cgroup_mode_legacy() - - @staticmethod - def is_cgroup_mode_hybrid(): - """Check if the current setup mode is hybrid (v1/v2) - - Return: - True if the mode is hybrid, else false - """ - return cgroup.is_cgroup_mode_hybrid() - - @staticmethod - def is_cgroup_mode_unified(): - """Check if the current setup mode is unified (v2) - - Return: - True if the mode is unified, else false - """ - return cgroup.is_cgroup_mode_unified() - - @staticmethod - def get_current_controller_path(pid, controller=None): - """Get the cgroup path of pid, under controller hierarchy - - Return: - Return cgroup path relative to mount point - - Description: - Invokes the libcgroup C function, cgroup_get_current_controller_path(). - It parses the /proc//cgroup file and returns the cgroup path, if - the controller matches in the output for cgroup v1 controllers and for - the cgroup v2 controllers, checks if the cgroup.controllers file has - the controller enabled. - """ - cdef char *current_path - - Cgroup.cgroup_init() - - if controller is None: - ret = cgroup.cgroup_get_current_controller_path(pid, NULL, - ¤t_path) - elif isinstance(controller, str): - ret = cgroup.cgroup_get_current_controller_path(pid, - c_str(controller), ¤t_path) - else: - raise TypeError("cgroup_get_current_controller_path failed: " - "expected controller type string, but passed " - "{}".format(type(controller))) - - if ret is not 0: - raise RuntimeError("cgroup_get_current_controller_path failed :" - "{}".format(ret)) - - return current_path.decode('ascii') - - @staticmethod - def move_process(pid, dest_cgname, controller=None): - """Move a process to the specified cgroup - - Return: - None - - Description: - Invokes the libcgroup C function, cgroup_change_cgroup_path(). - It moves a process to the specified cgroup dest_cgname. - - To move the process to a cgroup v1 cgroup, the controller must be - provided. For cgroup v2, the controller is optional - - Note: - * Writes to the cgroup sysfs - """ - cdef char *controllers[2] - - if not controller: - ret = cgroup.cgroup_change_cgroup_path(c_str(dest_cgname), pid, NULL) - elif isinstance(controller, str): - controllers[0] = malloc(CONTROL_NAMELEN_MAX) - strcpy(controllers[0], c_str(controller)) - controllers[1] = NULL - - ret = cgroup.cgroup_change_cgroup_path(c_str(dest_cgname), pid, - controllers) - free(controllers[0]) - else: - # - # In the future we could add support for a list of controllers - # - raise TypeError("Unsupported controller type: {}".format(type(controller))) - - if ret is not 0: - raise RuntimeError("cgroup_change_cgroup_path failed :" - "{}".format(ret)) - - @staticmethod - def log_level(log_level): - """Set the libcgroup log level - - Arguments: - log_level - libcgroup.LogLevel - - Description: - Set the libcgroup logger to stdout at the specified log_level - """ - cgroup.cgroup_set_default_logger(log_level) - - def __dealloc__(self): - cgroup.cgroup_free(&self._cgp) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/src/python/setup.py b/lib/libcgroup-3.1.0/src/python/setup.py deleted file mode 100755 index 753ad874bd8..00000000000 --- a/lib/libcgroup-3.1.0/src/python/setup.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# SPDX-License-Identifier: LGPL-2.1-only -# -# Libcgroup Python Module Build Script -# - -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from setuptools import Extension, setup -from Cython.Build import cythonize -import os - -setup( - name='libcgroup', - version=os.environ['VERSION_RELEASE'], - description='Python bindings for libcgroup', - url='https://github.com/libcgroup/libcgroup', - maintainer='Tom Hromatka', - maintainer_email='tom.hromatka@oracle.com', - license='LGPLv2.1', - platforms='Linux', - ext_modules=cythonize([ - Extension( - 'libcgroup', ['libcgroup.pyx'], - # unable to handle libtool libraries directly - extra_objects=['../.libs/libcgroup.a'], - libraries=['systemd'] - ), - ]) -) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/src/systemd.c b/lib/libcgroup-3.1.0/src/systemd.c deleted file mode 100644 index 47e19d31e0b..00000000000 --- a/lib/libcgroup-3.1.0/src/systemd.c +++ /dev/null @@ -1,348 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright (c) 2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - * Author: Silvia Chapa - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define USEC_PER_SEC 1000000 - -static const char * const modes[] = { - "fail", /* CGROUP_SYSTEMD_MODE_FAIL */ - "replace", /* CGROUP_SYSTEMD_MODE_REPLACE */ - "isolate", /* CGROUP_SYSTEMD_MODE_ISOLATE */ - "ignore-dependencies", /* CGROUP_SYSTEMD_MODE_IGNORE_DEPS */ - "ignore-requirements", /* CGROUP_SYSTEMD_MODE_IGNORE_REQS */ -}; -static_assert((sizeof(modes) / sizeof(modes[0])) == CGROUP_SYSTEMD_MODE_CNT, - "modes[] array must be same length as CGROUP_SYSTEMD_MODE_CNT"); - -static const char * const sender = "org.freedesktop.systemd1"; -static const char * const path = "/org/freedesktop/systemd1"; -static const char * const interface = "org.freedesktop.systemd1.Manager"; - -int cgroup_set_default_scope_opts(struct cgroup_systemd_scope_opts * const opts) -{ - if (!opts) - return ECGINVAL; - - opts->delegated = 1; - opts->mode = CGROUP_SYSTEMD_MODE_FAIL; - opts->pid = -1; - - return 0; -} - -/* - * Returns time elapsed in usec - * - * Inspired-by: https://github.com/cockpit-project/cockpit/blob/main/src/tls/socket-io.c#L39 - */ -static int64_t elapsed_time(const struct timespec * const start, const struct timespec * const end) -{ - int64_t elapsed = (end->tv_sec - start->tv_sec) * 1000000 + - (end->tv_nsec - start->tv_nsec) / 1000; - - assert(elapsed >= 0); - - return elapsed; -} - -static int job_removed_callback(sd_bus_message *message, void *user_data, sd_bus_error *error) -{ - const char *result, *msg_path, *scope_name; - const char **job_path = user_data; - int ret; - - ret = sd_bus_message_read(message, "uoss", NULL, &msg_path, &scope_name, &result); - if (ret < 0) { - cgroup_err("callback message read failed: %d\n", errno); - return 0; - } - - if (*job_path == NULL || strcmp(msg_path, *job_path) != 0) { - cgroup_dbg("Received a systemd signal, but it was not our message\n"); - return 0; - } - - cgroup_dbg("Received JobRemoved signal for scope %s. Result: %s\n", scope_name, result); - - /* - * Use the job_path pointer as a way to inform the original thread that the job has - * completed. - */ - *job_path = NULL; - return 0; -} - -int cgroup_create_scope(const char * const scope_name, const char * const slice_name, - const struct cgroup_systemd_scope_opts * const opts) -{ - sd_bus_message *msg = NULL, *reply = NULL; - int ret = 0, sdret = 0, cgret = ECGFAIL; - sd_bus_error error = SD_BUS_ERROR_NULL; - const char *job_path = NULL; - struct timespec start, now; - sd_bus *bus = NULL; - pid_t child_pid; - - if (!scope_name || !slice_name || !opts) - return ECGINVAL; - - if (strcmp(&scope_name[strlen(scope_name) - strlen(".scope")], ".scope") != 0) - cgroup_warn("scope doesn't have expected suffix\n"); - if (strcmp(&slice_name[strlen(slice_name) - strlen(".slice")], ".slice") != 0) - cgroup_warn("slice doesn't have expected suffix\n"); - - if (opts->mode >= CGROUP_SYSTEMD_MODE_CNT) { - cgroup_err("invalid systemd mode: %d\n", opts->mode); - return ECGINVAL; - } - - if (opts->mode == CGROUP_SYSTEMD_MODE_ISOLATE || - opts->mode == CGROUP_SYSTEMD_MODE_IGNORE_DEPS || - opts->mode == CGROUP_SYSTEMD_MODE_IGNORE_REQS) { - cgroup_err("unsupported systemd mode: %d\n", opts->mode); - return ECGINVAL; - } - - if (opts->pid < 0) { - child_pid = fork(); - if (child_pid < 0) { - last_errno = errno; - cgroup_err("fork failed: %d\n", errno); - return ECGOTHER; - } - - if (child_pid == 0) { - char *args[] = {"libcgroup_systemd_idle_thread", NULL}; - - /* - * Have the child sleep forever. Systemd will delete the scope if - * there isn't a running process in it. - */ - execvp("libcgroup_systemd_idle_thread", args); - - /* The child process should never get here */ - last_errno = errno; - cgroup_err("failed to create system idle thread.\n"); - return ECGOTHER; - } - - cgroup_dbg("created libcgroup_system_idle thread pid %d\n", child_pid); - } else { - child_pid = opts->pid; - } - cgroup_dbg("pid %d will be placed in scope %s\n", child_pid, scope_name); - - sdret = sd_bus_default_system(&bus); - if (sdret < 0) { - cgroup_err("failed to open the system bus: %d\n", errno); - goto out; - } - - sdret = sd_bus_match_signal(bus, NULL, sender, path, interface, - "JobRemoved", job_removed_callback, &job_path); - if (sdret < 0) { - cgroup_err("failed to install match callback: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_new_method_call(bus, &msg, sender, path, interface, - "StartTransientUnit"); - if (sdret < 0) { - cgroup_err("failed to create the systemd msg: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_append(msg, "ss", scope_name, modes[opts->mode]); - if (sdret < 0) { - cgroup_err("failed to append the scope name: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_open_container(msg, 'a', "(sv)"); - if (sdret < 0) { - cgroup_err("failed to open container: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_append(msg, "(sv)", "Description", "s", - "scope created by libcgroup"); - if (sdret < 0) { - cgroup_err("failed to append the description: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_append(msg, "(sv)", "PIDs", "au", 1, child_pid); - if (sdret < 0) { - cgroup_err("failed to append the PID: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_append(msg, "(sv)", "Slice", "s", slice_name); - if (sdret < 0) { - cgroup_err("failed to append the slice: %d\n", errno); - goto out; - } - - if (opts->delegated == 1) { - sdret = sd_bus_message_append(msg, "(sv)", "Delegate", "b", 1); - if (sdret < 0) { - cgroup_err("failed to append delegate: %d\n", errno); - goto out; - } - } - - sdret = sd_bus_message_close_container(msg); - if (sdret < 0) { - cgroup_err("failed to close the container: %d\n", errno); - goto out; - } - - sdret = sd_bus_message_append(msg, "a(sa(sv))", 0); - if (sdret < 0) { - cgroup_err("failed to append aux structure: %d\n", errno); - goto out; - } - - sdret = sd_bus_call(bus, msg, 0, &error, &reply); - if (sdret < 0) { - cgroup_err("sd_bus_call() failed: %d\n", - sd_bus_message_get_errno(msg)); - cgroup_err("error message: %s\n", error.message); - goto out; - } - - /* Receive the job_path from systemd */ - sdret = sd_bus_message_read(reply, "o", &job_path); - if (sdret < 0) { - cgroup_err("failed to read reply: %d\n", errno); - goto out; - } - - cgroup_dbg("job_path = %s\n", job_path); - - ret = clock_gettime(CLOCK_MONOTONIC, &start); - if (ret < 0) { - last_errno = errno; - cgroup_err("Failed to get time: %d\n", errno); - cgret = ECGOTHER; - goto out; - } - - /* The callback will null out the job_path pointer on completion */ - while(job_path) { - sdret = sd_bus_process(bus, NULL); - if (sdret < 0) { - cgroup_err("failed to process the sd bus: %d\n", errno); - goto out; - } - - if (sdret == 0) { - /* - * Per the sd_bus_wait() man page, call this function after sd_bus_process - * returns zero. The wait time (usec) was somewhat arbitrarily chosen - */ - sdret = sd_bus_wait(bus, 10); - if (sdret < 0) { - cgroup_err("failed to wait for sd bus: %d\n", errno); - goto out; - } - } - - ret = clock_gettime(CLOCK_MONOTONIC, &now); - if (ret < 0) { - last_errno = errno; - cgroup_err("Failed to get time: %d\n", errno); - cgret = ECGOTHER; - goto out; - } - - if (elapsed_time(&start, &now) > USEC_PER_SEC) { - cgroup_err("The create scope command timed out\n"); - goto out; - } - } - - cgret = 0; - -out: - if (cgret && opts->pid < 0) - kill(child_pid, SIGTERM); - - sd_bus_error_free(&error); - sd_bus_message_unref(msg); - sd_bus_message_unref(reply); - sd_bus_unref(bus); - - return cgret; -} - -int cgroup_create_scope2(struct cgroup *cgroup, int ignore_ownership, - const struct cgroup_systemd_scope_opts * const opts) -{ - char *copy1 = NULL, *copy2 = NULL, *slash, *slice_name, *scope_name; - int ret = 0; - - if (!cgroup) - return ECGROUPNOTALLOWED; - - slash = strstr(cgroup->name, "/"); - if (!slash) { - cgroup_err("cgroup name does not contain a slash: %s\n", cgroup->name); - return ECGINVAL; - } - - slash = strstr(slash + 1, "/"); - if (slash) { - cgroup_err("cgroup name contains more than one slash: %s\n", cgroup->name); - return ECGINVAL; - } - - copy1 = strdup(cgroup->name); - if (!copy1) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - scope_name = basename(copy1); - - copy2 = strdup(cgroup->name); - if (!copy2) { - last_errno = errno; - ret = ECGOTHER; - goto err; - } - - slice_name = dirname(copy2); - - ret = cgroup_create_scope(scope_name, slice_name, opts); - if (ret) - goto err; - - /* - * Utilize cgroup_create_cgroup() to assign the requested owner/group and permissions. - * cgroup_create_cgroup() can gracefully handle EEXIST if the cgroup already exists, so - * we can reuse its ownership logic without penalty. - */ - ret = cgroup_create_cgroup(cgroup, ignore_ownership); - -err: - if (copy1) - free(copy1); - if (copy2) - free(copy2); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/Makefile.am b/lib/libcgroup-3.1.0/src/tools/Makefile.am deleted file mode 100644 index 2e51e3d1455..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/Makefile.am +++ /dev/null @@ -1,75 +0,0 @@ -@CODE_COVERAGE_RULES@ - -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/include -LDADD = $(top_builddir)/src/libcgroup.la -lpthread - -if WITH_TOOLS - -if WITH_SYSTEMD -EXTRA_CFLAGS = -DWITH_SYSTEMD -endif - -bin_PROGRAMS = cgexec cgclassify cgcreate cgset cgxset cgget cgxget cgdelete \ - lssubsys lscgroup cgsnapshot - -sbin_PROGRAMS = cgconfigparser - -noinst_LTLIBRARIES = libcgset.la - -cgexec_SOURCES = cgexec.c tools-common.c tools-common.h -cgexec_LIBS = $(CODE_COVERAGE_LIBS) -cgexec_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgclassify_SOURCES = cgclassify.c tools-common.c tools-common.h -cgclassify_LIBS = $(CODE_COVERAGE_LIBS) -cgclassify_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgcreate_SOURCES = cgcreate.c tools-common.c tools-common.h -cgcreate_LIBS = $(CODE_COVERAGE_LIBS) -cgcreate_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -libcgset_la_SOURCES = cgset.c tools-common.c tools-common.h -libcgset_la_LIBADD = $(CODE_COVERAGE_LIBS) -libcgset_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC= -DUNIT_TEST -libcgset_la_LDFLAGS = -Wl,--no-undefined $(LDADD) - -cgset_SOURCES = cgset.c tools-common.c tools-common.h -cgset_LIBS = $(CODE_COVERAGE_LIBS) -cgset_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC=static - -cgxset_SOURCES = cgxset.c tools-common.c tools-common.h -cgxset_LIBS = $(CODE_COVERAGE_LIBS) -cgxset_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC=static - -cgget_SOURCES = cgget.c tools-common.c tools-common.h -cgget_LIBS = $(CODE_COVERAGE_LIBS) -cgget_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgxget_SOURCES = cgxget.c tools-common.c tools-common.h -cgxget_LIBS = $(CODE_COVERAGE_LIBS) -cgxget_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgconfigparser_SOURCES = cgconfig.c tools-common.c tools-common.h -cgconfigparser_LIBS = $(CODE_COVERAGE_LIBS) -cgconfigparser_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgdelete_SOURCES = cgdelete.c tools-common.c tools-common.h -cgdelete_LIBS = $(CODE_COVERAGE_LIBS) -cgdelete_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -lssubsys_SOURCES = lssubsys.c -lssubsys_LIBS = $(CODE_COVERAGE_LIBS) -lssubsys_CFLAGS = $(CODE_COVERAGE_CFLAGS) - -lscgroup_SOURCES = tools-common.c lscgroup.c -lscgroup_LIBS = $(CODE_COVERAGE_LIBS) -lscgroup_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -cgsnapshot_SOURCES = cgsnapshot.c -cgsnapshot_LIBS = $(CODE_COVERAGE_LIBS) -cgsnapshot_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) - -install-exec-hook: - chmod u+s $(DESTDIR)$(bindir)/cgexec - -endif diff --git a/lib/libcgroup-3.1.0/src/tools/Makefile.in b/lib/libcgroup-3.1.0/src/tools/Makefile.in deleted file mode 100644 index 84c994d7b40..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/Makefile.in +++ /dev/null @@ -1,1384 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WITH_TOOLS_TRUE@bin_PROGRAMS = cgexec$(EXEEXT) cgclassify$(EXEEXT) \ -@WITH_TOOLS_TRUE@ cgcreate$(EXEEXT) cgset$(EXEEXT) \ -@WITH_TOOLS_TRUE@ cgxset$(EXEEXT) cgget$(EXEEXT) \ -@WITH_TOOLS_TRUE@ cgxget$(EXEEXT) cgdelete$(EXEEXT) \ -@WITH_TOOLS_TRUE@ lssubsys$(EXEEXT) lscgroup$(EXEEXT) \ -@WITH_TOOLS_TRUE@ cgsnapshot$(EXEEXT) -@WITH_TOOLS_TRUE@sbin_PROGRAMS = cgconfigparser$(EXEEXT) -subdir = src/tools -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" -PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) -LTLIBRARIES = $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -@WITH_TOOLS_TRUE@libcgset_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__libcgset_la_SOURCES_DIST = cgset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_libcgset_la_OBJECTS = libcgset_la-cgset.lo \ -@WITH_TOOLS_TRUE@ libcgset_la-tools-common.lo -libcgset_la_OBJECTS = $(am_libcgset_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libcgset_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcgset_la_CFLAGS) \ - $(CFLAGS) $(libcgset_la_LDFLAGS) $(LDFLAGS) -o $@ -@WITH_TOOLS_TRUE@am_libcgset_la_rpath = -am__cgclassify_SOURCES_DIST = cgclassify.c tools-common.c \ - tools-common.h -@WITH_TOOLS_TRUE@am_cgclassify_OBJECTS = \ -@WITH_TOOLS_TRUE@ cgclassify-cgclassify.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgclassify-tools-common.$(OBJEXT) -cgclassify_OBJECTS = $(am_cgclassify_OBJECTS) -cgclassify_LDADD = $(LDADD) -cgclassify_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgclassify_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgclassify_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgconfigparser_SOURCES_DIST = cgconfig.c tools-common.c \ - tools-common.h -@WITH_TOOLS_TRUE@am_cgconfigparser_OBJECTS = \ -@WITH_TOOLS_TRUE@ cgconfigparser-cgconfig.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgconfigparser-tools-common.$(OBJEXT) -cgconfigparser_OBJECTS = $(am_cgconfigparser_OBJECTS) -cgconfigparser_LDADD = $(LDADD) -cgconfigparser_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgconfigparser_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(cgconfigparser_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ - $@ -am__cgcreate_SOURCES_DIST = cgcreate.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgcreate_OBJECTS = cgcreate-cgcreate.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgcreate-tools-common.$(OBJEXT) -cgcreate_OBJECTS = $(am_cgcreate_OBJECTS) -cgcreate_LDADD = $(LDADD) -cgcreate_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgcreate_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgcreate_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgdelete_SOURCES_DIST = cgdelete.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgdelete_OBJECTS = cgdelete-cgdelete.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgdelete-tools-common.$(OBJEXT) -cgdelete_OBJECTS = $(am_cgdelete_OBJECTS) -cgdelete_LDADD = $(LDADD) -cgdelete_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgdelete_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgdelete_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgexec_SOURCES_DIST = cgexec.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgexec_OBJECTS = cgexec-cgexec.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgexec-tools-common.$(OBJEXT) -cgexec_OBJECTS = $(am_cgexec_OBJECTS) -cgexec_LDADD = $(LDADD) -cgexec_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgexec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgexec_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgget_SOURCES_DIST = cgget.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgget_OBJECTS = cgget-cgget.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgget-tools-common.$(OBJEXT) -cgget_OBJECTS = $(am_cgget_OBJECTS) -cgget_LDADD = $(LDADD) -cgget_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgget_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgget_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgset_SOURCES_DIST = cgset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgset_OBJECTS = cgset-cgset.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgset-tools-common.$(OBJEXT) -cgset_OBJECTS = $(am_cgset_OBJECTS) -cgset_LDADD = $(LDADD) -cgset_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgset_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgset_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgsnapshot_SOURCES_DIST = cgsnapshot.c -@WITH_TOOLS_TRUE@am_cgsnapshot_OBJECTS = \ -@WITH_TOOLS_TRUE@ cgsnapshot-cgsnapshot.$(OBJEXT) -cgsnapshot_OBJECTS = $(am_cgsnapshot_OBJECTS) -cgsnapshot_LDADD = $(LDADD) -cgsnapshot_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgsnapshot_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgsnapshot_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgxget_SOURCES_DIST = cgxget.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgxget_OBJECTS = cgxget-cgxget.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgxget-tools-common.$(OBJEXT) -cgxget_OBJECTS = $(am_cgxget_OBJECTS) -cgxget_LDADD = $(LDADD) -cgxget_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgxget_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgxget_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__cgxset_SOURCES_DIST = cgxset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@am_cgxset_OBJECTS = cgxset-cgxset.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ cgxset-tools-common.$(OBJEXT) -cgxset_OBJECTS = $(am_cgxset_OBJECTS) -cgxset_LDADD = $(LDADD) -cgxset_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -cgxset_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cgxset_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__lscgroup_SOURCES_DIST = tools-common.c lscgroup.c -@WITH_TOOLS_TRUE@am_lscgroup_OBJECTS = \ -@WITH_TOOLS_TRUE@ lscgroup-tools-common.$(OBJEXT) \ -@WITH_TOOLS_TRUE@ lscgroup-lscgroup.$(OBJEXT) -lscgroup_OBJECTS = $(am_lscgroup_OBJECTS) -lscgroup_LDADD = $(LDADD) -lscgroup_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -lscgroup_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(lscgroup_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__lssubsys_SOURCES_DIST = lssubsys.c -@WITH_TOOLS_TRUE@am_lssubsys_OBJECTS = lssubsys-lssubsys.$(OBJEXT) -lssubsys_OBJECTS = $(am_lssubsys_OBJECTS) -lssubsys_LDADD = $(LDADD) -lssubsys_DEPENDENCIES = $(top_builddir)/src/libcgroup.la -lssubsys_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(lssubsys_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/cgclassify-cgclassify.Po \ - ./$(DEPDIR)/cgclassify-tools-common.Po \ - ./$(DEPDIR)/cgconfigparser-cgconfig.Po \ - ./$(DEPDIR)/cgconfigparser-tools-common.Po \ - ./$(DEPDIR)/cgcreate-cgcreate.Po \ - ./$(DEPDIR)/cgcreate-tools-common.Po \ - ./$(DEPDIR)/cgdelete-cgdelete.Po \ - ./$(DEPDIR)/cgdelete-tools-common.Po \ - ./$(DEPDIR)/cgexec-cgexec.Po \ - ./$(DEPDIR)/cgexec-tools-common.Po ./$(DEPDIR)/cgget-cgget.Po \ - ./$(DEPDIR)/cgget-tools-common.Po ./$(DEPDIR)/cgset-cgset.Po \ - ./$(DEPDIR)/cgset-tools-common.Po \ - ./$(DEPDIR)/cgsnapshot-cgsnapshot.Po \ - ./$(DEPDIR)/cgxget-cgxget.Po \ - ./$(DEPDIR)/cgxget-tools-common.Po \ - ./$(DEPDIR)/cgxset-cgxset.Po \ - ./$(DEPDIR)/cgxset-tools-common.Po \ - ./$(DEPDIR)/libcgset_la-cgset.Plo \ - ./$(DEPDIR)/libcgset_la-tools-common.Plo \ - ./$(DEPDIR)/lscgroup-lscgroup.Po \ - ./$(DEPDIR)/lscgroup-tools-common.Po \ - ./$(DEPDIR)/lssubsys-lssubsys.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libcgset_la_SOURCES) $(cgclassify_SOURCES) \ - $(cgconfigparser_SOURCES) $(cgcreate_SOURCES) \ - $(cgdelete_SOURCES) $(cgexec_SOURCES) $(cgget_SOURCES) \ - $(cgset_SOURCES) $(cgsnapshot_SOURCES) $(cgxget_SOURCES) \ - $(cgxset_SOURCES) $(lscgroup_SOURCES) $(lssubsys_SOURCES) -DIST_SOURCES = $(am__libcgset_la_SOURCES_DIST) \ - $(am__cgclassify_SOURCES_DIST) \ - $(am__cgconfigparser_SOURCES_DIST) \ - $(am__cgcreate_SOURCES_DIST) $(am__cgdelete_SOURCES_DIST) \ - $(am__cgexec_SOURCES_DIST) $(am__cgget_SOURCES_DIST) \ - $(am__cgset_SOURCES_DIST) $(am__cgsnapshot_SOURCES_DIST) \ - $(am__cgxget_SOURCES_DIST) $(am__cgxset_SOURCES_DIST) \ - $(am__lscgroup_SOURCES_DIST) $(am__lssubsys_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/include -LDADD = $(top_builddir)/src/libcgroup.la -lpthread -@WITH_SYSTEMD_TRUE@@WITH_TOOLS_TRUE@EXTRA_CFLAGS = -DWITH_SYSTEMD -@WITH_TOOLS_TRUE@noinst_LTLIBRARIES = libcgset.la -@WITH_TOOLS_TRUE@cgexec_SOURCES = cgexec.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgexec_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgexec_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgclassify_SOURCES = cgclassify.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgclassify_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgclassify_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgcreate_SOURCES = cgcreate.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgcreate_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgcreate_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@libcgset_la_SOURCES = cgset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@libcgset_la_LIBADD = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@libcgset_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC= -DUNIT_TEST -@WITH_TOOLS_TRUE@libcgset_la_LDFLAGS = -Wl,--no-undefined $(LDADD) -@WITH_TOOLS_TRUE@cgset_SOURCES = cgset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgset_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgset_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC=static -@WITH_TOOLS_TRUE@cgxset_SOURCES = cgxset.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgxset_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgxset_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -DSTATIC=static -@WITH_TOOLS_TRUE@cgget_SOURCES = cgget.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgget_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgget_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgxget_SOURCES = cgxget.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgxget_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgxget_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgconfigparser_SOURCES = cgconfig.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgconfigparser_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgconfigparser_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgdelete_SOURCES = cgdelete.c tools-common.c tools-common.h -@WITH_TOOLS_TRUE@cgdelete_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgdelete_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@lssubsys_SOURCES = lssubsys.c -@WITH_TOOLS_TRUE@lssubsys_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@lssubsys_CFLAGS = $(CODE_COVERAGE_CFLAGS) -@WITH_TOOLS_TRUE@lscgroup_SOURCES = tools-common.c lscgroup.c -@WITH_TOOLS_TRUE@lscgroup_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@lscgroup_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -@WITH_TOOLS_TRUE@cgsnapshot_SOURCES = cgsnapshot.c -@WITH_TOOLS_TRUE@cgsnapshot_LIBS = $(CODE_COVERAGE_LIBS) -@WITH_TOOLS_TRUE@cgsnapshot_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(EXTRA_CFLAGS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tools/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/tools/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -install-sbinPROGRAMS: $(sbin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-sbinPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(sbindir)" && rm -f $$files - -clean-sbinPROGRAMS: - @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libcgset.la: $(libcgset_la_OBJECTS) $(libcgset_la_DEPENDENCIES) $(EXTRA_libcgset_la_DEPENDENCIES) - $(AM_V_CCLD)$(libcgset_la_LINK) $(am_libcgset_la_rpath) $(libcgset_la_OBJECTS) $(libcgset_la_LIBADD) $(LIBS) - -cgclassify$(EXEEXT): $(cgclassify_OBJECTS) $(cgclassify_DEPENDENCIES) $(EXTRA_cgclassify_DEPENDENCIES) - @rm -f cgclassify$(EXEEXT) - $(AM_V_CCLD)$(cgclassify_LINK) $(cgclassify_OBJECTS) $(cgclassify_LDADD) $(LIBS) - -cgconfigparser$(EXEEXT): $(cgconfigparser_OBJECTS) $(cgconfigparser_DEPENDENCIES) $(EXTRA_cgconfigparser_DEPENDENCIES) - @rm -f cgconfigparser$(EXEEXT) - $(AM_V_CCLD)$(cgconfigparser_LINK) $(cgconfigparser_OBJECTS) $(cgconfigparser_LDADD) $(LIBS) - -cgcreate$(EXEEXT): $(cgcreate_OBJECTS) $(cgcreate_DEPENDENCIES) $(EXTRA_cgcreate_DEPENDENCIES) - @rm -f cgcreate$(EXEEXT) - $(AM_V_CCLD)$(cgcreate_LINK) $(cgcreate_OBJECTS) $(cgcreate_LDADD) $(LIBS) - -cgdelete$(EXEEXT): $(cgdelete_OBJECTS) $(cgdelete_DEPENDENCIES) $(EXTRA_cgdelete_DEPENDENCIES) - @rm -f cgdelete$(EXEEXT) - $(AM_V_CCLD)$(cgdelete_LINK) $(cgdelete_OBJECTS) $(cgdelete_LDADD) $(LIBS) - -cgexec$(EXEEXT): $(cgexec_OBJECTS) $(cgexec_DEPENDENCIES) $(EXTRA_cgexec_DEPENDENCIES) - @rm -f cgexec$(EXEEXT) - $(AM_V_CCLD)$(cgexec_LINK) $(cgexec_OBJECTS) $(cgexec_LDADD) $(LIBS) - -cgget$(EXEEXT): $(cgget_OBJECTS) $(cgget_DEPENDENCIES) $(EXTRA_cgget_DEPENDENCIES) - @rm -f cgget$(EXEEXT) - $(AM_V_CCLD)$(cgget_LINK) $(cgget_OBJECTS) $(cgget_LDADD) $(LIBS) - -cgset$(EXEEXT): $(cgset_OBJECTS) $(cgset_DEPENDENCIES) $(EXTRA_cgset_DEPENDENCIES) - @rm -f cgset$(EXEEXT) - $(AM_V_CCLD)$(cgset_LINK) $(cgset_OBJECTS) $(cgset_LDADD) $(LIBS) - -cgsnapshot$(EXEEXT): $(cgsnapshot_OBJECTS) $(cgsnapshot_DEPENDENCIES) $(EXTRA_cgsnapshot_DEPENDENCIES) - @rm -f cgsnapshot$(EXEEXT) - $(AM_V_CCLD)$(cgsnapshot_LINK) $(cgsnapshot_OBJECTS) $(cgsnapshot_LDADD) $(LIBS) - -cgxget$(EXEEXT): $(cgxget_OBJECTS) $(cgxget_DEPENDENCIES) $(EXTRA_cgxget_DEPENDENCIES) - @rm -f cgxget$(EXEEXT) - $(AM_V_CCLD)$(cgxget_LINK) $(cgxget_OBJECTS) $(cgxget_LDADD) $(LIBS) - -cgxset$(EXEEXT): $(cgxset_OBJECTS) $(cgxset_DEPENDENCIES) $(EXTRA_cgxset_DEPENDENCIES) - @rm -f cgxset$(EXEEXT) - $(AM_V_CCLD)$(cgxset_LINK) $(cgxset_OBJECTS) $(cgxset_LDADD) $(LIBS) - -lscgroup$(EXEEXT): $(lscgroup_OBJECTS) $(lscgroup_DEPENDENCIES) $(EXTRA_lscgroup_DEPENDENCIES) - @rm -f lscgroup$(EXEEXT) - $(AM_V_CCLD)$(lscgroup_LINK) $(lscgroup_OBJECTS) $(lscgroup_LDADD) $(LIBS) - -lssubsys$(EXEEXT): $(lssubsys_OBJECTS) $(lssubsys_DEPENDENCIES) $(EXTRA_lssubsys_DEPENDENCIES) - @rm -f lssubsys$(EXEEXT) - $(AM_V_CCLD)$(lssubsys_LINK) $(lssubsys_OBJECTS) $(lssubsys_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgclassify-cgclassify.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgclassify-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgconfigparser-cgconfig.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgconfigparser-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgcreate-cgcreate.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgcreate-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgdelete-cgdelete.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgdelete-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgexec-cgexec.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgexec-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgget-cgget.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgget-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgset-cgset.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgset-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgsnapshot-cgsnapshot.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgxget-cgxget.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgxget-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgxset-cgxset.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgxset-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgset_la-cgset.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcgset_la-tools-common.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lscgroup-lscgroup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lscgroup-tools-common.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lssubsys-lssubsys.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libcgset_la-cgset.lo: cgset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgset_la_CFLAGS) $(CFLAGS) -MT libcgset_la-cgset.lo -MD -MP -MF $(DEPDIR)/libcgset_la-cgset.Tpo -c -o libcgset_la-cgset.lo `test -f 'cgset.c' || echo '$(srcdir)/'`cgset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgset_la-cgset.Tpo $(DEPDIR)/libcgset_la-cgset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgset.c' object='libcgset_la-cgset.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgset_la_CFLAGS) $(CFLAGS) -c -o libcgset_la-cgset.lo `test -f 'cgset.c' || echo '$(srcdir)/'`cgset.c - -libcgset_la-tools-common.lo: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgset_la_CFLAGS) $(CFLAGS) -MT libcgset_la-tools-common.lo -MD -MP -MF $(DEPDIR)/libcgset_la-tools-common.Tpo -c -o libcgset_la-tools-common.lo `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcgset_la-tools-common.Tpo $(DEPDIR)/libcgset_la-tools-common.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='libcgset_la-tools-common.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcgset_la_CFLAGS) $(CFLAGS) -c -o libcgset_la-tools-common.lo `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgclassify-cgclassify.o: cgclassify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -MT cgclassify-cgclassify.o -MD -MP -MF $(DEPDIR)/cgclassify-cgclassify.Tpo -c -o cgclassify-cgclassify.o `test -f 'cgclassify.c' || echo '$(srcdir)/'`cgclassify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgclassify-cgclassify.Tpo $(DEPDIR)/cgclassify-cgclassify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgclassify.c' object='cgclassify-cgclassify.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -c -o cgclassify-cgclassify.o `test -f 'cgclassify.c' || echo '$(srcdir)/'`cgclassify.c - -cgclassify-cgclassify.obj: cgclassify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -MT cgclassify-cgclassify.obj -MD -MP -MF $(DEPDIR)/cgclassify-cgclassify.Tpo -c -o cgclassify-cgclassify.obj `if test -f 'cgclassify.c'; then $(CYGPATH_W) 'cgclassify.c'; else $(CYGPATH_W) '$(srcdir)/cgclassify.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgclassify-cgclassify.Tpo $(DEPDIR)/cgclassify-cgclassify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgclassify.c' object='cgclassify-cgclassify.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -c -o cgclassify-cgclassify.obj `if test -f 'cgclassify.c'; then $(CYGPATH_W) 'cgclassify.c'; else $(CYGPATH_W) '$(srcdir)/cgclassify.c'; fi` - -cgclassify-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -MT cgclassify-tools-common.o -MD -MP -MF $(DEPDIR)/cgclassify-tools-common.Tpo -c -o cgclassify-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgclassify-tools-common.Tpo $(DEPDIR)/cgclassify-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgclassify-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -c -o cgclassify-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgclassify-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -MT cgclassify-tools-common.obj -MD -MP -MF $(DEPDIR)/cgclassify-tools-common.Tpo -c -o cgclassify-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgclassify-tools-common.Tpo $(DEPDIR)/cgclassify-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgclassify-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgclassify_CFLAGS) $(CFLAGS) -c -o cgclassify-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgconfigparser-cgconfig.o: cgconfig.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -MT cgconfigparser-cgconfig.o -MD -MP -MF $(DEPDIR)/cgconfigparser-cgconfig.Tpo -c -o cgconfigparser-cgconfig.o `test -f 'cgconfig.c' || echo '$(srcdir)/'`cgconfig.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgconfigparser-cgconfig.Tpo $(DEPDIR)/cgconfigparser-cgconfig.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgconfig.c' object='cgconfigparser-cgconfig.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -c -o cgconfigparser-cgconfig.o `test -f 'cgconfig.c' || echo '$(srcdir)/'`cgconfig.c - -cgconfigparser-cgconfig.obj: cgconfig.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -MT cgconfigparser-cgconfig.obj -MD -MP -MF $(DEPDIR)/cgconfigparser-cgconfig.Tpo -c -o cgconfigparser-cgconfig.obj `if test -f 'cgconfig.c'; then $(CYGPATH_W) 'cgconfig.c'; else $(CYGPATH_W) '$(srcdir)/cgconfig.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgconfigparser-cgconfig.Tpo $(DEPDIR)/cgconfigparser-cgconfig.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgconfig.c' object='cgconfigparser-cgconfig.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -c -o cgconfigparser-cgconfig.obj `if test -f 'cgconfig.c'; then $(CYGPATH_W) 'cgconfig.c'; else $(CYGPATH_W) '$(srcdir)/cgconfig.c'; fi` - -cgconfigparser-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -MT cgconfigparser-tools-common.o -MD -MP -MF $(DEPDIR)/cgconfigparser-tools-common.Tpo -c -o cgconfigparser-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgconfigparser-tools-common.Tpo $(DEPDIR)/cgconfigparser-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgconfigparser-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -c -o cgconfigparser-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgconfigparser-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -MT cgconfigparser-tools-common.obj -MD -MP -MF $(DEPDIR)/cgconfigparser-tools-common.Tpo -c -o cgconfigparser-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgconfigparser-tools-common.Tpo $(DEPDIR)/cgconfigparser-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgconfigparser-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgconfigparser_CFLAGS) $(CFLAGS) -c -o cgconfigparser-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgcreate-cgcreate.o: cgcreate.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -MT cgcreate-cgcreate.o -MD -MP -MF $(DEPDIR)/cgcreate-cgcreate.Tpo -c -o cgcreate-cgcreate.o `test -f 'cgcreate.c' || echo '$(srcdir)/'`cgcreate.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgcreate-cgcreate.Tpo $(DEPDIR)/cgcreate-cgcreate.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgcreate.c' object='cgcreate-cgcreate.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -c -o cgcreate-cgcreate.o `test -f 'cgcreate.c' || echo '$(srcdir)/'`cgcreate.c - -cgcreate-cgcreate.obj: cgcreate.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -MT cgcreate-cgcreate.obj -MD -MP -MF $(DEPDIR)/cgcreate-cgcreate.Tpo -c -o cgcreate-cgcreate.obj `if test -f 'cgcreate.c'; then $(CYGPATH_W) 'cgcreate.c'; else $(CYGPATH_W) '$(srcdir)/cgcreate.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgcreate-cgcreate.Tpo $(DEPDIR)/cgcreate-cgcreate.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgcreate.c' object='cgcreate-cgcreate.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -c -o cgcreate-cgcreate.obj `if test -f 'cgcreate.c'; then $(CYGPATH_W) 'cgcreate.c'; else $(CYGPATH_W) '$(srcdir)/cgcreate.c'; fi` - -cgcreate-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -MT cgcreate-tools-common.o -MD -MP -MF $(DEPDIR)/cgcreate-tools-common.Tpo -c -o cgcreate-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgcreate-tools-common.Tpo $(DEPDIR)/cgcreate-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgcreate-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -c -o cgcreate-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgcreate-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -MT cgcreate-tools-common.obj -MD -MP -MF $(DEPDIR)/cgcreate-tools-common.Tpo -c -o cgcreate-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgcreate-tools-common.Tpo $(DEPDIR)/cgcreate-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgcreate-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgcreate_CFLAGS) $(CFLAGS) -c -o cgcreate-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgdelete-cgdelete.o: cgdelete.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -MT cgdelete-cgdelete.o -MD -MP -MF $(DEPDIR)/cgdelete-cgdelete.Tpo -c -o cgdelete-cgdelete.o `test -f 'cgdelete.c' || echo '$(srcdir)/'`cgdelete.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgdelete-cgdelete.Tpo $(DEPDIR)/cgdelete-cgdelete.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgdelete.c' object='cgdelete-cgdelete.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -c -o cgdelete-cgdelete.o `test -f 'cgdelete.c' || echo '$(srcdir)/'`cgdelete.c - -cgdelete-cgdelete.obj: cgdelete.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -MT cgdelete-cgdelete.obj -MD -MP -MF $(DEPDIR)/cgdelete-cgdelete.Tpo -c -o cgdelete-cgdelete.obj `if test -f 'cgdelete.c'; then $(CYGPATH_W) 'cgdelete.c'; else $(CYGPATH_W) '$(srcdir)/cgdelete.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgdelete-cgdelete.Tpo $(DEPDIR)/cgdelete-cgdelete.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgdelete.c' object='cgdelete-cgdelete.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -c -o cgdelete-cgdelete.obj `if test -f 'cgdelete.c'; then $(CYGPATH_W) 'cgdelete.c'; else $(CYGPATH_W) '$(srcdir)/cgdelete.c'; fi` - -cgdelete-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -MT cgdelete-tools-common.o -MD -MP -MF $(DEPDIR)/cgdelete-tools-common.Tpo -c -o cgdelete-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgdelete-tools-common.Tpo $(DEPDIR)/cgdelete-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgdelete-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -c -o cgdelete-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgdelete-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -MT cgdelete-tools-common.obj -MD -MP -MF $(DEPDIR)/cgdelete-tools-common.Tpo -c -o cgdelete-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgdelete-tools-common.Tpo $(DEPDIR)/cgdelete-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgdelete-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgdelete_CFLAGS) $(CFLAGS) -c -o cgdelete-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgexec-cgexec.o: cgexec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -MT cgexec-cgexec.o -MD -MP -MF $(DEPDIR)/cgexec-cgexec.Tpo -c -o cgexec-cgexec.o `test -f 'cgexec.c' || echo '$(srcdir)/'`cgexec.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgexec-cgexec.Tpo $(DEPDIR)/cgexec-cgexec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgexec.c' object='cgexec-cgexec.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -c -o cgexec-cgexec.o `test -f 'cgexec.c' || echo '$(srcdir)/'`cgexec.c - -cgexec-cgexec.obj: cgexec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -MT cgexec-cgexec.obj -MD -MP -MF $(DEPDIR)/cgexec-cgexec.Tpo -c -o cgexec-cgexec.obj `if test -f 'cgexec.c'; then $(CYGPATH_W) 'cgexec.c'; else $(CYGPATH_W) '$(srcdir)/cgexec.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgexec-cgexec.Tpo $(DEPDIR)/cgexec-cgexec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgexec.c' object='cgexec-cgexec.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -c -o cgexec-cgexec.obj `if test -f 'cgexec.c'; then $(CYGPATH_W) 'cgexec.c'; else $(CYGPATH_W) '$(srcdir)/cgexec.c'; fi` - -cgexec-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -MT cgexec-tools-common.o -MD -MP -MF $(DEPDIR)/cgexec-tools-common.Tpo -c -o cgexec-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgexec-tools-common.Tpo $(DEPDIR)/cgexec-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgexec-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -c -o cgexec-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgexec-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -MT cgexec-tools-common.obj -MD -MP -MF $(DEPDIR)/cgexec-tools-common.Tpo -c -o cgexec-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgexec-tools-common.Tpo $(DEPDIR)/cgexec-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgexec-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgexec_CFLAGS) $(CFLAGS) -c -o cgexec-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgget-cgget.o: cgget.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -MT cgget-cgget.o -MD -MP -MF $(DEPDIR)/cgget-cgget.Tpo -c -o cgget-cgget.o `test -f 'cgget.c' || echo '$(srcdir)/'`cgget.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgget-cgget.Tpo $(DEPDIR)/cgget-cgget.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgget.c' object='cgget-cgget.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -c -o cgget-cgget.o `test -f 'cgget.c' || echo '$(srcdir)/'`cgget.c - -cgget-cgget.obj: cgget.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -MT cgget-cgget.obj -MD -MP -MF $(DEPDIR)/cgget-cgget.Tpo -c -o cgget-cgget.obj `if test -f 'cgget.c'; then $(CYGPATH_W) 'cgget.c'; else $(CYGPATH_W) '$(srcdir)/cgget.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgget-cgget.Tpo $(DEPDIR)/cgget-cgget.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgget.c' object='cgget-cgget.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -c -o cgget-cgget.obj `if test -f 'cgget.c'; then $(CYGPATH_W) 'cgget.c'; else $(CYGPATH_W) '$(srcdir)/cgget.c'; fi` - -cgget-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -MT cgget-tools-common.o -MD -MP -MF $(DEPDIR)/cgget-tools-common.Tpo -c -o cgget-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgget-tools-common.Tpo $(DEPDIR)/cgget-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgget-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -c -o cgget-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgget-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -MT cgget-tools-common.obj -MD -MP -MF $(DEPDIR)/cgget-tools-common.Tpo -c -o cgget-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgget-tools-common.Tpo $(DEPDIR)/cgget-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgget-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgget_CFLAGS) $(CFLAGS) -c -o cgget-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgset-cgset.o: cgset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -MT cgset-cgset.o -MD -MP -MF $(DEPDIR)/cgset-cgset.Tpo -c -o cgset-cgset.o `test -f 'cgset.c' || echo '$(srcdir)/'`cgset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgset-cgset.Tpo $(DEPDIR)/cgset-cgset.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgset.c' object='cgset-cgset.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -c -o cgset-cgset.o `test -f 'cgset.c' || echo '$(srcdir)/'`cgset.c - -cgset-cgset.obj: cgset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -MT cgset-cgset.obj -MD -MP -MF $(DEPDIR)/cgset-cgset.Tpo -c -o cgset-cgset.obj `if test -f 'cgset.c'; then $(CYGPATH_W) 'cgset.c'; else $(CYGPATH_W) '$(srcdir)/cgset.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgset-cgset.Tpo $(DEPDIR)/cgset-cgset.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgset.c' object='cgset-cgset.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -c -o cgset-cgset.obj `if test -f 'cgset.c'; then $(CYGPATH_W) 'cgset.c'; else $(CYGPATH_W) '$(srcdir)/cgset.c'; fi` - -cgset-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -MT cgset-tools-common.o -MD -MP -MF $(DEPDIR)/cgset-tools-common.Tpo -c -o cgset-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgset-tools-common.Tpo $(DEPDIR)/cgset-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgset-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -c -o cgset-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgset-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -MT cgset-tools-common.obj -MD -MP -MF $(DEPDIR)/cgset-tools-common.Tpo -c -o cgset-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgset-tools-common.Tpo $(DEPDIR)/cgset-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgset-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgset_CFLAGS) $(CFLAGS) -c -o cgset-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgsnapshot-cgsnapshot.o: cgsnapshot.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgsnapshot_CFLAGS) $(CFLAGS) -MT cgsnapshot-cgsnapshot.o -MD -MP -MF $(DEPDIR)/cgsnapshot-cgsnapshot.Tpo -c -o cgsnapshot-cgsnapshot.o `test -f 'cgsnapshot.c' || echo '$(srcdir)/'`cgsnapshot.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgsnapshot-cgsnapshot.Tpo $(DEPDIR)/cgsnapshot-cgsnapshot.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgsnapshot.c' object='cgsnapshot-cgsnapshot.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgsnapshot_CFLAGS) $(CFLAGS) -c -o cgsnapshot-cgsnapshot.o `test -f 'cgsnapshot.c' || echo '$(srcdir)/'`cgsnapshot.c - -cgsnapshot-cgsnapshot.obj: cgsnapshot.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgsnapshot_CFLAGS) $(CFLAGS) -MT cgsnapshot-cgsnapshot.obj -MD -MP -MF $(DEPDIR)/cgsnapshot-cgsnapshot.Tpo -c -o cgsnapshot-cgsnapshot.obj `if test -f 'cgsnapshot.c'; then $(CYGPATH_W) 'cgsnapshot.c'; else $(CYGPATH_W) '$(srcdir)/cgsnapshot.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgsnapshot-cgsnapshot.Tpo $(DEPDIR)/cgsnapshot-cgsnapshot.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgsnapshot.c' object='cgsnapshot-cgsnapshot.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgsnapshot_CFLAGS) $(CFLAGS) -c -o cgsnapshot-cgsnapshot.obj `if test -f 'cgsnapshot.c'; then $(CYGPATH_W) 'cgsnapshot.c'; else $(CYGPATH_W) '$(srcdir)/cgsnapshot.c'; fi` - -cgxget-cgxget.o: cgxget.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -MT cgxget-cgxget.o -MD -MP -MF $(DEPDIR)/cgxget-cgxget.Tpo -c -o cgxget-cgxget.o `test -f 'cgxget.c' || echo '$(srcdir)/'`cgxget.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxget-cgxget.Tpo $(DEPDIR)/cgxget-cgxget.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgxget.c' object='cgxget-cgxget.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -c -o cgxget-cgxget.o `test -f 'cgxget.c' || echo '$(srcdir)/'`cgxget.c - -cgxget-cgxget.obj: cgxget.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -MT cgxget-cgxget.obj -MD -MP -MF $(DEPDIR)/cgxget-cgxget.Tpo -c -o cgxget-cgxget.obj `if test -f 'cgxget.c'; then $(CYGPATH_W) 'cgxget.c'; else $(CYGPATH_W) '$(srcdir)/cgxget.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxget-cgxget.Tpo $(DEPDIR)/cgxget-cgxget.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgxget.c' object='cgxget-cgxget.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -c -o cgxget-cgxget.obj `if test -f 'cgxget.c'; then $(CYGPATH_W) 'cgxget.c'; else $(CYGPATH_W) '$(srcdir)/cgxget.c'; fi` - -cgxget-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -MT cgxget-tools-common.o -MD -MP -MF $(DEPDIR)/cgxget-tools-common.Tpo -c -o cgxget-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxget-tools-common.Tpo $(DEPDIR)/cgxget-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgxget-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -c -o cgxget-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgxget-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -MT cgxget-tools-common.obj -MD -MP -MF $(DEPDIR)/cgxget-tools-common.Tpo -c -o cgxget-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxget-tools-common.Tpo $(DEPDIR)/cgxget-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgxget-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxget_CFLAGS) $(CFLAGS) -c -o cgxget-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -cgxset-cgxset.o: cgxset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -MT cgxset-cgxset.o -MD -MP -MF $(DEPDIR)/cgxset-cgxset.Tpo -c -o cgxset-cgxset.o `test -f 'cgxset.c' || echo '$(srcdir)/'`cgxset.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxset-cgxset.Tpo $(DEPDIR)/cgxset-cgxset.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgxset.c' object='cgxset-cgxset.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -c -o cgxset-cgxset.o `test -f 'cgxset.c' || echo '$(srcdir)/'`cgxset.c - -cgxset-cgxset.obj: cgxset.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -MT cgxset-cgxset.obj -MD -MP -MF $(DEPDIR)/cgxset-cgxset.Tpo -c -o cgxset-cgxset.obj `if test -f 'cgxset.c'; then $(CYGPATH_W) 'cgxset.c'; else $(CYGPATH_W) '$(srcdir)/cgxset.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxset-cgxset.Tpo $(DEPDIR)/cgxset-cgxset.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgxset.c' object='cgxset-cgxset.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -c -o cgxset-cgxset.obj `if test -f 'cgxset.c'; then $(CYGPATH_W) 'cgxset.c'; else $(CYGPATH_W) '$(srcdir)/cgxset.c'; fi` - -cgxset-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -MT cgxset-tools-common.o -MD -MP -MF $(DEPDIR)/cgxset-tools-common.Tpo -c -o cgxset-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxset-tools-common.Tpo $(DEPDIR)/cgxset-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgxset-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -c -o cgxset-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -cgxset-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -MT cgxset-tools-common.obj -MD -MP -MF $(DEPDIR)/cgxset-tools-common.Tpo -c -o cgxset-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cgxset-tools-common.Tpo $(DEPDIR)/cgxset-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='cgxset-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cgxset_CFLAGS) $(CFLAGS) -c -o cgxset-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -lscgroup-tools-common.o: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -MT lscgroup-tools-common.o -MD -MP -MF $(DEPDIR)/lscgroup-tools-common.Tpo -c -o lscgroup-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lscgroup-tools-common.Tpo $(DEPDIR)/lscgroup-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='lscgroup-tools-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -c -o lscgroup-tools-common.o `test -f 'tools-common.c' || echo '$(srcdir)/'`tools-common.c - -lscgroup-tools-common.obj: tools-common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -MT lscgroup-tools-common.obj -MD -MP -MF $(DEPDIR)/lscgroup-tools-common.Tpo -c -o lscgroup-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lscgroup-tools-common.Tpo $(DEPDIR)/lscgroup-tools-common.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools-common.c' object='lscgroup-tools-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -c -o lscgroup-tools-common.obj `if test -f 'tools-common.c'; then $(CYGPATH_W) 'tools-common.c'; else $(CYGPATH_W) '$(srcdir)/tools-common.c'; fi` - -lscgroup-lscgroup.o: lscgroup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -MT lscgroup-lscgroup.o -MD -MP -MF $(DEPDIR)/lscgroup-lscgroup.Tpo -c -o lscgroup-lscgroup.o `test -f 'lscgroup.c' || echo '$(srcdir)/'`lscgroup.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lscgroup-lscgroup.Tpo $(DEPDIR)/lscgroup-lscgroup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lscgroup.c' object='lscgroup-lscgroup.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -c -o lscgroup-lscgroup.o `test -f 'lscgroup.c' || echo '$(srcdir)/'`lscgroup.c - -lscgroup-lscgroup.obj: lscgroup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -MT lscgroup-lscgroup.obj -MD -MP -MF $(DEPDIR)/lscgroup-lscgroup.Tpo -c -o lscgroup-lscgroup.obj `if test -f 'lscgroup.c'; then $(CYGPATH_W) 'lscgroup.c'; else $(CYGPATH_W) '$(srcdir)/lscgroup.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lscgroup-lscgroup.Tpo $(DEPDIR)/lscgroup-lscgroup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lscgroup.c' object='lscgroup-lscgroup.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lscgroup_CFLAGS) $(CFLAGS) -c -o lscgroup-lscgroup.obj `if test -f 'lscgroup.c'; then $(CYGPATH_W) 'lscgroup.c'; else $(CYGPATH_W) '$(srcdir)/lscgroup.c'; fi` - -lssubsys-lssubsys.o: lssubsys.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lssubsys_CFLAGS) $(CFLAGS) -MT lssubsys-lssubsys.o -MD -MP -MF $(DEPDIR)/lssubsys-lssubsys.Tpo -c -o lssubsys-lssubsys.o `test -f 'lssubsys.c' || echo '$(srcdir)/'`lssubsys.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lssubsys-lssubsys.Tpo $(DEPDIR)/lssubsys-lssubsys.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lssubsys.c' object='lssubsys-lssubsys.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lssubsys_CFLAGS) $(CFLAGS) -c -o lssubsys-lssubsys.o `test -f 'lssubsys.c' || echo '$(srcdir)/'`lssubsys.c - -lssubsys-lssubsys.obj: lssubsys.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lssubsys_CFLAGS) $(CFLAGS) -MT lssubsys-lssubsys.obj -MD -MP -MF $(DEPDIR)/lssubsys-lssubsys.Tpo -c -o lssubsys-lssubsys.obj `if test -f 'lssubsys.c'; then $(CYGPATH_W) 'lssubsys.c'; else $(CYGPATH_W) '$(srcdir)/lssubsys.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lssubsys-lssubsys.Tpo $(DEPDIR)/lssubsys-lssubsys.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lssubsys.c' object='lssubsys-lssubsys.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lssubsys_CFLAGS) $(CFLAGS) -c -o lssubsys-lssubsys.obj `if test -f 'lssubsys.c'; then $(CYGPATH_W) 'lssubsys.c'; else $(CYGPATH_W) '$(srcdir)/lssubsys.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -@WITH_TOOLS_FALSE@install-exec-hook: -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-sbinPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/cgclassify-cgclassify.Po - -rm -f ./$(DEPDIR)/cgclassify-tools-common.Po - -rm -f ./$(DEPDIR)/cgconfigparser-cgconfig.Po - -rm -f ./$(DEPDIR)/cgconfigparser-tools-common.Po - -rm -f ./$(DEPDIR)/cgcreate-cgcreate.Po - -rm -f ./$(DEPDIR)/cgcreate-tools-common.Po - -rm -f ./$(DEPDIR)/cgdelete-cgdelete.Po - -rm -f ./$(DEPDIR)/cgdelete-tools-common.Po - -rm -f ./$(DEPDIR)/cgexec-cgexec.Po - -rm -f ./$(DEPDIR)/cgexec-tools-common.Po - -rm -f ./$(DEPDIR)/cgget-cgget.Po - -rm -f ./$(DEPDIR)/cgget-tools-common.Po - -rm -f ./$(DEPDIR)/cgset-cgset.Po - -rm -f ./$(DEPDIR)/cgset-tools-common.Po - -rm -f ./$(DEPDIR)/cgsnapshot-cgsnapshot.Po - -rm -f ./$(DEPDIR)/cgxget-cgxget.Po - -rm -f ./$(DEPDIR)/cgxget-tools-common.Po - -rm -f ./$(DEPDIR)/cgxset-cgxset.Po - -rm -f ./$(DEPDIR)/cgxset-tools-common.Po - -rm -f ./$(DEPDIR)/libcgset_la-cgset.Plo - -rm -f ./$(DEPDIR)/libcgset_la-tools-common.Plo - -rm -f ./$(DEPDIR)/lscgroup-lscgroup.Po - -rm -f ./$(DEPDIR)/lscgroup-tools-common.Po - -rm -f ./$(DEPDIR)/lssubsys-lssubsys.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-sbinPROGRAMS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/cgclassify-cgclassify.Po - -rm -f ./$(DEPDIR)/cgclassify-tools-common.Po - -rm -f ./$(DEPDIR)/cgconfigparser-cgconfig.Po - -rm -f ./$(DEPDIR)/cgconfigparser-tools-common.Po - -rm -f ./$(DEPDIR)/cgcreate-cgcreate.Po - -rm -f ./$(DEPDIR)/cgcreate-tools-common.Po - -rm -f ./$(DEPDIR)/cgdelete-cgdelete.Po - -rm -f ./$(DEPDIR)/cgdelete-tools-common.Po - -rm -f ./$(DEPDIR)/cgexec-cgexec.Po - -rm -f ./$(DEPDIR)/cgexec-tools-common.Po - -rm -f ./$(DEPDIR)/cgget-cgget.Po - -rm -f ./$(DEPDIR)/cgget-tools-common.Po - -rm -f ./$(DEPDIR)/cgset-cgset.Po - -rm -f ./$(DEPDIR)/cgset-tools-common.Po - -rm -f ./$(DEPDIR)/cgsnapshot-cgsnapshot.Po - -rm -f ./$(DEPDIR)/cgxget-cgxget.Po - -rm -f ./$(DEPDIR)/cgxget-tools-common.Po - -rm -f ./$(DEPDIR)/cgxset-cgxset.Po - -rm -f ./$(DEPDIR)/cgxset-tools-common.Po - -rm -f ./$(DEPDIR)/libcgset_la-cgset.Plo - -rm -f ./$(DEPDIR)/libcgset_la-tools-common.Plo - -rm -f ./$(DEPDIR)/lscgroup-lscgroup.Po - -rm -f ./$(DEPDIR)/lscgroup-tools-common.Po - -rm -f ./$(DEPDIR)/lssubsys-lssubsys.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS - -.MAKE: install-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-sbinPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-sbinPROGRAMS - -.PRECIOUS: Makefile - -@CODE_COVERAGE_RULES@ - -@WITH_TOOLS_TRUE@install-exec-hook: -@WITH_TOOLS_TRUE@ chmod u+s $(DESTDIR)$(bindir)/cgexec - -# 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/lib/libcgroup-3.1.0/src/tools/cgclassify.c b/lib/libcgroup-3.1.0/src/tools/cgclassify.c deleted file mode 100644 index d868fec6e28..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgclassify.c +++ /dev/null @@ -1,700 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright RedHat Inc. 2008 - * - * Authors: Vivek Goyal - * - * Replace systemd idle_thread enhancements by Kamalesh Babulal - * Copyright (c) 2023 Oracle and/or its affiliates. - * Author: Kamalesh Babulal - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#define TEMP_BUF 81 - -#define SYSTEMD_IDLE_THREAD "libcgroup_systemd_idle_thread" - -static pid_t find_scope_pid(pid_t pid, int capture); -static int write_systemd_unified(const char * const cgrp_name, pid_t pid); -static int is_scope_parsed(const char * const path); -static int rollback_pid_cgroups(pid_t pid); - -struct cgroup_info { - char ctrl_name[CONTROL_NAMELEN_MAX]; - char cgrp_path[FILENAME_MAX]; -}info[MAX_MNT_ELEMENTS + 1]; - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s '-h' for more information.\n", program_name); - return; - } - - info("Usage: %s [[-g] :] ", program_name); - info("[--sticky | --cancel-sticky] \n"); - info("Move running task(s) to given cgroups\n"); - info(" -h, --help Display this help\n"); - info(" -g : Control group to be used as target\n"); - info(" --cancel-sticky cgred daemon change pidlist and children tasks\n"); - info(" --sticky cgred daemon does not change "); - info("pidlist and children tasks\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); - info(" -r Replace the default idle_thread spawned "); - info("for the systemd scope\n"); -#endif -} - -/* - * Change process group as specified on command line. - */ -static int change_group_path(pid_t pid, struct cgroup_group_spec *cgroup_list[]) -{ - int ret = 0; - int i; - - for (i = 0; i < CG_HIER_MAX; i++) { - if (!cgroup_list[i]) - break; - - ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid, - (const char *const*) cgroup_list[i]->controllers); - if (ret) { - err("Error changing group of pid %d: %s\n", pid, cgroup_strerror(ret)); - return -1; - } - } - - return 0; -} - -/* - * Change process group as specified in cgrules.conf. - */ -static int change_group_based_on_rule(pid_t pid) -{ - char *procname = NULL; - int ret = -1; - uid_t euid; - gid_t egid; - - /* Put pid into right cgroup as per rules in /etc/cgrules.conf */ - if (cgroup_get_uid_gid_from_procfs(pid, &euid, &egid)) { - err("Error in determining euid/egid of pid %d\n", pid); - goto out; - } - - ret = cgroup_get_procname_from_procfs(pid, &procname); - if (ret) { - err("Error in determining process name of pid %d\n", pid); - goto out; - } - - /* Change the cgroup by determining the rules */ - ret = cgroup_change_cgroup_flags(euid, egid, procname, pid, 0); - if (ret) { - err("Error: change of cgroup failed for pid %d: %s\n", pid, cgroup_strerror(ret)); - goto out; - } - ret = 0; - -out: - if (procname) - free(procname); - - return ret; -} - -static struct option longopts[] = { - {"sticky", no_argument, NULL, 's'}, - {"cancel-sticky", no_argument, NULL, 'u'}, - {"help", no_argument, NULL, 'h'}, - {0, 0, 0, 0} -}; - -int main(int argc, char *argv[]) -{ - struct cgroup_group_spec *cgroup_list[CG_HIER_MAX]; - int ignore_default_systemd_delegate_slice = 0; - int ret = 0, i, exit_code = 0; - int skip_replace_idle = 0; - pid_t scope_pid = -1; - int replace_idle = 0; - int cg_specified = 0; - int flag = 0; - char *endptr; - pid_t pid; - int c; - - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - memset(cgroup_list, 0, sizeof(cgroup_list)); -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "+g:shbr", longopts, NULL)) > 0) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; - case 'r': - replace_idle = 1; - break; -#else - while ((c = getopt_long(argc, argv, "+g:sh", longopts, NULL)) > 0) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - exit(0); - break; - case 'g': - ret = parse_cgroup_spec(cgroup_list, optarg, CG_HIER_MAX); - if (ret) { - err("cgroup controller and path parsing failed\n"); - exit(EXIT_BADARGS); - } - cg_specified = 1; - break; - case 's': - flag |= CGROUP_DAEMON_UNCHANGE_CHILDREN; - break; - case 'u': - flag |= CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS; - break; - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - break; - } - } - - /* Initialize libcg */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - return ret; - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - for (i = optind; i < argc; i++) { - pid = (pid_t) strtol(argv[i], &endptr, 10); - if (endptr[0] != '\0') { - /* the input argument was not a number */ - err("Error: %s is not valid pid.\n", argv[i]); - exit_code = 2; - continue; - } - - if (flag) - ret = cgroup_register_unchanged_process(pid, flag); - if (ret) - exit_code = 1; - - if (replace_idle && !skip_replace_idle) { - ret = find_scope_pid(pid, 1); - if (ret) { - err("Failed to read /proc/%u/cgroups\n", pid); - return 1; - } - } - - if (cg_specified) - ret = change_group_path(pid, cgroup_list); - else - ret = change_group_based_on_rule(pid); - - /* if any group change fails */ - if (ret) - exit_code = 1; - - /* skip replacing of idle_thread in systemd slice */ - if (!replace_idle) - continue; - - /* systemd idle_thread is already replaced */ - if (skip_replace_idle) - continue; - - scope_pid = find_scope_pid(pid, 0); - if (scope_pid == -1) - goto err; - - skip_replace_idle = 1; - - ret = kill(scope_pid, SIGTERM); - if (ret) { - err("Failed to kill pid %u:%s\n", scope_pid, strerror(errno)); - goto err; - } - } - - return exit_code; - -err: - exit_code = rollback_pid_cgroups(pid); - return exit_code; -} - -static pid_t search_systemd_idle_thread_task(pid_t pids[], size_t size) -{ - char task_cmd[FILENAME_MAX]; - char buffer[FILENAME_MAX]; - FILE *pid_cmd_fp = NULL; - int scope_pid = -1; - int i; - - for (i = 0; i < size; i++) { - snprintf(buffer, FILENAME_MAX, "/proc/%u/cmdline", pids[i]); - pid_cmd_fp = fopen(buffer, "re"); - /* task might have exited */ - if (!pid_cmd_fp) - continue; - - /* task might have exited, so consider only successful reads. */ - if (fgets(task_cmd, FILENAME_MAX, pid_cmd_fp)) { - if (!strcmp(task_cmd, SYSTEMD_IDLE_THREAD)) { - scope_pid = pids[i]; - fclose(pid_cmd_fp); - break; - } - } - fclose(pid_cmd_fp); - } - - return scope_pid; -} - -static pid_t find_scope_pid(pid_t pid, int capture) -{ - pid_t _scope_pid = -1, scope_pid = -1; - char ctrl_name[CONTROL_NAMELEN_MAX]; - char cgroup_name[FILENAME_MAX]; - char scope_name[FILENAME_MAX]; - int found_systemd_cgrp = 0; - int found_unified_cgrp = 0; - char buffer[FILENAME_MAX]; - FILE *pid_proc_fp = NULL; - char *_ctrl_name = NULL; - int idx, ret, size = 0; - pid_t *pids; - int i=0; - - /* - * Let's parse the cgroup of the pid, to check if its in one or - * more .scopes. - */ - snprintf(buffer, FILENAME_MAX, "/proc/%u/cgroup", pid); - pid_proc_fp = fopen(buffer, "re"); - if (!pid_proc_fp) { - err("Failed to open: %s\n", buffer); - return -1; - } - - while (fgets(buffer, FILENAME_MAX, pid_proc_fp)) { - memset(ctrl_name, '\0', sizeof(ctrl_name)); - - /* check for overflow of controllers */ - if (i >= MAX_MNT_ELEMENTS) { - err("Found more than MAX_MNT_ELEMENTS controllers\n"); - scope_pid = -1; - goto out; - } - - /* read according to the cgroup mode */ - if (strstr(buffer, "::")) { - snprintf(ctrl_name, CONTROL_NAMELEN_MAX, "unified"); - ret = sscanf(buffer, "%d::%4096s\n", &idx, cgroup_name); - } else{ - ret = sscanf(buffer, "%d:%[^:]:%4096s\n", &idx, ctrl_name, cgroup_name); - } - - if (ret != 2 && ret != 3) { - err("Unrecognized cgroup file format: %s\n", buffer); - scope_pid = -1; - goto out; - } - - /* cgroup v1 might have shared mount points cpu,cpuacct */ - _ctrl_name = strchr(ctrl_name, ','); - if (_ctrl_name) { - size = strlen(ctrl_name) - strlen(_ctrl_name); - ctrl_name[size] = '\0'; - } - - /* - * capture is true, while the pid's controller and cgroups - * are populated for rollback case. - */ - if (capture) { - snprintf(info[i].ctrl_name, CONTROL_NAMELEN_MAX, "%s", ctrl_name); - snprintf(info[i].cgrp_path, FILENAME_MAX, "%s", cgroup_name); - } - - if (!is_cgroup_mode_unified()) { - if (ret == 3 && !strncmp(ctrl_name, "name=", 5)) { - if (!strcmp(ctrl_name, "name=systemd")) { - i++; - found_systemd_cgrp = 1; - } - continue; - } else if (ret == 2) { - i++; - found_unified_cgrp = 1; - continue; - } - } - i++; - - /* we are not interested in other functionality */ - if (capture) - continue; - - /* skip if the cgroup path doesn't have systemd scope format */ - if (strstr(cgroup_name, ".scope") == NULL || - strstr(cgroup_name, ".slice") == NULL) - continue; - - /* skip if we have already searched cgroup for idle_thread */ - if (is_scope_parsed(cgroup_name)) - continue; - - - if (ret == 2) - ret = cgroup_get_procs(cgroup_name, NULL, &pids, &size); - else - ret = cgroup_get_procs(cgroup_name, ctrl_name, &pids, &size); - if (ret) { - err("Failed to read cgroup.procs of cgroup: %s\n", cgroup_name + 1); - scope_pid = -1; - goto out; - } - - /* - * .scope created by the non-libcgroup process, will not - * have libcgroup_systemd_idle_thread - */ - _scope_pid = search_systemd_idle_thread_task(pids, size); - free(pids); - - if (_scope_pid == -1) - continue; - - if (scope_pid == -1) { - /* - * cgexec pid needs to written into: - * ../systemd///cgroup.procs (legacy/hybrid) - * ../unified///cgroup.procs (hybrid) - */ - snprintf(scope_name, FILENAME_MAX, "%s", cgroup_name); - scope_pid = _scope_pid; - continue; - } - - if (_scope_pid != scope_pid) { - err("Failed to replace scope idle_thread, found two idle_thread\n"); - err(" %u %u\n", scope_pid, _scope_pid); - scope_pid = -1; - goto out; - } - } - - if (capture) { - scope_pid = 0; - goto out; - } - - if (scope_pid == -1) { - err("Failed to find idle_thread task\n"); - goto out; - } - - if (is_cgroup_mode_legacy() && (found_systemd_cgrp == 0 || found_unified_cgrp == 1)) { - err("cgroup legacy setup incorrect\n"); - scope_pid = -1; - goto out; - } - - if (is_cgroup_mode_hybrid() && (found_systemd_cgrp == 0 || found_unified_cgrp == 0)) { - err("cgroup hybrid setup incorrect\n"); - scope_pid = -1; - goto out; - } - - /* This is true for cgroup v1 (legacy/hybrid) */ - if (found_systemd_cgrp) { - ret = write_systemd_unified(scope_name, pid); - if (ret) - scope_pid = -1; - } - - info[i].ctrl_name[0] = '\0'; -out: - if (pid_proc_fp) - fclose(pid_proc_fp); - - return scope_pid; -} - -/* - * Parse the /proc/mounts file and look for the controller string - * in each line. If found copies the mount point into mnt_point, - * else return NULL mnt_point. - */ -static void find_mnt_point(const char * const controller, char **mnt_point) -{ - char proc_mount[] = "/proc/mounts"; - char cgroup_path[FILENAME_MAX]; - char buffer[FILENAME_MAX * 2]; - FILE *proc_mount_f = NULL; - int ret; - - *mnt_point = NULL; - - proc_mount_f = fopen(proc_mount, "re"); - if (proc_mount_f == NULL) { - err("Failed to read %s:%s\n", proc_mount, strerror(errno)); - goto out; - } - - while (fgets(buffer, (FILENAME_MAX * 2), proc_mount_f) != NULL) { - /* skip line that doesn't have controller */ - if (!strstr(buffer, controller)) - continue; - - if (strcmp(controller, "name=systemd") == 0) { - if (!strstr(buffer, "name=systemd ") && - !strstr(buffer, "name=systemd,")) - continue; - } - - ret = sscanf(buffer, "%*s %4096s\n", cgroup_path); - if (ret != 1) { - err("Failed during read of %s:%s\n", proc_mount, strerror(errno)); - goto out; - } - - *mnt_point = strdup(cgroup_path); - if (!*mnt_point) - err("strdup of %s failed\n", cgroup_path); - break; - } - -out: - if (proc_mount_f) - fclose(proc_mount_f); -} - -static int write_systemd_unified(const char * const scope_name, pid_t pid) -{ - char cgroup_procs_path[FILENAME_MAX + 14]; - FILE *cgroup_systemd_path_f = NULL; - FILE *cgroup_unified_path_f = NULL; - char *cgroup_name = NULL; - - /* construct the systemd cgroup path, by parsing /proc/mounts */ - find_mnt_point("name=systemd", &cgroup_name); - if (!cgroup_name) { - err("Unable find name=systemd cgroup path\n"); - return -1; - } - - snprintf(cgroup_procs_path, sizeof(cgroup_procs_path), "%s/%s/cgroup.procs", - cgroup_name, scope_name); - free(cgroup_name); - - cgroup_systemd_path_f = fopen(cgroup_procs_path, "we"); - if (!cgroup_systemd_path_f) { - err("Failed to open %s\n", cgroup_procs_path); - return -1; - } - - if (is_cgroup_mode_hybrid()) { - /* - * construct the unified cgroup path, by parsing - * /proc/mounts - */ - find_mnt_point("unified", &cgroup_name); - if (!cgroup_name) { - err("Unable find unified cgroup path\n"); - fclose(cgroup_systemd_path_f); - return -1; - } - - snprintf(cgroup_procs_path, sizeof(cgroup_procs_path), "%s/%s/cgroup.procs", - cgroup_name, scope_name); - free(cgroup_name); - - cgroup_unified_path_f = fopen(cgroup_procs_path, "we"); - if (!cgroup_unified_path_f) { - err("Failed to open %s\n", cgroup_procs_path); - fclose(cgroup_systemd_path_f); - return -1; - } - } - - fprintf(cgroup_systemd_path_f, "%d", pid); - fflush(cgroup_systemd_path_f); - fclose(cgroup_systemd_path_f); - - if (!is_cgroup_mode_hybrid()) - return 0; - - fprintf(cgroup_unified_path_f, "%d", pid); - fflush(cgroup_unified_path_f); - fclose(cgroup_unified_path_f); - - return 0; -} - -static int is_scope_parsed(const char * const path) -{ - /* - * As per, /kernel/cgroup/cgroup.c::cgroup_init() - * At the max there can be only 16 controllers and we are - * not accounting for named hierarchies, which can be more - * than 16 themselves. - */ - static char parsed_scope_path[MAX_MNT_ELEMENTS][FILENAME_MAX]; - int i; - - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (!strcmp(parsed_scope_path[i], path)) - return 1; - if (parsed_scope_path[i][0] == '\0') { - snprintf(parsed_scope_path[i], FILENAME_MAX, "%s", path); - break; - } - } - - return 0; -} - -/* Borrowed from src/api.c::__attach_task_pid */ -static int attach_task_pid(char *path, pid_t tid) -{ - FILE *tasks = NULL; - int ret = 0; - - tasks = fopen(path, "we"); - if (!tasks) { - switch (errno) { - case EPERM: - ret = ECGROUPNOTOWNER; - break; - case ENOENT: - ret = ECGROUPNOTEXIST; - break; - default: - ret = ECGROUPNOTALLOWED; - } - goto err; - } - ret = fprintf(tasks, "%d", tid); - if (ret < 0) { - ret = ECGOTHER; - goto err; - } - ret = fflush(tasks); - if (ret) { - ret = ECGOTHER; - goto err; - } - fclose(tasks); - return 0; -err: - err("cannot write tid %d to %s:%s\n", tid, path, strerror(errno)); - if (tasks) - fclose(tasks); - return ret; -} - -static int rollback_pid_cgroups(pid_t pid) -{ - char cgroup_proc_path[FILENAME_MAX + 14]; - char cgroup_path[FILENAME_MAX]; - int err = 0, idx = 0, ret = 0; - char *cgrp_proc_path = NULL; - - /* - * unified cgroup rollback is simple, we need to write into - * single cgroup hierarchy. - */ - if (is_cgroup_mode_unified()) { - pthread_rwlock_rdlock(&cg_mount_table_lock); - cg_build_path_locked(info[idx].cgrp_path, cgroup_path, NULL); - pthread_rwlock_unlock(&cg_mount_table_lock); - - snprintf(cgroup_proc_path, FILENAME_MAX + 14, "%s/cgroup.procs", cgroup_path); - ret = attach_task_pid(cgroup_proc_path, pid); - return ret; - } - - for (idx = 0; info[idx].ctrl_name[0] != '\0'; idx++) { - /* find the systemd cgroup path */ - if (!strcmp(info[idx].ctrl_name, "name=systemd")) { - find_mnt_point("name=systemd", &cgrp_proc_path); - if (!cgrp_proc_path) { - err("Unable find name=systemd cgroup path\n"); - return -1; - } - - snprintf(cgroup_proc_path, FILENAME_MAX + 14, "%s/%s/cgroup.procs", - cgrp_proc_path, info[idx].cgrp_path); - free(cgrp_proc_path); - - /* find the unified cgroup path */ - } else if (is_cgroup_mode_hybrid() && - !strcmp(info[idx].ctrl_name, "unified")) { - find_mnt_point("unified cgroup2", &cgrp_proc_path); - if (!cgrp_proc_path) { - err("Unable find unified cgroup path\n"); - return -1; - } - - snprintf(cgroup_proc_path, FILENAME_MAX + 14, "%s/%s/cgroup.procs", - cgrp_proc_path, info[idx].cgrp_path); - free(cgrp_proc_path); - - /* find other controller hierarchy path */ - } else { - pthread_rwlock_rdlock(&cg_mount_table_lock); - cg_build_path_locked(info[idx].cgrp_path, cgroup_path, info[idx].ctrl_name); - pthread_rwlock_unlock(&cg_mount_table_lock); - - snprintf(cgroup_proc_path, FILENAME_MAX + 14, "%s/cgroup.procs", - cgroup_path); - } - - /* record the error and continue */ - ret = attach_task_pid(cgroup_proc_path, pid); - if (ret) - err = -1; - } - - return err; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgconfig.c b/lib/libcgroup-3.1.0/src/tools/cgconfig.c deleted file mode 100644 index b541d4b1212..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgconfig.c +++ /dev/null @@ -1,196 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright IBM Corporation. 2007 - * - * Authors: Dhaval Giani - * Balbir Singh - * - * Code initiated and designed by Dhaval Giani. All faults are most likely - * his mistake. - */ - -/* For basename() */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include "tools-common.h" - -#include -#include - -#include -#include - -#include -#include -#include -#include - -static struct cgroup_string_list cfg_files; - -static void usage(int status, char *progname) -{ - if (status != 0) { - err("Wrong input parameters, try %s '-h' for more information.\n", progname); - return; - } - - info("Usage: %s [-h] [-f mode] [-d mode] [-s mode] ", progname); - info("[-t :] [-a :] [-l FILE] [-L DIR] ...\n"); - info("Parse and load the specified cgroups configuration file\n"); - info(" -a : Default owner of groups "); - info("files and directories\n"); - info(" -d, --dperm=mode Default group directory permissions\n"); - info(" -f, --fperm=mode Default group file permissions\n"); - info(" -h, --help Display this help\n"); - info(" -l, --load=FILE Parse and load the cgroups configuration file\n"); - info(" -L, --load-directory=DIR Parse and load the cgroups "); - info("configuration files from a directory\n"); - info(" -s, --tperm=mode Default tasks file permissions\n"); - info(" -t : Default owner of the tasks file\n"); -} - -int main(int argc, char *argv[]) -{ - static struct option options[] = { - {"help", 0, 0, 'h'}, - {"load", 1, 0, 'l'}, - {"load-directory", 1, 0, 'L'}, - {"task", required_argument, NULL, 't'}, - {"admin", required_argument, NULL, 'a'}, - {"dperm", required_argument, NULL, 'd'}, - {"fperm", required_argument, NULL, 'f' }, - {"tperm", required_argument, NULL, 's' }, - {0, 0, 0, 0} - }; - - uid_t tuid = NO_UID_GID, auid = NO_UID_GID; - gid_t tgid = NO_UID_GID, agid = NO_UID_GID; - mode_t tasks_mode = NO_PERMS; - mode_t file_mode = NO_PERMS; - mode_t dir_mode = NO_PERMS; - - struct cgroup *default_group = NULL; - int filem_change = 0; - int dirm_change = 0; - int ret, error = 0; - int c, i; - - cgroup_set_default_logger(-1); - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - error = cgroup_string_list_init(&cfg_files, argc/2); - if (error) - goto err; - - while ((c = getopt_long(argc, argv, "hl:L:t:a:d:f:s:", options, NULL)) > 0) { - switch (c) { - case 'h': - usage(0, argv[0]); - error = 0; - goto err; - case 'l': - error = cgroup_string_list_add_item(&cfg_files, optarg); - if (error) { - err("%s: cannot add file to list, out of memory?\n", argv[0]); - goto err; - } - break; - case 'L': - cgroup_string_list_add_directory(&cfg_files, optarg, argv[0]); - break; - case 'a': - /* set admin uid/gid */ - error = parse_uid_gid(optarg, &auid, &agid, argv[0]); - if (error) - goto err; - break; - case 't': - /* set task uid/gid */ - error = parse_uid_gid(optarg, &tuid, &tgid, argv[0]); - if (error) - goto err; - break; - case 'd': - dirm_change = 1; - error = parse_mode(optarg, &dir_mode, argv[0]); - if (error) - goto err; - break; - case 'f': - filem_change = 1; - error = parse_mode(optarg, &file_mode, argv[0]); - if (error) - goto err; - break; - case 's': - filem_change = 1; - error = parse_mode(optarg, &tasks_mode, argv[0]); - if (error) - goto err; - break; - default: - usage(1, argv[0]); - error = EXIT_BADARGS; - goto err; - } - } - - if (argv[optind]) { - usage(1, argv[0]); - error = EXIT_BADARGS; - goto err; - } - - /* set default permissions */ - default_group = cgroup_new_cgroup("default"); - if (!default_group) { - error = -1; - err("%s: cannot create default cgroup\n", argv[0]); - goto err; - } - - error = cgroup_set_uid_gid(default_group, tuid, tgid, auid, agid); - if (error) { - err("%s: cannot set default UID and GID: %s\n", argv[0], cgroup_strerror(error)); - goto free_cgroup; - } - - if (dirm_change | filem_change) { - cgroup_set_permissions(default_group, dir_mode, file_mode, tasks_mode); - } - - error = cgroup_config_set_default(default_group); - if (error) { - err("%s: cannot set config parser defaults: %s\n", argv[0], - cgroup_strerror(error)); - goto free_cgroup; - } - - for (i = 0; i < cfg_files.count; i++) { - ret = cgroup_config_load_config(cfg_files.items[i]); - if (ret) { - err("%s; error loading %s: %s\n", argv[0], cfg_files.items[i], - cgroup_strerror(ret)); - if (!error) - error = ret; - } - } - -free_cgroup: - cgroup_free(&default_group); -err: - cgroup_string_list_free(&cfg_files); - - return error; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgcreate.c b/lib/libcgroup-3.1.0/src/tools/cgcreate.c deleted file mode 100644 index 82a6c97c7c8..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgcreate.c +++ /dev/null @@ -1,355 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright Red Hat, Inc. 2009 - * - * Authors: Ivana Hutarova Varekova - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * Display the usage - */ -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h for more information.\n", program_name); - return; - } - - info("Usage: %s [-h] [-f mode] [-d mode] [-s mode] ", program_name); - info("[-t :] [-a :] -g : [-g ...]\n"); - info("Create control group(s)\n"); - info(" -a : Owner of the group and all its files\n"); - info(" -d, --dperm=mode Group directory permissions\n"); - info(" -f, --fperm=mode Group file permissions\n"); - info(" -g : Control group which should be added\n"); - info(" -h, --help Display this help\n"); - info(" -s, --tperm=mode Tasks file permissions\n"); - info(" -t : Owner of the tasks file\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd"); - info("delegate hierarchy\n"); - info(" -c, --scope Create a delegated systemd scope\n"); - info(" -p, --pid=pid Task pid to use to create systemd "); - info("scope\n"); - info(" -S, --setdefault Set this scope as the default scope "); - info("delegate hierarchy\n"); -#endif -} - -#ifdef WITH_SYSTEMD -static int create_systemd_scope(struct cgroup * const cg, const char * const prog_name, - int set_default, pid_t pid) -{ - struct cgroup_systemd_scope_opts opts; - char slice[FILENAME_MAX]; - char *scope; - int ret; - int len; - - ret = cgroup_set_default_scope_opts(&opts); - if (ret) - return ret; - - opts.pid = pid; - - ret = cgroup_create_scope2(cg, 0, &opts); - if (!ret && set_default) { - scope = strstr(cg->name, "/"); - if (!scope) { - err("%s: Invalid scope name %s, expected /\n", - prog_name, cg->name); - ret = ECGINVAL; - goto err; - } - len = strlen(cg->name) - strlen(scope); - strncpy(slice, cg->name, FILENAME_MAX - 1); - slice[len] = '\0'; - scope++; - - ret = cgroup_write_systemd_default_cgroup(slice, scope); - /* - * cgroup_write_systemd_default_cgroup() returns 0 on failure - */ - if (ret == 0) { - err("%s: failed to write default %s/%s to ", - prog_name, slice, scope); - err("/var/run/libcgroup/systemd\n"); - ret = ECGINVAL; - goto err; - } - - /* - * the default was successfully set. override the return of "1" back to - * the usual "0" on success. - */ - ret = 0; - } - -err: - return ret; -} -#else -static int create_systemd_scope(struct cgroup * const cg, const char * const prog_name, - int set_default, pid_t pid) -{ - return ECGINVAL; -} -#endif /* WITH_SYSTEMD */ - -int main(int argc, char *argv[]) -{ - static struct option long_opts[] = { - {"help", no_argument, NULL, 'h'}, - {"task", required_argument, NULL, 't'}, - {"admin", required_argument, NULL, 'a'}, - {"", required_argument, NULL, 'g'}, - {"dperm", required_argument, NULL, 'd'}, - {"fperm", required_argument, NULL, 'f'}, - {"tperm", required_argument, NULL, 's'}, -#ifdef WITH_SYSTEMD - {"scope", no_argument, NULL, 'c'}, - {"setdefault", no_argument, NULL, 'S'}, - {"pid", required_argument, NULL, 'p'}, -#endif /* WITH_SYSTEMD */ - {0, 0, 0, 0}, - }; - - uid_t tuid = CGRULE_INVALID, auid = CGRULE_INVALID; - gid_t tgid = CGRULE_INVALID, agid = CGRULE_INVALID; - - int ignore_default_systemd_delegate_slice = 0; - int set_default_scope = 0; - int create_scope = 0; - pid_t scope_pid = -1; - - struct cgroup_group_spec **cgroup_list; - struct cgroup_controller *cgc; - struct cgroup *cgroup; - - /* approximation of max. numbers of groups that will be created */ - int capacity = argc; - - /* permission variables */ - mode_t tasks_mode = NO_PERMS; - mode_t file_mode = NO_PERMS; - mode_t dir_mode = NO_PERMS; - int filem_change = 0; - int dirm_change = 0; - - int ret = 0; - int i, j; - int c; - - /* no parametr on input */ - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - cgroup_list = calloc(capacity, sizeof(struct cgroup_group_spec *)); - if (cgroup_list == NULL) { - err("%s: out of memory\n", argv[0]); - ret = -1; - goto err; - } - -#ifdef WITH_SYSTEMD - /* parse arguments */ - while ((c = getopt_long(argc, argv, "a:t:g:hd:f:s:bcp:S", long_opts, NULL)) > 0) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; - case 'c': - create_scope = 1; - break; - case 'p': - scope_pid = atoi(optarg); - if (scope_pid <= 1) { - err("%s: Invalid pid %s\n", argv[0], optarg); - ret = EXIT_BADARGS; - goto err; - } - break; - case 'S': - set_default_scope = 1; - break; -#else - while ((c = getopt_long(argc, argv, "a:t:g:hd:f:s:", long_opts, NULL)) > 0) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - ret = 0; - goto err; - case 'a': - /* set admin uid/gid */ - if (parse_uid_gid(optarg, &auid, &agid, argv[0])) - goto err; - break; - case 't': - /* set task uid/gid */ - if (parse_uid_gid(optarg, &tuid, &tgid, argv[0])) - goto err; - break; - case 'g': - ret = parse_cgroup_spec(cgroup_list, optarg, capacity); - if (ret) { - err("%s: cgroup controller and path parsing failed (%s)\n", - argv[0], argv[optind]); - ret = EXIT_BADARGS; - goto err; - } - break; - case 'd': - dirm_change = 1; - ret = parse_mode(optarg, &dir_mode, argv[0]); - if (ret) - goto err; - break; - case 'f': - filem_change = 1; - ret = parse_mode(optarg, &file_mode, argv[0]); - if (ret) - goto err; - break; - case 's': - filem_change = 1; - ret = parse_mode(optarg, &tasks_mode, argv[0]); - if (ret) - goto err; - break; - default: - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - } - -#ifdef WITH_SYSTEMD - if (ignore_default_systemd_delegate_slice && create_scope) { - err("%s: \"-b\" and \"-c\" are mutually exclusive\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - if (set_default_scope && !create_scope) { - err("%s: \"-S\" requires \"-c\" to be provided\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - if (!create_scope && scope_pid != -1) { - err("%s: \"-p\" requires \"-c\" to be provided\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } -#endif - - /* no cgroup name */ - if (argv[optind]) { - err("%s: wrong arguments (%s)\n", argv[0], argv[optind]); - ret = EXIT_BADARGS; - goto err; - } - - /* initialize libcg */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* this will always be false if WITH_SYSTEMD is not defined */ - if (!create_scope && !ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* for each new cgroup */ - for (i = 0; i < capacity; i++) { - if (!cgroup_list[i]) - break; - - /* create the new cgroup structure */ - cgroup = cgroup_new_cgroup(cgroup_list[i]->path); - if (!cgroup) { - ret = ECGFAIL; - err("%s: can't add new cgroup: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* set uid and gid for the new cgroup based on input options */ - ret = cgroup_set_uid_gid(cgroup, tuid, tgid, auid, agid); - if (ret) - goto err; - - /* add controllers to the new cgroup */ - j = 0; - while (cgroup_list[i]->controllers[j]) { - if (strcmp(cgroup_list[i]->controllers[j], "*") == 0) { - /* it is meta character, add all controllers */ - ret = cgroup_add_all_controllers(cgroup); - if (ret != 0) { - ret = ECGINVAL; - err("%s: can't add all controllers\n", argv[0]); - cgroup_free(&cgroup); - goto err; - } - } else { - cgc = cgroup_add_controller(cgroup, - cgroup_list[i]->controllers[j]); - if (!cgc) { - ret = ECGINVAL; - err("%s: controller %s can't be add\n", argv[0], - cgroup_list[i]->controllers[j]); - cgroup_free(&cgroup); - goto err; - } - } - j++; - } - - /* all variables set so create cgroup */ - if (dirm_change | filem_change) - cgroup_set_permissions(cgroup, dir_mode, file_mode, tasks_mode); - - if (create_scope) { - ret = create_systemd_scope(cgroup, argv[0], set_default_scope, scope_pid); - } else { - ret = cgroup_create_cgroup(cgroup, 0); - } - if (ret) { - err("%s: can't create cgroup %s: %s\n", argv[0], cgroup->name, - cgroup_strerror(ret)); - cgroup_free(&cgroup); - goto err; - } - cgroup_free(&cgroup); - } - -err: - if (cgroup_list) { - for (i = 0; i < capacity; i++) { - if (cgroup_list[i]) - cgroup_free_group_spec(cgroup_list[i]); - } - free(cgroup_list); - } - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgdelete.c b/lib/libcgroup-3.1.0/src/tools/cgdelete.c deleted file mode 100644 index 5e85a9316c6..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgdelete.c +++ /dev/null @@ -1,295 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright RedHat Inc. 2009 - * - * Authors: Jan Safranek - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -static const struct option long_options[] = { - {"recursive", no_argument, NULL, 'r'}, - {"help", no_argument, NULL, 'h'}, - {"group", required_argument, NULL, 'g'}, - {NULL, 0, NULL, 0} -}; - -struct ext_cgroup_record { - char name[FILENAME_MAX]; /* controller name */ - char controller[FILENAME_MAX]; /* cgroup name */ - int h_number; /* hierarchy number */ -}; - - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters,"); - err(" try %s --help' for more information.\n", program_name); - return; - } - - info("Usage: %s [-h] [-r] [[-g] :] ...\n", program_name); - info("Remove control group(s)\n"); - info(" -g : Control group to be removed (-g is optional)\n"); - info(" -h, --help Display this help\n"); - info(" -r, --recursive Recursively remove all subgroups\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); -#endif -} - -/* - * Skip adding controller which points to the same cgroup when delete - * cgroup with specifying multi controllers. Just skip controller which - * cgroup and hierarchy number is same - */ -static int skip_add_controller(int counter, int *skip, struct ext_cgroup_record *ecg_list) -{ - struct controller_data info; - void *handle; - int ret = 0; - int k; - - /* find out hierarchy number of added cgroup */ - ecg_list[counter].h_number = 0; - - ret = cgroup_get_all_controller_begin(&handle, &info); - while (ret == 0) { - if (!strcmp(info.name, ecg_list[counter].name)) { - /* hierarchy number found out, set it */ - ecg_list[counter].h_number = info.hierarchy; - break; - } - ret = cgroup_get_all_controller_next(&handle, &info); - } - cgroup_get_all_controller_end(&handle); - - /* deal with cgroup_get_controller_begin/next ret values */ - if (ret == ECGEOF) - ret = 0; - if (ret) { - err("cgroup_get_controller_begin/next failed(%s)\n", cgroup_strerror(ret)); - return ret; - } - - /* found out whether the hierarchy should be skipped */ - *skip = 0; - for (k = 0; k < counter; k++) { - if ((!strcmp(ecg_list[k].name, ecg_list[counter].name)) && - (ecg_list[k].h_number == ecg_list[counter].h_number)) { - /* we found a control group in the same hierarchy */ - if (strcmp(ecg_list[k].controller, ecg_list[counter].controller)) { - /* - * it is a different controller -> if there - * is not one cgroup for the same controller, - * skip it - */ - *skip = 1; - } else { - /* - * there is the identical group,controller - * pair don't skip it - */ - *skip = 0; - return ret; - } - } - } - - return ret; -} - - -int main(int argc, char *argv[]) -{ - int ignore_default_systemd_delegate_slice = 0; - struct cgroup_group_spec **cgroup_list = NULL; - struct ext_cgroup_record *ecg_list = NULL; - struct cgroup_controller *cgc; - struct cgroup *cgroup; - - int final_ret = 0; - int counter = 0; - int flags = 0; - int max = 0; - int ret = 0; - int i, j, c; - int skip; - - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - /* initialize libcg */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - cgroup_list = calloc(argc, sizeof(struct cgroup_group_spec *)); - if (cgroup_list == NULL) { - err("%s: out of memory\n", argv[0]); - ret = -1; - goto err; - } - - ecg_list = calloc(argc, sizeof(struct ext_cgroup_record)); - if (ecg_list == NULL) { - err("%s: out of memory\n", argv[0]); - ret = -1; - goto err; - } - - /* Parse arguments */ -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "rhg:b", long_options, NULL)) > 0) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; -#else - while ((c = getopt_long(argc, argv, "rhg:", long_options, NULL)) > 0) { - switch (c) { -#endif - case 'r': - flags |= CGFLAG_DELETE_RECURSIVE; - break; - case 'g': - ret = parse_cgroup_spec(cgroup_list, optarg, argc); - if (ret != 0) { - err("%s: error parsing cgroup '%s'", argv[0], optarg); - ret = EXIT_BADARGS; - goto err; - } - break; - case 'h': - usage(0, argv[0]); - ret = 0; - goto err; - default: - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* parse groups on command line */ - for (i = optind; i < argc; i++) { - ret = parse_cgroup_spec(cgroup_list, argv[i], argc); - if (ret != 0) { - err("%s: error parsing cgroup '%s'\n", argv[0], argv[i]); - ret = EXIT_BADARGS; - goto err; - } - } - - /* for each cgroup to be deleted */ - for (i = 0; i < argc; i++) { - if (!cgroup_list[i]) - break; - - /* create the new cgroup structure */ - cgroup = cgroup_new_cgroup(cgroup_list[i]->path); - if (!cgroup) { - ret = ECGFAIL; - err("%s: can't create new cgroup: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* add controllers to the cgroup */ - j = 0; - while (cgroup_list[i]->controllers[j]) { - skip = 0; - /* - * save controller name, cg name and hierarchy - * number to determine whether we should skip - * adding controller - */ - if (counter == max) { - /* - * there is not enough space to store - * them, create it - */ - max = max + argc; - ecg_list = (struct ext_cgroup_record *) - realloc(ecg_list, max * sizeof(struct ext_cgroup_record)); - if (!ecg_list) { - err("%s: not enough memory\n", argv[0]); - final_ret = -1; - goto err; - } - } - - strncpy(ecg_list[counter].controller, - cgroup_list[i]->controllers[j], FILENAME_MAX); - ecg_list[counter].controller[FILENAME_MAX - 1] = '\0'; - - strncpy(ecg_list[counter].name, - cgroup_list[i]->path, FILENAME_MAX); - ecg_list[counter].name[FILENAME_MAX - 1] = '\0'; - - ret = skip_add_controller(counter, &skip, ecg_list); - if (ret) - goto err; - - if (skip) { - /* don't add the controller, goto next one */ - goto next; - } - - cgc = cgroup_add_controller(cgroup, cgroup_list[i]->controllers[j]); - if (!cgc) { - ret = ECGFAIL; - err("%s: controller %s can't be added\n", argv[0], - cgroup_list[i]->controllers[j]); - cgroup_free(&cgroup); - goto err; - } -next: - counter++; - j++; - } - - ret = cgroup_delete_cgroup_ext(cgroup, flags); - /* Remember the errors and continue, try to remove all groups. */ - if (ret != 0) { - err("%s: cannot remove group '%s': %s\n", argv[0], cgroup->name, - cgroup_strerror(ret)); - final_ret = ret; - } - cgroup_free(&cgroup); - } - - ret = final_ret; - -err: - if (ecg_list) - free(ecg_list); - - if (cgroup_list) { - for (i = 0; i < argc; i++) { - if (cgroup_list[i]) - cgroup_free_group_spec(cgroup_list[i]); - } - free(cgroup_list); - } - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgexec.c b/lib/libcgroup-3.1.0/src/tools/cgexec.c deleted file mode 100644 index 863d4fb58d4..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgexec.c +++ /dev/null @@ -1,524 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright RedHat Inc. 2008 - * - * Authors: Vivek Goyal - * - * Replace systemd idle_thread enhancements by Kamalesh Babulal - * Copyright (c) 2023 Oracle and/or its affiliates. - * Author: Kamalesh Babulal - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include "tools-common.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define SYSTEMD_IDLE_THREAD "libcgroup_systemd_idle_thread" - -static pid_t find_scope_pid(pid_t pid); -static int write_systemd_unified(const char * const scope_name); -static int is_scope_parsed(const char * const path); - -static struct option longopts[] = { - {"sticky", no_argument, NULL, 's'}, - {"help", no_argument, NULL, 'h'}, - {0, 0, 0, 0} -}; - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s --help for more information.\n", program_name); - return; - } - - info("Usage: %s [-h] [-g :] [--sticky] ", program_name); - info("command [arguments] ...\n"); - info("Run the task in given control group(s)\n"); - info(" -g : Control group which should be added\n"); - info(" -h, --help Display this help\n"); - info(" --sticky cgred daemon does not "); - info("change pidlist and children tasks\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); - info(" -r Replace the default idle_thread spawned "); - info("for the systemd scope\n"); -#endif -} - -int main(int argc, char *argv[]) -{ - struct cgroup_group_spec *cgroup_list[CG_HIER_MAX]; - int ignore_default_systemd_delegate_slice = 0; - pid_t scope_pid = -1; - int child_status = 0; - int replace_idle = 0; - int cg_specified = 0; - int flag_child = 0; - int i, ret = 0; - uid_t uid; - gid_t gid; - pid_t pid; - int c; - - memset(cgroup_list, 0, sizeof(cgroup_list)); -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "+g:shbr", longopts, NULL)) > 0) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; - case 'r': - replace_idle = 1; - break; -#else - while ((c = getopt_long(argc, argv, "+g:sh", longopts, NULL)) > 0) { - switch (c) { -#endif - case 'g': - ret = parse_cgroup_spec(cgroup_list, optarg, CG_HIER_MAX); - if (ret) { - err("cgroup controller and path parsing failed\n"); - exit(EXIT_BADARGS); - } - cg_specified = 1; - break; - case 's': - flag_child |= CGROUP_DAEMON_UNCHANGE_CHILDREN; - break; - case 'h': - usage(0, argv[0]); - exit(0); - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - } - - /* Executable name */ - if (!argv[optind]) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - /* Initialize libcg */ - ret = cgroup_init(); - if (ret) { - err("libcgroup initialization failed: %s\n", cgroup_strerror(ret)); - return ret; - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* Just for debugging purposes. */ - uid = geteuid(); - gid = getegid(); - cgroup_dbg("My euid and egid is: %d,%d\n", (int) uid, (int) gid); - - uid = getuid(); - gid = getgid(); - pid = getpid(); - - ret = cgroup_register_unchanged_process(pid, flag_child); - if (ret) { - err("registration of process failed\n"); - return ret; - } - - /* - * 'cgexec' command file needs the root privilege for executing a - * cgroup_register_unchanged_process() by using unix domain socket, - * and an euid/egid should be changed to the executing user from a - * root user. - */ - if (setresuid(uid, uid, uid)) { - err("%s", strerror(errno)); - return -1; - } - - if (setresgid(gid, gid, gid)) { - err("%s", strerror(errno)); - return -1; - } - - if (cg_specified) { - /* - * User has specified the list of control group - * and controllers - */ - for (i = 0; i < CG_HIER_MAX; i++) { - if (!cgroup_list[i]) - break; - - ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid, - (const char *const*) cgroup_list[i]->controllers); - if (ret) { - err("cgroup change of group failed\n"); - return ret; - } - } - } else { - - /* Change the cgroup by determining the rules based on uid */ - ret = cgroup_change_cgroup_flags(uid, gid, argv[optind], pid, 0); - if (ret) { - err("cgroup change of group failed\n"); - return ret; - } - } - - if (!replace_idle) { - /* Now exec the new process */ - execvp(argv[optind], &argv[optind]); - err("exec failed:%s", strerror(errno)); - return -1; - } - - scope_pid = find_scope_pid(pid); - if (scope_pid == -1) - return -1; - - pid = fork(); - if (pid == -1) { - err("Fork failed for pid %u:%s\n", pid, strerror(errno)); - return -1; - } - - /* child process kills the spawned idle_thread */ - if (pid == 0) { - ret = kill(scope_pid, SIGTERM); - if (ret) { - err("Failed to kill pid %u:%s\n", scope_pid, strerror(errno)); - exit(1); - } - - exit(0); - } - - wait(&child_status); - if (WEXITSTATUS(child_status)) - return -1; - - /* Now exec the new process */ - execvp(argv[optind], &argv[optind]); - err("exec failed:%s", strerror(errno)); - - return -1; -} - -static pid_t search_systemd_idle_thread_task(pid_t pids[], size_t size) -{ - char task_cmd[FILENAME_MAX]; - char buffer[FILENAME_MAX]; - FILE *pid_cmd_fp = NULL; - int scope_pid = -1; - int i; - - for (i = 0; i < size; i++) { - snprintf(buffer, FILENAME_MAX, "/proc/%u/cmdline", pids[i]); - pid_cmd_fp = fopen(buffer, "re"); - /* task might have exited */ - if (!pid_cmd_fp) - continue; - - /* task might have exited, so consider only successful reads. */ - if (fgets(task_cmd, FILENAME_MAX, pid_cmd_fp)) { - if (!strcmp(task_cmd, SYSTEMD_IDLE_THREAD)) { - scope_pid = pids[i]; - fclose(pid_cmd_fp); - break; - } - } - fclose(pid_cmd_fp); - } - return scope_pid; - -} - -static pid_t find_scope_pid(pid_t pid) -{ - pid_t _scope_pid = -1, scope_pid = -1; - char ctrl_name[CONTROL_NAMELEN_MAX]; - char cgroup_name[FILENAME_MAX]; - char scope_name[FILENAME_MAX]; - int found_systemd_cgrp = 0; - int found_unified_cgrp = 0; - char buffer[FILENAME_MAX]; - FILE *pid_proc_fp = NULL; - char *_ctrl_name = NULL; - int idx, ret, size = 0; - pid_t *pids; - - - /* Let's parse the cgroup of the pid, to check if its in one or - * more .scopes. - */ - snprintf(buffer, FILENAME_MAX, "/proc/%u/cgroup", pid); - pid_proc_fp = fopen(buffer, "re"); - if (!pid_proc_fp) { - err("Failed to open: %s\n", buffer); - return -1; - } - - while (fgets(buffer, FILENAME_MAX, pid_proc_fp)) { - memset(ctrl_name, '\0', sizeof(CONTROL_NAMELEN_MAX)); - - /* read according to the cgroup mode */ - if (strstr(buffer, "::")) - ret = sscanf(buffer, "%d::%4096s\n", &idx, cgroup_name); - else - ret = sscanf(buffer, "%d:%[^:]:%4096s\n", &idx, ctrl_name, cgroup_name); - - if (ret != 2 && ret != 3) { - err("Unrecognized cgroup file format: %s\n", buffer); - goto out; - } - - if (!is_cgroup_mode_unified()) { - if (ret == 3 && !strncmp(ctrl_name, "name=systemd", 12)) { - found_systemd_cgrp = 1; - continue; - } else if (ret == 2) { - found_unified_cgrp = 1; - continue; - } - } - - /* skip if the cgroup path doesn't have systemd scope format */ - if (strstr(cgroup_name, ".scope") == NULL || - strstr(cgroup_name, ".slice") == NULL) - continue; - - /* skip if we have already searched cgroup for idle_thread */ - if (is_scope_parsed(cgroup_name)) - continue; - - /* cgroup v1 might have shared mount points cpu,cpuacct */ - _ctrl_name = strchr(ctrl_name, ','); - if (_ctrl_name) { - size = strlen(ctrl_name) - strlen(_ctrl_name); - ctrl_name[size] = '\0'; - } - - if (ret == 2) - ret = cgroup_get_procs(cgroup_name, NULL, &pids, &size); - else - ret = cgroup_get_procs(cgroup_name, ctrl_name, &pids, &size); - if (ret) { - err("Failed to read cgroup.procs of cgroup: %s\n", cgroup_name + 1); - goto out; - } - - /* - * .scope created by the non-libcgroup process, will not - * have libcgroup_systemd_idle_thread - */ - _scope_pid = search_systemd_idle_thread_task(pids, size); - free(pids); - - if (_scope_pid == -1) - continue; - - if (scope_pid == -1) { - /* - * cgexec pid needs to written into: - * ../systemd///cgroup.procs (legacy/hybrid) - * ../unified///cgroup.procs (hybrid) - */ - snprintf(scope_name, FILENAME_MAX, "%s", cgroup_name); - scope_pid = _scope_pid; - continue; - } - - if (_scope_pid != scope_pid) { - err("Failed to replace scope idle_thread, found two idle_thread\n"); - err(" %u %u\n", scope_pid, _scope_pid); - goto out; - } - } - - if (scope_pid == -1) { - err("Failed to find idle_thread task\n"); - goto out; - } - - if (is_cgroup_mode_legacy() && (found_systemd_cgrp == 0 || found_unified_cgrp == 1)) { - err("cgroup legacy setup incorrect\n"); - scope_pid = -1; - goto out; - } - - if (is_cgroup_mode_hybrid() && (found_systemd_cgrp == 0 || found_unified_cgrp == 0)) { - err("cgroup hybrid setup incorrect\n"); - scope_pid = -1; - goto out; - } - - /* This is true for cgroup v1 (legacy/hybrid) */ - if (found_systemd_cgrp) { - ret = write_systemd_unified(scope_name); - if (ret) - scope_pid = -1; - } - -out: - if (pid_proc_fp) - fclose(pid_proc_fp); - - return scope_pid; -} - -/* - * Parse the /proc/mounts file and look for the controller string - * in each line. If found copies the mount point into mnt_point, - * else return NULL mnt_point. - */ -static void find_mnt_point(const char * const controller, char **mnt_point) -{ - char proc_mount[] = "/proc/mounts"; - char cgroup_path[FILENAME_MAX]; - char buffer[FILENAME_MAX * 2]; - FILE *proc_mount_f = NULL; - int ret; - - *mnt_point = NULL; - - proc_mount_f = fopen(proc_mount, "re"); - if (proc_mount_f == NULL) { - err("Failed to read %s:%s\n", proc_mount, strerror(errno)); - goto out; - } - - while (fgets(buffer, (FILENAME_MAX * 2), proc_mount_f) != NULL) { - /* skip line that doesn't have controller */ - if (!strstr(buffer, controller)) - continue; - - ret = sscanf(buffer, "%*s %4096s\n", cgroup_path); - if (ret != 1) { - err("Failed during read of %s:%s\n", proc_mount, strerror(errno)); - goto out; - } - - *mnt_point = strdup(cgroup_path); - if (!*mnt_point) - err("strdup of %s failed\n", cgroup_path); - break; - } - -out: - if (proc_mount_f) - fclose(proc_mount_f); -} - -static int write_systemd_unified(const char * const scope_name) -{ - char cgroup_procs_path[FILENAME_MAX * 2 + 25]; - FILE *cgroup_systemd_path_f = NULL; - FILE *cgroup_unified_path_f = NULL; - char *cgroup_name = NULL; - pid_t pid; - - /* construct the systemd cgroup path, by parsing /proc/mounts */ - find_mnt_point("name=systemd ", &cgroup_name); - if (!cgroup_name) { - err("Unable find name=systemd cgroup path\n"); - return -1; - } - - snprintf(cgroup_procs_path, sizeof(cgroup_procs_path), "%s/%s/cgroup.procs", - cgroup_name, scope_name); - free(cgroup_name); - - cgroup_systemd_path_f = fopen(cgroup_procs_path, "we"); - if (!cgroup_systemd_path_f) { - err("Failed to open %s\n", cgroup_procs_path); - return -1; - } - - if (is_cgroup_mode_hybrid()) { - /* - * construct the unified cgroup path, by parsing - * /proc/mounts - */ - find_mnt_point("unified cgroup2", &cgroup_name); - if (!cgroup_name) { - err("Unable find unified cgroup path\n"); - fclose(cgroup_systemd_path_f); - return -1; - } - - snprintf(cgroup_procs_path, sizeof(cgroup_procs_path), "%s/%s/cgroup.procs", - cgroup_name, scope_name); - free(cgroup_name); - - cgroup_unified_path_f = fopen(cgroup_procs_path, "we"); - if (!cgroup_unified_path_f) { - err("Failed to open %s\n", cgroup_procs_path); - fclose(cgroup_systemd_path_f); - return -1; - } - } - - pid = getpid(); - - fprintf(cgroup_systemd_path_f, "%d", pid); - fflush(cgroup_systemd_path_f); - fclose(cgroup_systemd_path_f); - - if (!is_cgroup_mode_hybrid()) - return 0; - - fprintf(cgroup_unified_path_f, "%d", pid); - fflush(cgroup_unified_path_f); - fclose(cgroup_unified_path_f); - - return 0; -} - -static int is_scope_parsed(const char * const path) -{ - /* - * As per, /kernel/cgroup/cgroup.c::cgroup_init() - * At the max there can be only 16 controllers and we are - * not accounting for named hierarchies, which can be more - * than 16 themselves. - */ - static char parsed_scope_path[MAX_MNT_ELEMENTS][FILENAME_MAX]; - int i; - - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - if (!strcmp(parsed_scope_path[i], path)) - return 1; - - if (parsed_scope_path[i][0] == '\0') { - snprintf(parsed_scope_path[i], FILENAME_MAX, "%s", path); - break; - } - } - - return 0; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgget.c b/lib/libcgroup-3.1.0/src/tools/cgget.c deleted file mode 100644 index 07f1fb2d8ff..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgget.c +++ /dev/null @@ -1,883 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#define MODE_SHOW_HEADERS 1 -#define MODE_SHOW_NAMES 2 -#define MODE_SYSTEMD_DELEGATE 4 - -#define LL_MAX 100 - -static int find_cgroup_mount_type(void); -static int print_controller_version(void); - -static const struct option long_options[] = { - {"variable", required_argument, NULL, 'r'}, - {"help", no_argument, NULL, 'h'}, - {"all", no_argument, NULL, 'a'}, - {"values-only", no_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} -}; - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h' for more information.\n", program_name); - return; - } - info("Usage: %s [-nv] [-r ] [-g ] [-a] ...\n", program_name); - info("Print parameter(s) of given group(s).\n"); - info(" -a, --all Print info about all relevant controllers\n"); - info(" -g Controller which info should be displayed\n"); - info(" -g : Control group which info should be displayed\n"); - info(" -h, --help Display this help\n"); - info(" -n Do not print headers\n"); - info(" -r, --variable Define parameter to display\n"); - info(" -v, --values-only Print only values, not "); - info("parameter names\n"); - info(" -m Display the cgroup mode\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); -#endif - info(" -c Display controller version\n"); -} - -static int get_controller_from_name(const char * const name, char **controller) -{ - char *dot; - - *controller = strdup(name); - if (*controller == NULL) - return ECGOTHER; - - dot = strchr(*controller, '.'); - if (dot == NULL) { - err("cgget: error parsing parameter name '%s'", name); - return ECGINVAL; - } - *dot = '\0'; - - return 0; -} - -static int create_cg(struct cgroup **cg_list[], int * const cg_list_len) -{ - *cg_list = realloc(*cg_list, ((*cg_list_len) + 1) * sizeof(struct cgroup *)); - if ((*cg_list) == NULL) - return ECGCONTROLLERCREATEFAILED; - - memset(&(*cg_list)[*cg_list_len], 0, sizeof(struct cgroup *)); - - (*cg_list)[*cg_list_len] = cgroup_new_cgroup(""); - if ((*cg_list)[*cg_list_len] == NULL) - return ECGCONTROLLERCREATEFAILED; - - (*cg_list_len)++; - - return 0; -} - -static int parse_a_flag(struct cgroup **cg_list[], int * const cg_list_len) -{ - struct cgroup_mount_point controller; - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - void *handle; - int ret = 0; - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-r" was provided, then we know that the cgroup(s) will be - * an optarg at the end with no flag. Let's temporarily populate - * the first cgroup with the requested control values. - */ - cg = (*cg_list)[0]; - - ret = cgroup_get_controller_begin(&handle, &controller); - while (ret == 0) { - cgc = cgroup_get_controller(cg, controller.name); - if (!cgc) { - cgc = cgroup_add_controller(cg, controller.name); - if (!cgc) { - err("cgget: cannot find controller '%s'\n", controller.name); - ret = ECGOTHER; - goto out; - } - } - ret = cgroup_get_controller_next(&handle, &controller); - } - if (ret == ECGEOF) - /* - * we successfully reached the end of the controller list; - * this is not an error - */ - ret = 0; - - cgroup_get_controller_end(&handle); - - return ret; - -out: - cgroup_get_controller_end(&handle); - - return ret; -} - -static int parse_r_flag(struct cgroup **cg_list[], int * const cg_list_len, - const char * const cntl_value) -{ - char *cntl_value_controller = NULL; - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - int ret = 0; - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-r" was provided, then we know that the cgroup(s) will be - * an optarg at the end with no flag. Let's temporarily populate - * the first cgroup with the requested control values. - */ - cg = (*cg_list)[0]; - - ret = get_controller_from_name(cntl_value, &cntl_value_controller); - if (ret) - goto out; - - cgc = cgroup_get_controller(cg, cntl_value_controller); - if (!cgc) { - cgc = cgroup_add_controller(cg, cntl_value_controller); - if (!cgc) { - err("cgget: cannot find controller '%s'\n", cntl_value_controller); - ret = ECGOTHER; - goto out; - } - } - - ret = cgroup_add_value_string(cgc, cntl_value, NULL); - -out: - if (cntl_value_controller) - free(cntl_value_controller); - - return ret; -} - -static int parse_g_flag_no_colon(struct cgroup **cg_list[], int * const cg_list_len, - const char * const ctrl_str) -{ - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - int ret = 0; - - if ((*cg_list_len) > 1) { - ret = ECGMAXVALUESEXCEEDED; - goto out; - } - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-g " was provided, then we know that the cgroup(s) - * will be an optarg at the end with no flag. Let's temporarily - * populate the first cgroup with the requested control values. - */ - cg = *cg_list[0]; - - cgc = cgroup_get_controller(cg, ctrl_str); - if (!cgc) { - cgc = cgroup_add_controller(cg, ctrl_str); - if (!cgc) { - err("cgget: cannot find controller '%s'\n", ctrl_str); - ret = ECGOTHER; - goto out; - } - } - -out: - return ret; -} - -static int split_cgroup_name(const char * const ctrl_str, char *cg_name) -{ - char *colon; - - colon = strchr(ctrl_str, ':'); - if (colon == NULL) { - /* ctrl_str doesn't contain a ":" */ - cg_name[0] = '\0'; - return ECGINVAL; - } - - strncpy(cg_name, &colon[1], FILENAME_MAX - 1); - - return 0; -} - -static int split_controllers(const char * const in, char **ctrl[], int * const ctrl_len) -{ - char *copy, *tok, *colon, *saveptr = NULL; - int ret = 0; - char **tmp; - - copy = strdup(in); - if (!copy) - goto out; - saveptr = copy; - - colon = strchr(copy, ':'); - if (colon) - colon[0] = '\0'; - - while ((tok = strtok_r(copy, ",", ©))) { - tmp = realloc(*ctrl, sizeof(char *) * ((*ctrl_len) + 1)); - if (!tmp) { - ret = ECGOTHER; - goto out; - } - - *ctrl = tmp; - (*ctrl)[*ctrl_len] = strdup(tok); - if ((*ctrl)[*ctrl_len] == NULL) { - ret = ECGOTHER; - goto out; - } - - (*ctrl_len)++; - } - -out: - if (saveptr) - free(saveptr); - - return ret; -} - -static int parse_g_flag_with_colon(struct cgroup **cg_list[], int * const cg_list_len, - const char * const ctrl_str) -{ - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - char **controllers = NULL; - int controllers_len = 0; - int i, ret = 0; - - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - - cg = (*cg_list)[(*cg_list_len) - 1]; - - ret = split_cgroup_name(ctrl_str, cg->name); - if (ret) - goto out; - - ret = split_controllers(ctrl_str, &controllers, &controllers_len); - if (ret) - goto out; - - for (i = 0; i < controllers_len; i++) { - cgc = cgroup_get_controller(cg, controllers[i]); - if (!cgc) { - cgc = cgroup_add_controller(cg, controllers[i]); - if (!cgc) { - err("cgget: cannot find controller '%s'\n", controllers[i]); - ret = ECGOTHER; - goto out; - } - } - } - -out: - for (i = 0; i < controllers_len; i++) - free(controllers[i]); - - return ret; -} - -static int parse_opt_args(int argc, char *argv[], struct cgroup **cg_list[], - int * const cg_list_len, bool first_cg_is_dummy) -{ - struct cgroup *cg = NULL; - int ret = 0; - - /* - * The first cgroup was temporarily populated and requires the - * user to provide a cgroup name as an opt - */ - if (argv[optind] == NULL && first_cg_is_dummy) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - /* - * The user has provided a cgroup and controller via the - * -g : flag and has also provided a cgroup - * via the optind. This was not supported by the previous cgget - * implementation. Continue that approach. - * - * Example of a command that will hit this code: - * $ cgget -g cpu:mycgroup mycgroup - */ - if (argv[optind] != NULL && (*cg_list_len) > 0 && - strcmp((*cg_list)[0]->name, "") != 0) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - while (argv[optind] != NULL) { - if ((*cg_list_len) > 0) - cg = (*cg_list)[(*cg_list_len) - 1]; - else - cg = NULL; - - if ((*cg_list_len) == 0) { - /* - * The user didn't provide a '-r' or '-g' flag. - * The parse_a_flag() function can be reused here - * because we both have the same use case - gather - * all the data about this particular cgroup. - */ - ret = parse_a_flag(cg_list, cg_list_len); - if (ret) - goto out; - - strncpy((*cg_list)[(*cg_list_len) - 1]->name, argv[optind], - sizeof((*cg_list)[(*cg_list_len) - 1]->name) - 1); - } else if (cg != NULL && strlen(cg->name) == 0) { - /* - * this cgroup was created based upon control/value - * pairs or with a -g option. we'll - * populate it with the parameter provided by the user - */ - strncpy(cg->name, argv[optind], sizeof(cg->name) - 1); - } else { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - - ret = cgroup_copy_cgroup((*cg_list)[(*cg_list_len) - 1], - (*cg_list)[(*cg_list_len) - 2]); - if (ret) - goto out; - - strncpy((*cg_list)[(*cg_list_len) - 1]->name, argv[optind], - sizeof((*cg_list)[(*cg_list_len) - 1]->name) - 1); - } - optind++; - } - -out: - return ret; -} - -static int parse_opts(int argc, char *argv[], struct cgroup **cg_list[], int * const cg_list_len, - int * const mode) -{ - bool do_not_fill_controller = false; - bool first_cgroup_is_dummy = false; - bool cgroup_mount_type = false; - bool fill_controller = false; - bool print_ctrl_ver = false; - int ret = 0; - int c; - - /* Parse arguments. */ -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "r:hnvg:ambc", long_options, NULL)) > 0) { - switch (c) { - case 'b': - *mode = (*mode) & (INT_MAX ^ MODE_SYSTEMD_DELEGATE); - break; -#else - while ((c = getopt_long(argc, argv, "r:hnvg:amc", long_options, NULL)) > 0) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - exit(0); - case 'n': - /* Do not show headers. */ - *mode = (*mode) & (INT_MAX ^ MODE_SHOW_HEADERS); - break; - case 'v': - /* Do not show parameter names. */ - *mode = (*mode) & (INT_MAX ^ MODE_SHOW_NAMES); - break; - case 'r': - do_not_fill_controller = true; - first_cgroup_is_dummy = true; - ret = parse_r_flag(cg_list, cg_list_len, optarg); - if (ret) - goto err; - break; - case 'g': - fill_controller = true; - if (strchr(optarg, ':') == NULL) { - first_cgroup_is_dummy = true; - ret = parse_g_flag_no_colon(cg_list, cg_list_len, optarg); - if (ret) - goto err; - } else { - ret = parse_g_flag_with_colon(cg_list, cg_list_len, optarg); - if (ret) - goto err; - } - break; - case 'a': - fill_controller = true; - ret = parse_a_flag(cg_list, cg_list_len); - if (ret) - goto err; - break; - case 'm': - cgroup_mount_type = true; - break; - case 'c': - print_ctrl_ver = true; - break; - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - } - - /* Don't allow '-r' and ('-g' or '-a') */ - if (fill_controller && do_not_fill_controller) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - /* '-m' and '-c' should not used with other options */ - if ((cgroup_mount_type || print_ctrl_ver) && - (fill_controller || do_not_fill_controller)) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - if (cgroup_mount_type) { - ret = find_cgroup_mount_type(); - if (ret) - goto err; - } - - if (print_ctrl_ver) { - ret = print_controller_version(); - if (ret) - goto err; - } - - ret = parse_opt_args(argc, argv, cg_list, cg_list_len, first_cgroup_is_dummy); - if (ret) - goto err; - -err: - return ret; -} - -static int get_cv_value(struct control_value * const cv, const char * const cg_name, - const char * const controller_name) -{ - bool is_multiline = false; - void *tmp, *handle = NULL; - char tmp_line[LL_MAX]; - int ret; - - ret = cgroup_read_value_begin(controller_name, cg_name, cv->name, &handle, tmp_line, - LL_MAX); - if (ret == ECGEOF) - goto read_end; - if (ret != 0) { - if (ret == ECGOTHER) { - int tmp_ret; - - /* - * to maintain compatibility with an earlier version - * of cgget, try to determine if the failure was due - * to an invalid controller - */ - tmp_ret = cgroup_test_subsys_mounted(controller_name); - if (tmp_ret == 0) { - err("cgget: cannot find controller '%s' in group '%s'\n", - controller_name, cg_name); - } else { - err("variable file read failed %s\n", cgroup_strerror(ret)); - } - } - - goto end; - } - - /* remove the newline character */ - tmp_line[strcspn(tmp_line, "\n")] = '\0'; - - strncpy(cv->value, tmp_line, CG_CONTROL_VALUE_MAX - 1); - cv->multiline_value = strdup(cv->value); - if (cv->multiline_value == NULL) - goto read_end; - - while ((ret = cgroup_read_value_next(&handle, tmp_line, LL_MAX)) == 0) { - if (ret == 0) { - is_multiline = true; - cv->value[0] = '\0'; - - /* remove the newline character */ - tmp_line[strcspn(tmp_line, "\n")] = '\0'; - - tmp = realloc(cv->multiline_value, sizeof(char) * - (strlen(cv->multiline_value) + strlen(tmp_line) + 3)); - if (tmp == NULL) - goto read_end; - - cv->multiline_value = tmp; - strcat(cv->multiline_value, "\n\t"); - strcat(cv->multiline_value, tmp_line); - } - } - -read_end: - cgroup_read_value_end(&handle); - if (ret == ECGEOF) - ret = 0; -end: - if (is_multiline == false && cv->multiline_value) { - free(cv->multiline_value); - cv->multiline_value = NULL; - } - - if ((FILE *)handle) - fclose((FILE *)handle); - - return ret; -} - -static int indent_multiline_value(struct control_value * const cv) -{ - char tmp_val[CG_CONTROL_VALUE_MAX] = {0}; - char *tok, *saveptr = NULL; - - tok = strtok_r(cv->value, "\n", &saveptr); - strncat(tmp_val, tok, CG_CONTROL_VALUE_MAX - 1); - /* don't indent the first value */ - while ((tok = strtok_r(NULL, "\n", &saveptr))) { - strncat(tmp_val, "\n\t", (CG_CONTROL_VALUE_MAX - (strlen(tmp_val) + 1))); - strncat(tmp_val, tok, (CG_CONTROL_VALUE_MAX - (strlen(tmp_val) + 1))); - } - - cv->multiline_value = strdup(tmp_val); - if (!cv->multiline_value) - return ECGOTHER; - - return 0; -} - -static int fill_empty_controller(struct cgroup * const cg, struct cgroup_controller * const cgc) -{ - char cgrp_ctrl_path[FILENAME_MAX] = { '\0' }; - char mnt_path[FILENAME_MAX] = { '\0' }; -#ifdef WITH_SYSTEMD - char tmp[FILENAME_MAX] = { '\0' }; -#endif - struct dirent *ctrl_dir = NULL; - int i, mnt_path_len, ret = 0; - bool found_mount = false; - DIR *dir = NULL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (i = 0; i < CG_CONTROLLER_MAX && cg_mount_table[i].name[0] != '\0'; i++) { - if (strlen(cgc->name) == strlen(cg_mount_table[i].name) && - strncmp(cgc->name, cg_mount_table[i].name, strlen(cgc->name)) == 0) { - found_mount = true; - break; - } - } - - if (found_mount == false) - goto out; - - if (!cg_build_path_locked(NULL, mnt_path, cg_mount_table[i].name)) - goto out; - - mnt_path_len = strlen(mnt_path); -#ifdef WITH_SYSTEMD - /* - * If the user has set a slice/scope as setdefault in the - * cgconfig.conf file, every path constructed will have the - * systemd_default_cgroup slice/scope suffixed to it. - * - * We need to trim the slice/scope from the path, incase of - * user providing / as the cgroup name in the command - * line: - * cgget -g cpu:/foo - */ - if (cg->name[0] == '/' && cg->name[1] != '\0' && - strncmp(mnt_path + (mnt_path_len - 7), ".scope/", 7) == 0) { - snprintf(tmp, FILENAME_MAX, "%s", dirname(mnt_path)); - strncpy(mnt_path, tmp, FILENAME_MAX - 1); - mnt_path[FILENAME_MAX - 1] = '\0'; - - mnt_path_len = strlen(mnt_path); - if (strncmp(mnt_path + (mnt_path_len - 6), ".slice", 6) == 0) { - snprintf(tmp, FILENAME_MAX, "%s", dirname(mnt_path)); - strncpy(mnt_path, tmp, FILENAME_MAX - 1); - mnt_path[FILENAME_MAX - 1] = '\0'; - } else { - cgroup_dbg("Malformed path %s (expected slice name)\n", mnt_path); - ret = ECGOTHER; - goto out; - } - } -#endif - strncat(mnt_path, cg->name, FILENAME_MAX - mnt_path_len - 1); - mnt_path[sizeof(mnt_path) - 1] = '\0'; - - if (access(mnt_path, F_OK)) - goto out; - - if (!cg_build_path_locked(cg->name, cgrp_ctrl_path, cg_mount_table[i].name)) - goto out; - - dir = opendir(cgrp_ctrl_path); - if (!dir) { - ret = ECGOTHER; - goto out; - } - - while ((ctrl_dir = readdir(dir)) != NULL) { - /* Skip over non regular files */ - if (ctrl_dir->d_type != DT_REG) - continue; - - ret = cgroup_fill_cgc(ctrl_dir, cg, cgc, i); - if (ret == ECGFAIL) - goto out; - - if (cgc->index > 0) { - cgc->values[cgc->index - 1]->dirty = false; - - /* - * previous versions of cgget indented the second - * and all subsequent lines. Continue that behavior - */ - if (strchr(cgc->values[cgc->index - 1]->value, '\n')) { - ret = indent_multiline_value( - cgc->values[cgc->index - 1]); - if (ret) - goto out; - } - } - } - -out: - if (dir) - closedir(dir); - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} - -static int get_controller_values(struct cgroup * const cg, struct cgroup_controller * const cgc) -{ - int ret = 0; - int i; - - for (i = 0; i < cgc->index; i++) { - ret = get_cv_value(cgc->values[i], cg->name, cgc->name); - if (ret) - goto out; - } - - if (cgc->index == 0) { - /* fill the entire controller since no values were provided */ - ret = fill_empty_controller(cg, cgc); - if (ret) - goto out; - } - -out: - return ret; -} - -static int get_cgroup_values(struct cgroup * const cg) -{ - int ret = 0; - int i; - - for (i = 0; i < cg->index; i++) { - ret = get_controller_values(cg, cg->controller[i]); - if (ret) - break; - } - - return ret; -} - -static int get_values(struct cgroup *cg_list[], int cg_list_len) -{ - int ret = 0; - int i; - - for (i = 0; i < cg_list_len; i++) { - ret = get_cgroup_values(cg_list[i]); - if (ret) - break; - } - - return ret; -} - -void print_control_values(const struct control_value * const cv, int mode) -{ - if (mode & MODE_SHOW_NAMES) - info("%s: ", cv->name); - - if (cv->multiline_value) - info("%s\n", cv->multiline_value); - else - info("%s\n", cv->value); -} - -void print_controller(const struct cgroup_controller * const cgc, int mode) -{ - int i; - - for (i = 0; i < cgc->index; i++) - print_control_values(cgc->values[i], mode); -} - -static void print_cgroup(const struct cgroup * const cg, int mode) -{ - int i; - - if (mode & MODE_SHOW_HEADERS) - info("%s:\n", cg->name); - - for (i = 0; i < cg->index; i++) - print_controller(cg->controller[i], mode); - - if (mode & MODE_SHOW_HEADERS) - info("\n"); -} - -static void print_cgroups(struct cgroup *cg_list[], int cg_list_len, int mode) -{ - int i; - - for (i = 0; i < cg_list_len; i++) - print_cgroup(cg_list[i], mode); -} - -int main(int argc, char *argv[]) -{ - int mode = MODE_SHOW_NAMES | MODE_SHOW_HEADERS | MODE_SYSTEMD_DELEGATE; - struct cgroup **cg_list = NULL; - int cg_list_len = 0; - int ret = 0, i; - - /* No parameter on input? */ - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - ret = parse_opts(argc, argv, &cg_list, &cg_list_len, &mode); - if (ret) - goto err; - - /* this is false always for disable-systemd */ - if (mode & MODE_SYSTEMD_DELEGATE) - cgroup_set_default_systemd_cgroup(); - - ret = get_values(cg_list, cg_list_len); - if (ret) - goto err; - - print_cgroups(cg_list, cg_list_len, mode); - -err: - for (i = 0; i < cg_list_len; i++) - cgroup_free(&(cg_list[i])); - - return ret; -} - -static int find_cgroup_mount_type(void) -{ - enum cg_setup_mode_t setup_mode; - int ret = 0; - - setup_mode = cgroup_setup_mode(); - switch(setup_mode) { - case CGROUP_MODE_LEGACY: - info("Legacy Mode (Cgroup v1 only).\n"); - break; - case CGROUP_MODE_HYBRID: - info("Hybrid mode (Cgroup v1/v2).\n"); - break; - case CGROUP_MODE_UNIFIED: - info("Unified Mode (Cgroup v2 only).\n"); - break; - default: - err("Unable to determine the Cgroup setup mode.\n"); - ret = 1; - break; - } - - return ret; -} - -static int print_controller_version(void) -{ - struct cgroup_mount_point controller; - enum cg_version_t version; - void *handle; - int ret = 0; - - /* perf_event controller is the one with the lengthiest name */ - info("%-11s\t%-7s\n", "#Controller","Version"); - ret = cgroup_get_controller_begin(&handle, &controller); - while (ret == 0) { - ret = cgroup_get_controller_version(controller.name, &version); - if (!ret) - info("%-11s\t%d\n", controller.name, version); - else - info("%-11s\t%-7s\n", controller.name, "unknown"); - - ret = cgroup_get_controller_next(&handle, &controller); - } - cgroup_get_controller_end(&handle); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgset.c b/lib/libcgroup-3.1.0/src/tools/cgset.c deleted file mode 100644 index 82f698f8360..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgset.c +++ /dev/null @@ -1,288 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include - -#define FL_RULES 1 -#define FL_COPY 2 - -enum { - COPY_FROM_OPTION = CHAR_MAX + 1 -}; - -#ifndef UNIT_TEST -static const struct option long_options[] = { - {"rule", required_argument, NULL, 'r'}, - {"help", no_argument, NULL, 'h'}, - {"copy-from", required_argument, NULL, COPY_FROM_OPTION}, - {NULL, 0, NULL, 0} -}; - -int flags; /* used input method */ - -static struct cgroup *copy_name_value_from_cgroup(char src_cg_path[FILENAME_MAX]) -{ - struct cgroup *src_cgroup; - int ret = 0; - - /* create source cgroup */ - src_cgroup = cgroup_new_cgroup(src_cg_path); - if (!src_cgroup) { - err("can't create cgroup: %s\n", cgroup_strerror(ECGFAIL)); - goto scgroup_err; - } - - /* copy the name-version values to the cgroup structure */ - ret = cgroup_get_cgroup(src_cgroup); - if (ret != 0) { - err("cgroup %s error: %s\n", src_cg_path, cgroup_strerror(ret)); - goto scgroup_err; - } - - return src_cgroup; - -scgroup_err: - cgroup_free(&src_cgroup); - - return NULL; -} - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, "); - err("try %s --help' for more information.\n", program_name); - return; - } - - info("Usage: %s [-r ] ...\n", program_name); - info(" or: %s --copy-from ...\n", program_name); - info("Set the parameters of given cgroup(s)\n"); - info(" -r, --variable Define parameter to set\n"); - info(" --copy-from Control group whose "); - info("parameters will be copied\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd "); - info("delegate hierarchy\n"); -#endif -} -#endif /* !UNIT_TEST */ - -STATIC int parse_r_flag(const char * const program_name, const char * const name_value_str, - struct control_value * const name_value) -{ - char *copy = NULL, *buf = NULL; - int ret = 0; - - buf = strchr(name_value_str, '='); - if (buf == NULL) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - copy = strdup(name_value_str); - if (copy == NULL) { - err("%s: not enough memory\n", program_name); - ret = -1; - goto err; - } - - /* parse optarg value */ - buf = strtok(copy, "="); - if (buf == NULL) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - strncpy(name_value->name, buf, FILENAME_MAX); - name_value->name[FILENAME_MAX-1] = '\0'; - - buf = strchr(name_value_str, '='); - /* - * we don't need to check the return value of strchr because we - * know there's already an '=' character in the string. - */ - buf++; - - if (strlen(buf) == 0) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - strncpy(name_value->value, buf, CG_CONTROL_VALUE_MAX); - name_value->value[CG_CONTROL_VALUE_MAX-1] = '\0'; - -err: - if (copy) - free(copy); - - return ret; -} - -#ifndef UNIT_TEST -int main(int argc, char *argv[]) -{ - int ignore_default_systemd_delegate_slice = 0; - struct control_value *name_value = NULL; - int nv_number = 0; - int nv_max = 0; - - char src_cg_path[FILENAME_MAX] = "\0"; - struct cgroup *src_cgroup = NULL; - struct cgroup *cgroup = NULL; - - int ret = 0; - int c; - - /* no parameter on input */ - if (argc < 2) { - err("Usage is %s -r relative path to cgroup>\n", argv[0]); - exit(EXIT_BADARGS); - } - - /* parse arguments */ -#ifdef WITH_SYSTEMD - while ((c = getopt_long (argc, argv, "r:hb", long_options, NULL)) != -1) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; -#else - while ((c = getopt_long (argc, argv, "r:h", long_options, NULL)) != -1) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - ret = 0; - goto err; - - case 'r': - if ((flags & FL_COPY) != 0) { - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - flags |= FL_RULES; - - /* add name-value pair to buffer (= name_value variable) */ - if (nv_number >= nv_max) { - nv_max += CG_NV_MAX; - name_value = (struct control_value *) - realloc(name_value, nv_max * sizeof(struct control_value)); - if (!name_value) { - err("%s: not enough memory\n", argv[0]); - ret = -1; - goto err; - } - } - - ret = parse_r_flag(argv[0], optarg, &name_value[nv_number]); - if (ret) - goto err; - - nv_number++; - break; - case COPY_FROM_OPTION: - if (flags != 0) { - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - flags |= FL_COPY; - strncpy(src_cg_path, optarg, FILENAME_MAX); - src_cg_path[FILENAME_MAX-1] = '\0'; - break; - default: - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - } - - /* no cgroup name */ - if (!argv[optind]) { - err("%s: no cgroup specified\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - if (flags == 0) { - err("%s: no name-value pair was set\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - /* initialize libcgroup */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* copy the name-value pairs from -r options */ - if ((flags & FL_RULES) != 0) { - src_cgroup = create_cgroup_from_name_value_pairs("tmp", name_value, nv_number); - if (src_cgroup == NULL) - goto err; - } - - /* copy the name-value from the given group */ - if ((flags & FL_COPY) != 0) { - src_cgroup = copy_name_value_from_cgroup(src_cg_path); - if (src_cgroup == NULL) - goto err; - } - - while (optind < argc) { - /* create new cgroup */ - cgroup = cgroup_new_cgroup(argv[optind]); - if (!cgroup) { - ret = ECGFAIL; - err("%s: can't add new cgroup: %s\n", argv[0], cgroup_strerror(ret)); - goto cgroup_free_err; - } - - /* copy the values from the source cgroup to new one */ - ret = cgroup_copy_cgroup(cgroup, src_cgroup); - if (ret != 0) { - err("%s: cgroup %s error: %s\n", argv[0], src_cg_path, - cgroup_strerror(ret)); - goto cgroup_free_err; - } - - /* modify cgroup based on values of the new one */ - ret = cgroup_modify_cgroup(cgroup); - if (ret) { - err("%s: cgroup modify error: %s\n", argv[0], cgroup_strerror(ret)); - goto cgroup_free_err; - } - - optind++; - cgroup_free(&cgroup); - } - -cgroup_free_err: - if (cgroup) - cgroup_free(&cgroup); - if (src_cgroup) - cgroup_free(&src_cgroup); -err: - free(name_value); - - return ret; -} -#endif /* !UNIT_TEST */ diff --git a/lib/libcgroup-3.1.0/src/tools/cgsnapshot.c b/lib/libcgroup-3.1.0/src/tools/cgsnapshot.c deleted file mode 100644 index 58de4fa2675..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgsnapshot.c +++ /dev/null @@ -1,853 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. - * Written by Ivana Hutarova Varekova - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -enum flag { - FL_LIST = 1, - FL_SILENT = 2, /* do-not show any warning/error output */ - FL_STRICT = 4, /* don show the variables which are not on allowlist */ - FL_OUTPUT = 8, /* output should be redirect to the given file */ - FL_DENY = 16, /* denylist set */ - FL_ALLOW = 32, /* allowlist set */ -}; - -#define DENYLIST_CONF "/etc/cgsnapshot_denylist.conf" -#define ALLOWLIST_CONF "/etc/cgsnapshot_allowlist.conf" - -struct deny_list_type { - char *name; /* variable name */ - struct deny_list_type *next; /* pointer to the next record */ -}; - -struct deny_list_type *deny_list; -struct deny_list_type *allow_list; - -typedef char cont_name_t[FILENAME_MAX]; - -int flags; -FILE *output_f; - -/* - * Display the usage - */ -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h' for more information.\n", program_name); - return; - } - - info("Usage: %s [-h] [-s] [-b FILE] [-w FILE] [-f FILE] [controller] [...]\n", - program_name); - info("Generate the configuration file for given controllers\n"); - info(" -b, --denylist=FILE Set the denylist"); - info(" configuration file (default %s)\n", DENYLIST_CONF); - info(" -f, --file=FILE Redirect the output to output_file\n"); - info(" -h, --help Display this help\n"); - info(" -s, --silent Ignore all warnings\n"); - info(" -t, --strict Don't show variables "); - info("which are not on the allowlist\n"); - info(" -w, --allowlist=FILE Set the allowlist "); - info("configuration file (don't used by default)\n"); -} - -/* cache values from denylist file to the list structure */ -int load_list(char *filename, struct deny_list_type **p_list) -{ - struct deny_list_type *start = NULL; - struct deny_list_type *end = NULL; - struct deny_list_type *new; - - char buf[FILENAME_MAX]; - char name[FILENAME_MAX]; - int i = 0; - FILE *fw; - int ret; - - fw = fopen(filename, "r"); - if (fw == NULL) { - err("ERROR: Failed to open file %s: %s\n", filename, strerror(errno)); - *p_list = NULL; - return 1; - } - - /* go through the configuration file and search the line */ - while (fgets(buf, FILENAME_MAX, fw) != NULL) { - buf[FILENAME_MAX-1] = '\0'; - i = 0; - - /* if the record start with # then skip it */ - while ((buf[i] == ' ') || (buf[i] == '\n')) - i++; - - if ((buf[i] == '#') || (buf[i] == '\0')) - continue; - - ret = sscanf(buf, "%s", name); - if (ret == 0) - continue; - - new = (struct deny_list_type *) malloc(sizeof(struct deny_list_type)); - if (new == NULL) { - err("ERROR: Memory allocation problem (%s)\n", strerror(errno)); - ret = 1; - goto err; - } - - new->name = strdup(name); - if (new->name == NULL) { - err("ERROR: Memory allocation problem (%s)\n", strerror(errno)); - ret = 1; - free(new); - goto err; - } - new->next = NULL; - - /* update the variables list */ - if (start == NULL) { - start = new; - end = new; - } else { - end->next = new; - end = new; - } - } - fclose(fw); - - *p_list = start; - - return 0; - -err: - fclose(fw); - new = start; - while (new != NULL) { - end = new->next; - free(new->name); - free(new); - new = end; - } - *p_list = NULL; - - return ret; -} - -/* free list structure */ -void free_list(struct deny_list_type *list) -{ - struct deny_list_type *now; - struct deny_list_type *next; - - now = list; - while (now != NULL) { - next = now->next; - free(now->name); - free(now); - now = next; - } -} - -/* - * Test whether the variable is on the list return values are: - * 1 ... was found - * 0 ... no record was found - */ -int is_on_list(char *name, struct deny_list_type *list) -{ - struct deny_list_type *record; - - record = list; - /* go through the list of all values */ - while (record != NULL) { - /* if the variable name is found */ - if (strcmp(record->name, name) == 0) { - return 1; /* return its value */ - } - record = record->next; - } - - return 0; /* the variable was not found */ -} - -/* - * Display permissions record for the given group defined by path - */ -static int display_permissions(const char *path, const char * const cg_name, - const char * const ctrl_name) -{ - char tasks_path[FILENAME_MAX]; - struct passwd *pw; - struct group *gr; - struct stat sba; - struct stat sbt; - int ret; - - /* admin permissions record */ - /* get the directory statistic */ - ret = stat(path, &sba); - if (ret) { - err("ERROR: can't read statistics about %s\n", path); - return -1; - } - - /* tasks permissions record */ - /* get tasks file statistic */ - ret = cgroup_build_tasks_procs_path(tasks_path, sizeof(tasks_path), cg_name, ctrl_name); - if (ret) { - err("ERROR: can't build tasks/procs path: %d\n", ret); - return -1; - } - - ret = stat(tasks_path, &sbt); - if (ret) { - err("ERROR: can't read statistics about %s\n", tasks_path); - return -1; - } - - if ((sba.st_uid) || (sba.st_gid) || (sbt.st_uid) || (sbt.st_gid)) { - /* - * some uid or gid is nonroot, admin permission - * tag is necessary - */ - - /* print the header */ - fprintf(output_f, "\tperm {\n"); - - /* find out the user and group name */ - pw = getpwuid(sba.st_uid); - if (pw == NULL) { - err("ERROR: can't get %d user name\n", sba.st_uid); - fprintf(output_f, "}\n}\n"); - return -1; - } - - gr = getgrgid(sba.st_gid); - if (gr == NULL) { - err("ERROR: can't get %d group name\n", sba.st_gid); - fprintf(output_f, "}\n}\n"); - return -1; - } - - /* print the admin record */ - fprintf(output_f, "\t\tadmin {\n"); - fprintf(output_f, "\t\t\tuid = %s;\n", pw->pw_name); - fprintf(output_f, "\t\t\tgid = %s;\n", gr->gr_name); - fprintf(output_f, "\t\t}\n"); - - /* find out the user and group name */ - pw = getpwuid(sbt.st_uid); - if (pw == NULL) { - err("ERROR: can't get %d user name\n", sbt.st_uid); - fprintf(output_f, "}\n}\n"); - return -1; - } - - gr = getgrgid(sbt.st_gid); - if (gr == NULL) { - err("ERROR: can't get %d group name\n", sbt.st_gid); - fprintf(output_f, "}\n}\n"); - return -1; - } - - /* print the task record */ - fprintf(output_f, "\t\ttask {\n"); - fprintf(output_f, "\t\t\ttuid = %s;\n", pw->pw_name); - fprintf(output_f, "\t\t\ttgid = %s;\n", gr->gr_name); - fprintf(output_f, "\t\t}\n"); - - fprintf(output_f, "\t}\n"); - } - - return 0; -} - -/* - * Display the control group record: - * header - * permission record - * controllers records - * tail - */ -static int display_cgroup_data(struct cgroup *group, - char controller[CG_CONTROLLER_MAX][FILENAME_MAX], - const char *group_path, int root_path_len, int first, - const char *program_name) -{ - struct cgroup_controller *group_controller = NULL; - char var_path[FILENAME_MAX]; - char *value = NULL; - char *output_name; - struct stat sb; - int bl, wl = 0; /* is on the denylist/allowlist flag */ - int nr_var = 0; - int i = 0, j; - int ret = 0; - char *name; - - /* print the group definition header */ - fprintf(output_f, "group %s {\n", group->name); - - /* for all wanted controllers display controllers tag */ - while (controller[i][0] != '\0') { - /* display the permission tags */ - ret = display_permissions(group_path, group->name, controller[i]); - if (ret) - return ret; - - group_controller = cgroup_get_controller(group, controller[i]); - if (group_controller == NULL) { - info("cannot find controller '%s' in group '%s'\n", controller[i], - group->name); - i++; - ret = -1; - continue; - } - - /* print the controller header */ - if (strncmp(controller[i], "name=", 5) == 0) - fprintf(output_f, "\t\"%s\" {\n", controller[i]); - else - fprintf(output_f, "\t%s {\n", controller[i]); - i++; - nr_var = cgroup_get_value_name_count(group_controller); - - for (j = 0; j < nr_var; j++) { - name = cgroup_get_value_name(group_controller, j); - - /* - * For the non-root groups cgconfigparser set - * permissions of variable files to 777. Thus it - * is necessary to test the permissions of variable - * files in the root group to find out whether the - * variable is writable. - */ - if (root_path_len >= FILENAME_MAX) - root_path_len = FILENAME_MAX - 1; - - strncpy(var_path, group_path, root_path_len); - var_path[root_path_len] = '\0'; - - strncat(var_path, "/", FILENAME_MAX - strlen(var_path) - 1); - var_path[FILENAME_MAX-1] = '\0'; - - strncat(var_path, name, FILENAME_MAX - strlen(var_path) - 1); - var_path[FILENAME_MAX-1] = '\0'; - - /* test whether the write permissions */ - ret = stat(var_path, &sb); - /* - * freezer.state is not in root group so ret != 0, - * but it should be listed device.list should be - * read to create device.allow input - */ - /* 0200 == S_IWUSR */ - if ((ret == 0) && ((sb.st_mode & 0200) == 0) && - (strcmp("devices.list", name) != 0)) { - /* variable is not writable */ - continue; - } - - /* - * find whether the variable is denylisted - * or allowlisted - */ - bl = is_on_list(name, deny_list); - wl = is_on_list(name, allow_list); - - /* if it is denylisted skip it and continue */ - if (bl) - continue; - - /* - * if it is not allowlisted and strict tag is used - * skip it and continue too - */ - if ((!wl) && (flags & FL_STRICT)) - continue; - - /* - * if it is not allowlisted and silent tag is not - * used write an warning - */ - if ((!wl) && !(flags & FL_SILENT) && (first)) { - err("WARNING: variable %s is neither ", name); - err("deny nor allow list\n"); - } - - output_name = name; - - /* - * deal with devices variables: - * - omit devices.deny and device.allow, - * - generate devices.{deny,allow} from - * device.list variable (deny all and then - * all device.list devices - */ - if ((strcmp("devices.deny", name) == 0) || - (strcmp("devices.allow", name) == 0)) - continue; - - if (strcmp("devices.list", name) == 0) { - output_name = "devices.allow"; - fprintf(output_f, "\t\tdevices.deny=\"a *:* rwm\";\n"); - } - - ret = cgroup_get_value_string(group_controller, name, &value); - - /* variable can not be read */ - if (ret != 0) { - ret = 0; - err("ERROR: Value of variable %s can be read\n", name); - goto err; - } - fprintf(output_f, "\t\t%s=\"%s\";\n", output_name, value); - free(value); - } - fprintf(output_f, "\t}\n"); - } - - /* tail of the record */ - fprintf(output_f, "}\n\n"); - -err: - return ret; -} - -/* - * creates the record about the hierarchies which contains - * "controller" subsystem - */ -static int display_controller_data(char controller[CG_CONTROLLER_MAX][FILENAME_MAX], - const char *program_name) -{ - char cgroup_name[FILENAME_MAX]; - struct cgroup_file_info info; - struct cgroup *group = NULL; - int prefix_len; - void *handle; - int first = 1; - int lvl; - int ret; - - /* - * start to parse the structure for the first controller - - * controller[0] attached to hierarchy - */ - ret = cgroup_walk_tree_begin(controller[0], "/", 0, &handle, &info, &lvl); - if (ret != 0) - return ret; - - prefix_len = strlen(info.full_path); - - /* go through all files and directories */ - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) == 0) { - /* some group starts here */ - if (info.type == CGROUP_FILE_TYPE_DIR) { - /* parse the group name from full_path*/ - strncpy(cgroup_name, &info.full_path[prefix_len], FILENAME_MAX); - cgroup_name[FILENAME_MAX-1] = '\0'; - - /* start to grab data about the new group */ - group = cgroup_new_cgroup(cgroup_name); - if (group == NULL) { - info("cannot create group '%s'\n", cgroup_name); - ret = ECGFAIL; - goto err; - } - - ret = cgroup_get_cgroup(group); - if (ret != 0) { - /* - * We know for sure that the cgroup exists - * but just that the cgroup v2 controller - * is not enabled in the cgroup.subtree_control - * file. - */ - if (ret != ECGROUPNOTEXIST) { - info("cannot read group '%s': %s %d\n", cgroup_name, - cgroup_strerror(ret), ret); - goto err; - } - } - - if (ret == 0) - display_cgroup_data(group, controller, info.full_path, prefix_len, - first, program_name); - first = 0; - cgroup_free(&group); - } - } - -err: - cgroup_walk_tree_end(&handle); - if (ret == ECGEOF) - ret = 0; - - return ret; -} - -static int is_ctlr_on_list(char controllers[CG_CONTROLLER_MAX][FILENAME_MAX], - cont_name_t wanted_conts[CG_CONTROLLER_MAX]) -{ - char tmp_controllers[CG_CONTROLLER_MAX][FILENAME_MAX]; - int i = 0, j = 0, k = 0; - int ret = 0; - - while (controllers[i][0] != '\0') { - while (wanted_conts[j][0] != '\0') { - if (strcmp(controllers[i], wanted_conts[j]) == 0) { - strncpy(tmp_controllers[k], wanted_conts[j], FILENAME_MAX - 1); - (tmp_controllers[k])[FILENAME_MAX - 1] = '\0'; - k++; - } - j++; - } - j = 0; - i++; - } - - (tmp_controllers[k])[0] = '\0'; - - /* Lets reset the controllers to intersection of controller ∩ wanted_conts */ - for (i = 0; tmp_controllers[i][0] != '\0'; i++) { - /* - * gcc complains about truncation when using snprintf() and - * and coverity complains about truncation when using strncpy(). - * Avoid both these warnings by directly invoking memcpy() - */ - memcpy(controllers[i], tmp_controllers[i], sizeof(controllers[i])); - ret = 1; - } - (controllers[i])[0] = '\0'; - - return ret; -} - - -/* print data about input cont_name controller */ -static int parse_controllers(cont_name_t cont_names[CG_CONTROLLER_MAX], const char *program_name) -{ - char controllers[CG_CONTROLLER_MAX][FILENAME_MAX] = {"\0"}; - struct cgroup_mount_point controller; - char path[FILENAME_MAX]; - void *handle; - int ret = 0; - int max = 0; - - path[0] = '\0'; - - ret = cgroup_get_controller_begin(&handle, &controller); - - /* go through the list of controllers/mount point pairs */ - while (ret == 0) { - if (strcmp(path, controller.path) == 0) { - /* - * if it is still the same mount point - * - * note that the last entry in controllers[][] must be '\0', so - * we need to stop populating the array at CG_CONTROLLER_MAX - 1 - */ - if (max < CG_CONTROLLER_MAX - 1) { - strncpy(controllers[max], controller.name, FILENAME_MAX); - (controllers[max])[FILENAME_MAX-1] = '\0'; - max++; - } - } else { - /* we got new mount point, print it if needed */ - if ((!(flags & FL_LIST) || (is_ctlr_on_list(controllers, cont_names))) && - (max != 0 && max < CG_CONTROLLER_MAX)) { - (controllers[max])[0] = '\0'; - ret = display_controller_data(controllers, program_name); - if (ret) - goto err; - } - - strncpy(controllers[0], controller.name, FILENAME_MAX); - (controllers[0])[FILENAME_MAX-1] = '\0'; - - strncpy(path, controller.path, FILENAME_MAX); - path[FILENAME_MAX-1] = '\0'; - max = 1; - } - - /* the actual controller should not be printed */ - ret = cgroup_get_controller_next(&handle, &controller); - } - - if ((!(flags & FL_LIST) || (is_ctlr_on_list(controllers, cont_names))) && - (max != 0 && max < CG_CONTROLLER_MAX)) { - (controllers[max])[0] = '\0'; - ret = display_controller_data(controllers, program_name); - } - -err: - cgroup_get_controller_end(&handle); - if (ret != ECGEOF) - return ret; - - return 0; -} - -static int show_mountpoints(const char *controller) -{ - char path[FILENAME_MAX]; - int quote = 0; - void *handle; - int ret; - - if (strncmp(controller, "name=", 5) == 0) - quote = 1; - - ret = cgroup_get_subsys_mount_point_begin(controller, &handle, path); - if (ret) - return ret; - - while (ret == 0) { - if (quote) - fprintf(output_f, "\t\"%s\" = %s;\n", controller, path); - else - fprintf(output_f, "\t%s = %s;\n", controller, path); - ret = cgroup_get_subsys_mount_point_next(&handle, path); - } - cgroup_get_subsys_mount_point_end(&handle); - - if (ret != ECGEOF) - return ret; - - return 0; -} - -/* - * parse whether data about given controller "name" should be displayed. - * If yes then the data are printed. "cont_names" is list of controllers - * which should be shown. - */ -static void parse_mountpoint(cont_name_t cont_names[CG_CONTROLLER_MAX], char *name) -{ - int i; - - /* if there is no controller list show all mounted controllers */ - if (!(flags & FL_LIST)) { - if (show_mountpoints(name)) { - /* the controller is not mounted */ - if ((flags & FL_SILENT) == 0) - err("ERROR: %s hierarchy not mounted\n", name); - } - return; - } - - /* there is controller list - show wanted mounted controllers only */ - for (i = 0; i <= CG_CONTROLLER_MAX-1; i++) { - if (!strncmp(cont_names[i], name, strlen(name)+1)) { - /* controller is on the list */ - if (show_mountpoints(name)) { - /* the controller is not mounted */ - if ((flags & FL_SILENT) == 0) { - err("ERROR: %s hierarchy not mounted\n", name); - } - break; - } - break; - } - } -} - -/* print data about input mount points */ -static int parse_mountpoints(cont_name_t cont_names[CG_CONTROLLER_MAX], const char *program_name) -{ - struct cgroup_mount_point mount; - struct controller_data info; - int ret, final_ret = 0; - void *handle; - - /* start mount section */ - fprintf(output_f, "mount {\n"); - - /* go through the controller list */ - ret = cgroup_get_all_controller_begin(&handle, &info); - while (ret == 0) { - - /* the controller attached to some hierarchy */ - if (info.hierarchy != 0) - parse_mountpoint(cont_names, info.name); - - /* next controller */ - ret = cgroup_get_all_controller_next(&handle, &info); - } - - if (ret != ECGEOF) { - if ((flags & FL_SILENT) != 0) { - err("E: in get next controller %s\n", cgroup_strerror(ret)); - } - final_ret = ret; - } - - cgroup_get_all_controller_end(&handle); - - /* process also named hierarchies */ - ret = cgroup_get_controller_begin(&handle, &mount); - while (ret == 0) { - if (strncmp(mount.name, "name=", 5) == 0) - parse_mountpoint(cont_names, mount.name); - ret = cgroup_get_controller_next(&handle, &mount); - } - - if (ret != ECGEOF) { - if ((flags & FL_SILENT) != 0) { - err("E: in get next controller %s\n", cgroup_strerror(ret)); - } - final_ret = ret; - } - - cgroup_get_controller_end(&handle); - - /* finish mount section */ - fprintf(output_f, "}\n\n"); - - return final_ret; -} - -int main(int argc, char *argv[]) -{ - static struct option long_opts[] = { - {"help", no_argument, NULL, 'h'}, - {"silent", no_argument, NULL, 's'}, - {"denylist", required_argument, NULL, 'b'}, - {"allowlist", required_argument, NULL, 'w'}, - {"strict", no_argument, NULL, 't'}, - {"file", required_argument, NULL, 'f'}, - {0, 0, 0, 0} - }; - - cont_name_t wanted_cont[CG_CONTROLLER_MAX]; - char bl_file[FILENAME_MAX]; /* denylist file name */ - char wl_file[FILENAME_MAX]; /* allowlist file name */ - int ret = 0, err; - int c_number = 0; - int c, i; - - for (i = 0; i < CG_CONTROLLER_MAX; i++) - wanted_cont[i][0] = '\0'; - - flags = 0; - - /* parse arguments */ - while ((c = getopt_long(argc, argv, "hsb:w:tf:", long_opts, NULL)) > 0) { - switch (c) { - case 'h': - usage(0, argv[0]); - return 0; - case 's': - flags |= FL_SILENT; - break; - case 'b': - flags |= FL_DENY; - strncpy(bl_file, optarg, FILENAME_MAX); - bl_file[FILENAME_MAX-1] = '\0'; - break; - case 'w': - flags |= FL_ALLOW; - strncpy(wl_file, optarg, FILENAME_MAX); - wl_file[FILENAME_MAX-1] = '\0'; - break; - case 't': - flags |= FL_STRICT; - break; - case 'f': - flags |= FL_OUTPUT; - output_f = fopen(optarg, "w"); - if (output_f == NULL) { - err("%s: Failed to open file %s\n", argv[0], optarg); - return ECGOTHER; - } - break; - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - } - - /* read the list of controllers */ - while (optind < argc) { - flags |= FL_LIST; - strncpy(wanted_cont[c_number], argv[optind], FILENAME_MAX); - (wanted_cont[c_number])[FILENAME_MAX-1] = '\0'; - c_number++; - optind++; - if (optind == CG_CONTROLLER_MAX-1) { - err("too many parameters\n"); - break; - } - } - - if ((flags & FL_OUTPUT) == 0) - output_f = stdout; - - /* denylist */ - if (flags & FL_DENY) { - ret = load_list(bl_file, &deny_list); - } else { - /* load the denylist from the default location */ - ret = load_list(DENYLIST_CONF, &deny_list); - } - if (ret != 0) { - ret = EXIT_BADARGS; - goto finish; - } - - /* allowlist */ - if (flags & FL_ALLOW) - ret = load_list(wl_file, &allow_list); - if (ret != 0) { - ret = EXIT_BADARGS; - goto finish; - } - - /* print the header */ - fprintf(output_f, "# Configuration file generated by cgsnapshot\n"); - - /* initialize libcgroup */ - ret = cgroup_init(); - if (ret) - /* empty configuration file */ - goto finish; - - /* print mount points section */ - ret = parse_mountpoints(wanted_cont, argv[0]); - ret = ret ? EXIT_BADARGS : 0; - /* continue with processing on error*/ - - /* print hierarchies section */ - /* replace error from parse_mountpoints() only with another error */ - err = parse_controllers(wanted_cont, argv[0]); - if (err) - ret = err; - -finish: - free_list(deny_list); - free_list(allow_list); - - if (output_f != stdout) - fclose(output_f); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/cgxget.c b/lib/libcgroup-3.1.0/src/tools/cgxget.c deleted file mode 100644 index cc84abcd244..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgxget.c +++ /dev/null @@ -1,939 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup extended cgxget. Works with both cgroup v1 and v2 - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ -#include "tools-common.h" -#include "abstraction-common.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -#define MODE_SHOW_HEADERS 1 -#define MODE_SHOW_NAMES 2 -#define MODE_SYSTEMD_DELEGATE 4 - -#define LL_MAX 100 - -#ifndef LIBCG_LIB -static const struct option long_options[] = { - {"v1", no_argument, NULL, '1'}, - {"v2", no_argument, NULL, '2'}, - {"ignore-unmappable", no_argument, NULL, 'i'}, - {"variable", required_argument, NULL, 'r'}, - {"help", no_argument, NULL, 'h'}, - {"all", no_argument, NULL, 'a'}, - {"values-only", no_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} -}; - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h' for more information.\n", program_name); - return; - } - - info("Usage: %s [-nv] [-r ] [-g ] [-a] ...\n", program_name); - info(" or: %s [-nv] [-r ] -g : ...\n", program_name); - info("Print parameter(s) of given group(s).\n"); - info(" -1, --v1 Provided parameters are in v1 format\n"); - info(" -2, --v2 Provided parameters are in v2 format\n"); - info(" -i, --ignore-unmappable Do not return an error for "); - info("settings that cannot be converted\n"); - info(" -a, --all Print info about all relevant controllers\n"); - info(" -g Controller which info should be displayed\n"); - info(" -g : Control group which info should be displayed\n"); - info(" -h, --help Display this help\n"); - info(" -n Do not print headers\n"); - info(" -r, --variable Define parameter to display\n"); - info(" -v, --values-only Print only values, not parameter names\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); -#endif -} - -static int get_controller_from_name(const char * const name, char **controller) -{ - char *dot; - - *controller = strdup(name); - if (*controller == NULL) - return ECGOTHER; - - dot = strchr(*controller, '.'); - if (dot == NULL) { - err("cgxget: error parsing parameter name\n '%s'", name); - return ECGINVAL; - } - *dot = '\0'; - - return 0; -} - -static int create_cg(struct cgroup **cg_list[], int * const cg_list_len) -{ - *cg_list = realloc(*cg_list, ((*cg_list_len) + 1) * sizeof(struct cgroup *)); - if ((*cg_list) == NULL) - return ECGCONTROLLERCREATEFAILED; - - memset(&(*cg_list)[*cg_list_len], 0, sizeof(struct cgroup *)); - - (*cg_list)[*cg_list_len] = cgroup_new_cgroup(""); - if ((*cg_list)[*cg_list_len] == NULL) - return ECGCONTROLLERCREATEFAILED; - - (*cg_list_len)++; - - return 0; -} - -static int parse_a_flag(struct cgroup **cg_list[], int * const cg_list_len) -{ - struct cgroup_mount_point controller; - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - void *handle; - int ret = 0; - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-r" was provided, then we know that the cgroup(s) will be - * an optarg at the end with no flag. Let's temporarily populate - * the first cgroup with the requested control values. - */ - cg = (*cg_list)[0]; - - ret = cgroup_get_controller_begin(&handle, &controller); - while (ret == 0) { - cgc = cgroup_get_controller(cg, controller.name); - if (!cgc) { - cgc = cgroup_add_controller(cg, controller.name); - if (!cgc) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - } - - ret = cgroup_get_controller_next(&handle, &controller); - } - if (ret == ECGEOF) - /* - * we successfully reached the end of the controller list; - * this is not an error - */ - ret = 0; - - cgroup_get_controller_end(&handle); - - return ret; - -out: - cgroup_get_controller_end(&handle); - - return ret; -} - -static int parse_r_flag(struct cgroup **cg_list[], int * const cg_list_len, - const char * const cntl_value) -{ - char *cntl_value_controller = NULL; - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - int ret = 0; - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-r" was provided, then we know that the cgroup(s) will be - * an optarg at the end with no flag. Let's temporarily populate - * the first cgroup with the requested control values. - */ - cg = (*cg_list)[0]; - - ret = get_controller_from_name(cntl_value, &cntl_value_controller); - if (ret) - goto out; - - cgc = cgroup_get_controller(cg, cntl_value_controller); - if (!cgc) { - cgc = cgroup_add_controller(cg, cntl_value_controller); - if (!cgc) { - err("cgxget: cannot find controller '%s'\n", cntl_value_controller); - ret = ECGOTHER; - goto out; - } - } - - ret = cgroup_add_value_string(cgc, cntl_value, NULL); - -out: - if (cntl_value_controller) - free(cntl_value_controller); - - return ret; -} - -static int parse_g_flag_no_colon(struct cgroup **cg_list[], int * const cg_list_len, - const char * const ctrl_str) -{ - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - int ret = 0; - - if ((*cg_list_len) > 1) { - ret = ECGMAXVALUESEXCEEDED; - goto out; - } - - if ((*cg_list_len) == 0) { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - } - - /* - * if "-g " was provided, then we know that the - * cgroup(s) will be an optarg at the end with no flag. - * Let's temporarily populate the first cgroup with the requested - * control values. - */ - cg = *cg_list[0]; - - cgc = cgroup_get_controller(cg, ctrl_str); - if (!cgc) { - cgc = cgroup_add_controller(cg, ctrl_str); - if (!cgc) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - } - -out: - return ret; -} - -static int split_cgroup_name(const char * const ctrl_str, char *cg_name) -{ - char *colon; - - colon = strchr(ctrl_str, ':'); - if (colon == NULL) { - /* ctrl_str doesn't contain a ":" */ - cg_name[0] = '\0'; - return ECGINVAL; - } - - strncpy(cg_name, &colon[1], FILENAME_MAX - 1); - - return 0; -} - -static int split_controllers(const char * const in, char **ctrl[], int * const ctrl_len) -{ - char *copy, *tok, *colon, *saveptr = NULL; - int ret = 0; - char **tmp; - - copy = strdup(in); - if (!copy) - goto out; - saveptr = copy; - - colon = strchr(copy, ':'); - if (colon) - colon[0] = '\0'; - - while ((tok = strtok_r(copy, ",", ©))) { - tmp = realloc(*ctrl, sizeof(char *) * ((*ctrl_len) + 1)); - if (!tmp) { - ret = ECGOTHER; - goto out; - } - - *ctrl = tmp; - (*ctrl)[*ctrl_len] = strdup(tok); - if ((*ctrl)[*ctrl_len] == NULL) { - ret = ECGOTHER; - goto out; - } - - (*ctrl_len)++; - } - -out: - if (saveptr) - free(saveptr); - - return ret; -} - -static int parse_g_flag_with_colon(struct cgroup **cg_list[], int * const cg_list_len, - const char * const ctrl_str) -{ - struct cgroup_controller *cgc; - struct cgroup *cg = NULL; - char **controllers = NULL; - int controllers_len = 0; - int i, ret = 0; - - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - - cg = (*cg_list)[(*cg_list_len) - 1]; - - ret = split_cgroup_name(ctrl_str, cg->name); - if (ret) - goto out; - - ret = split_controllers(ctrl_str, &controllers, &controllers_len); - if (ret) - goto out; - - for (i = 0; i < controllers_len; i++) { - cgc = cgroup_get_controller(cg, controllers[i]); - if (!cgc) { - cgc = cgroup_add_controller(cg, controllers[i]); - if (!cgc) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - } - } - -out: - for (i = 0; i < controllers_len; i++) - free(controllers[i]); - - return ret; -} - -static int parse_opt_args(int argc, char *argv[], struct cgroup **cg_list[], - int * const cg_list_len, bool first_cg_is_dummy) -{ - struct cgroup *cg = NULL; - int ret = 0; - - /* - * The first cgroup was temporarily populated and requires the - * user to provide a cgroup name as an opt - */ - if (argv[optind] == NULL && first_cg_is_dummy) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - /* - * The user has provided a cgroup and controller via the - * -g : flag and has also provided a cgroup - * via the optind. This was not supported by the previous - * cgget implementation. Continue that approach. - * - * Example of a command that will hit this code: - * $ cgxget -g cpu:mycgroup mycgroup - */ - if (argv[optind] != NULL && (*cg_list_len) > 0 && strcmp((*cg_list)[0]->name, "") != 0) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - while (argv[optind] != NULL) { - if ((*cg_list_len) > 0) - cg = (*cg_list)[(*cg_list_len) - 1]; - else - cg = NULL; - - if ((*cg_list_len) == 0) { - /* - * The user didn't provide a '-r' or '-g' flag. - * The parse_a_flag() function can be reused here - * because we both have the same use case - gather - * all the data about this particular cgroup. - */ - ret = parse_a_flag(cg_list, cg_list_len); - if (ret) - goto out; - - strncpy((*cg_list)[(*cg_list_len) - 1]->name, argv[optind], - sizeof((*cg_list)[(*cg_list_len) - 1]->name) - 1); - } else if (cg != NULL && strlen(cg->name) == 0) { - /* - * this cgroup was created based upon control/value - * pairs or with a -g option. we'll - * populate it with the parameter provided by the user - */ - strncpy(cg->name, argv[optind], sizeof(cg->name) - 1); - } else { - ret = create_cg(cg_list, cg_list_len); - if (ret) - goto out; - - ret = cgroup_copy_cgroup((*cg_list)[(*cg_list_len) - 1], - (*cg_list)[(*cg_list_len) - 2]); - if (ret) - goto out; - - strncpy((*cg_list)[(*cg_list_len) - 1]->name, argv[optind], - sizeof((*cg_list)[(*cg_list_len) - 1]->name) - 1); - } - - optind++; - } - -out: - return ret; -} - -static int parse_opts(int argc, char *argv[], struct cgroup **cg_list[], int * const cg_list_len, - int * const mode, enum cg_version_t * const version, - bool * const ignore_unmappable) -{ - bool do_not_fill_controller = false; - bool first_cgroup_is_dummy = false; - bool fill_controller = false; - int ret = 0; - int c; - - /* Parse arguments. */ -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "r:hnvg:a12ib", long_options, NULL)) > 0) { - switch (c) { - case 'b': - *mode = (*mode) & (INT_MAX ^ MODE_SYSTEMD_DELEGATE); - break; -#else - while ((c = getopt_long(argc, argv, "r:hnvg:a12i", long_options, NULL)) > 0) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - exit(0); - case 'n': - /* Do not show headers. */ - *mode = (*mode) & (INT_MAX ^ MODE_SHOW_HEADERS); - break; - case 'v': - /* Do not show parameter names. */ - *mode = (*mode) & (INT_MAX ^ MODE_SHOW_NAMES); - break; - case 'r': - do_not_fill_controller = true; - first_cgroup_is_dummy = true; - ret = parse_r_flag(cg_list, cg_list_len, optarg); - if (ret) - goto err; - break; - case 'g': - fill_controller = true; - if (strchr(optarg, ':') == NULL) { - first_cgroup_is_dummy = true; - ret = parse_g_flag_no_colon(cg_list, cg_list_len, optarg); - if (ret) - goto err; - } else { - ret = parse_g_flag_with_colon(cg_list, cg_list_len, optarg); - if (ret) - goto err; - } - break; - case 'a': - fill_controller = true; - ret = parse_a_flag(cg_list, cg_list_len); - if (ret) - goto err; - break; - case '1': - *version = CGROUP_V1; - break; - case '2': - *version = CGROUP_V2; - break; - case 'i': - *ignore_unmappable = true; - break; - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - } - - /* Don't allow '-r' and ('-g' or '-a') */ - if (fill_controller && do_not_fill_controller) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - ret = parse_opt_args(argc, argv, cg_list, cg_list_len, first_cgroup_is_dummy); - if (ret) - goto err; - -err: - return ret; -} -#endif /* !LIBCG_LIB */ - -static int get_cv_value(struct control_value * const cv, const char * const cg_name, - const char * const controller_name) -{ - bool is_multiline = false; - char tmp_line[LL_MAX]; - void *handle, *tmp; - int ret; - - ret = cgroup_read_value_begin(controller_name, cg_name, cv->name, &handle, tmp_line, - LL_MAX); - if (ret == ECGEOF) - goto read_end; - if (ret != 0) { - if (ret == ECGOTHER) { - int tmp_ret; - - /* - * to maintain compatibility with an earlier - * version of cgget, try to determine if the - * failure was due to an invalid controller - */ - tmp_ret = cgroup_test_subsys_mounted(controller_name); - if (tmp_ret == 0) { - err("cgxget: cannot find controller '%s' in group '%s'\n", - controller_name, cg_name); - } else { - err("variable file read failed %s\n", cgroup_strerror(ret)); - } - } - - goto end; - } - - /* remove the newline character */ - tmp_line[strcspn(tmp_line, "\n")] = '\0'; - - strncpy(cv->value, tmp_line, CG_CONTROL_VALUE_MAX - 1); - cv->multiline_value = strdup(cv->value); - if (cv->multiline_value == NULL) - goto read_end; - - while ((ret = cgroup_read_value_next(&handle, tmp_line, LL_MAX)) == 0) { - if (ret == 0) { - is_multiline = true; - cv->value[0] = '\0'; - - /* remove the newline character */ - tmp_line[strcspn(tmp_line, "\n")] = '\0'; - - tmp = realloc(cv->multiline_value, sizeof(char) * - (strlen(cv->multiline_value) + strlen(tmp_line) + 3)); - if (tmp == NULL) - goto read_end; - - cv->multiline_value = tmp; - strcat(cv->multiline_value, "\n\t"); - strcat(cv->multiline_value, tmp_line); - } - } - -read_end: - cgroup_read_value_end(&handle); - if (ret == ECGEOF) - ret = 0; -end: - if (is_multiline == false && cv->multiline_value) { - free(cv->multiline_value); - cv->multiline_value = NULL; - } - - return ret; -} - -static int indent_multiline_value(struct control_value * const cv) -{ - char tmp_val[CG_CONTROL_VALUE_MAX] = {0}; - char *tok, *saveptr = NULL; - - tok = strtok_r(cv->value, "\n", &saveptr); - strncat(tmp_val, tok, CG_CONTROL_VALUE_MAX - 1); - /* don't indent the first value */ - while ((tok = strtok_r(NULL, "\n", &saveptr))) { - strncat(tmp_val, "\n\t", (CG_CONTROL_VALUE_MAX - (strlen(tmp_val) + 1))); - strncat(tmp_val, tok, (CG_CONTROL_VALUE_MAX - (strlen(tmp_val) + 1))); - } - - cv->multiline_value = strdup(tmp_val); - if (!cv->multiline_value) - return ECGOTHER; - - return 0; -} - -static int fill_empty_controller(struct cgroup * const cg, struct cgroup_controller * const cgc) -{ - char cgrp_ctrl_path[FILENAME_MAX] = { '\0' }; - char mnt_path[FILENAME_MAX] = { '\0' }; -#ifdef WITH_SYSTEMD - char tmp[FILENAME_MAX] = { '\0' }; -#endif - struct dirent *ctrl_dir = NULL; - int i, mnt_path_len, ret = 0; - bool found_mount = false; - DIR *dir = NULL; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - - for (i = 0; i < CG_CONTROLLER_MAX && - cg_mount_table[i].name[0] != '\0'; i++) { - - if (strlen(cgc->name) == strlen(cg_mount_table[i].name) && - strncmp(cgc->name, cg_mount_table[i].name, strlen(cgc->name)) == 0) { - found_mount = true; - break; - } - } - - if (found_mount == false) - goto out; - - if (!cg_build_path_locked(NULL, mnt_path, cg_mount_table[i].name)) - goto out; - - mnt_path_len = strlen(mnt_path); -#ifdef WITH_SYSTEMD - /* - * If the user has set a slice/scope as setdefault in the - * cgconfig.conf file, every path constructed will have the - * systemd_default_cgroup slice/scope suffixed to it. - * - * We need to trim the slice/scope from the path, incase of - * user providing / as the cgroup name in the command - * line: - * cgxget -1 -r cpu.shares /a - */ - - if (cg->name[0] == '/' && cg->name[1] != '\0' && - strncmp(mnt_path + (mnt_path_len - 7), ".scope/", 7) == 0) { - snprintf(tmp, FILENAME_MAX, "%s", dirname(mnt_path)); - strncpy(mnt_path, tmp, FILENAME_MAX - 1); - mnt_path[FILENAME_MAX - 1] = '\0'; - - mnt_path_len = strlen(mnt_path); - if (strncmp(mnt_path + (mnt_path_len - 6), ".slice", 6) == 0) { - snprintf(tmp, FILENAME_MAX, "%s", dirname(mnt_path)); - strncpy(mnt_path, tmp, FILENAME_MAX - 1); - mnt_path[FILENAME_MAX - 1] = '\0'; - } else { - cgroup_dbg("Malformed path %s (expected slice name)\n", mnt_path); - ret = ECGOTHER; - goto out; - } - } -#endif - strncat(mnt_path, cg->name, FILENAME_MAX - mnt_path_len - 1); - mnt_path[sizeof(mnt_path) - 1] = '\0'; - - if (access(mnt_path, F_OK)) - goto out; - - if (!cg_build_path_locked(cg->name, cgrp_ctrl_path, cg_mount_table[i].name)) - goto out; - - dir = opendir(cgrp_ctrl_path); - if (!dir) { - ret = ECGOTHER; - goto out; - } - - while ((ctrl_dir = readdir(dir)) != NULL) { - /* Skip over non regular files */ - if (ctrl_dir->d_type != DT_REG) - continue; - - ret = cgroup_fill_cgc(ctrl_dir, cg, cgc, i); - if (ret == ECGFAIL) - goto out; - - if (cgc->index > 0) { - cgc->values[cgc->index - 1]->dirty = false; - - /* - * previous versions of cgget indented the second - * and all subsequent lines. Continue that behavior - */ - if (strchr(cgc->values[cgc->index - 1]->value, '\n')) { - ret = indent_multiline_value(cgc->values[cgc->index - 1]); - if (ret) - goto out; - } - } - } - -out: - if (dir) - closedir(dir); - - pthread_rwlock_unlock(&cg_mount_table_lock); - - return ret; -} - -static int get_controller_values(struct cgroup * const cg, struct cgroup_controller * const cgc) -{ - int ret = 0; - int i; - - for (i = 0; i < cgc->index; i++) { - ret = get_cv_value(cgc->values[i], cg->name, cgc->name); - if (ret) - goto out; - } - - if (cgc->index == 0) { - /* fill the entire controller since no values were provided */ - ret = fill_empty_controller(cg, cgc); - if (ret) - goto out; - } - -out: - return ret; -} - -static int get_cgroup_values(struct cgroup * const cg) -{ - int ret = 0; - int i; - - for (i = 0; i < cg->index; i++) { - ret = get_controller_values(cg, cg->controller[i]); - if (ret) - break; - } - - return ret; -} - -#ifndef LIBCG_LIB -static int get_values(struct cgroup *cg_list[], int cg_list_len) -{ - int ret = 0; - int i; - - for (i = 0; i < cg_list_len; i++) { - ret = get_cgroup_values(cg_list[i]); - if (ret) - break; - } - - return ret; -} - -static void print_control_values(const struct control_value * const cv, int mode) -{ - if (mode & MODE_SHOW_NAMES) - info("%s: ", cv->name); - - if (cv->multiline_value) - info("%s\n", cv->multiline_value); - else - info("%s\n", cv->value); -} - -static void print_controller(const struct cgroup_controller * const cgc, int mode) -{ - int i; - - for (i = 0; i < cgc->index; i++) - print_control_values(cgc->values[i], mode); -} - -static void print_cgroup(const struct cgroup * const cg, int mode) -{ - int i; - - if (mode & MODE_SHOW_HEADERS) - info("%s:\n", cg->name); - - for (i = 0; i < cg->index; i++) - print_controller(cg->controller[i], mode); - - if (mode & MODE_SHOW_HEADERS) - info("\n"); -} - -static void print_cgroups(struct cgroup *cg_list[], int cg_list_len, int mode) -{ - int i; - - for (i = 0; i < cg_list_len; i++) - print_cgroup(cg_list[i], mode); -} - -static int convert_cgroups(struct cgroup **cg_list[], int cg_list_len, - enum cg_version_t in_version, enum cg_version_t out_version) -{ - struct cgroup **cg_converted_list; - int i = 0, j, ret = 0; - - cg_converted_list = malloc(cg_list_len * sizeof(struct cgroup *)); - if (cg_converted_list == NULL) - goto out; - - for (i = 0; i < cg_list_len; i++) { - cg_converted_list[i] = cgroup_new_cgroup((*cg_list)[i]->name); - if (cg_converted_list[i] == NULL) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - - ret = cgroup_convert_cgroup(cg_converted_list[i], out_version, (*cg_list)[i], - in_version); - if (ret) - goto out; - } - -out: - if (ret != 0 && ret != ECGNOVERSIONCONVERT) { - /* The conversion failed */ - for (j = 0; j < i; j++) - cgroup_free(&(cg_converted_list[j])); - free(cg_converted_list); - } else { - /* - * The conversion succeeded or was unmappable. - * Free the old list. - */ - for (i = 0; i < cg_list_len; i++) - cgroup_free(&(*cg_list)[i]); - - *cg_list = cg_converted_list; - } - - return ret; -} - -int main(int argc, char *argv[]) -{ - int mode = MODE_SHOW_NAMES | MODE_SHOW_HEADERS | MODE_SYSTEMD_DELEGATE; - enum cg_version_t version = CGROUP_UNK; - struct cgroup **cg_list = NULL; - bool ignore_unmappable = false; - int cg_list_len = 0; - int ret = 0, i; - - /* No parameter on input? */ - if (argc < 2) { - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - ret = parse_opts(argc, argv, &cg_list, &cg_list_len, &mode, &version, &ignore_unmappable); - if (ret) - goto err; - - /* this is false always for disable-systemd */ - if (mode & MODE_SYSTEMD_DELEGATE) - cgroup_set_default_systemd_cgroup(); - - ret = convert_cgroups(&cg_list, cg_list_len, version, CGROUP_DISK); - if ((ret && ret != ECGNOVERSIONCONVERT) || - (ret == ECGNOVERSIONCONVERT && !ignore_unmappable)) - /* - * If the user not has specified that we ignore any errors - * due to being unable to map from v1 to v2 or vice versa, - * return error, else ignore the error and continue. - */ - goto err; - - ret = get_values(cg_list, cg_list_len); - if (ret) - goto err; - - ret = convert_cgroups(&cg_list, cg_list_len, CGROUP_DISK, version); - if (ret) - goto err; - - print_cgroups(cg_list, cg_list_len, mode); - -err: - for (i = 0; i < cg_list_len; i++) - cgroup_free(&(cg_list[i])); - - return ret; -} -#endif /* !LIBCG_LIB */ - -#ifdef LIBCG_LIB -int cgroup_cgxget(struct cgroup **cg, enum cg_version_t version, bool ignore_unmappable) -{ - struct cgroup *disk_cg, *out_cg; - int ret; - - if (!cg || !(*cg)) { - ret = ECGINVAL; - goto out; - } - - disk_cg = cgroup_new_cgroup((*cg)->name); - if (!disk_cg) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - - ret = cgroup_convert_cgroup(disk_cg, CGROUP_DISK, *cg, version); - if (ret == ECGNOVERSIONCONVERT && ignore_unmappable) - ret = 0; - else if (ret) - goto out; - - ret = get_cgroup_values(disk_cg); - if (ret) - goto out; - - out_cg = cgroup_new_cgroup((*cg)->name); - if (!out_cg) { - ret = ECGCONTROLLERCREATEFAILED; - goto out; - } - - ret = cgroup_convert_cgroup(out_cg, version, disk_cg, CGROUP_DISK); - if (ret) { - cgroup_free(&out_cg); - goto out; - } - - cgroup_free(cg); - *cg = out_cg; - -out: - if (disk_cg) - cgroup_free(&disk_cg); - - return ret; -} -#endif /* LIBCG_LIB */ diff --git a/lib/libcgroup-3.1.0/src/tools/cgxset.c b/lib/libcgroup-3.1.0/src/tools/cgxset.c deleted file mode 100644 index e5eba5284c4..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/cgxset.c +++ /dev/null @@ -1,380 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Libcgroup extended cgxset. Works with both cgroup v1 and v2 - * - * Copyright (c) 2021-2022 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ -#include "tools-common.h" -#include "abstraction-common.h" - -#include -#include - -#include -#include -#include -#include -#include - -#define FL_RULES 1 -#define FL_COPY 2 - -enum { - COPY_FROM_OPTION = CHAR_MAX + 1 -}; - -#ifndef UNIT_TEST -static const struct option long_options[] = { - {"v1", no_argument, NULL, '1'}, - {"v2", no_argument, NULL, '2'}, - {"ignore-unmappable", no_argument, NULL, 'i'}, - {"rule", required_argument, NULL, 'r'}, - {"help", no_argument, NULL, 'h'}, - {"copy-from", required_argument, NULL, COPY_FROM_OPTION}, - {NULL, 0, NULL, 0} -}; - -int flags; /* used input method */ - -static struct cgroup *copy_name_value_from_cgroup(char src_cg_path[FILENAME_MAX]) -{ - struct cgroup *src_cgroup; - int ret = 0; - - /* create source cgroup */ - src_cgroup = cgroup_new_cgroup(src_cg_path); - if (!src_cgroup) { - err("can't create cgroup: %s\n", cgroup_strerror(ECGFAIL)); - goto scgroup_err; - } - - /* copy the name-version values to the cgroup structure */ - ret = cgroup_get_cgroup(src_cgroup); - if (ret != 0) { - err("cgroup %s error: %s\n", src_cg_path, cgroup_strerror(ret)); - goto scgroup_err; - } - - return src_cgroup; - -scgroup_err: - cgroup_free(&src_cgroup); - - return NULL; -} - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, "); - err("try %s --help' for more information.\n", program_name); - return; - } - - info("Usage: %s [-r ] ...\n", program_name); - info(" or: %s --copy-from ...\n", program_name); - info("Set the parameters of given cgroup(s)\n"); - info(" -1, --v1 Provided parameters are in v1 format\n"); - info(" -2, --v2 Provided parameters are in v2 format\n"); - info(" -i, --ignore-unmappable Do not return an error for "); - info("settings that cannot be converted\n"); - info(" -r, --variable Define parameter to set\n"); - info(" --copy-from Control group whose "); - info("parameters will be copied\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd "); - info("delegate hierarchy\n"); -#endif -} -#endif /* !UNIT_TEST */ - -STATIC int parse_r_flag(const char * const program_name, const char * const name_value_str, - struct control_value * const name_value) -{ - char *copy = NULL, *buf = NULL; - int ret = 0; - - buf = strchr(name_value_str, '='); - if (buf == NULL) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - copy = strdup(name_value_str); - if (copy == NULL) { - err("%s: not enough memory\n", program_name); - ret = -1; - goto err; - } - - /* parse optarg value */ - buf = strtok(copy, "="); - if (buf == NULL) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - strncpy(name_value->name, buf, FILENAME_MAX); - name_value->name[FILENAME_MAX-1] = '\0'; - - buf = strchr(name_value_str, '='); - /* - * we don't need to check the return value of strchr because we - * know there's already an '=' character in the string. - */ - buf++; - - if (strlen(buf) == 0) { - err("%s: wrong parameter of option -r: %s\n", program_name, optarg); - ret = EXIT_BADARGS; - goto err; - } - - strncpy(name_value->value, buf, CG_CONTROL_VALUE_MAX); - name_value->value[CG_CONTROL_VALUE_MAX-1] = '\0'; - -err: - if (copy) - free(copy); - - return ret; -} - -#ifndef UNIT_TEST -int main(int argc, char *argv[]) -{ - int ignore_default_systemd_delegate_slice = 0; - struct control_value *name_value = NULL; - int nv_number = 0; - int nv_max = 0; - - struct cgroup *converted_src_cgroup = NULL; - char src_cg_path[FILENAME_MAX] = "\0"; - struct cgroup *src_cgroup = NULL; - struct cgroup *cgroup = NULL; - - enum cg_version_t src_version = CGROUP_UNK; - bool ignore_unmappable = false; - int ret = 0; - int c; - - /* no parametr on input */ - if (argc < 2) { - err("Usage is %s -r \n", argv[0]); - return -1; - } - -#ifdef WITH_SYSTEMD - /* parse arguments */ - while ((c = getopt_long (argc, argv, "r:h12ib", long_options, NULL)) != -1) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; -#else - while ((c = getopt_long (argc, argv, "r:h12i", long_options, NULL)) != -1) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - ret = 0; - goto err; - case 'r': - if ((flags & FL_COPY) != 0) { - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - flags |= FL_RULES; - - /* add name-value pair to buffer (= name_value variable) */ - if (nv_number >= nv_max) { - nv_max += CG_NV_MAX; - name_value = (struct control_value *) - realloc(name_value, nv_max * sizeof(struct control_value)); - if (!name_value) { - err("%s: not enough memory\n", argv[0]); - ret = -1; - goto err; - } - } - - ret = parse_r_flag(argv[0], optarg, &name_value[nv_number]); - if (ret) - goto err; - - nv_number++; - break; - case COPY_FROM_OPTION: - if (flags != 0) { - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - flags |= FL_COPY; - strncpy(src_cg_path, optarg, FILENAME_MAX); - src_cg_path[FILENAME_MAX-1] = '\0'; - break; - case '1': - src_version = CGROUP_V1; - break; - case '2': - src_version = CGROUP_V2; - break; - case 'i': - ignore_unmappable = true; - break; - default: - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - } - - /* no cgroup name */ - if (!argv[optind]) { - err("%s: no cgroup specified\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - if (flags == 0) { - err("%s: no name-value pair was set\n", argv[0]); - ret = EXIT_BADARGS; - goto err; - } - - /* initialize libcgroup */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], - cgroup_strerror(ret)); - goto err; - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* copy the name-value pairs from -r options */ - if ((flags & FL_RULES) != 0) { - src_cgroup = create_cgroup_from_name_value_pairs("tmp", name_value, nv_number); - if (src_cgroup == NULL) - goto err; - } - - /* copy the name-value from the given group */ - if ((flags & FL_COPY) != 0) { - src_cgroup = copy_name_value_from_cgroup(src_cg_path); - if (src_cgroup == NULL) - goto err; - } - - while (optind < argc) { - /* create new cgroup */ - cgroup = cgroup_new_cgroup(argv[optind]); - if (!cgroup) { - ret = ECGFAIL; - err("%s: can't add new cgroup: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* copy the values from the source cgroup to new one */ - ret = cgroup_copy_cgroup(cgroup, src_cgroup); - if (ret != 0) { - err("%s: cgroup %s error: %s\n", argv[0], src_cg_path, - cgroup_strerror(ret)); - goto err; - } - - converted_src_cgroup = cgroup_new_cgroup(cgroup->name); - if (converted_src_cgroup == NULL) { - ret = ECGCONTROLLERCREATEFAILED; - goto err; - } - - /* - * If a failure occurs between this comment and the "End of above comment" - * below, then we need to manually free converted_src_cgroup. - */ - - ret = cgroup_convert_cgroup(converted_src_cgroup, CGROUP_DISK, src_cgroup, - src_version); - if ((ret && ret != ECGNOVERSIONCONVERT) || - (ret == ECGNOVERSIONCONVERT && !ignore_unmappable)) { - /* - * If the user not has specified that we ignore any errors - * due to being unable to map from v1 to v2 or vice versa, - * return error, else ignore the error and continue. - */ - free(converted_src_cgroup); - goto err; - } - - /* - * End of above comment about converted_src_cgroup needing to be manually freed. - */ - - cgroup_free(&cgroup); - cgroup = converted_src_cgroup; - - /* modify cgroup based on values of the new one */ - ret = cgroup_modify_cgroup(cgroup); - if (ret) { - err("%s: cgroup modify error: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - optind++; - cgroup_free(&cgroup); - } - -err: - if (cgroup) - cgroup_free(&cgroup); - if (src_cgroup) - cgroup_free(&src_cgroup); - free(name_value); - - return ret; -} -#endif /* !UNIT_TEST */ - -#ifdef LIBCG_LIB -int cgroup_cgxset(const struct cgroup * const cgroup, enum cg_version_t version, - bool ignore_unmappable) -{ - struct cgroup *converted_cgroup; - int ret; - - converted_cgroup = cgroup_new_cgroup(cgroup->name); - if (converted_cgroup == NULL) { - ret = ECGCONTROLLERCREATEFAILED; - goto err; - } - - ret = cgroup_convert_cgroup(converted_cgroup, CGROUP_DISK, cgroup, version); - if (ret == ECGNOVERSIONCONVERT && ignore_unmappable) - /* - * The user has specified that we should ignore any errors - * due to being unable to map from v1 to v2 or vice versa - */ - ret = 0; - else if (ret) - goto err; - - /* modify cgroup based on values of the new one */ - ret = cgroup_modify_cgroup(converted_cgroup); - if (ret) - goto err; - -err: - if (converted_cgroup) - cgroup_free(&converted_cgroup); - - return ret; -} -#endif /* LIBCG_LIB */ diff --git a/lib/libcgroup-3.1.0/src/tools/lscgroup.c b/lib/libcgroup-3.1.0/src/tools/lscgroup.c deleted file mode 100644 index 280f1d6818d..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/lscgroup.c +++ /dev/null @@ -1,326 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by Ivana Hutarova Varekova - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include - -enum flag { - /* - * the flag set if there is a cgroup on - * output if there is no one we want to - * display all cgroups - */ - FL_LIST = 1 -}; - -static inline void trim_filepath(char *path) -{ - int len; - - len = strlen(path) - 1; - while (path[len] == '/') - len--; - - path[len + 1] = '\0'; -} - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h' for more information.\n", program_name); - return; - } - - info("Usage: %s [-h] [[-g] :] [...]\n", program_name); - info("List all cgroups\n"); - info(" -g : Control group to be "); - info("displayed (-g is optional)\n"); - info(" -h, --help Display this help\n"); -#ifdef WITH_SYSTEMD - info(" -b Ignore default systemd delegate hierarchy\n"); -#endif - info("(Note: currently supported on cgroups v1 only)\n"); -} - -/* - * if the info about controller "name" should be printed, then the function - * returns nonzero value - */ -static int is_ctlr_on_list(struct cgroup_group_spec *cgroup_list, const char *name) -{ - int j; - - for (j = 0; cgroup_list->controllers[j] != NULL; j++) - if (strcmp(cgroup_list->controllers[j], name) == 0) - return 1; - - return 0; -} - -static void print_info(struct cgroup_file_info *info, char *name, int pref) -{ - if (info->type == CGROUP_FILE_TYPE_DIR) { - if (info->full_path[pref] == '/') - info("%s:%s\n", name, &info->full_path[pref]); - else - info("%s:/%s\n", name, &info->full_path[pref]); - } -} - -/* display controller:/input_path cgroups */ -static int display_controller_data(char *input_path, char *controller, char *name) -{ - char cgroup_dir_path[FILENAME_MAX]; - char input_dir_path[FILENAME_MAX]; - struct cgroup_file_info info; - int lvl, len, ret; - void *handle; - - ret = cgroup_walk_tree_begin(controller, input_path, 0, &handle, &info, &lvl); - if (ret != 0) - return ret; - - strncpy(cgroup_dir_path, info.full_path, FILENAME_MAX); - cgroup_dir_path[sizeof(cgroup_dir_path) - 1] = '\0'; - /* remove problematic '/' characters from cgroup directory path */ - trim_filepath(cgroup_dir_path); - - strncpy(input_dir_path, input_path, FILENAME_MAX); - input_dir_path[sizeof(input_dir_path) - 1] = '\0'; - - /* remove problematic '/' characters from input directory path */ - trim_filepath(input_dir_path); - len = strlen(cgroup_dir_path) - strlen(input_dir_path); - print_info(&info, name, len); - - while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) == 0) - print_info(&info, name, len); - - cgroup_walk_tree_end(&handle); - if (ret == ECGEOF) - ret = 0; - - return ret; -} - -/* - * print data about input cgroup_list cgroups if FL_LIST flag is set then - * if the function does not find the cgroup it returns ECGEOF - */ -static int print_cgroup(struct cgroup_group_spec *cgroup_spec, int flags) -{ - struct cgroup_mount_point controller; - char all_conts[FILENAME_MAX]; - char con_name[FILENAME_MAX]; - char path[FILENAME_MAX]; - int output = 0; - void *handle; - int ret = 0; - - path[0] = '\0'; - con_name[0] = '\0'; - all_conts[0] = '\0'; - - ret = cgroup_get_controller_begin(&handle, &controller); - - /* go through the list of controllers/mount point pairs */ - while (ret == 0) { - if (strcmp(path, controller.path) == 0) { - /* if it is still the same mount point */ - strncat(all_conts, ",", FILENAME_MAX-strlen(all_conts)-1); - strncat(all_conts, controller.name, FILENAME_MAX-strlen(all_conts)-1); - all_conts[sizeof(all_conts) - 1] = '\0'; - } else { - /* we got new mount point, print it if needed */ - if (output) { - ret = display_controller_data(cgroup_spec->path, con_name, - all_conts); - if (ret) - return ret; - if ((flags & FL_LIST) != 0) { - /* we succesfully finish printing */ - output = 0; - break; - } - } - - output = 0; - strncpy(all_conts, controller.name, FILENAME_MAX); - all_conts[FILENAME_MAX-1] = '\0'; - - strncpy(con_name, controller.name, FILENAME_MAX); - con_name[FILENAME_MAX-1] = '\0'; - - strncpy(path, controller.path, FILENAME_MAX); - path[FILENAME_MAX-1] = '\0'; - } - - /* set output flag */ - if ((output == 0) && (!(flags & FL_LIST) || - (is_ctlr_on_list(cgroup_spec, controller.name)))) - output = 1; - - /* the actual controller should not be printed */ - ret = cgroup_get_controller_next(&handle, &controller); - } - - cgroup_get_controller_end(&handle); - if (ret != ECGEOF) - return ret; - - if (output) - ret = display_controller_data(cgroup_spec->path, con_name, all_conts); - - return ret; -} - - -static int cgroup_list_cgroups(char *tname, struct cgroup_group_spec *cgroup_list[], int flags) -{ - int final_ret = 0; - int ret = 0; - int i = 0; - - /* initialize libcgroup */ - ret = cgroup_init(); - if (ret) { - err("cgroups can't be listed: %s\n", cgroup_strerror(ret)); - return ret; - } - - if ((flags & FL_LIST) == 0) { - struct cgroup_group_spec *cgroup_spec; - - cgroup_spec = calloc(1, sizeof(struct cgroup_group_spec)); - /* we have to print all cgroups */ - ret = print_cgroup(cgroup_spec, flags); - free(cgroup_spec); - if (ret == 0) { - final_ret = 0; - } else { - final_ret = ret; - err("cgroups can't be listed: %s\n", cgroup_strerror(ret)); - } - } else { - /* we have he list of controllers which should be print */ - while ((cgroup_list[i] != NULL) && ((ret == ECGEOF) || (ret == 0))) { - - ret = print_cgroup(cgroup_list[i], flags); - if (ret != 0) { - if (ret == ECGEOF) { - /* controller was not found */ - final_ret = ECGFAIL; - } else { - /* other problem */ - final_ret = ret; - } - - err("%s: cannot find group %s..:%s: %s\n", tname, - cgroup_list[i]->controllers[0], cgroup_list[i]->path, - cgroup_strerror(final_ret)); - } - i++; - } - } - - return final_ret; -} - -int main(int argc, char *argv[]) -{ - static struct option options[] = { - {"help", 0, 0, 'h'}, - {"group", required_argument, NULL, 'g'}, - {0, 0, 0, 0} - }; - - struct cgroup_group_spec *cgroup_list[CG_HIER_MAX]; - int ignore_default_systemd_delegate_slice = 0; - int flags = 0; - int ret = 0; - int c; - int i; - - memset(cgroup_list, 0, sizeof(cgroup_list)); - - /* parse arguments */ -#ifdef WITH_SYSTEMD - while ((c = getopt_long(argc, argv, "hg:b", options, NULL)) > 0) { - switch (c) { - case 'b': - ignore_default_systemd_delegate_slice = 1; - break; -#else - while ((c = getopt_long(argc, argv, "hg:", options, NULL)) > 0) { - switch (c) { -#endif - case 'h': - usage(0, argv[0]); - ret = 0; - goto err; - case 'g': - ret = parse_cgroup_spec(cgroup_list, optarg, CG_HIER_MAX); - if (ret) { - err("%s: cgroup controller and path parsing failed (%s)\n", - argv[0], optarg); - return ret; - } - break; - default: - usage(1, argv[0]); - ret = EXIT_BADARGS; - goto err; - } - } - - /* initialize libcg */ - ret = cgroup_init(); - if (ret) { - err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret)); - goto err; - } - - /* this is false always for disable-systemd */ - if (!ignore_default_systemd_delegate_slice) - cgroup_set_default_systemd_cgroup(); - - /* read the list of controllers */ - while (optind < argc) { - ret = parse_cgroup_spec(cgroup_list, argv[optind], CG_HIER_MAX); - if (ret) { - err("%s: cgroup controller an path parsing failed (%s)\n", argv[0], - argv[optind]); - return -1; - } - optind++; - } - - if (cgroup_list[0] != NULL) { - /* cgroups on input */ - flags |= FL_LIST; - } - - /* print the information based on list of input cgroups and flags */ - ret = cgroup_list_cgroups(argv[0], cgroup_list, flags); - -err: - if (cgroup_list[0]) { - for (i = 0; i < CG_HIER_MAX; i++) { - if (cgroup_list[i]) - cgroup_free_group_spec(cgroup_list[i]); - } - } - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/lssubsys.c b/lib/libcgroup-3.1.0/src/tools/lssubsys.c deleted file mode 100644 index c143d175ef6..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/lssubsys.c +++ /dev/null @@ -1,282 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by Ivana Hutarova Varekova - */ - -#include "tools-common.h" - -#include -#include - -#include -#include -#include -#include -#include - - -enum flag { - FL_MOUNT = 1, /* show the mount points */ - FL_LIST = 2, - FL_ALL = 4, /* show all subsystems - not mounted too */ - FL_HIERARCHY = 8, /* show info about hierarchies */ - FL_MOUNT_ALL = 16 /* show all mount points of hierarchies */ -}; - -typedef char cont_name_t[FILENAME_MAX]; - -static void usage(int status, const char *program_name) -{ - if (status != 0) { - err("Wrong input parameters, try %s -h' for more information.\n", program_name); - return; - } - - info("Usage: %s [-i] [-m] [-M] [controller] [...]\n", program_name); - info(" or: %s [-a] [-i] [-m] [-M]\n", program_name); - info("List information about given controller(s) If no controller "); - info("is set list information about all mounted controllers.\n"); - info(" -a, --all Display information "); - info("about all controllers (including not mounted ones)\n"); - info(" -h, --help Display this help\n"); - info(" -i, --hierarchies Display information about hierarchies\n"); - info(" -m, --mount-points Display mount points\n"); - info(" -M, --all-mount-points Display all mount points\n"); - info("(Note: currently supported on cgroups v1 only)\n"); -} - -static int print_controller_mount(const char *controller, int flags, cont_name_t cont_names, - int hierarchy) -{ - char path[FILENAME_MAX]; - void *handle; - int ret = 0; - - /* print only hierarchy name */ - if (!(flags & FL_MOUNT) && !(flags & FL_HIERARCHY)) - info("%s\n", cont_names); - - /* print only hierarchy name and number*/ - if (!(flags & FL_MOUNT) && (flags & FL_HIERARCHY)) - info("%s %d\n", cont_names, hierarchy); - - if (flags & FL_MOUNT) { - /* print hierarchy name and mount point(s) */ - ret = cgroup_get_subsys_mount_point_begin(controller, &handle, path); - /* intentionally ignore error from above call */ - while (ret == 0) { - info("%s %s\n", cont_names, path); - /* first mount record is enough */ - if (!(flags & FL_MOUNT_ALL)) - goto stop; - ret = cgroup_get_subsys_mount_point_next(&handle, path); - } - if (ret == ECGEOF) - ret = 0; -stop: - cgroup_get_subsys_mount_point_end(&handle); - } - return ret; -} - -/* display all controllers attached to the given hierarchy */ -static int print_all_controllers_in_hierarchy(const char *tname, int hierarchy, int flags) -{ - struct controller_data info; - enum cg_version_t version; - cont_name_t cont_names = "\0"; - cont_name_t cont_name; - int first = 1; - void *handle; - int ret = 0; - - /* - * Initialize libcgroup and intentionally ignore its result, no - * mounted controller is valid use case. - */ - (void) cgroup_init(); - - ret = cgroup_get_all_controller_begin(&handle, &info); - if ((ret != 0) && (ret != ECGEOF)) { - err("cannot read controller data: %s\n", cgroup_strerror(ret)); - return ret; - } - - while (ret != ECGEOF) { - ret = cgroup_get_controller_version(info.name, &version); - if (ret) - goto end; - - /* - * v1 controllers should be in the hierachy. - * v2 controllers will have a hierarchy value of zero - */ - if (version == CGROUP_V1 && info.hierarchy != hierarchy) - goto next; - - if (first) { - /* the first controller in the hierarchy */ - strncpy(cont_name, info.name, FILENAME_MAX-1); - cont_name[sizeof(cont_name) - 1] = '\0'; - - strncpy(cont_names, info.name, FILENAME_MAX-1); - cont_names[sizeof(cont_names) - 1] = '\0'; - first = 0; - } else { - /* the next controller in the hierarchy */ - strncat(cont_names, ",", FILENAME_MAX-1); - strncat(cont_names, info.name, FILENAME_MAX-1); - cont_names[sizeof(cont_names) - 1] = '\0'; - } - -next: - ret = cgroup_get_all_controller_next(&handle, &info); - if (ret && ret != ECGEOF) - goto end; - } - - ret = print_controller_mount(cont_name, flags, cont_names, hierarchy); -end: - cgroup_get_all_controller_end(&handle); - - if (ret == ECGEOF) - ret = 0; - - return ret; -} - - -/* - * go through the list of all controllers gather them based on hierarchy - * number and print them - */ -static int cgroup_list_all_controllers(const char *tname, cont_name_t cont_name[CG_CONTROLLER_MAX], - int c_number, int flags) -{ - struct controller_data info; - int h_list[CG_CONTROLLER_MAX]; /* list of hierarchies */ - int is_on_list = 0; - int counter = 0; - void *handle; - int ret; - int j; - - ret = cgroup_get_all_controller_begin(&handle, &info); - while (ret == 0) { - if (info.hierarchy == 0) { - /* the controller is not attached to any hierachy */ - if (flags & FL_ALL) { - /* display only if -a flag is set */ - info("%s\n", info.name); - } - } - is_on_list = 0; - j = 0; - while ((is_on_list == 0) && (j < c_number)) { - if (strcmp(info.name, cont_name[j]) == 0) { - is_on_list = 1; - break; - } - j++; - } - - if ((info.hierarchy != 0) && ((flags & FL_ALL) || - (!(flags & FL_LIST) || (is_on_list == 1)))) { - /* - * the controller is attached to some hierarchy - * and either should be output all controllers, - * or the controller is on the output list - */ - h_list[counter] = info.hierarchy; - counter++; - for (j = 0; j < counter-1; j++) { - /* - * the hierarchy already was on the list - * so remove the new record - */ - if (h_list[j] == info.hierarchy) { - counter--; - break; - } - } - } - - ret = cgroup_get_all_controller_next(&handle, &info); - } - cgroup_get_all_controller_end(&handle); - if (ret == ECGEOF) - ret = 0; - if (ret) { - err("cgroup_get_controller_begin/next failed (%s)\n", cgroup_strerror(ret)); - return ret; - } - - for (j = 0; j < counter; j++) - ret = print_all_controllers_in_hierarchy(tname, h_list[j], flags); - - return ret; -} - -int main(int argc, char *argv[]) -{ - static struct option options[] = { - {"help", 0, 0, 'h'}, - {"mount-points", 0, 0, 'm'}, - {"all-mount-points", 0, 0, 'M'}, - {"all", 0, 0, 'a'}, - {"hierarchies", 0, 0, 'i'}, - {0, 0, 0, 0} - }; - - cont_name_t cont_name[CG_CONTROLLER_MAX]; - int c_number = 0; - int flags = 0; - int ret = 0; - int c; - int i; - - for (i = 0; i < CG_CONTROLLER_MAX; i++) - cont_name[i][0] = '\0'; - - /* parse arguments */ - while ((c = getopt_long(argc, argv, "mMhai", options, NULL)) > 0) { - switch (c) { - case 'h': - usage(0, argv[0]); - return 0; - case 'm': - flags |= FL_MOUNT; - break; - case 'M': - flags |= FL_MOUNT | FL_MOUNT_ALL; - break; - case 'a': - flags |= FL_ALL; - break; - case 'i': - flags |= FL_HIERARCHY; - break; - default: - usage(1, argv[0]); - exit(EXIT_BADARGS); - } - } - - /* read the list of controllers */ - while (optind < argc) { - flags |= FL_LIST; - strncpy(cont_name[c_number], argv[optind], FILENAME_MAX); - cont_name[c_number][FILENAME_MAX-1] = '\0'; - c_number++; - optind++; - if (optind == CG_CONTROLLER_MAX) { - err("Warning: too many parameters\n"); - break; - } - } - - ret = cgroup_list_all_controllers(argv[0], cont_name, c_number, flags); - - return ret; -} diff --git a/lib/libcgroup-3.1.0/src/tools/tools-common.c b/lib/libcgroup-3.1.0/src/tools/tools-common.c deleted file mode 100644 index e79023b2b1f..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/tools-common.c +++ /dev/null @@ -1,312 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright Red Hat, Inc. 2009 - * - * Author: Vivek Goyal - * Jan Safranek - */ - -/* for asprintf */ -#define _GNU_SOURCE - -#include "tools-common.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg, int capacity) -{ - char *cptr = NULL, *pathptr = NULL, *temp; - struct cgroup_group_spec *ptr; - int i, j; - - ptr = *cdptr; - - /* Find first free entry inside the cgroup data array */ - for (i = 0; i < capacity; i++, ptr++) { - if (!cdptr[i]) - break; - } - - if (i == capacity) { - /* No free slot found */ - fprintf(stderr, "Max allowed hierarchies %d reached\n", capacity); - return -1; - } - - /* Extract list of controllers */ - if (optarg[0] == ':') { - /* No controller was passed in */ - cptr = NULL; - pathptr = strtok(optarg, ":"); - } else { - /* Extract the list of controllers from the user */ - cptr = strtok(optarg, ":"); - cgroup_dbg("list of controllers is %s\n", cptr); - if (!cptr) - return -1; - - pathptr = strtok(NULL, ":"); - } - - cgroup_dbg("cgroup path is %s\n", pathptr); - if (!pathptr) - return -1; - - /* instanciate cgroup_data. */ - cdptr[i] = calloc(1, sizeof(struct cgroup_group_spec)); - if (!cdptr[i]) { - fprintf(stderr, "%s\n", strerror(errno)); - return -1; - } - - if (cptr != NULL) { - /* Convert list of controllers into an array of strings. */ - j = 0; - do { - if (j == 0) - temp = strtok(cptr, ","); - else - temp = strtok(NULL, ","); - - if (temp) { - cdptr[i]->controllers[j] = strdup(temp); - if (!cdptr[i]->controllers[j]) { - free(cdptr[i]); - fprintf(stderr, "%s\n", strerror(errno)); - return -1; - } - } - j++; - } while (temp && j < CG_CONTROLLER_MAX-1); - } - - /* Store path to the cgroup */ - strncpy(cdptr[i]->path, pathptr, FILENAME_MAX - 1); - cdptr[i]->path[sizeof(cdptr[i]->path) - 1] = '\0'; - - return 0; -} - - -/** - * Free a single cgroup_group_spec structure - * <--->@param cl The structure to free from memory. - */ -void cgroup_free_group_spec(struct cgroup_group_spec *cl) -{ - /* Loop variable */ - int i = 0; - - /* Make sure our structure is not NULL, first. */ - if (!cl) { - cgroup_dbg("Warning: Attempted to free NULL rule.\n"); - return; - } - - /* We must free any used controller strings, too. */ - for (i = 0; i < CG_CONTROLLER_MAX; i++) { - if (cl->controllers[i]) - free(cl->controllers[i]); - } - - free(cl); -} - - -int cgroup_string_list_init(struct cgroup_string_list *list, int initial_size) -{ - if (list == NULL) - return ECGINVAL; - - list->items = calloc(initial_size, sizeof(char *)); - if (!list->items) - return ECGFAIL; - - list->count = 0; - list->size = initial_size; - - return 0; -} - -void cgroup_string_list_free(struct cgroup_string_list *list) -{ - int i; - - if (list == NULL) - return; - - if (list->items == NULL) - return; - - for (i = 0; i < list->count; i++) - free(list->items[i]); - - free(list->items); -} - -int cgroup_string_list_add_item(struct cgroup_string_list *list, const char *item) -{ - if (list == NULL) - return ECGINVAL; - - if (list->size <= list->count) { - char **tmp = realloc(list->items, sizeof(char *) * list->size*2); - if (tmp == NULL) - return ECGFAIL; - list->items = tmp; - list->size = list->size * 2; - } - - list->items[list->count] = strdup(item); - if (list->items[list->count] == NULL) - return ECGFAIL; - list->count++; - - return 0; -} - -static int _compare_string(const void *a, const void *b) -{ - const char *sa = * (char * const *) a; - const char *sb = * (char * const *) b; - - return strcmp(sa, sb); -} - - -int cgroup_string_list_add_directory(struct cgroup_string_list *list, char *dirname, - char *program_name) -{ - int start, ret, count = 0; - struct dirent *item; - DIR *d; - - if (list == NULL) - return ECGINVAL; - - start = list->count; - - d = opendir(dirname); - if (!d) { - fprintf(stderr, "%s: cannot open %s: %s\n", program_name, dirname, - strerror(errno)); - exit(1); - } - - do { - errno = 0; - item = readdir(d); - if (item && (item->d_type == DT_REG || item->d_type == DT_LNK)) { - char *tmp, *file_ext; - - /* we are interested in .conf files, skip others */ - file_ext = strstr(item->d_name, ".conf"); - if (!file_ext) - continue; - - if (strcmp(file_ext, ".conf") || strlen(item->d_name) == 5) - continue; - - ret = asprintf(&tmp, "%s/%s", dirname, item->d_name); - if (ret < 0) { - fprintf(stderr, "%s: out of memory\n", program_name); - exit(1); - } - ret = cgroup_string_list_add_item(list, tmp); - free(tmp); - count++; - if (ret) { - fprintf(stderr, "%s: %s\n", program_name, cgroup_strerror(ret)); - exit(1); - } - } - if (!item && errno) { - fprintf(stderr, "%s: cannot read %s: %s\n", program_name, dirname, - strerror(errno)); - exit(1); - } - } while (item != NULL); - closedir(d); - - /* sort the names found in the directory */ - if (count > 0) - qsort(&list->items[start], count, sizeof(char *), _compare_string); - - return 0; -} - -/* allowed mode strings are octal version: "755" */ -int parse_mode(char *string, mode_t *pmode, const char *program_name) -{ - size_t len; - char *end; - long mode; - - len = strlen(string); - if (len < 3 || len > 4) - goto err; - - errno = 0; - mode = strtol(string, &end, 8); - if (errno != 0 || *end != '\0') - goto err; - *pmode = mode; - return 0; - -err: - *pmode = 0; - fprintf(stdout, "%s wrong mode format %s\n", program_name, string); - - return -1; -} - -int parse_uid_gid(char *string, uid_t *uid, gid_t *gid, const char *program_name) -{ - char *grp_string = NULL; - char *pwd_string = NULL; - struct passwd *pwd; - struct group *grp; - - *uid = *gid = NO_UID_GID; - - if (string[0] == ':') - grp_string = strtok(string, ":"); - else { - pwd_string = strtok(string, ":"); - if (pwd_string != NULL) - grp_string = strtok(NULL, ":"); - } - - if (pwd_string != NULL) { - pwd = getpwnam(pwd_string); - if (pwd != NULL) { - *uid = pwd->pw_uid; - } else { - fprintf(stderr, "%s: can't find uid of user %s.\n", program_name, - pwd_string); - return -1; - } - } - if (grp_string != NULL) { - grp = getgrnam(grp_string); - if (grp != NULL) { - *gid = grp->gr_gid; - } else { - fprintf(stderr, "%s: can't find gid of group %s.\n", program_name, - grp_string); - return -1; - } - } - - return 0; -} diff --git a/lib/libcgroup-3.1.0/src/tools/tools-common.h b/lib/libcgroup-3.1.0/src/tools/tools-common.h deleted file mode 100644 index 04888434a22..00000000000 --- a/lib/libcgroup-3.1.0/src/tools/tools-common.h +++ /dev/null @@ -1,137 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * Copyright Red Hat, Inc. 2009 - * - * Author: Vivek Goyal - * Jan Safranek - */ - -#ifndef __TOOLS_COMMON - -#define __TOOLS_COMMON - -#ifdef __cplusplus -extern "C" { -#endif - -#include "config.h" -#include "../libcgroup-internal.h" - -#include - -#define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, "Error: " x) -#define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, "Warning: " x) -#define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, "Info: " x) -#define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x) -#define cgroup_cont(x...) cgroup_log(CGROUP_LOG_CONT, x) - -#define err(x...) fprintf(stderr, x) -#define info(x...) fprintf(stdout, x) - -#define EXIT_BADARGS 129 - -/** - * Auxiliary specifier of group, used to store parsed command line options. - */ -struct cgroup_group_spec { - char path[FILENAME_MAX]; - char *controllers[CG_CONTROLLER_MAX]; -}; - -/** - * Simple dynamic array of strings. - */ -struct cgroup_string_list { - char **items; - int size; - int count; -}; - -/** - * Parse command line option with group specifier into provided data structure. - * The option must have form of 'controller1,controller2,..:group_name'. - * - * The parsed list of controllers and group name is added at the end of - * provided cdptr, - * i.e. on place of first NULL cgroup_group_spec*. - * - * @param cdptr Target data structure to fill. New item is allocated and - * added at the end. - * @param optarg Argument to parse. - * @param capacity The capacity of the cdptr array. - * @return 0 on success, != 0 on error. - */ -int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg, int capacity); - -/** - * Free a single cgroup_group_spec structure. - * @param cl The structure to free from memory - */ -void cgroup_free_group_spec(struct cgroup_group_spec *cl); - -/** - * Initialize a new list. - * @param list The list to initialize. - * @param initial_size The initial size of the list to pre-allocate. - */ -int cgroup_string_list_init(struct cgroup_string_list *list, int initial_size); - -/** - * Destroy a list, automatically freeing all its items. - * @param list The list to destroy. - */ -void cgroup_string_list_free(struct cgroup_string_list *list); - -/** - * Adds new item to the list. It automatically resizes underlying array if needed. - * @param list The list to modify. - * @param item The item to add. The item is automatically copied to new buffer. - */ -int cgroup_string_list_add_item(struct cgroup_string_list *list, const char *item); - -/** - * Add alphabetically sorted files present in given directory - * (without subdirs) to list of strings. - * The function exits on error. - * @param list The list to add files to. - * @param dirname Full path to directory to examime. - * @param program_name Name of the executable, it will be used for - * printing errors to stderr. - */ -int cgroup_string_list_add_directory(struct cgroup_string_list *list, char *dirname, - char *program_name); - -/** - * Parse file permissions as octal number. - * @param string A string to parse, must contain 3-4 characters '0'-'7'. - * @param pmode Parsed mode. - * @oaram program_name Argv[0] to show error messages. - */ -int parse_mode(char *string, mode_t *pmode, const char *program_name); - -/** - * Parse UID and GID from string in form "user:group". - * @param string A string to parse. - * @param uid Parsed UID (-1 if 'user' is missing in the string). - * @param gid Parsed GID (-1 if 'group' is missing in the string). - * @param program_name Argv[0] to show error messages. - */ -int parse_uid_gid(char *string, uid_t *uid, gid_t *gid, const char *program_name); - -/** - * Functions that are defined as STATIC can be placed within the - * UNIT_TEST ifdef. This will allow them to be included in the unit tests - * while remaining static in a normal libcgroup build. - */ -#ifdef UNIT_TEST - -int parse_r_flag(const char * const program_name, const char * const name_value_str, - struct control_value * const name_value); - -#endif /* UNIT_TEST */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* TOOLS_COMMON */ diff --git a/lib/libcgroup-3.1.0/src/wrapper.c b/lib/libcgroup-3.1.0/src/wrapper.c deleted file mode 100644 index 547d5054d0c..00000000000 --- a/lib/libcgroup-3.1.0/src/wrapper.c +++ /dev/null @@ -1,833 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-only -/** - * Copyright IBM Corporation. 2008 - * - * Author: Dhaval Giani - * - * Code initiated and designed by Dhaval Giani. All faults are most likely - * his mistake. - */ - -#define _GNU_SOURCE - -#include -#include - -#include -#include -#include -#include -#include -#include - -static void init_cgroup(struct cgroup *cgroup) -{ - cgroup->task_fperm = NO_PERMS; - cgroup->control_fperm = NO_PERMS; - cgroup->control_dperm = NO_PERMS; - - cgroup->control_gid = NO_UID_GID; - cgroup->control_uid = NO_UID_GID; - cgroup->tasks_gid = NO_UID_GID; - cgroup->tasks_uid = NO_UID_GID; -} - -void init_cgroup_table(struct cgroup *cgroups, size_t count) -{ - size_t i; - - for (i = 0; i < count; ++i) - init_cgroup(&cgroups[i]); -} - -struct cgroup *cgroup_new_cgroup(const char *name) -{ - struct cgroup *cgroup; - - if (!name) - return NULL; - - cgroup = calloc(1, sizeof(struct cgroup)); - if (!cgroup) - return NULL; - - init_cgroup(cgroup); - strncpy(cgroup->name, name, FILENAME_MAX - 1); - cgroup->name[FILENAME_MAX - 1] = '\0'; - - return cgroup; -} - -struct cgroup_controller *cgroup_add_controller(struct cgroup *cgroup, const char *name) -{ - struct cgroup_controller *controller; - int i, ret; - - if (!cgroup || !name) - return NULL; - - /* Still not sure how to handle the failure here. */ - if (cgroup->index >= CG_CONTROLLER_MAX) - return NULL; - - /* Still not sure how to handle the failure here. */ - for (i = 0; i < cgroup->index; i++) { - if (strncmp(name, cgroup->controller[i]->name, CONTROL_NAMELEN_MAX) == 0) - return NULL; - } - - controller = calloc(1, sizeof(struct cgroup_controller)); - if (!controller) - return NULL; - - strncpy(controller->name, name, CONTROL_NAMELEN_MAX - 1); - controller->name[CONTROL_NAMELEN_MAX - 1] = '\0'; - - controller->cgroup = cgroup; - controller->index = 0; - - if (strcmp(controller->name, CGROUP_FILE_PREFIX) == 0) { - /* - * Operating on the "cgroup" controller is only allowed - * on cgroup v2 systems - */ - controller->version = CGROUP_V2; - } else { - ret = cgroup_get_controller_version(controller->name, &controller->version); - if (ret) { - cgroup_dbg("failed to get cgroup version for controller %s\n", - controller->name); - free(controller); - return NULL; - } - } - - cgroup->controller[cgroup->index] = controller; - cgroup->index++; - - return controller; -} - -int cgroup_add_all_controllers(struct cgroup *cgroup) -{ - struct cgroup_controller *cgc; - struct controller_data info; - enum cg_setup_mode_t mode; - void *handle; - int ret = 0; - - if (!cgroup) - return ECGINVAL; - - mode = cgroup_setup_mode(); - - /* - * Per kernel documentation, cgroup-v2.rst, /proc/cgroups is "meaningless" for cgroup v2. - * Use the cgroup's cgroup.controllers file instead - */ - if (mode == CGROUP_MODE_UNIFIED) { - char *ret_c, *controller, *stok_buff = NULL, line[CGV2_CONTROLLERS_LL_MAX]; - /* - * cg_cgroup_v2_mount_path (FILENAME_MAX) + cgroup->name (FILENAME_MAX) + - * strlen("cgroup.controllers") (18) + 2 forward slashes + 1 NULL terminator - */ - char cgroup_controllers_path[FILENAME_MAX * 2 + 18 + 2 + 1]; - FILE *fp; - - pthread_rwlock_rdlock(&cg_mount_table_lock); - if (strlen(cg_cgroup_v2_mount_path) == 0) { - pthread_rwlock_unlock(&cg_mount_table_lock); - ret = ECGOTHER; - goto out; - } - - snprintf(cgroup_controllers_path, sizeof(cgroup_controllers_path), "%s/%s/%s", - cg_cgroup_v2_mount_path, cgroup->name, CGV2_CONTROLLERS_FILE); - pthread_rwlock_unlock(&cg_mount_table_lock); - - fp = fopen(cgroup_controllers_path, "re"); - if (!fp) { - ret = ECGOTHER; - goto out; - } - - ret_c = fgets(line, CGV2_CONTROLLERS_LL_MAX, fp); - fclose(fp); - if (ret_c == NULL) { - /* no controllers are enabled */ - goto out; - } - - /* Remove the trailing newline */ - ret_c[strlen(ret_c) - 1] = '\0'; - - /* - * cgroup.controllers returns a list of available controllers in - * the following format: - * cpuset cpu io memory pids rdma - */ - controller = strtok_r(ret_c, " ", &stok_buff); - do { - cgc = cgroup_add_controller(cgroup, controller); - if (!cgc) { - ret = ECGINVAL; - fprintf(stderr, "controller %s can't be added\n", controller); - goto end; - } - } while ((controller = strtok_r(NULL, " ", &stok_buff))); - } else { - /* go through the controller list */ - ret = cgroup_get_all_controller_begin(&handle, &info); - if ((ret != 0) && (ret != ECGEOF)) { - fprintf(stderr, "cannot read controller data: %s\n", cgroup_strerror(ret)); - return ret; - } - - while (ret == 0) { - if (info.hierarchy == 0) { - /* - * the controller is not attached to any - * hierarchy skip it. - */ - goto next; - } - - /* add mounted controller to cgroup structure */ - cgc = cgroup_add_controller(cgroup, info.name); - if (!cgc) { - ret = ECGINVAL; - fprintf(stderr, "controller %s can't be added\n", info.name); - goto end; - } - -next: - ret = cgroup_get_all_controller_next(&handle, &info); - if (ret && ret != ECGEOF) - goto end; - } - -end: - cgroup_get_all_controller_end(&handle); - if (ret == ECGEOF) - ret = 0; - if (ret) - fprintf(stderr, "cgroup_get_controller_begin/next failed (%s)\n", - cgroup_strerror(ret)); - } - -out: - return ret; -} - -static void cgroup_free_value(struct control_value *value) -{ - if (value->multiline_value) - free(value->multiline_value); - if (value->prev_name) - free(value->prev_name); - - free(value); -} - -void cgroup_free_controller(struct cgroup_controller *ctrl) -{ - int i; - - for (i = 0; i < ctrl->index; i++) - cgroup_free_value(ctrl->values[i]); - ctrl->index = 0; - - free(ctrl); -} - -void cgroup_free_controllers(struct cgroup *cgroup) -{ - int i; - - if (!cgroup) - return; - - for (i = 0; i < cgroup->index; i++) - cgroup_free_controller(cgroup->controller[i]); - - cgroup->index = 0; -} - -void cgroup_free(struct cgroup **cgroup) -{ - struct cgroup *cg = *cgroup; - - /* Passing NULL pointers is OK. We just return. */ - if (!cg) - return; - - cgroup_free_controllers(cg); - free(cg); - *cgroup = NULL; -} - -int cgroup_add_value_string(struct cgroup_controller *controller, const char *name, - const char *value) -{ - int i; - struct control_value *cntl_value; - - if (!controller || !name) - return ECGINVAL; - - if (controller->index >= CG_NV_MAX) - return ECGMAXVALUESEXCEEDED; - - for (i = 0; i < controller->index && i < CG_NV_MAX; i++) { - if (!strcmp(controller->values[i]->name, name)) - return ECGVALUEEXISTS; - } - - cntl_value = calloc(1, sizeof(struct control_value)); - if (!cntl_value) - return ECGCONTROLLERCREATEFAILED; - - strncpy(cntl_value->name, name, sizeof(cntl_value->name)); - cntl_value->name[sizeof(cntl_value->name)-1] = '\0'; - - if (value) { - if (strlen(value) >= sizeof(cntl_value->value)) { - fprintf(stderr, "value exceeds the maximum of %ld characters\n", - sizeof(cntl_value->value) - 1); - free(cntl_value); - return ECGCONFIGPARSEFAIL; - } - - strncpy(cntl_value->value, value, sizeof(cntl_value->value)); - cntl_value->value[sizeof(cntl_value->value)-1] = '\0'; - cntl_value->dirty = true; - } - - controller->values[controller->index] = cntl_value; - controller->index++; - - return 0; -} - -int cgroup_add_value_int64(struct cgroup_controller *controller, const char *name, int64_t value) -{ - char *val; - int ret; - - ret = asprintf(&val, "%"PRId64, value); - if (ret < 0) { - last_errno = errno; - return ECGOTHER; - } - - ret = cgroup_add_value_string(controller, name, val); - free(val); - - return ret; -} - -int cgroup_add_value_uint64(struct cgroup_controller *controller, const char *name, - u_int64_t value) -{ - char *val; - int ret; - - ret = asprintf(&val, "%" PRIu64, value); - if (ret < 0) { - last_errno = errno; - return ECGOTHER; - } - - ret = cgroup_add_value_string(controller, name, val); - free(val); - - return ret; -} - -int cgroup_add_value_bool(struct cgroup_controller *controller, const char *name, bool value) -{ - char *val; - int ret; - - if (value) - val = strdup("1"); - else - val = strdup("0"); - if (!val) { - last_errno = errno; - return ECGOTHER; - } - - ret = cgroup_add_value_string(controller, name, val); - free(val); - - return ret; -} - -int cgroup_remove_value(struct cgroup_controller * const controller, const char * const name) -{ - int i; - - for (i = 0; i < controller->index; i++) { - if (strcmp(controller->values[i]->name, name) == 0) { - cgroup_free_value(controller->values[i]); - - if (i == (controller->index - 1)) { - /* This is the last entry in the table. There's nothing to move */ - controller->index--; - } else { - memmove(&controller->values[i], &controller->values[i + 1], - sizeof(struct control_value *) * (controller->index - i - 1)); - controller->index--; - } - return 0; - } - } - - return ECGROUPNOTEXIST; -} - -int cgroup_compare_controllers(struct cgroup_controller *cgca, struct cgroup_controller *cgcb) -{ - int i; - - if (!cgca || !cgcb) - return ECGINVAL; - - if (strcmp(cgca->name, cgcb->name)) - return ECGCONTROLLERNOTEQUAL; - - if (cgca->index != cgcb->index) - return ECGCONTROLLERNOTEQUAL; - - for (i = 0; i < cgca->index; i++) { - struct control_value *cva = cgca->values[i]; - struct control_value *cvb = cgcb->values[i]; - - if (strcmp(cva->name, cvb->name)) - return ECGCONTROLLERNOTEQUAL; - - if (strcmp(cva->value, cvb->value)) - return ECGCONTROLLERNOTEQUAL; - } - - return 0; -} - -int cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b) -{ - int i, j; - - if (!cgroup_a || !cgroup_b) - return ECGINVAL; - - if (strcmp(cgroup_a->name, cgroup_b->name)) - return ECGROUPNOTEQUAL; - - if (cgroup_a->tasks_uid != cgroup_b->tasks_uid) - return ECGROUPNOTEQUAL; - - if (cgroup_a->tasks_gid != cgroup_b->tasks_gid) - return ECGROUPNOTEQUAL; - - if (cgroup_a->control_uid != cgroup_b->control_uid) - return ECGROUPNOTEQUAL; - - if (cgroup_a->control_gid != cgroup_b->control_gid) - return ECGROUPNOTEQUAL; - - if (cgroup_a->index != cgroup_b->index) - return ECGROUPNOTEQUAL; - - for (i = 0; i < cgroup_a->index; i++) { - struct cgroup_controller *cgca = cgroup_a->controller[i]; - bool found_match = false; - - /* - * Don't penalize the user if the controllers are in different order - * from cgroup_a to cgroup_b - */ - for (j = 0; j < cgroup_b->index; j++) { - struct cgroup_controller *cgcb = cgroup_b->controller[j]; - - if (cgroup_compare_controllers(cgca, cgcb) == 0) { - found_match = true; - break; - } - } - - if (!found_match) - return ECGCONTROLLERNOTEQUAL; - } - - return 0; -} - -int cgroup_set_uid_gid(struct cgroup *cgroup, uid_t tasks_uid, gid_t tasks_gid, uid_t control_uid, - gid_t control_gid) -{ - if (!cgroup) - return ECGINVAL; - - cgroup->tasks_uid = tasks_uid; - cgroup->tasks_gid = tasks_gid; - cgroup->control_uid = control_uid; - cgroup->control_gid = control_gid; - - return 0; -} - -int cgroup_get_uid_gid(struct cgroup *cgroup, uid_t *tasks_uid, gid_t *tasks_gid, - uid_t *control_uid, gid_t *control_gid) -{ - if (!cgroup || !tasks_uid || !tasks_gid || !control_uid || !control_gid) - return ECGINVAL; - - *tasks_uid = cgroup->tasks_uid; - *tasks_gid = cgroup->tasks_gid; - *control_uid = cgroup->control_uid; - *control_gid = cgroup->control_gid; - - return 0; -} - -struct cgroup_controller *cgroup_get_controller(struct cgroup *cgroup, const char *name) -{ - int i; - struct cgroup_controller *cgc; - - if (!cgroup) - return NULL; - - for (i = 0; i < cgroup->index; i++) { - cgc = cgroup->controller[i]; - - if (!strcmp(cgc->name, name)) - return cgc; - } - - return NULL; -} - -int cgroup_get_value_string(struct cgroup_controller *controller, const char *name, char **value) -{ - int i; - - if (!controller || !name || !value) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - *value = strdup(val->value); - - if (!*value) - return ECGOTHER; - - return 0; - } - } - - return ECGROUPVALUENOTEXIST; - -} - -int cgroup_set_value_string(struct cgroup_controller *controller, const char *name, - const char *value) -{ - int i; - - if (!controller || !name || !value) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - strncpy(val->value, value, CG_CONTROL_VALUE_MAX); - val->value[sizeof(val->value)-1] = '\0'; - val->dirty = true; - return 0; - } - } - - return cgroup_add_value_string(controller, name, value); -} - -int cgroup_get_value_int64(struct cgroup_controller *controller, const char *name, int64_t *value) -{ - int i; - - if (!controller || !name || !value) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - if (sscanf(val->value, "%" SCNd64, value) != 1) - return ECGINVAL; - - return 0; - } - } - - return ECGROUPVALUENOTEXIST; -} - -int cgroup_set_value_int64(struct cgroup_controller *controller, const char *name, int64_t value) -{ - int ret; - int i; - - if (!controller || !name) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - ret = snprintf(val->value, sizeof(val->value), "%" PRId64, value); - if (ret >= sizeof(val->value)) - return ECGINVAL; - - val->dirty = true; - return 0; - } - } - - return cgroup_add_value_int64(controller, name, value); -} - -int cgroup_get_value_uint64(struct cgroup_controller *controller, const char *name, - u_int64_t *value) -{ - int i; - - if (!controller || !name || !value) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - if (sscanf(val->value, "%" SCNu64, value) != 1) - return ECGINVAL; - - return 0; - } - } - - return ECGROUPVALUENOTEXIST; -} - -int cgroup_set_value_uint64(struct cgroup_controller *controller, const char *name, - u_int64_t value) -{ - int ret; - int i; - - if (!controller || !name) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - ret = snprintf(val->value, sizeof(val->value), "%" PRIu64, value); - if (ret >= sizeof(val->value)) - return ECGINVAL; - - val->dirty = true; - return 0; - } - } - - return cgroup_add_value_uint64(controller, name, value); -} - -int cgroup_get_value_bool(struct cgroup_controller *controller, const char *name, bool *value) -{ - int i; - - if (!controller || !name || !value) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - int cgc_val; - - if (sscanf(val->value, "%d", &cgc_val) != 1) - return ECGINVAL; - - if (cgc_val) - *value = true; - else - *value = false; - - return 0; - } - } - - return ECGROUPVALUENOTEXIST; -} - -int cgroup_set_value_bool(struct cgroup_controller *controller, const char *name, bool value) -{ - int ret; - int i; - - if (!controller || !name) - return ECGINVAL; - - for (i = 0; i < controller->index; i++) { - struct control_value *val = controller->values[i]; - - if (!strcmp(val->name, name)) { - if (value) - ret = snprintf(val->value, sizeof(val->value), "1"); - else - ret = snprintf(val->value, sizeof(val->value), "0"); - - if (ret >= sizeof(val->value)) - return ECGINVAL; - - val->dirty = true; - return 0; - - } - } - - return cgroup_add_value_bool(controller, name, value); -} - -struct cgroup *create_cgroup_from_name_value_pairs(const char *name, - struct control_value *name_value, int nv_number) -{ - struct cgroup_controller *cgc; - struct cgroup *src_cgroup; - char con[FILENAME_MAX]; - - int ret; - int i; - - /* create source cgroup */ - src_cgroup = cgroup_new_cgroup(name); - if (!src_cgroup) { - fprintf(stderr, "can't create cgroup: %s\n", cgroup_strerror(ECGFAIL)); - goto scgroup_err; - } - - /* Add pairs name-value to relevant controllers of this cgroup. */ - for (i = 0; i < nv_number; i++) { - - if ((strchr(name_value[i].name, '.')) == NULL) { - fprintf(stderr, "wrong -r parameter (%s=%s)\n", name_value[i].name, - name_value[i].value); - goto scgroup_err; - } - - strncpy(con, name_value[i].name, FILENAME_MAX - 1); - con[FILENAME_MAX - 1] = '\0'; - - strtok(con, "."); - - /* - * find out whether we have to add the controller or - * cgroup already contains it. - */ - cgc = cgroup_get_controller(src_cgroup, con); - if (!cgc) { - /* add relevant controller */ - cgc = cgroup_add_controller(src_cgroup, con); - if (!cgc) { - fprintf(stderr, "controller %s can't be add\n", con); - goto scgroup_err; - } - } - - /* add name-value pair to this controller */ - ret = cgroup_add_value_string(cgc, name_value[i].name, name_value[i].value); - if (ret) { - fprintf(stderr, "name-value pair %s=%s can't be set\n", name_value[i].name, - name_value[i].value); - goto scgroup_err; - } - } - - return src_cgroup; - -scgroup_err: - cgroup_free(&src_cgroup); - - return NULL; -} - -int cgroup_get_value_name_count(struct cgroup_controller *controller) -{ - if (!controller) - return -1; - - return controller->index; -} - - -char *cgroup_get_value_name(struct cgroup_controller *controller, int index) -{ - - if (!controller) - return NULL; - - if (index < controller->index) - return (controller->values[index])->name; - else - return NULL; -} - -char *cgroup_get_cgroup_name(struct cgroup *cgroup) -{ - if (!cgroup) - return NULL; - - return cgroup->name; -} - - -/* - * Return true if cgroup setup mode is cgroup v1 (legacy), else - * returns false. - */ -bool is_cgroup_mode_legacy(void) -{ - enum cg_setup_mode_t setup_mode; - - setup_mode = cgroup_setup_mode(); - return (setup_mode == CGROUP_MODE_LEGACY); -} - -/* - * Return true if cgroup setup mode is cgroup v1/v2 (hybrid), else - * returns false. - */ -bool is_cgroup_mode_hybrid(void) -{ - enum cg_setup_mode_t setup_mode; - - setup_mode = cgroup_setup_mode(); - return (setup_mode == CGROUP_MODE_HYBRID); -} - -/* - * Return true if cgroup setup mode is cgroup v2 (unified), else - * returns false. - */ -bool is_cgroup_mode_unified(void) -{ - enum cg_setup_mode_t setup_mode; - - setup_mode = cgroup_setup_mode(); - return (setup_mode == CGROUP_MODE_UNIFIED); -} diff --git a/lib/libcgroup-3.1.0/tests/Makefile.am b/lib/libcgroup-3.1.0/tests/Makefile.am deleted file mode 100644 index fd4b335425f..00000000000 --- a/lib/libcgroup-3.1.0/tests/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -DIST_SUBDIRS = ftests gunit -if WITH_TESTS -SUBDIRS = $(DIST_SUBDIRS) -endif diff --git a/lib/libcgroup-3.1.0/tests/Makefile.in b/lib/libcgroup-3.1.0/tests/Makefile.in deleted file mode 100644 index 17d2256c154..00000000000 --- a/lib/libcgroup-3.1.0/tests/Makefile.in +++ /dev/null @@ -1,653 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = tests -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir distdir-am -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in README.md -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -DIST_SUBDIRS = ftests gunit -@WITH_TESTS_TRUE@SUBDIRS = $(DIST_SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/libcgroup-3.1.0/tests/README.md b/lib/libcgroup-3.1.0/tests/README.md deleted file mode 100644 index 05449ee7bcc..00000000000 --- a/lib/libcgroup-3.1.0/tests/README.md +++ /dev/null @@ -1,5 +0,0 @@ -[![Build Status](https://github.com/libcgroup/libcgroup-tests/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/libcgroup/libcgroup-tests/actions) -[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/libcgroup/libcgroup-tests.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/libcgroup/libcgroup-tests/alerts/?mode=list) - -The libcgroup-tests repository contains the automated tests for the -[libcgroup](https://github.com/libcgroup/libcgroup) project. diff --git a/lib/libcgroup-3.1.0/tests/ftests/001-cgget-basic_cgget_v1.py b/lib/libcgroup-3.1.0/tests/ftests/001-cgget-basic_cgget_v1.py deleted file mode 100755 index c7b3a34f56e..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/001-cgget-basic_cgget_v1.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgget functionality test -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '001cgget' -SETTING = 'cpu.shares' -VALUE = '512' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - Cgroup.set(config, CGNAME, SETTING, VALUE) - - -def test(config): - Cgroup.get_and_validate(config, CGNAME, SETTING, VALUE) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/002-cgdelete-recursive_delete.py b/lib/libcgroup-3.1.0/tests/ftests/002-cgdelete-recursive_delete.py deleted file mode 100755 index d999ca6b9fe..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/002-cgdelete-recursive_delete.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup recursive cgdelete functionality test -# -# Copyright (c) 2020-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from libcgroup import Mode -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -PARENT = '002cgdelete' -CHILD = 'childcg' -GRANDCHILD = 'grandchildcg' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - # This test has shown inconsistent failures on underpowered legacy - # machines when run within a container. Skip that configuration - if Cgroup.get_cgroup_mode(config) == Mode.CGROUP_MODE_LEGACY and \ - config.args.container: - result = consts.TEST_SKIPPED - cause = 'Skip this test in containerized legacy hierarchies' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENT) - Cgroup.create(config, CONTROLLER, os.path.join(PARENT, CHILD)) - Cgroup.create(config, CONTROLLER, os.path.join(PARENT, CHILD, GRANDCHILD)) - - version = CgroupVersion.get_version(CONTROLLER) - if version == CgroupVersion.CGROUP_V1: - # cgdelete in a cgroup v1 controller should be able to move a process - # from a child cgroup to its parent. - # - # Moving a process from a child cgroup to its parent isn't (easily) - # supported in cgroup v2 because of cgroup v2's restriction that - # processes only be located in leaf cgroups - grandchild_cgrp_path = os.path.join(PARENT, CHILD, GRANDCHILD) - config.process.create_process_in_cgroup(config, CONTROLLER, - grandchild_cgrp_path) - - -def test(config): - Cgroup.delete(config, CONTROLLER, PARENT, recursive=True) - - return consts.TEST_PASSED, None - - -def teardown(config): - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/003-cgget-basic_cgget_v2.py b/lib/libcgroup-3.1.0/tests/ftests/003-cgget-basic_cgget_v2.py deleted file mode 100755 index f5fe7666df7..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/003-cgget-basic_cgget_v2.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgget functionality test -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '003cgget' - -SETTING = 'cpuset.mems' -VALUE = '0' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpuset') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpuset controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - Cgroup.set(config, CGNAME, SETTING, VALUE) - - -def test(config): - Cgroup.get_and_validate(config, CGNAME, SETTING, VALUE) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/004-cgsnapshot-basic_snapshot_v1.py b/lib/libcgroup-3.1.0/tests/ftests/004-cgsnapshot-basic_snapshot_v1.py deleted file mode 100755 index 6b6f32c1139..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/004-cgsnapshot-basic_snapshot_v1.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgsnapshot functionality test -# -# Copyright (c) 2020-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME = '004cgsnapshot' -CGSNAPSHOT = """group 004cgsnapshot { - memory { - memory.use_hierarchy="1"; - memory.soft_limit_in_bytes="9223372036854771712"; - memory.force_empty=""; - memory.move_charge_at_immigrate="0"; - memory.kmem.tcp.max_usage_in_bytes="0"; - memory.max_usage_in_bytes="0"; - memory.oom_control="oom_kill_disable 0 - under_oom 0 - oom_kill 0"; - memory.limit_in_bytes="9223372036854771712"; - memory.swappiness="60"; - memory.kmem.failcnt="0"; - memory.kmem.max_usage_in_bytes="0"; - memory.failcnt="0"; - memory.kmem.tcp.failcnt="0"; - memory.kmem.limit_in_bytes="9223372036854771712"; - memory.use_hierarchy="1"; - memory.kmem.tcp.limit_in_bytes="9223372036854771712"; -""" - -CGSNAPSHOT_SWAP = """ memory.memsw.failcnt="0"; - memory.memsw.limit_in_bytes="9223372036854771712"; - memory.memsw.max_usage_in_bytes="0"; - } - }""" - -CGSNAPSHOT_NOSWAP = """ } - }""" - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - return result, cause - - if not config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test must be run within a container' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - try: - # check if the memsw.failcnt file exists. if so, add it to the - # expected snapshot - Cgroup.get(config, setting='memory.memsw.failcnt', cgname=CGNAME) - expected_str = CGSNAPSHOT + CGSNAPSHOT_SWAP - except RunError: - # memsw files don't exist. exclude them from the snapshot - expected_str = CGSNAPSHOT + CGSNAPSHOT_NOSWAP - - expected = Cgroup.snapshot_to_dict(expected_str) - actual = Cgroup.snapshot(config, controller=CONTROLLER) - - if expected[CGNAME] != actual[CGNAME]: - result = consts.TEST_FAILED - cause = 'Expected cgsnapshot result did not equal actual cgsnapshot' - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/005-cgsnapshot-basic_snapshot_v2.py b/lib/libcgroup-3.1.0/tests/ftests/005-cgsnapshot-basic_snapshot_v2.py deleted file mode 100755 index 006a4b709a8..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/005-cgsnapshot-basic_snapshot_v2.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgsnapshot functionality test -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '005cgsnapshot' -CGSNAPSHOT = """group 005cgsnapshot { - cpuset { - cpuset.cpus.partition="member"; - cpuset.mems=""; - cpuset.cpus=""; - } - }""" - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpuset') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpuset controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - expected = Cgroup.snapshot_to_dict(CGSNAPSHOT) - actual = Cgroup.snapshot(config, controller=CONTROLLER) - - if expected[CGNAME].controllers[CONTROLLER] != \ - actual[CGNAME].controllers[CONTROLLER]: - result = consts.TEST_FAILED - cause = 'Expected cgsnapshot result did not equal actual cgsnapshot' - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/006-cgrules-basic_cgrules_v1.py b/lib/libcgroup-3.1.0/tests/ftests/006-cgrules-basic_cgrules_v1.py deleted file mode 100755 index b7a9b586732..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/006-cgrules-basic_cgrules_v1.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgrules functionality test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from process import Process -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -PARENT_CGNAME = '006cgrules' -CHILD_CGNAME = 'childcg' - -# move all perl processes to the 006cgrules/childcg cgroup in the -# cpu controller -CGRULE = ( - '*:/usr/bin/perl cpu {}' - ''.format(os.path.join(PARENT_CGNAME, CHILD_CGNAME)) - ) - -cg = Cgroup(os.path.join(PARENT_CGNAME, CHILD_CGNAME)) - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENT_CGNAME) - Cgroup.create(config, CONTROLLER, - os.path.join(PARENT_CGNAME, CHILD_CGNAME)) - - Cgroup.set_cgrules_conf(config, CGRULE, append=False) - cg.start_cgrules(config) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - pid = config.process.create_process(config) - proc_cgroup = Process.get_cgroup(config, pid, CONTROLLER) - - # proc/{pid}/cgroup alsways prepends a '/' to the cgroup path - if proc_cgroup != os.path.join('/', PARENT_CGNAME, CHILD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'PID {} was expected to be in cgroup {} but is in ' - 'cgroup {}' - ''.format(pid, - os.path.join('/', PARENT_CGNAME, CHILD_CGNAME), - proc_cgroup) - ) - - return result, cause - - -def teardown(config): - # destroy the child processes - config.process.join_children(config) - cg.join_children(config) - Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/007-cgrules-basic_cgrules_v2.py b/lib/libcgroup-3.1.0/tests/ftests/007-cgrules-basic_cgrules_v2.py deleted file mode 100755 index 4216a1b66a0..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/007-cgrules-basic_cgrules_v2.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic cgrules functionality test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from process import Process -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '007cgrules' - -# move all perl processes to the 007cgrules cgroup in the -# cpuset controller -CGRULE = '*:/usr/bin/perl cpuset {}'.format(CGNAME) - -cg = Cgroup(CGNAME) - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version('cpuset') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpuset controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - Cgroup.set_cgrules_conf(config, CGRULE, append=False) - cg.start_cgrules(config) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - pid = config.process.create_process(config) - proc_cgroup = Process.get_cgroup(config, pid, CONTROLLER) - - # proc/{pid}/cgroup alsways prepends a '/' to the cgroup path - if proc_cgroup != os.path.join('/', CGNAME): - result = consts.TEST_FAILED - cause = ( - 'PID {} was expected to be in cgroup {} but is in ' - 'cgroup {}' - ''.format(pid, os.path.join('/', CGNAME), proc_cgroup) - ) - - return result, cause - - -def teardown(config): - # destroy the child processes - config.process.join_children(config) - cg.join_children(config) - Cgroup.delete(config, CONTROLLER, CGNAME, recursive=False) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/008-cgget-multiple_r_flags.py b/lib/libcgroup-3.1.0/tests/ftests/008-cgget-multiple_r_flags.py deleted file mode 100755 index e4120824f6d..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/008-cgget-multiple_r_flags.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - multiple '-r' flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME = '008cgget' - -SETTING1_V1 = 'memory.limit_in_bytes' -SETTING1_V2 = 'memory.max' -VALUE1 = '1048576' - -SETTING2_V1 = 'memory.soft_limit_in_bytes' -SETTING2_V2 = 'memory.high' -VALUE2 = '1024000' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - Cgroup.set(config, CGNAME, SETTING1_V1, VALUE1) - Cgroup.set(config, CGNAME, SETTING2_V1, VALUE2) - elif version == CgroupVersion.CGROUP_V2: - Cgroup.set(config, CGNAME, SETTING1_V2, VALUE1) - Cgroup.set(config, CGNAME, SETTING2_V2, VALUE2) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - settings = [SETTING1_V1, SETTING2_V1] - elif version == CgroupVersion.CGROUP_V2: - settings = [SETTING1_V2, SETTING2_V2] - - out = Cgroup.get(config, controller=None, cgname=CGNAME, setting=settings) - - if out.splitlines()[0] != '{}:'.format(CGNAME): - result = consts.TEST_FAILED - cause = ( - 'cgget expected the cgroup name {} in the first line.\n' - 'Instead it received {}' - ''.format(CGNAME, out.splitlines()[0]) - ) - - if out.splitlines()[1] != '{}: {}'.format(settings[0], VALUE1): - result = consts.TEST_FAILED - cause = ( - 'cgget expected the following:\n\t{}: {}\n' - 'but received:\n\t{}' - ''.format(settings[0], VALUE1, out.splitlines()[1]) - ) - - if out.splitlines()[2] != '{}: {}'.format(settings[1], VALUE2): - result = consts.TEST_FAILED - cause = ( - 'cgget expected the following:\n\t{}: {}\n' - 'but received:\n\t{}' - ''.format(settings[1], VALUE2, out.splitlines()[2]) - ) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/009-cgget-g_flag_controller_only.py b/lib/libcgroup-3.1.0/tests/ftests/009-cgget-g_flag_controller_only.py deleted file mode 100755 index 5997307e965..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/009-cgget-g_flag_controller_only.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - '-g' -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '009cgget' - -EXPECTED_OUT_V1 = [ - '''009cgget: - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth without cpu.stat nr_busts, burst_time - '''009cgget: - cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth with cpu.stat nr_busts, burst_time - '''009cgget: - cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - nr_bursts 0 - burst_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - -EXPECTED_OUT_V2 = [ - '''009cgget: - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI - '''009cgget: - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth without cpu.stat nr_busts, burst_time - '''009cgget: - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth with cpu.stat nr_busts, burst_time - '''009cgget: - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - nr_bursts 0 - burst_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=CONTROLLER, cgname=CGNAME) - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - for expected_out in EXPECTED_OUT_V1: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - elif version == CgroupVersion.CGROUP_V2: - for expected_out in EXPECTED_OUT_V2: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - - if len(out.splitlines()) != len(expected_out.splitlines()): - result = consts.TEST_FAILED - cause = ( - 'Expected {} lines but received {} lines' - ''.format(len(expected_out.splitlines()), - len(out.splitlines())) - ) - return result, cause - - for line_num, line in enumerate(out.splitlines()): - if line.strip() != expected_out.splitlines()[line_num].strip(): - result = consts.TEST_FAILED - cause = ( - 'Expected line:\n\t{}\nbut received line:\n\t{}' - ''.format(expected_out.splitlines()[line_num].strip(), - line.strip()) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py deleted file mode 100755 index 469e3c64c59..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - '-g' : -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '010cgget' - -EXPECTED_OUT_V1 = [ - '''cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth without cpu.stat nr_busts, burst_time - '''cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth with cpu.stat nr_busts, burst_time - '''cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - nr_bursts 0 - burst_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - -EXPECTED_OUT_V2 = [ - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth without cpu.stat nr_busts, burst_time - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth with cpu.stat nr_busts, burst_time - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - nr_bursts 0 - burst_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', -] - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller='{}:{}'.format(CONTROLLER, CGNAME), - print_headers=False) - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - for expected_out in EXPECTED_OUT_V1: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - elif version == CgroupVersion.CGROUP_V2: - for expected_out in EXPECTED_OUT_V2: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - - if len(out.splitlines()) != len(expected_out.splitlines()): - result = consts.TEST_FAILED - cause = ( - 'Expected line count: {}, but received line count: {}' - ''.format(len(expected_out.splitlines()), - len(out.splitlines())) - ) - return result, cause - - if len(out.splitlines()) != len(expected_out.splitlines()): - result = consts.TEST_FAILED - cause = ( - 'Expected {} lines but received {} lines' - ''.format(len(expected_out.splitlines()), - len(out.splitlines())) - ) - return result, cause - - for line_num, line in enumerate(out.splitlines()): - if line.strip() != expected_out.splitlines()[line_num].strip(): - result = consts.TEST_FAILED - cause = ( - 'Expected line:\n\t{}\nbut received line:\n\t{}' - ''.format(expected_out.splitlines()[line_num].strip(), - line.strip()) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/011-cgget-r_flag_two_cgroups.py b/lib/libcgroup-3.1.0/tests/ftests/011-cgget-r_flag_two_cgroups.py deleted file mode 100755 index e6a02defeb3..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/011-cgget-r_flag_two_cgroups.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - '-r' -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME1 = '011cgget1' -CGNAME2 = '011cgget2' - -SETTING_V1 = 'memory.limit_in_bytes' -SETTING_V2 = 'memory.max' -VALUE = '2048000' - -EXPECTED_OUT_V1 = '''011cgget1: -memory.limit_in_bytes: 2048000 - -011cgget2: -memory.limit_in_bytes: 2048000 -''' - -EXPECTED_OUT_V2 = '''011cgget1: -memory.max: 2048000 - -011cgget2: -memory.max: 2048000 -''' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME1) - Cgroup.create(config, CONTROLLER, CGNAME2) - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - Cgroup.set(config, CGNAME1, SETTING_V1, VALUE) - Cgroup.set(config, CGNAME2, SETTING_V1, VALUE) - elif version == CgroupVersion.CGROUP_V2: - Cgroup.set(config, CGNAME1, SETTING_V2, VALUE) - Cgroup.set(config, CGNAME2, SETTING_V2, VALUE) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - setting = SETTING_V1 - expected_out = EXPECTED_OUT_V1 - elif version == CgroupVersion.CGROUP_V2: - setting = SETTING_V2 - expected_out = EXPECTED_OUT_V2 - - out = Cgroup.get(config, controller=None, cgname=[CGNAME1, CGNAME2], - setting=setting) - - for line_num, line in enumerate(out.splitlines()): - if line.strip() != expected_out.splitlines()[line_num].strip(): - result = consts.TEST_FAILED - cause = ( - 'Expected line:\n\t{}\nbut received line:\n\t{}' - ''.format(expected_out.splitlines()[line_num].strip(), - line.strip()) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME1) - Cgroup.delete(config, CONTROLLER, CGNAME2) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/012-cgget-multiple_r_flags2.py b/lib/libcgroup-3.1.0/tests/ftests/012-cgget-multiple_r_flags2.py deleted file mode 100755 index d0bd7eda97e..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/012-cgget-multiple_r_flags2.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - multiple '-r' flags and multiple cgroups -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME1 = '012cgget1' -CGNAME2 = '012cgget2' - -SETTING1_V1 = 'memory.limit_in_bytes' -SETTING1_V2 = 'memory.max' -VALUE1 = '4194304' - -SETTING2_V1 = 'memory.soft_limit_in_bytes' -SETTING2_V2 = 'memory.high' -VALUE2 = '4096000' - -EXPECTED_OUT = '''{}: -{} -{} - -{}: -{} -{} -'''.format(CGNAME1, VALUE1, VALUE2, CGNAME2, VALUE1, VALUE2) - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME1) - Cgroup.create(config, CONTROLLER, CGNAME2) - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - Cgroup.set(config, CGNAME1, SETTING1_V1, VALUE1) - Cgroup.set(config, CGNAME1, SETTING2_V1, VALUE2) - Cgroup.set(config, CGNAME2, SETTING1_V1, VALUE1) - Cgroup.set(config, CGNAME2, SETTING2_V1, VALUE2) - elif version == CgroupVersion.CGROUP_V2: - Cgroup.set(config, CGNAME1, SETTING1_V2, VALUE1) - Cgroup.set(config, CGNAME1, SETTING2_V2, VALUE2) - Cgroup.set(config, CGNAME2, SETTING1_V2, VALUE1) - Cgroup.set(config, CGNAME2, SETTING2_V2, VALUE2) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - version = CgroupVersion.get_version(CONTROLLER) - - if version == CgroupVersion.CGROUP_V1: - settings = [SETTING1_V1, SETTING2_V1] - elif version == CgroupVersion.CGROUP_V2: - settings = [SETTING1_V2, SETTING2_V2] - - out = Cgroup.get(config, controller=None, cgname=[CGNAME1, CGNAME2], - setting=settings, values_only=True) - - for line_num, line in enumerate(out.splitlines()): - if line.strip() != EXPECTED_OUT.splitlines()[line_num].strip(): - result = consts.TEST_FAILED - cause = ( - 'Expected line:\n\t{}\nbut received line:\n\t{}' - ''.format(EXPECTED_OUT.splitlines()[line_num].strip(), - line.strip()) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME1) - Cgroup.delete(config, CONTROLLER, CGNAME2) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/013-cgget-multiple_g_flags.py b/lib/libcgroup-3.1.0/tests/ftests/013-cgget-multiple_g_flags.py deleted file mode 100755 index da0d2697181..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/013-cgget-multiple_g_flags.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - multiple '-g' flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER1 = 'pids' -CONTROLLER2 = 'cpu' -CGNAME = '013cgget' - -EXPECTED_OUT_V1 = [ - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with cfs_bandwidth without cpu.stat nr_busts, burst_time - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with cfs_bandwidth with cpu.stat nr_busts, burst_time - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - nr_bursts 0 - burst_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - -EXPECTED_OUT_V2 = [ - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth without cpu.stat nr_busts, burst_time - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth with cpu.stat nr_busts, burst_time - '''013cgget: - pids.current: 0 - pids.events: max 0 - pids.max: max - cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - nr_bursts 0 - burst_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER1, CGNAME) - Cgroup.create(config, CONTROLLER2, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=[CONTROLLER1, CONTROLLER2], - cgname=CGNAME) - - version = CgroupVersion.get_version(CONTROLLER1) - - if version == CgroupVersion.CGROUP_V1: - for expected_out in EXPECTED_OUT_V1: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - elif version == CgroupVersion.CGROUP_V2: - for expected_out in EXPECTED_OUT_V2: - if len(out.splitlines()) == len(expected_out.splitlines()): - break - - if len(out.splitlines()) != len(expected_out.splitlines()): - result = consts.TEST_FAILED - cause = ( - 'Expected {} lines but received {} lines' - ''.format(len(expected_out.splitlines()), - len(out.splitlines())) - ) - return result, cause - - for line_num, line in enumerate(out.splitlines()): - if line.strip() != expected_out.splitlines()[line_num].strip(): - result = consts.TEST_FAILED - cause = ( - 'Expected line:\n\t{}\nbut received line:\n\t{}' - ''.format(expected_out.splitlines()[line_num].strip(), - line.strip()) - ) - return result, cause - - return result, cause - - -def teardown(config): - ver1 = CgroupVersion.get_version(CONTROLLER1) - ver2 = CgroupVersion.get_version(CONTROLLER2) - - if ver1 == CgroupVersion.CGROUP_V2 and \ - ver2 == CgroupVersion.CGROUP_V2: - # If both controllers are cgroup v2, then we only need to delete - # one cgroup. The path will be the same for both - Cgroup.delete(config, [CONTROLLER1, CONTROLLER2], CGNAME) - else: - Cgroup.delete(config, CONTROLLER1, CGNAME) - Cgroup.delete(config, CONTROLLER2, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/014-cgget-a_flag.py b/lib/libcgroup-3.1.0/tests/ftests/014-cgget-a_flag.py deleted file mode 100755 index 145135513a5..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/014-cgget-a_flag.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - exercise the '-a' flag -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER1 = 'memory' -CONTROLLER2 = 'cpuset' -CGNAME = '014cgget' - - -def prereqs(config): - pass - - -def setup(config): - ver1 = CgroupVersion.get_version(CONTROLLER1) - ver2 = CgroupVersion.get_version(CONTROLLER2) - - if ver1 == CgroupVersion.CGROUP_V2 and \ - ver2 == CgroupVersion.CGROUP_V2: - # If both controllers are cgroup v2, then we only need to make - # one cgroup. The path will be the same for both - Cgroup.create(config, [CONTROLLER1, CONTROLLER2], CGNAME) - else: - Cgroup.create(config, CONTROLLER1, CGNAME) - Cgroup.create(config, CONTROLLER2, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, cgname=CGNAME, all_controllers=True) - - # arbitrary check to ensure we read several lines - if len(out.splitlines()) < 20: - result = consts.TEST_FAILED - cause = ( - 'Expected multiple lines, but only received {}' - ''.format(len(out.splitlines())) - ) - return result, cause - - # arbitrary check for a setting that's in both cgroup v1 and cgroup v2 - # memory.stat - if '\tpgmajfault' not in out: - result = consts.TEST_FAILED - cause = 'Unexpected output\n{}'.format(out) - return result, cause - - # make sure that a cpuset value was in the output: - if 'cpuset.cpus' not in out: - result = consts.TEST_FAILED - cause = 'Failed to find cpuset settings in output\n{}'.format(out) - - return result, cause - - -def teardown(config): - ver1 = CgroupVersion.get_version(CONTROLLER1) - ver2 = CgroupVersion.get_version(CONTROLLER2) - - if ver1 == CgroupVersion.CGROUP_V2 and \ - ver2 == CgroupVersion.CGROUP_V2: - # If both controllers are cgroup v2, then we only need to make - # one cgroup. The path will be the same for both - Cgroup.delete(config, [CONTROLLER1, CONTROLLER2], CGNAME) - else: - Cgroup.delete(config, CONTROLLER1, CGNAME) - Cgroup.delete(config, CONTROLLER2, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/015-cgget-multiline_r_flag.py b/lib/libcgroup-3.1.0/tests/ftests/015-cgget-multiline_r_flag.py deleted file mode 100755 index 388a0e10e1d..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/015-cgget-multiline_r_flag.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - get a multiline value via the '-r' flag -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME = '015cgget' - -SETTING = 'memory.stat' -VALUE = '512' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=None, cgname=CGNAME, - setting=SETTING, print_headers=True, - values_only=False) - - # arbitrary check to ensure we read several lines - if len(out.splitlines()) < 10: - result = consts.TEST_FAILED - cause = ( - 'Expected multiple lines, but only received {}' - ''.format(len(out.splitlines())) - ) - return result, cause - - # arbitrary check for a setting that's in both cgroup v1 and cgroup v2 - # memory.stat - if '\tunevictable' not in out: - result = consts.TEST_FAILED - cause = 'Unexpected output\n{}'.format(out) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/016-cgget-invalid_options.py b/lib/libcgroup-3.1.0/tests/ftests/016-cgget-invalid_options.py deleted file mode 100755 index 2fd80f6f181..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/016-cgget-invalid_options.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - multiple '-g' flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '016cgget' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - # Github Actions has issues with cgget and the code coverage profiler. - # This causes issues with the error handling of this test - if not config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test must be run within a container' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - try: - # cgget -g cpu - Cgroup.get(config, controller=CONTROLLER) - except RunError as re: - if 'Wrong input parameters,' not in re.stderr: - result = consts.TEST_FAILED - cause = "#1 Expected 'Wrong input parameters' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#1 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #1 erroneously passed' - return result, cause - - try: - # cgget -g cpu:016cgget 016cgget - Cgroup.get(config, controller='{}:{}'.format(CONTROLLER, CGNAME), - cgname=CGNAME) - except RunError as re: - if 'Wrong input parameters,' not in re.stderr: - result = consts.TEST_FAILED - cause = "#2 Expected 'Wrong input parameters' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#2 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #2 erroneously passed' - return result, cause - - try: - # cgget -r invalidsetting 016cgget - Cgroup.get(config, setting='invalidsetting', cgname=CGNAME, - print_headers=False, values_only=True) - except RunError as re: - if 'cgget: error parsing parameter name' not in re.stderr: - result = consts.TEST_FAILED - cause = ( - "#3 Expected 'cgget: error parsing parameter name' to " - "be in stderr" - ) - return result, cause - - # legacy cgget returns 0 but populates stderr for this case. - # This feels wrong, so the updated cgget returns ECGINVAL - if re.ret != 91 and re.ret != 0: - result = consts.TEST_FAILED - cause = ( - '#3 Expected return code of 0 or 91 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #3 erroneously passed' - return result, cause - - try: - # cgget -r invalid.setting 016cgget - Cgroup.get(config, setting='invalid.setting', cgname=CGNAME, - print_headers=False, values_only=True) - except RunError as re: - if 'cgget: cannot find controller' not in re.stderr: - result = consts.TEST_FAILED - cause = ( - "#4 Expected 'cgget: cannot find controller' to be in " - "stderr" - ) - return result, cause - - # legacy cgget returns 0 but populates stderr for this case. - # This feels wrong, so the updated cgget returns ECGOTHER - if re.ret != 96 and re.ret != 0: - result = consts.TEST_FAILED - cause = ( - '#4 Expected return code of 0 or 96 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #4 erroneously passed' - return result, cause - - try: - # cgget -r cpu.invalid 016cgget - Cgroup.get(config, setting='{}.invalid'.format(CONTROLLER), - cgname=CGNAME, print_headers=False, values_only=True) - except RunError as re: - if 'variable file read failed' not in re.stderr: - result = consts.TEST_FAILED - cause = "#5 Expected 'variable file read failed' to be in stderr" - return result, cause - - # legacy cgget returns 0 but populates stderr for this case. - # This feels wrong, so the updated cgget returns ECGOTHER - if re.ret != 96 and re.ret != 0: - result = consts.TEST_FAILED - cause = ( - '#5 Expected return code of 0 or 96 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #5 erroneously passed' - return result, cause - - try: - # cgget with no parameters - Cgroup.get(config, controller=None, cgname=None, setting=None, - print_headers=True, values_only=False, - all_controllers=False, cghelp=False) - except RunError as re: - if 'Wrong input parameters,' not in re.stderr: - result = consts.TEST_FAILED - cause = "#6 Expected 'Wrong input parameters' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#6 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #6 erroneously passed' - return result, cause - - # cgget -h - ret = Cgroup.get(config, cghelp=True) - if 'Print parameter(s)' not in ret: - result = consts.TEST_FAILED - cause = '#7 Failed to print help text' - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/017-cgconfig-load_file.py b/lib/libcgroup-3.1.0/tests/ftests/017-cgconfig-load_file.py deleted file mode 100755 index 8ab58eb1c79..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/017-cgconfig-load_file.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser functionality test using a configuration file -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '017cgconfig' -CFS_PERIOD = '500000' -CFS_QUOTA = '100000' -SHARES = '999' - -CONFIG_FILE = '''group -{} {{ - {} {{ - cpu.cfs_period_us = {}; - cpu.cfs_quota_us = {}; - cpu.shares = {}; - }} -}}'''.format(CGNAME, CONTROLLER, CFS_PERIOD, CFS_QUOTA, SHARES) - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '017cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - - return result, cause - - -def setup(config): - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - -def test(config): - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_period_us', CFS_PERIOD) - Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_quota_us', CFS_QUOTA) - Cgroup.get_and_validate(config, CGNAME, 'cpu.shares', SHARES) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - os.remove(CONFIG_FILE_NAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/018-cgconfig-load_dir.py b/lib/libcgroup-3.1.0/tests/ftests/018-cgconfig-load_dir.py deleted file mode 100755 index 4f9dfa71e80..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/018-cgconfig-load_dir.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser functionality test using a configuration directory -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CPU_CTRL = 'cpu' -MEMORY_CTRL = 'memory' -CGNAME = '018cgconfig' -CFS_PERIOD = '400000' -CFS_QUOTA = '50000' -SHARES = '123' - -LIMIT_IN_BYTES = '409600' -SOFT_LIMIT_IN_BYTES = '376832' - -CONFIG_FILE = '''group -{} {{ - {} {{ - cpu.cfs_period_us = {}; - cpu.cfs_quota_us = {}; - cpu.shares = {}; - }} - {} {{ - memory.limit_in_bytes = {}; - memory.soft_limit_in_bytes = {}; - }} -}}'''.format(CGNAME, CPU_CTRL, CFS_PERIOD, CFS_QUOTA, SHARES, - MEMORY_CTRL, LIMIT_IN_BYTES, SOFT_LIMIT_IN_BYTES) - -CONFIG_FILE_DIR = os.path.join(os.getcwd(), '018cgconfig') -CONFIG_FILE_NAME = os.path.join(CONFIG_FILE_DIR, 'cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - - return result, cause - - -def setup(config): - os.mkdir(CONFIG_FILE_DIR) - - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - -def test(config): - Cgroup.configparser(config, load_dir=CONFIG_FILE_DIR) - - Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_period_us', CFS_PERIOD) - Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_quota_us', CFS_QUOTA) - Cgroup.get_and_validate(config, CGNAME, 'cpu.shares', SHARES) - Cgroup.get_and_validate(config, CGNAME, 'memory.limit_in_bytes', - LIMIT_IN_BYTES) - Cgroup.get_and_validate(config, CGNAME, 'memory.soft_limit_in_bytes', - SOFT_LIMIT_IN_BYTES) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CPU_CTRL, CGNAME) - Cgroup.delete(config, MEMORY_CTRL, CGNAME) - os.remove(CONFIG_FILE_NAME) - os.rmdir(CONFIG_FILE_DIR) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/019-cgconfig-uidgid_dperm_fperm.py b/lib/libcgroup-3.1.0/tests/ftests/019-cgconfig-uidgid_dperm_fperm.py deleted file mode 100755 index 2d99777df90..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/019-cgconfig-uidgid_dperm_fperm.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser functionality test - '-a', '-d', '-f' flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from container import ContainerError -from run import Run, RunError -from cgroup import Cgroup -import consts -import ftests -import utils -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '019cgconfig' - -CONFIG_FILE = '''group -{} {{ - {} {{ - }} -}}'''.format(CGNAME, CONTROLLER) - -USER = 'cguser019' -GROUP = 'cggroup019' -DPERM = '515' -FPERM = '246' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '019cgconfig.conf') - - -def prereqs(config): - pass - - -def setup(config): - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - if config.args.container: - config.container.run(['useradd', '-p', 'Test019#1', USER]) - config.container.run(['groupadd', GROUP]) - else: - Run.run(['sudo', 'useradd', '-p', 'Test019#1', USER]) - Run.run(['sudo', 'groupadd', '-f', GROUP]) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME, dflt_usr=USER, - dflt_grp=GROUP, dperm=DPERM, fperm=FPERM) - - mnt_path = Cgroup.get_controller_mount_point(CONTROLLER) - cpus_path = os.path.join(mnt_path, CGNAME, 'cpuset.cpus') - - user = utils.get_file_owner_username(config, cpus_path) - group = utils.get_file_owner_group_name(config, cpus_path) - - if user != USER: - result = consts.TEST_FAILED - cause = ( - 'Owner name failed. Expected {}, received {}\n' - ''.format(USER, user) - ) - return result, cause - - if group != GROUP: - result = consts.TEST_FAILED - cause = ( - 'Owner group failed. Expected {}, received {}\n' - ''.format(GROUP, group) - ) - return result, cause - - fperm = utils.get_file_permissions(config, cpus_path) - if fperm != FPERM: - result = consts.TEST_FAILED - cause = ( - 'File permissions failed. Expected {}, received {}\n' - ''.format(FPERM, fperm) - ) - return result, cause - - dperm = utils.get_file_permissions(config, os.path.join(mnt_path, CGNAME)) - if dperm != DPERM: - result = consts.TEST_FAILED - cause = ( - 'Directory permissions failed. Expected {}, received {}\n' - ''.format(DPERM, dperm) - ) - - return result, cause - - -def teardown(config): - os.remove(CONFIG_FILE_NAME) - - try: - if config.args.container: - config.container.run(['userdel', USER]) - config.container.run(['groupdel', GROUP]) - else: - Run.run(['sudo', 'userdel', '-r', USER]) - Run.run(['sudo', 'groupdel', GROUP]) - except (ContainerError, RunError, ValueError): - pass - - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/020-cgconfig-tasks_perms_owner.py b/lib/libcgroup-3.1.0/tests/ftests/020-cgconfig-tasks_perms_owner.py deleted file mode 100755 index 19ed057b19d..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/020-cgconfig-tasks_perms_owner.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser functionality test - '-s', '-t', flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from container import ContainerError -from run import Run, RunError -import consts -import ftests -import utils -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '020cgconfig' - -CONFIG_FILE = '''group -{} {{ - {} {{ - }} -}}'''.format(CGNAME, CONTROLLER) - -USER = 'cguser020' -GROUP = 'cggroup020' -TPERM = '642' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '020cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpuset') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpuset controller' - - return result, cause - - -def setup(config): - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - if config.args.container: - config.container.run(['useradd', '-p', 'Test020#1', USER]) - config.container.run(['groupadd', GROUP]) - else: - Run.run(['sudo', 'useradd', '-p', 'Test020#1', USER]) - Run.run(['sudo', 'groupadd', '-f', GROUP]) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME, tperm=TPERM, - tasks_usr=USER, tasks_grp=GROUP) - - mnt_path = Cgroup.get_controller_mount_point(CONTROLLER) - tasks_path = os.path.join(mnt_path, CGNAME, 'tasks') - - user = utils.get_file_owner_username(config, tasks_path) - group = utils.get_file_owner_group_name(config, tasks_path) - - if user != USER: - result = consts.TEST_FAILED - cause = ( - 'Owner name failed. Expected {}, received {}\n' - ''.format(USER, user) - ) - return result, cause - - if group != GROUP: - result = consts.TEST_FAILED - cause = ( - 'Owner group failed. Expected {}, received {}\n' - ''.format(GROUP, group) - ) - return result, cause - - tperm = utils.get_file_permissions(config, tasks_path) - if tperm != TPERM: - result = consts.TEST_FAILED - cause = ( - 'File permissions failed. Expected {}, received {}\n' - ''.format(TPERM, tperm) - ) - - return result, cause - - -def teardown(config): - os.remove(CONFIG_FILE_NAME) - - try: - if config.args.container: - config.container.run(['userdel', USER]) - config.container.run(['groupdel', GROUP]) - else: - Run.run(['sudo', 'userdel', '-r', USER]) - Run.run(['sudo', 'groupdel', GROUP]) - except (ContainerError, RunError, ValueError): - pass - - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/021-cgconfig-invalid_options.py b/lib/libcgroup-3.1.0/tests/ftests/021-cgconfig-invalid_options.py deleted file mode 100755 index bac84ebc9ae..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/021-cgconfig-invalid_options.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser functionality test - invalid and help options -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '021cgconfig' - -CONFIG_FILE = '''group -{} {{ - {} {{ - cpuset.cpus = abc123; - }} -}}'''.format(CGNAME, CONTROLLER) - -USER = 'cguser021' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '021cgconfig.conf') - - -def prereqs(config): - pass - - -def setup(config): - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - -def test(config): - result = consts.TEST_PASSED - cause = None - - ret = Cgroup.configparser(config, cghelp=True) - if 'Parse and load the specified cgroups' not in ret: - result = consts.TEST_FAILED - cause = 'Failed to print cgconfigparser help text' - return result, cause - - try: - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - except RunError as re: - if 'Invalid argument' not in re.stderr: - result = consts.TEST_FAILED - cause = "Expected 'Invalid argument' to be in stderr" - return result, cause - - if re.ret != 96: - result = consts.TEST_FAILED - cause = 'Expected return code of 96 but received {}'.format(re.ret) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case erroneously passed' - - return result, cause - - -def teardown(config): - os.remove(CONFIG_FILE_NAME) - - -def main(config): - prereqs(config) - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/022-cgset-multiple_r_flag.py b/lib/libcgroup-3.1.0/tests/ftests/022-cgset-multiple_r_flag.py deleted file mode 100755 index 6d139307902..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/022-cgset-multiple_r_flag.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - set multiple values via the '-r' flag -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME = '022cgset' - -SETTINGS = ['memory.limit_in_bytes', - 'memory.soft_limit_in_bytes', - 'memory.swappiness'] -VALUES = ['1024000', '512000', '55'] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - Cgroup.set(config, cgname=CGNAME, setting=SETTINGS, value=VALUES) - - for i, setting in enumerate(SETTINGS): - Cgroup.get_and_validate(config, CGNAME, setting, VALUES[i]) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/023-cgset-copy_from.py b/lib/libcgroup-3.1.0/tests/ftests/023-cgset-copy_from.py deleted file mode 100755 index 6fa2ff282a3..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/023-cgset-copy_from.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - test the '--copy-from' option -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -SRC_CGNAME = '023cgsetsrc' -DST_CGNAME = '023cgsetdst' - -SETTINGS = ['memory.limit_in_bytes', - 'memory.soft_limit_in_bytes', - 'memory.swappiness'] -VALUES = ['122880', '40960', '42'] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, SRC_CGNAME) - Cgroup.create(config, CONTROLLER, DST_CGNAME) - Cgroup.set(config, cgname=SRC_CGNAME, setting=SETTINGS, value=VALUES) - - -def test(config): - Cgroup.set(config, cgname=DST_CGNAME, copy_from=SRC_CGNAME) - - for i, setting in enumerate(SETTINGS): - Cgroup.get_and_validate(config, DST_CGNAME, setting, VALUES[i]) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, SRC_CGNAME) - Cgroup.delete(config, CONTROLLER, DST_CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/025-cgset-multiple_cgroups.py b/lib/libcgroup-3.1.0/tests/ftests/025-cgset-multiple_cgroups.py deleted file mode 100755 index dab2f72ecc1..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/025-cgset-multiple_cgroups.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - set multiple cgroups' values -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAME1 = '025cgset1' -CGNAME2 = '025cgset2' - -SETTING = 'memory.swappiness' -VALUE = '42' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME1) - Cgroup.create(config, CONTROLLER, CGNAME2) - - -def test(config): - Cgroup.set(config, cgname=[CGNAME1, CGNAME2], setting=SETTING, value=VALUE) - - Cgroup.get_and_validate(config, CGNAME1, SETTING, VALUE) - Cgroup.get_and_validate(config, CGNAME2, SETTING, VALUE) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME1) - Cgroup.delete(config, CONTROLLER, CGNAME2) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/026-cgset-multiple_r_multiple_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/026-cgset-multiple_r_multiple_cgroup.py deleted file mode 100755 index 1d60bb27df4..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/026-cgset-multiple_r_multiple_cgroup.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - set multiple values in multiple cgroups -# via the '-r' flag -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'memory' -CGNAMES = ['026cgset1', '026cgset2'] - -SETTINGS = ['memory.limit_in_bytes', - 'memory.soft_limit_in_bytes', - 'memory.swappiness'] -VALUES = ['2048000', '1024000', '89'] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 memory controller' - - return result, cause - - -def setup(config): - for cg in CGNAMES: - Cgroup.create(config, CONTROLLER, cg) - - -def test(config): - Cgroup.set(config, cgname=CGNAMES, setting=SETTINGS, value=VALUES) - - for i, setting in enumerate(SETTINGS): - for cg in CGNAMES: - Cgroup.get_and_validate(config, cg, setting, VALUES[i]) - - return consts.TEST_PASSED, None - - -def teardown(config): - for cg in CGNAMES: - Cgroup.delete(config, CONTROLLER, cg) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/027-cgset-invalid_options.py b/lib/libcgroup-3.1.0/tests/ftests/027-cgset-invalid_options.py deleted file mode 100755 index c284ab927eb..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/027-cgset-invalid_options.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - invalid options -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME1 = '027cgset1' -CGNAME2 = '027cgset2' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME1) - Cgroup.create(config, CONTROLLER, CGNAME2) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - try: - # cgset -r cpu.shares=100 --copy-from 027cgset2 027cgset1 - Cgroup.set(config, cgname=CGNAME1, setting='cpu.shares', value='100', - copy_from=CGNAME2) - except RunError as re: - if 'Wrong input parameters,' not in re.stderr: - result = consts.TEST_FAILED - cause = "#1 Expected 'Wrong input parameters' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#1 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #1 erroneously passed' - return result, cause - - try: - # cgset -r cpu.shares=100 - Cgroup.set(config, cgname=None, setting='cpu.shares', value='100') - except RunError as re: - if 'cgset: no cgroup specified' not in re.stderr: - result = consts.TEST_FAILED - cause = "#2 Expected 'no cgroup specified' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#2 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #2 erroneously passed' - return result, cause - - try: - # cgset 027cgset1 - Cgroup.set(config, cgname=CGNAME1) - except RunError as re: - if 'cgset: no name-value pair was set' not in re.stderr: - result = consts.TEST_FAILED - cause = "#3 Expected 'no name-value pair' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#3 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #3 erroneously passed' - return result, cause - - try: - # cgset - no flags provided - Cgroup.set(config) - except RunError as re: - if 'Usage is' not in re.stderr: - result = consts.TEST_FAILED - cause = "#4 Expected 'Usage is' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#4 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #4 erroneously passed' - return result, cause - - try: - # cgset -r cpu.shares= 027cgset1 - Cgroup.set(config, cgname=CGNAME1, setting='cpu.shares', value='') - except RunError as re: - if 'wrong parameter of option -r' not in re.stderr: - result = consts.TEST_FAILED - cause = "#5 Expected 'Wrong parameter of option' to be in stderr" - return result, cause - - if re.ret != 129: - result = consts.TEST_FAILED - cause = ( - '#5 Expected return code of 129 but received {}' - ''.format(re.ret) - ) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Test case #5 erroneously passed' - return result, cause - - # cgset -h - ret = Cgroup.set(config, cghelp=True) - if 'Usage:' not in ret: - result = consts.TEST_FAILED - cause = '#6 Failed to print help text' - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME1) - Cgroup.delete(config, CONTROLLER, CGNAME2) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/029-lssubsys-basic_lssubsys.py b/lib/libcgroup-3.1.0/tests/ftests/029-lssubsys-basic_lssubsys.py deleted file mode 100755 index 756c64bb239..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/029-lssubsys-basic_lssubsys.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Basic lssubsys functionality test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - - -def prereqs(config): - pass - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - mount_list = Cgroup.get_cgroup_mounts(config, expand_v2_mounts=False) - - # cgroup v2 mounts won't show up unless '-a' is specified - lssubsys_list = Cgroup.lssubsys(config, ls_all=False) - - for mount in mount_list: - if mount.version == CgroupVersion.CGROUP_V2: - continue - - if mount.controller == 'name=systemd' or mount.controller == 'systemd': - continue - - found = False - for lsmount in lssubsys_list.splitlines(): - if ',' in lsmount: - for ctrl in lsmount.split(','): - if ctrl == mount.controller: - found = True - break - - if lsmount == mount.controller: - found = True - break - - if not found: - result = consts.TEST_FAILED - cause = ( - 'Failed to find {} in lssubsys list' - ''.format(mount.controller) - ) - return result, cause - - return result, cause - - -def teardown(config): - pass - - -def main(config): - prereqs(config) - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/030-lssubsys-lssubsys_all.py b/lib/libcgroup-3.1.0/tests/ftests/030-lssubsys-lssubsys_all.py deleted file mode 100755 index c83587d83dc..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/030-lssubsys-lssubsys_all.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# 'lssubsys -a' test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -import consts -import ftests -import sys -import os - - -def prereqs(config): - pass - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - mount_list = Cgroup.get_cgroup_mounts(config, expand_v2_mounts=True) - - # cgroup v2 mounts won't show up unless '-a' is specified - lssubsys_list = Cgroup.lssubsys(config, ls_all=True) - - for mount in mount_list: - if mount.controller == 'name=systemd' or mount.controller == 'systemd': - continue - - found = False - for lsmount in lssubsys_list.splitlines(): - if ',' in lsmount: - for ctrl in lsmount.split(','): - if ctrl == mount.controller: - found = True - break - - if lsmount == mount.controller: - found = True - break - - if lsmount == 'blkio' and mount.controller == 'io': - found = True - break - - if not found: - result = consts.TEST_FAILED - cause = ( - 'Failed to find {} in lssubsys list' - ''.format(mount.controller) - ) - return result, cause - - ret = Cgroup.lssubsys(config, cghelp=True) - if 'Usage:' not in ret: - result = consts.TEST_FAILED - cause = 'Failed to print help text' - - return result, cause - - -def teardown(config): - pass - - -def main(config): - prereqs(config) - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/031-lscgroup-g_flag.py b/lib/libcgroup-3.1.0/tests/ftests/031-lscgroup-g_flag.py deleted file mode 100755 index 334a3e99636..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/031-lscgroup-g_flag.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# lscgroup functionality test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import utils -import sys -import os - -CONTROLLER = 'cpuset' -PARENT_CGNAME = '031lscgroup' -CHILD_CGNAME = 'childlscgroup' -GRANDCHILD_CGNAME = 'grandchildlscgroup' - -# lscgroup is inconsistent in its handling of trailing slashes -# -# When invoking lscgroup with no flags, no trailing slashes are present in -# any of the cgroups. -# -# When invoking lscgroup with the -g flag, a trailing slash is present on -# the first cgroup returned (i.e. the cgroup specified in the -g flag) -# -EXPECTED_OUT1 = '''{}:/{}/ -{}:/{}/{} -{}:/{}/{}/{}'''.format(CONTROLLER, PARENT_CGNAME, - CONTROLLER, PARENT_CGNAME, CHILD_CGNAME, - CONTROLLER, PARENT_CGNAME, CHILD_CGNAME, - GRANDCHILD_CGNAME) - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - v2_cnt = 0 - mount_list = Cgroup.get_cgroup_mounts(config) - - for mount in mount_list: - if mount.version == CgroupVersion.CGROUP_V2: - v2_cnt += 1 - - if v2_cnt > 1: - # There is a bug in lscgroup - see issue #50 - where it doesn't - # properly list the enabled controllers for a cgroup v2 cgroup. - # Skip this test because of this - result = consts.TEST_SKIPPED - cause = 'See Github Issue #50 - lscgroup lists controllers...' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENT_CGNAME) - Cgroup.create( - config, CONTROLLER, os.path.join( - PARENT_CGNAME, CHILD_CGNAME) - ) - Cgroup.create(config, CONTROLLER, - os.path.join(PARENT_CGNAME, CHILD_CGNAME, GRANDCHILD_CGNAME)) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.lscgroup(config, controller=CONTROLLER, path=PARENT_CGNAME) - if out != EXPECTED_OUT1: - result = consts.TEST_FAILED - cause = ( - "Expected lscgroup output doesn't match received output\n'" - "Expected:\n{}\n" - "Received:\n{}\n" - "".format(utils.indent(EXPECTED_OUT1, 4), - utils.indent(out, 4)) - ) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/032-lscgroup-multiple_g_flags.py b/lib/libcgroup-3.1.0/tests/ftests/032-lscgroup-multiple_g_flags.py deleted file mode 100755 index 528c43d7918..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/032-lscgroup-multiple_g_flags.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# lscgroup functionality test - multiple '-g' flags -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import utils -import sys -import os - -CONTROLLER = 'cpuset' -PARENT_CGNAME = '032lscgroup' -CHILD_CGNAME = 'childlscgroup' -GRANDCHILD_CGNAME = 'grandchildlscgroup' -SIBLING_CGNAME = '032sibling' -SIBLING_CHILD_CGNAME = 'cousinlscgroup' - -# lscgroup is inconsistent in its handling of trailing slashes -# -# When invoking lscgroup with no flags, no trailing slashes are present in -# any of the cgroups. -# -# When invoking lscgroup with the -g flag, a trailing slash is present on -# the first cgroup returned (i.e. the cgroup specified in the -g flag) -# -EXPECTED_OUT1 = '''{}:/{}/ -{}:/{}/{} -{}:/{}/{}/{} -{}:/{}/ -{}:/{}/{}'''.format(CONTROLLER, PARENT_CGNAME, - CONTROLLER, PARENT_CGNAME, CHILD_CGNAME, - CONTROLLER, PARENT_CGNAME, CHILD_CGNAME, GRANDCHILD_CGNAME, - CONTROLLER, SIBLING_CGNAME, - CONTROLLER, SIBLING_CGNAME, SIBLING_CHILD_CGNAME) - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - v2_cnt = 0 - mount_list = Cgroup.get_cgroup_mounts(config) - - for mount in mount_list: - if mount.version == CgroupVersion.CGROUP_V2: - v2_cnt += 1 - - if v2_cnt > 1: - # There is a bug in lscgroup - see issue #50 - where it doesn't - # properly list the enabled controllers for a cgroup v2 cgroup. - # Skip this test because of this - result = consts.TEST_SKIPPED - cause = 'See Github Issue #50 - lscgroup lists controllers...' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENT_CGNAME) - Cgroup.create(config, CONTROLLER, - os.path.join(PARENT_CGNAME, CHILD_CGNAME)) - Cgroup.create(config, CONTROLLER, - os.path.join(PARENT_CGNAME, CHILD_CGNAME, GRANDCHILD_CGNAME)) - - Cgroup.create(config, CONTROLLER, SIBLING_CGNAME) - Cgroup.create(config, CONTROLLER, - os.path.join(SIBLING_CGNAME, SIBLING_CHILD_CGNAME)) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.lscgroup(config, controller=[CONTROLLER, CONTROLLER], - path=[PARENT_CGNAME, SIBLING_CGNAME]) - if out != EXPECTED_OUT1: - result = consts.TEST_FAILED - cause = ( - "Expected lscgroup output doesn't match received output\n" - "Expected:\n{}\n" - "Received:\n{}\n" - "".format(utils.indent(EXPECTED_OUT1, 4), - utils.indent(out, 4)) - ) - return result, cause - - ret = Cgroup.lscgroup(config, cghelp=True) - if 'Usage:' not in ret: - result = consts.TEST_FAILED - cause = 'Failed to print help text' - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True) - Cgroup.delete(config, CONTROLLER, SIBLING_CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/033-cgget-no_flags.py b/lib/libcgroup-3.1.0/tests/ftests/033-cgget-no_flags.py deleted file mode 100755 index 114cdf3340b..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/033-cgget-no_flags.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - no flags, only a cgroup -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '033cgget' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=None, cgname=CGNAME) - - if out.splitlines()[0] != '{}:'.format(CGNAME): - result = consts.TEST_FAILED - cause = ( - 'cgget expected the cgroup name {} in the first line.\n' - 'Instead it received {}' - ''.format(CGNAME, out.splitlines()[0]) - ) - - if len(out.splitlines()) < 5: - result = consts.TEST_FAILED - cause = ( - 'Too few lines output by cgget. Received {} lines' - ''.format(len(out.splitlines())) - ) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/034-cgexec-basic_cgexec.py b/lib/libcgroup-3.1.0/tests/ftests/034-cgexec-basic_cgexec.py deleted file mode 100755 index b3a07471f5b..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/034-cgexec-basic_cgexec.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup cgexec test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from process import Process -from cgroup import Cgroup -import consts -import ftests -import sys -import os - - -CONTROLLER = 'cpuset' -CGNAME = '034cgexec' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - if not config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test must be run within a container' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, - cgclassify=False) - - pids = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - if pids is None: - result = consts.TEST_FAILED - cause = 'No processes were found in cgroup {}'.format(CGNAME) - return result, cause - - # run cgexec -h - ret = Cgroup.cgexec(config, controller=CONTROLLER, cgname=CGNAME, - cmdline=None, cghelp=True) - if 'Run the task in given control group(s)' not in ret: - result = consts.TEST_FAILED - cause = 'Failed to print cgexec help text: {}'.format(ret) - - return result, cause - - -def teardown(config): - pids = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - Process.kill(config, pids) - - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/035-cgset-set_cgroup_type.py b/lib/libcgroup-3.1.0/tests/ftests/035-cgset-set_cgroup_type.py deleted file mode 100755 index 42ce71d57fb..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/035-cgset-set_cgroup_type.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgget/cgset cgroup.type functionality test -# -# Copyright (c) 2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' -CGNAME = '035cgset' - -SETTING = 'cgroup.type' -BEFORE = 'domain' -AFTER = 'threaded' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - Cgroup.get_and_validate(config, CGNAME, SETTING, BEFORE) - - -def test(config): - Cgroup.set_and_validate(config, CGNAME, SETTING, AFTER) - - return consts.TEST_PASSED, None - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/036-cgset-multi_thread.py b/lib/libcgroup-3.1.0/tests/ftests/036-cgset-multi_thread.py deleted file mode 100755 index a736ff0b517..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/036-cgset-multi_thread.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Multithreaded cgroup v2 test -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from process import Process -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -PARENT_CGNAME = '036threaded' -CHILD_CGPATH = os.path.join(PARENT_CGNAME, 'childcg') - -SETTING = 'cgroup.type' -AFTER = 'threaded' -THREADS = 3 - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENT_CGNAME) - Cgroup.create(config, CONTROLLER, CHILD_CGPATH) - - Cgroup.set_and_validate(config, CHILD_CGPATH, SETTING, AFTER) - - -def test(config): - config.process.create_threaded_process_in_cgroup( - config, CONTROLLER, PARENT_CGNAME, THREADS) - - threads = Cgroup.get(config, controller=None, cgname=PARENT_CGNAME, - setting='cgroup.threads', print_headers=False, - values_only=True) - threads = threads.replace('\n', '').split('\t') - -# #pick the first thread - thread_tid = threads[1] - - Cgroup.set_and_validate(config, CHILD_CGPATH, 'cgroup.threads', thread_tid) - - return consts.TEST_PASSED, None - - -def teardown(config): - # destroy the child processes - pids = Cgroup.get_pids_in_cgroup(config, PARENT_CGNAME, CONTROLLER) - Process.kill(config, pids) - - Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/037-cgxget-cpu_settings.py b/lib/libcgroup-3.1.0/tests/ftests/037-cgxget-cpu_settings.py deleted file mode 100755 index 20871e8684b..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/037-cgxget-cpu_settings.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgxget functionality test - various cpu settings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '037cgxget' - -CGRP_VER_V1 = CgroupVersion.CGROUP_V1 -CGRP_VER_V2 = CgroupVersion.CGROUP_V2 - -TABLE = [ - # writesetting, writeval, writever, readsetting, readval, readver - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.shares', '512', CGRP_VER_V1], - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.weight', '50', CGRP_VER_V2], - - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.shares', '2048', CGRP_VER_V1], - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.weight', '200', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '10000', CGRP_VER_V1, - 'cpu.cfs_quota_us', '10000', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.cfs_period_us', '100000', CGRP_VER_V1], - ['cpu.cfs_period_us', '50000', CGRP_VER_V1, - 'cpu.max', '10000 50000', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '-1', CGRP_VER_V1, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.max', 'max 100000', CGRP_VER_V2], - - ['cpu.max', '5000 25000', CGRP_VER_V2, - 'cpu.max', '5000 25000', CGRP_VER_V2], - ['cpu.max', '6000 26000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '6000', CGRP_VER_V1], - ['cpu.max', '7000 27000', CGRP_VER_V2, - 'cpu.cfs_period_us', '27000', CGRP_VER_V1], - - ['cpu.max', 'max 40000', CGRP_VER_V2, - 'cpu.max', 'max 40000', CGRP_VER_V2], - ['cpu.max', 'max 41000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], -] - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - for entry in TABLE: - Cgroup.xset(config, cgname=CGNAME, setting=entry[0], value=entry[1], - version=entry[2]) - - out = Cgroup.xget(config, cgname=CGNAME, setting=entry[3], - version=entry[5], values_only=True, - print_headers=False) - if out != entry[4]: - result = consts.TEST_FAILED - cause = ( - 'After setting {}={}, expected {}={}, but received ' - '{}={}'.format(entry[0], entry[1], entry[3], entry[4], - entry[3], out) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/038-cgxget-cpuset_settings.py b/lib/libcgroup-3.1.0/tests/ftests/038-cgxget-cpuset_settings.py deleted file mode 100755 index 8af6d874e54..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/038-cgxget-cpuset_settings.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgxget functionality test - various cpuset settings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -from run import Run, RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpuset' -CGNAME = '038cgxget' - -CGRP_VER_V1 = CgroupVersion.CGROUP_V1 -CGRP_VER_V2 = CgroupVersion.CGROUP_V2 - -TABLE = [ - # writesetting, writeval, writever, readsetting, readval, readver - ['cpuset.cpus', '0-1', CGRP_VER_V1, - 'cpuset.cpus', '0-1', CGRP_VER_V1], - ['cpuset.cpus', '0-1', CGRP_VER_V1, - 'cpuset.cpus', '0-1', CGRP_VER_V2], - ['cpuset.cpus', '0-1', CGRP_VER_V1, - 'cpuset.effective_cpus', '0-1', CGRP_VER_V1], - ['cpuset.cpus', '0-1', CGRP_VER_V1, - 'cpuset.cpus.effective', '0-1', CGRP_VER_V2], - ['cpuset.cpus', '1', CGRP_VER_V2, - 'cpuset.cpus', '1', CGRP_VER_V1], - ['cpuset.cpus', '1', CGRP_VER_V2, - 'cpuset.cpus', '1', CGRP_VER_V2], - - ['cpuset.mems', '0', CGRP_VER_V1, - 'cpuset.mems', '0', CGRP_VER_V1], - ['cpuset.mems', '0', CGRP_VER_V1, - 'cpuset.mems', '0', CGRP_VER_V2], - ['cpuset.mems', '0', CGRP_VER_V2, - 'cpuset.mems', '0', CGRP_VER_V1], - ['cpuset.mems', '0', CGRP_VER_V2, - 'cpuset.mems', '0', CGRP_VER_V2], - ['cpuset.mems', '0', CGRP_VER_V1, - 'cpuset.effective_mems', '0', CGRP_VER_V1], - ['cpuset.mems', '0', CGRP_VER_V1, - 'cpuset.mems.effective', '0', CGRP_VER_V2], - - ['cpuset.cpu_exclusive', '1', CGRP_VER_V1, - 'cpuset.cpu_exclusive', '1', CGRP_VER_V1], - ['cpuset.cpu_exclusive', '1', CGRP_VER_V1, - 'cpuset.cpus.partition', 'root', CGRP_VER_V2], - ['cpuset.cpu_exclusive', '0', CGRP_VER_V1, - 'cpuset.cpu_exclusive', '0', CGRP_VER_V1], - ['cpuset.cpu_exclusive', '0', CGRP_VER_V1, - 'cpuset.cpus.partition', 'member', CGRP_VER_V2], - - ['cpuset.cpus.partition', 'root', CGRP_VER_V2, - 'cpuset.cpu_exclusive', '1', CGRP_VER_V1], - ['cpuset.cpus.partition', 'root', CGRP_VER_V2, - 'cpuset.cpus.partition', 'root', CGRP_VER_V2], - ['cpuset.cpus.partition', 'member', CGRP_VER_V2, - 'cpuset.cpu_exclusive', '0', CGRP_VER_V1], - ['cpuset.cpus.partition', 'member', CGRP_VER_V2, - 'cpuset.cpus.partition', 'member', CGRP_VER_V2], -] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - nproc = Run.run('nproc') - if int(nproc) < 2: - result = consts.TEST_SKIPPED - cause = 'This test requires 2 or more processors' - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - for entry in TABLE: - try: - Cgroup.xset(config, cgname=CGNAME, setting=entry[0], - value=entry[1], version=entry[2]) - except RunError as re: - if re.stderr.find('Invalid argument') >= 0: - # The kernel disallowed this setting, likely due to the many - # complexities of exclusive cpusets - continue - raise re - - out = Cgroup.xget(config, cgname=CGNAME, setting=entry[3], - version=entry[5], values_only=True, - print_headers=False) - if out != entry[4]: - result = consts.TEST_FAILED - cause = ( - 'After setting {}={}, expected {}={}, but received ' - '{}={}' - ''.format(entry[0], entry[1], entry[3], entry[4], - entry[3], out) - ) - return result, cause - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/039-pybindings-cgxget.py b/lib/libcgroup-3.1.0/tests/ftests/039-pybindings-cgxget.py deleted file mode 100755 index 9e609e18c5e..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/039-pybindings-cgxget.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgxget functionality test using the python bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from cgroup import CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '039bindings' - -SETTING1 = 'cpu.shares' -VALUE1 = '4096' - -SETTING2 = 'cpu.weight' -VALUE2 = '400' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLER, CGNAME) - if CgroupVersion.get_version('cpu') == CgroupVersion.CGROUP_V1: - CgroupCli.set(config, CGNAME, SETTING1, VALUE1) - else: - CgroupCli.set(config, CGNAME, SETTING2, VALUE2) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg1 = Cgroup(CGNAME, Version.CGROUP_V1) - cg1.add_controller(CONTROLLER) - cg1.add_setting(SETTING1) - - cg1.cgxget() - - if len(cg1.controllers) != 1: - result = consts.TEST_FAILED - cause = ( - "Controller length doesn't match, expected 1, but " - "received {}" - "".format(len(cg1.controllers)) - ) - return result, cause - - if len(cg1.controllers[CONTROLLER].settings) != 1: - result = consts.TEST_FAILED - cause = ( - "Settings length doesn't match, expected 1, but " - " received {}" - "".format(len(cg1.controllers[CONTROLLER].settings)) - ) - return result, cause - - if cg1.controllers[CONTROLLER].settings[SETTING1] != VALUE1: - result = consts.TEST_FAILED - cause = ( - 'Expected {} = {} but received {}' - ''.format(SETTING1, VALUE1, - cg1.controllers[CONTROLLER].settings[SETTING1]) - ) - return result, cause - - cg2 = Cgroup(CGNAME, Version.CGROUP_V2) - cg2.add_controller(CONTROLLER) - cg2.add_setting(SETTING2) - - cg2.cgxget() - - if len(cg2.controllers) != 1: - result = consts.TEST_FAILED - cause = ( - "Controller length doesn't match, expected 1, but" - " received {}" - "".format(len(cg2.controllers)) - ) - return result, cause - - if len(cg2.controllers[CONTROLLER].settings) != 1: - result = consts.TEST_FAILED - cause = ( - "Settings length doesn't match, expected 1, but" - "received {}" - "".format(len(cg2.controllers[CONTROLLER].settings)) - ) - return result, cause - - if cg2.controllers[CONTROLLER].settings[SETTING2] != VALUE2: - result = consts.TEST_FAILED - cause = ( - 'Expected {} = {} but received {}' - ''.format(SETTING2, VALUE2, - cg2.controllers[CONTROLLER].settings[SETTING2]) - ) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/040-pybindings-cgxset.py b/lib/libcgroup-3.1.0/tests/ftests/040-pybindings-cgxset.py deleted file mode 100755 index 8e392a45db9..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/040-pybindings-cgxset.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgxset functionality test using the python bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import CgroupVersion as CgroupCliVersion -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from run import Run -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '040bindings' - -SETTING1 = 'cpu.shares' -VALUE1 = '512' - -SETTING2 = 'cpu.weight' -VALUE2 = '50' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - user_name = Run.run('whoami', shell_bool=True) - group_name = Run.run('groups', shell_bool=True).split(' ')[0] - - CgroupCli.create(config, controller_list=CONTROLLER, cgname=CGNAME, - user_name=user_name, group_name=group_name) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg1 = Cgroup(CGNAME, Version.CGROUP_V1) - cg1.add_controller(CONTROLLER) - cg1.add_setting(SETTING1, VALUE1) - - cg1.cgxset() - - value_v1 = CgroupCli.xget( - config, setting=SETTING1, print_headers=False, - values_only=True, - version=CgroupCliVersion.CGROUP_V1, - cgname=CGNAME - ) - - if value_v1 != VALUE1: - result = consts.TEST_FAILED - cause = 'Expected {}, but received {}'.format(VALUE1, value_v1) - return result, cause - - # Set the cpu.shares/cpu.weight to an arbitrary value to ensure - # the following v2 cgxset works properly - CgroupCli.xset(config, cgname=CGNAME, setting=SETTING1, value='1234', - version=CgroupCliVersion.CGROUP_V1) - - cg2 = Cgroup(CGNAME, Version.CGROUP_V2) - cg2.add_controller(CONTROLLER) - cg2.add_setting(SETTING2, VALUE2) - - cg2.cgxset() - - value_v2 = CgroupCli.xget( - config, setting=SETTING2, print_headers=False, - values_only=True, - version=CgroupCliVersion.CGROUP_V2, - cgname=CGNAME - ) - - if value_v2 != VALUE2: - result = consts.TEST_FAILED - cause = 'Expected {}, but received {}'.format(VALUE2, value_v2) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/041-pybindings-library_version.py b/lib/libcgroup-3.1.0/tests/ftests/041-pybindings-library_version.py deleted file mode 100755 index 313507884d8..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/041-pybindings-library_version.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# get the library version using the python bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from libcgroup import Cgroup -import consts -import ftests -import sys -import os - - -def prereqs(config): - pass - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - [major, minor, release] = Cgroup.library_version() - - if not isinstance(major, int): - result = consts.TEST_FAILED - cause = 'Major version failed. Received {}'.format(major) - return result, cause - - if not isinstance(minor, int): - result = consts.TEST_FAILED - cause = 'Minor version failed. Received {}'.format(minor) - return result, cause - - if not isinstance(release, int): - result = consts.TEST_FAILED - cause = 'Release version failed. Received {}'.format(release) - - return result, cause - - -def teardown(config): - pass - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/042-cgxget-unmappable.py b/lib/libcgroup-3.1.0/tests/ftests/042-cgxget-unmappable.py deleted file mode 100755 index 9b865483fc5..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/042-cgxget-unmappable.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgxget test with no mappable settings -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '042cgxget' -SETTING = 'cpu.stat' - - -def prereqs(config): - pass - - -def setup(config): - Cgroup.create(config, CONTROLLER, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) == CgroupVersion.CGROUP_V1: - # request the opposite version of what this system is running - requested_ver = CgroupVersion.CGROUP_V2 - else: - requested_ver = CgroupVersion.CGROUP_V1 - - out = Cgroup.xget( - config, cgname=CGNAME, setting=SETTING, - version=requested_ver, print_headers=False, - ignore_unmappable=True - ) - if len(out): - result = consts.TEST_FAILED - cause = 'Expected cgxget to return nothing. Received {}'.format(out) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME) - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/043-cgcreate-empty_controller.py b/lib/libcgroup-3.1.0/tests/ftests/043-cgcreate-empty_controller.py deleted file mode 100755 index bb0c487ba75..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/043-cgcreate-empty_controller.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgcreate with no controller specified functionality test -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' -CGNAME = '043cgcreate' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.create(config, None, CGNAME) - - # verify the cgroup exists by reading cgroup.procs - Cgroup.get( - config, controller=None, cgname=CGNAME, - setting='cgroup.procs', print_headers=True, - values_only=False - ) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, None, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/044-pybindings-cgcreate_empty_controller.py b/lib/libcgroup-3.1.0/tests/ftests/044-pybindings-cgcreate_empty_controller.py deleted file mode 100755 index 1edc95c6d0e..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/044-pybindings-cgcreate_empty_controller.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# empty cgcreate functionality test using the python bindings -# -# Copyright (c) 2021-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from cgroup import CgroupVersion -from run import Run -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -PARENT_NAME = '044cgcreate' -CGNAME = os.path.join(PARENT_NAME, 'madeviapython') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - user_name = Run.run('whoami', shell_bool=True) - group_name = Run.run('groups', shell_bool=True).split(' ')[0] - - CgroupCli.create(config, controller_list=CONTROLLER, cgname=PARENT_NAME, - user_name=user_name, group_name=group_name) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.create() - - # Read a valid file within the newly created cgroup. - # This should fail if the cgroup was not created successfully - cg.add_setting(setting_name='cgroup.procs') - cg.cgxget() - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, None, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/045-pybindings-list_mount_points.py b/lib/libcgroup-3.1.0/tests/ftests/045-pybindings-list_mount_points.py deleted file mode 100755 index f8a8b9ebe24..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/045-pybindings-list_mount_points.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_list_mount_points functionality test using the python bindings -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from libcgroup import Cgroup, Version -import consts -import ftests -import sys -import os - -CGNAME = '045bindings' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - mount_points_v1 = Cgroup.mount_points(Version.CGROUP_V1) - mount_points_v2 = Cgroup.mount_points(Version.CGROUP_V2) - if not mount_points_v1 and not mount_points_v2: - result = consts.TEST_FAILED - cause = ("No cgroup mount point found") - - return result, cause - - -def teardown(config): - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/046-cgexec-empty_controller.py b/lib/libcgroup-3.1.0/tests/ftests/046-cgexec-empty_controller.py deleted file mode 100755 index 981048a3b83..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/046-cgexec-empty_controller.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 -# -# cgexec to an empty cgroup functionality test using the python bindings -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from process import Process -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = '046cgexec' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - Cgroup.create(config, None, cgname=CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup(config, '', CGNAME) - output = Cgroup.get( - config, controller=None, cgname=CGNAME, - setting='cgroup.procs', print_headers=False, - values_only=False - ) - - if not len(output): - result = consts.TEST_FAILED - cause = 'No process created in the cgroup' - - return result, cause - - -def teardown(config): - pids = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - Process.kill(config, pids) - - Cgroup.delete(config, None, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/047-cgcreate-delete_cgrp_shared_mnt.py b/lib/libcgroup-3.1.0/tests/ftests/047-cgcreate-delete_cgrp_shared_mnt.py deleted file mode 100755 index 36971d9724f..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/047-cgcreate-delete_cgrp_shared_mnt.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test deleting cgroup on mount point shared by cgroup v1 controllers -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER1 = 'cpu' -CONTROLLER2 = 'cpuacct' - -CGNAME = '047shared_mnts' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - - # cpuacct controller is only available on cgroup v1, if an exception - # gets raised, then no cgroup v1 controllers mounted. - try: - CgroupVersion.get_version('cpuacct') - except IndexError: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpuacct controller' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER1, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - try: - Cgroup.delete(config, CONTROLLER2, CGNAME) - except RunError as re: - if 'No such file or directory' in re.stderr: - cause = 'cpu and cpuacct controllers do not share mount points.' - result = consts.TEST_FAILED - else: - raise re - - try: - Cgroup.delete(config, CONTROLLER1, CGNAME) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - return result, cause - - -def teardown(config): - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/048-pybindings-get_cgroup_mode.py b/lib/libcgroup-3.1.0/tests/ftests/048-pybindings-get_cgroup_mode.py deleted file mode 100755 index 1d24e92f6db..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/048-pybindings-get_cgroup_mode.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to get the cgroup mode -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup -import consts -import ftests -import sys -import os - - -def prereqs(config): - pass - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - mode1 = Cgroup.cgroup_mode() - mode2 = CgroupCli.get_cgroup_mode(config) - - if mode1 != mode2: - result = consts.TEST_FAILED - cause = 'mode mismatch: libcgroup mode: {}, tests mode: {}'.format(mode1, mode2) - - return result, cause - - -def teardown(config): - pass - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/049-sudo-systemd_create_scope.py b/lib/libcgroup-3.1.0/tests/ftests/049-sudo-systemd_create_scope.py deleted file mode 100755 index df14edc59e0..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/049-sudo-systemd_create_scope.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Create a systemd scope -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from cgroup import CgroupVersion -from libcgroup import Cgroup -from systemd import Systemd -from process import Process -from run import RunError -import ftests -import consts -import sys -import os - -SLICE = 'libcgtests.slice' -SCOPE = '049delegated.scope' - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.create_scope(scope_name=SCOPE, slice_name=SLICE) - - if not Systemd.is_delegated(config, SCOPE): - result = consts.TEST_FAILED - cause = 'Cgroup is not delegated' - - return result, cause - - -def teardown(config, result): - pid = CgroupCli.get(config, cgname=os.path.join(SLICE, SCOPE), setting='cgroup.procs', - print_headers=False, values_only=True) - Process.kill(config, pid) - - if result != consts.TEST_PASSED: - # Something went wrong. Let's force the removal of the cgroups just to be safe. - # Note that this should remove the cgroup, but it won't remove it from systemd's - # internal caches, so the system may not return to its 'pristine' prior-to-this-test - # state - try: - CgroupCli.delete(config, None, os.path.join(SLICE, SCOPE)) - except RunError: - pass - else: - # There is no need to remove the scope. systemd should automatically remove it - # once there are no processes inside of it - pass - - return consts.TEST_PASSED, None - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/050-sudo-systemd_create_scope_w_pid.py b/lib/libcgroup-3.1.0/tests/ftests/050-sudo-systemd_create_scope_w_pid.py deleted file mode 100755 index 9759e7440d1..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/050-sudo-systemd_create_scope_w_pid.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Create a systemd scope with an existing PID -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from cgroup import CgroupVersion -from libcgroup import Cgroup -from systemd import Systemd -from process import Process -from run import RunError -import ftests -import consts -import sys -import os - -SLICE = 'libcgtests.slice' -SCOPE = '050delegated.scope' -pid = None - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - global pid - - result = consts.TEST_PASSED - cause = None - - pid = int(config.process.create_process(config)) - Cgroup.create_scope(SCOPE, slice_name=SLICE, pid=pid) - - if not Systemd.is_delegated(config, SCOPE): - result = consts.TEST_FAILED - cause = 'Cgroup is not delegated' - - return result, cause - - -def teardown(config, result): - global pid - - Process.kill(config, pid) - - if result != consts.TEST_PASSED: - # Something went wrong. Let's force the removal of the cgroups just to be safe. - # Note that this should remove the cgroup, but it won't remove it from systemd's - # internal caches, so the system may not return to its 'pristine' prior-to-this-test - # state - try: - CgroupCli.delete(config, None, os.path.join(SLICE, SCOPE)) - except RunError: - pass - else: - # There is no need to remove the scope. systemd should automatically remove it - # once there are no processes inside of it - pass - - return consts.TEST_PASSED, None - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/051-sudo-cgroup_get_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/051-sudo-cgroup_get_cgroup.py deleted file mode 100755 index 47fe1deca28..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/051-sudo-cgroup_get_cgroup.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Exercise cgroup_create_cgroup() and cgroup_get_cgroup() -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from libcgroup import Cgroup, Version -from cgroup import CgroupVersion -import ftests -import consts -import sys -import os - -CGNAME = '051cgnewcg/childcg' - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.create() - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.get() - - if len(cg.controllers) != 1: - # only one controller, cpu, should be enabled - result = consts.TEST_FAILED - cause = 'Expected one controller to be enabled, but {} were enabled'.format( - len(cg.controllers)) - - return result, cause - - -def teardown(config, result): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - try: - cg.delete() - except RuntimeError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/052-sudo-cgroup_attach_task.py b/lib/libcgroup-3.1.0/tests/ftests/052-sudo-cgroup_attach_task.py deleted file mode 100755 index 112b917ad47..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/052-sudo-cgroup_attach_task.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Attach a task to a cgroup via cgroup_attach_task() -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from cgroup import CgroupVersion -import ftests -import consts -import sys -import os - -CGNAME = '052cgattachcg' - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.create() - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.attach() - - found = False - pids = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - for pid in pids: - if pid == os.getpid(): - # our process was successfully added to the cgroup - found = True - - if not found: - result = consts.TEST_FAILED - cause = 'Could not find pid {} in cgroup {}'.format(os.getpid(), CGNAME) - return result, cause - - # now let's attach this process to the root cgroup and ensure we no longer - # are in CGNAME - cg.attach(root_cgroup=True) - - found = False - pids = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - for pid in pids: - if pid == os.getpid(): - # our process was successfully added to the cgroup - found = True - - if found: - result = consts.TEST_FAILED - cause = 'pid {} was erroneously found in cgroup {}'.format(os.getpid(), CGNAME) - - return result, cause - - -def teardown(config, result): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - try: - cg.delete() - except RuntimeError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/053-sudo-cgroup_attach_task_pid.py b/lib/libcgroup-3.1.0/tests/ftests/053-sudo-cgroup_attach_task_pid.py deleted file mode 100755 index c873c39e10a..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/053-sudo-cgroup_attach_task_pid.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Attach a task to a cgroup via cgroup_attach_task_pid() -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from cgroup import CgroupVersion -import ftests -import consts -import sys -import os - -CGNAME = '053cgattachcg' - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.create() - - -def test(config): - result = consts.TEST_PASSED - cause = None - - child_pid = config.process.create_process(config) - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.attach(child_pid) - - found = False - pids = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - for pid in pids: - if pid == child_pid: - # our process was successfully added to the cgroup - found = True - - if not found: - result = consts.TEST_FAILED - cause = 'Could not find pid {} in cgroup {}'.format(child_pid, CGNAME) - return result, cause - - # now let's attach the child process to the root cgroup and ensure we no longer - # are in CGNAME - cg.attach(pid=child_pid, root_cgroup=True) - - found = False - pids = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - for pid in pids: - if pid == child_pid: - # our process was successfully added to the cgroup - found = True - - if found: - result = consts.TEST_FAILED - cause = 'pid {} was erroneously found in cgroup {}'.format(child_pid, CGNAME) - - return result, cause - - -def teardown(config, result): - cg = Cgroup(CGNAME, Version.CGROUP_V2) - try: - cg.delete() - except RuntimeError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/054-sudo-set_uid_gid_v2.py b/lib/libcgroup-3.1.0/tests/ftests/054-sudo-set_uid_gid_v2.py deleted file mode 100755 index 05966ce10e7..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/054-sudo-set_uid_gid_v2.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to set the uid/gid on a cgroup v2 cgroup using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, CgroupVersion -from libcgroup import Cgroup, Version -import consts -import ftests -import utils -import sys -import os - -CGNAME = '054setuidgid' -CONTROLLER = 'cpu' -TASKS_UID = 1234 -TASKS_GID = 5678 -CTRL_UID = 3456 -CTRL_GID = 7890 - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.set_uid_gid(TASKS_UID, TASKS_GID, CTRL_UID, CTRL_GID) - cg.add_controller(CONTROLLER) - cg.create(ignore_ownership=False) - - ctrl_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'cgroup.procs') - - uid = utils.get_file_owner_uid(config, ctrl_path) - if uid != CTRL_UID: - result = consts.TEST_FAILED - cause = 'Expected cgroup.procs owner to be {} but it\'s {}'.format(CTRL_UID, uid) - - gid = utils.get_file_owner_gid(config, ctrl_path) - if gid != CTRL_GID: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs group to be {} but it\'s {}'.format(CTRL_GID, gid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, None, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/055-sudo-set_uid_gid_v1.py b/lib/libcgroup-3.1.0/tests/ftests/055-sudo-set_uid_gid_v1.py deleted file mode 100755 index 7ca972e452f..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/055-sudo-set_uid_gid_v1.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to set the uid/gid on a cgroup v1 cgroup using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, CgroupVersion -from libcgroup import Cgroup, Version -import consts -import ftests -import utils -import sys -import os - -CGNAME = '055setuidgid' -CONTROLLER = 'cpu' -TASKS_UID = 1234 -TASKS_GID = 5678 -CTRL_UID = 3456 -CTRL_GID = 7890 - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v1' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V1) - cg.set_uid_gid(TASKS_UID, TASKS_GID, CTRL_UID, CTRL_GID) - cg.add_controller(CONTROLLER) - cg.create(ignore_ownership=False) - - tasks_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'tasks') - - tasks_uid = utils.get_file_owner_uid(config, tasks_path) - if tasks_uid != TASKS_UID: - result = consts.TEST_FAILED - cause = 'Expected tasks owner to be {} but it\'s {}'.format(TASKS_UID, tasks_uid) - - tasks_gid = utils.get_file_owner_gid(config, tasks_path) - if tasks_gid != TASKS_GID: - result = consts.TEST_FAILED - tmp_cause = 'Expected tasks group to be {} but it\'s {}'.format(TASKS_GID, tasks_gid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - ctrl_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'cgroup.procs') - - ctrl_uid = utils.get_file_owner_uid(config, ctrl_path) - if ctrl_uid != CTRL_UID: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs owner to be {} but it\'s {}'.format(CTRL_UID, ctrl_uid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - ctrl_gid = utils.get_file_owner_gid(config, ctrl_path) - if ctrl_gid != CTRL_GID: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs group to be {} but it\'s {}'.format(CTRL_GID, ctrl_gid) - if not cause: - cause = tmp_cause - else: - cause = '{}\n{}'.format(cause, tmp_cause) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/056-sudo-set_permissions_v2.py b/lib/libcgroup-3.1.0/tests/ftests/056-sudo-set_permissions_v2.py deleted file mode 100755 index 7ac41bac691..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/056-sudo-set_permissions_v2.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to set the permissions on a cgroup using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, CgroupVersion -from libcgroup import Cgroup, Version -import consts -import ftests -import utils -import stat -import sys -import os - -CGNAME = '056setperms' -CONTROLLER = 'memory' -# 0711 -DIR_MODE = stat.S_IRWXU | stat.S_IXGRP | stat.S_IXOTH -# 0640 -CTRL_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP -# 0771 -TASK_MODE = stat.S_IRWXU | stat.S_IRWXG | stat.S_IXOTH - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.set_permissions(DIR_MODE, CTRL_MODE, TASK_MODE) - cg.add_controller(CONTROLLER) - cg.create(ignore_ownership=False) - - dir_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME) - - dir_mode = utils.get_file_permissions(config, dir_path) - if int(dir_mode, 8) != DIR_MODE: - result = consts.TEST_FAILED - cause = 'Expected directory mode to be {} but it\'s {}'.format( - format(DIR_MODE, '03o'), dir_mode) - - ctrl_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'cgroup.procs') - - ctrl_mode = utils.get_file_permissions(config, ctrl_path) - if int(ctrl_mode, 8) != CTRL_MODE: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs mode to be {} but it\'s {}'.format( - format(CTRL_MODE, '03o'), ctrl_mode) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, None, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/057-sudo-set_permissions_v1.py b/lib/libcgroup-3.1.0/tests/ftests/057-sudo-set_permissions_v1.py deleted file mode 100755 index 566f6a0ad10..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/057-sudo-set_permissions_v1.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to set the permissions on a cgroup using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, CgroupVersion -from libcgroup import Cgroup, Version -import consts -import ftests -import utils -import stat -import sys -import os - -CGNAME = '057setperms' -CONTROLLER = 'memory' -# 0711 -DIR_MODE = stat.S_IRWXU | stat.S_IXGRP | stat.S_IXOTH -# 0640 -CTRL_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP -# 0660 -TASK_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v1' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V1) - cg.set_permissions(DIR_MODE, CTRL_MODE, TASK_MODE) - cg.add_controller(CONTROLLER) - cg.create(ignore_ownership=False) - - dir_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME) - - dir_mode = utils.get_file_permissions(config, dir_path) - if int(dir_mode, 8) != DIR_MODE: - result = consts.TEST_FAILED - cause = 'Expected directory mode to be {} but it\'s {}'.format( - format(DIR_MODE, '03o'), dir_mode) - - ctrl_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'cgroup.procs') - - ctrl_mode = utils.get_file_permissions(config, ctrl_path) - if int(ctrl_mode, 8) != CTRL_MODE: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs mode to be {} but it\'s {}'.format( - format(CTRL_MODE, '03o'), ctrl_mode) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - task_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'tasks') - - task_mode = utils.get_file_permissions(config, task_path) - if int(task_mode, 8) != TASK_MODE: - result = consts.TEST_FAILED - tmp_cause = 'Expected tasks mode to be {} but it\'s {}'.format( - format(TASK_MODE, '03o'), task_mode) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/058-sudo-systemd_create_scope2.py b/lib/libcgroup-3.1.0/tests/ftests/058-sudo-systemd_create_scope2.py deleted file mode 100755 index 751a221d612..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/058-sudo-systemd_create_scope2.py +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Create a systemd scope with an existing PID -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import CgroupVersion as CgroupCliVersion -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from systemd import Systemd -from process import Process -from run import RunError -import ftests -import consts -import utils -import stat -import sys -import os - -pid = None -CGNAME = 'libcgtests.slice/058delegated.scope' - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - -# 0751 -DIR_MODE = stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH -# 0644 -CTRL_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH -# 0775 -TASK_MODE = stat.S_IRWXU | stat.S_IRWXG | stat.S_IXOTH - -TASKS_UID = 2468 -TASKS_GID = 3579 -CTRL_UID = 4680 -CTRL_GID = 5791 - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupCliVersion.get_version(CONTROLLER) != CgroupCliVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - global pid - - result = consts.TEST_PASSED - cause = None - - pid = config.process.create_process(config) - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - - cg.add_controller(CONTROLLER) - cg.set_permissions(DIR_MODE, CTRL_MODE, TASK_MODE) - cg.set_uid_gid(TASKS_UID, TASKS_GID, CTRL_UID, CTRL_GID) - - cg.create_scope2(ignore_ownership=False, pid=pid) - - if not Systemd.is_delegated(config, os.path.basename(CGNAME)): - result = consts.TEST_FAILED - cause = 'Cgroup is not delegated' - - if not CgroupCli.is_controller_enabled(config, CGNAME, CONTROLLER): - result = consts.TEST_FAILED - tmp_cause = 'Controller {} is not enabled in the parent cgroup'.format(CONTROLLER) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - dir_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME) - - dir_mode = utils.get_file_permissions(config, dir_path) - if int(dir_mode, 8) != DIR_MODE: - result = consts.TEST_FAILED - tmp_cause = 'Expected directory mode to be {} but it\'s {}'.format( - format(DIR_MODE, '03o'), dir_mode) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - ctrl_path = os.path.join(CgroupCli.get_controller_mount_point(CONTROLLER), CGNAME, - 'cgroup.procs') - - ctrl_mode = utils.get_file_permissions(config, ctrl_path) - if int(ctrl_mode, 8) != CTRL_MODE: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs mode to be {} but it\'s {}'.format( - format(CTRL_MODE, '03o'), ctrl_mode) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - uid = utils.get_file_owner_uid(config, ctrl_path) - if uid != CTRL_UID: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs owner to be {} but it\'s {}'.format(CTRL_UID, uid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - gid = utils.get_file_owner_gid(config, ctrl_path) - if gid != CTRL_GID: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup.procs group to be {} but it\'s {}'.format(CTRL_GID, gid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config, result): - global pid - - Process.kill(config, pid) - - if result != consts.TEST_PASSED: - # Something went wrong. Let's force the removal of the cgroups just to be safe. - # Note that this should remove the cgroup, but it won't remove it from systemd's - # internal caches, so the system may not return to its 'pristine' prior-to-this-test - # state - try: - CgroupCli.delete(config, None, CGNAME) - except RunError: - pass - else: - # There is no need to remove the scope. systemd should automatically remove it - # once there are no processes inside of it - pass - - return consts.TEST_PASSED, None - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/059-sudo-invalid_systemd_create_scope2.py b/lib/libcgroup-3.1.0/tests/ftests/059-sudo-invalid_systemd_create_scope2.py deleted file mode 100755 index 25d2e39095b..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/059-sudo-invalid_systemd_create_scope2.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test invalid parameters for systemd_create_scope2() -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import CgroupVersion as CgroupCliVersion -from libcgroup import Cgroup, Version -import ftests -import consts -import sys -import os - -# Which controller isn't all that important, but it is important that we -# have a cgroup v2 controller -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupCliVersion.get_version(CONTROLLER) != CgroupCliVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires cgroup v2' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cg1 = Cgroup("InvalidNameBecauseNoSlash", Version.CGROUP_V2) - cg1.add_controller(CONTROLLER) - try: - cg1.create_scope2() - except RuntimeError as re: - if '50011' not in str(re): - result = consts.TEST_FAILED - cause = 'Expected ECGINVAL (50011) but received {}'.format(re) - else: - result = consts.TEST_FAILED - cause = 'An invalid cgroup name unexpectedly passed: {}'.format(cg1.name) - - cg2 = Cgroup("Invalid/TooMany/Slashes", Version.CGROUP_V2) - cg2.add_controller(CONTROLLER) - try: - cg2.create_scope2() - except RuntimeError as re: - if '50011' not in str(re): - result = consts.TEST_FAILED - tmp_cause = 'Expected ECGINVAL (50011) but received {}'.format(re) - if not cause: - cause = tmp_cause - else: - cause = '{}\n{}'.format(cause, tmp_cause) - else: - result = consts.TEST_FAILED - cause = 'An invalid cgroup name unexpectedly passed: {}'.format(cg1.name) - if not cause: - cause = tmp_cause - else: - cause = '{}\n{}'.format(cause, tmp_cause) - - return result, cause - - -def teardown(config, result): - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/060-sudo-cgconfigparser-systemd.py b/lib/libcgroup-3.1.0/tests/ftests/060-sudo-cgconfigparser-systemd.py deleted file mode 100755 index 33f32c6a7b6..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/060-sudo-cgconfigparser-systemd.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgconfigparser functionality test - systemd configurations -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal - -from systemd import Systemd -from process import Process -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import time -import sys -import os - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '060_cg_in_scope' -OTHER_CGNAME = '060_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test060.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '060cgconfig.conf') - -CONFIGURATIONS = [ - # [ 'systemd configuration file', 'Excepted error substring'] - ['systemd {\n}', 'Error: failed to parse file'], - - ['systemd {\n\tslice = libcgroup;\n}', - 'Error: Invalid systemd configuration slice value libcgroup'], - - ['systemd {\n\tscope = test060;\n}', - 'Error: Invalid systemd configuration scope value test060'], - - ['systemd {\n\tslice = libcgroup.slice;\n}', - 'Error: Invalid systemd setting, missing scope name'], - - ['systemd {\n\tscope = test060.scope;\n}', - 'Error: Invalid systemd setting, missing slice name'], - - ['systemd {\n\tsetdefault = yes;\n}', - 'Error: Invalid systemd setting, missing slice name'], - - ['systemd {\n\tpid = 123;\n}', - 'Error: Invalid systemd setting, missing slice name'], - - ['systemd {\n\tInvalid = Invalid;\n}', - 'Error: Invalid systemd configuration Invalid'], - - ['systemd {\n\tslice = libcgroup.slice;\n\tsetdefault = yes;\n\t}', - 'Error: Invalid systemd setting, missing scope name'], - - ['systemd {\n\tscope = test060.scope;\n\tsetdefault = yes;\n\t}', - 'Error: Invalid systemd setting, missing slice name'], - - ['systemd {\n\tslice = libcgroup.slice;\n\tscope = test060.scope;\n\t' - 'setdefault = invalid;\n\t}', - 'Error: Invalid systemd configuration setdefault'], - - ['systemd {\n\tslice = libcgroup.slice;\n\tscope = test060.scope;\n\t' - 'setdefault = yes;\n\tpid = abc;\n}', - 'Error: Invalid systemd configuration pid'], -] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - pass - - -def write_conf_file(config, configurations): - f = open(CONFIG_FILE_NAME, 'w') - f.write(configurations) - f.close() - - -def test_invalid_configurations(config): - result = consts.TEST_PASSED - cause = None - - # Try parsing invalid systemd configurations from CONFIGURATION table - # and none of them is excepted to pass. - for configuration in CONFIGURATIONS: - write_conf_file(config, configuration[0]) - - try: - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - except RunError as re: - if configuration[1] not in re.stdout: - result = consts.TEST_FAILED - tmp_cause = ( - 'Unexpected error {}, while parsing configuration:' - '\n{}'.format(re.stdout, configuration[0]) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - else: - result = consts.TEST_FAILED - tmp_cause = ( - 'Creation of systemd default slice/scope, erroneously succeeded with' - 'configuration:\n{}'.format(configuration[0]) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - result, cause = test_invalid_configurations(config) - if result == consts.TEST_FAILED: - return result, cause - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - # Pass a valid configuration to the parser - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - if not Cgroup.exists(config, CONTROLLER, os.path.join(SLICE, SCOPE), ignore_systemd=True): - result = consts.TEST_FAILED - cause = 'Failed to create systemd slice/scope' - return result, cause - - # It's invalid to pass the same configuration file twice. The values - # were already read and slice/scope cgroups were created, unless - # something has gone wrong, this should fail. - try: - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - except RunError as re: - if 'already exists' not in re.stdout: - result = consts.TEST_FAILED - cause = 'Unexpected error {}'.format(re.stdout) - else: - result = consts.TEST_FAILED - cause = 'Creation of systemd default slice/scope erroneously succeeded' - - # killing the pid should remove the scope cgroup too. - Process.kill(config, pid) - - # Let's pause and wait for the systemd to remove the scope. - time.sleep(1) - - if Cgroup.exists(config, CONTROLLER, os.path.join(SLICE, SCOPE), ignore_systemd=True): - result = consts.TEST_FAILED - cause = 'Systemd failed to remove the scope {}'.format(SCOPE) - - return result, cause - - -def teardown(config): - # The scope is already removed, when the task was killed. - try: - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - except RunError as re: - if 'scope not loaded' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/061-sudo-g_flag_controller_only_systemd-v1.py b/lib/libcgroup-3.1.0/tests/ftests/061-sudo-g_flag_controller_only_systemd-v1.py deleted file mode 100755 index 078b18fdfa9..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/061-sudo-g_flag_controller_only_systemd-v1.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - '-b' '-g' (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# Author: Kamalesh Babulal - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = 'cg_in_scope' -OTHER_CGNAME = 'cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test061.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '061cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, CONTROLLER, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/{}/'.format(SYSTEMD_CGNAME, CONTROLLER, SLICE, SCOPE) - ) - return result, cause - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=CONTROLLER, cgname=SYSTEMD_CGNAME) - if len(out.splitlines()) < 10: - # This cgget command gets all of the settings/values within the cgroup. - # We don't care about the exact data, but there should be at least 10 - # lines of settings/values - result = consts.TEST_FAILED - cause = ( - 'cgget failed to read at least 10 lines from ' - 'cgroup {}: {}'.format(SYSTEMD_CGNAME, out) - ) - - out = Cgroup.get(config, controller=CONTROLLER, cgname=OTHER_CGNAME, ignore_systemd=True) - if len(out.splitlines()) < 10: - result = consts.TEST_FAILED - tmp_cause = ( - 'cgget failed to read at least 10 lines from ' - 'cgroup {}: {}'.format(OTHER_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # This should fail because the wrong path should be built up - out = Cgroup.get(config, controller=CONTROLLER, cgname=SYSTEMD_CGNAME, ignore_systemd=True, - print_headers=False) - if len(out) > 0: - result = consts.TEST_FAILED - tmp_cause = ( - 'cgget erroneously read cgroup {} at the ' - 'wrong path: {}'.format(SYSTEMD_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # This should fail because the wrong path should be built up - out = Cgroup.get(config, controller=CONTROLLER, cgname=OTHER_CGNAME, print_headers=False) - if len(out) > 0: - result = consts.TEST_FAILED - tmp_cause = ( - 'cgget erroneously read cgroup {} at the ' - 'wrong path: {}'.format(OTHER_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - teardown(config) - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/062-sudo-g_flag_controller_only_systemd-v2.py b/lib/libcgroup-3.1.0/tests/ftests/062-sudo-g_flag_controller_only_systemd-v2.py deleted file mode 100755 index e77eb6aae37..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/062-sudo-g_flag_controller_only_systemd-v2.py +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgget functionality test - '-b' '-g' (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = 'cg_in_scope' -OTHER_CGNAME = 'cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test062.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '062cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, None, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/'.format(SYSTEMD_CGNAME, SLICE, SCOPE) - ) - return result, cause - - # With cgroup v2, we can't enable controller for the child cgroup, while - # a task is attached to test062.scope. Attach the task from test062.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, - # so that the cgroup.get() works - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) - - Cgroup.set( - config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', - value='+cpu', ignore_systemd=True - ) - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - out = Cgroup.get(config, controller=CONTROLLER, cgname=SYSTEMD_CGNAME) - if len(out.splitlines()) < 10: - # This cgget command gets all of the settings/values within the cgroup. - # We don't care about the exact data, but there should be at least 10 - # lines of settings/values - result = consts.TEST_FAILED - cause = ( - 'cgget failed to read at least 10 lines from ' - 'cgroup {}: {}'.format(SYSTEMD_CGNAME, out) - ) - - out = Cgroup.get(config, controller=CONTROLLER, cgname=OTHER_CGNAME, ignore_systemd=True) - if len(out.splitlines()) < 10: - result = consts.TEST_FAILED - tmp_cause = ( - 'cgget failed to read at least 10 lines from ' - 'cgroup {}: {}'.format(OTHER_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # This should fail because the wrong path should be built up - out = Cgroup.get(config, controller=CONTROLLER, cgname=SYSTEMD_CGNAME, - ignore_systemd=True, print_headers=False) - if len(out) > 0: - result = consts.TEST_FAILED - tmp_cause = ( - 'cgget erroneously read cgroup {} at the wrong ' - 'path: {}'.format(SYSTEMD_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # This should fail because the wrong path should be built up - out = Cgroup.get(config, controller=CONTROLLER, cgname=OTHER_CGNAME, print_headers=False) - if len(out) > 0: - result = consts.TEST_FAILED - cause = ( - 'cgget erroneously read cgroup {} at the wrong ' - 'path: {}'.format(OTHER_CGNAME, out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - teardown(config) - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/063-sudo-systemd_cgset-v1.py b/lib/libcgroup-3.1.0/tests/ftests/063-sudo-systemd_cgset-v1.py deleted file mode 100755 index bb615bf4fc1..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/063-sudo-systemd_cgset-v1.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - '-b' '-g' (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# Author: Kamalesh Babulal - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '063_cg_in_scope' -OTHER_CGNAME = '063_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test063.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '063cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, CONTROLLER, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/{}/'.format(SYSTEMD_CGNAME, CONTROLLER, SLICE, SCOPE) - ) - return result, cause - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.set_and_validate(config, SYSTEMD_CGNAME, 'cpu.shares', '200') - Cgroup.set_and_validate(config, OTHER_CGNAME, 'cpu.shares', '300', ignore_systemd=True) - - try: - Cgroup.set(config, SYSTEMD_CGNAME, 'cpu.shares', '400', ignore_systemd=True) - except RunError as re: - if 'requested group parameter does not exist' not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = 'Setting cpu.shares on {} erroneously succeeded'.format(SYSTEMD_CGNAME) - - try: - Cgroup.set(config, OTHER_CGNAME, 'cpu.shares', '500') - except RunError as re: - if 'requested group parameter does not exist' not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - tmp_cause = 'Setting cpu.shares on {} erroneously succeeded'.format(OTHER_CGNAME) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/064-sudo-systemd_cgset-v2.py b/lib/libcgroup-3.1.0/tests/ftests/064-sudo-systemd_cgset-v2.py deleted file mode 100755 index c42bc5010ed..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/064-sudo-systemd_cgset-v2.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgset functionality test - '-b' '-g' (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '064_cg_in_scope' -OTHER_CGNAME = '064_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test064.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '064cgconfig.conf') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, None, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/'.format(SYSTEMD_CGNAME, SLICE, SCOPE) - ) - return result, cause - - # With cgroup v2, we can't enable controller for the child cgroup, while - # a task is attached to test064.scope. Attach the task from test064.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, - # so that the cgroup.get() works - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) - - Cgroup.set( - config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', - value='+cpu', ignore_systemd=True - ) - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.set_and_validate(config, SYSTEMD_CGNAME, 'cpu.weight', '200') - Cgroup.set_and_validate(config, OTHER_CGNAME, 'cpu.weight', '300', ignore_systemd=True) - - try: - Cgroup.set(config, SYSTEMD_CGNAME, 'cpu.weight', '400', ignore_systemd=True) - except RunError as re: - if 'requested group parameter does not exist' not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = 'Setting cpu.weight on {} erroneously succeeded'.format(SYSTEMD_CGNAME) - - try: - Cgroup.set(config, OTHER_CGNAME, 'cpu.weight', '500') - except RunError as re: - if 'requested group parameter does not exist' not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - tmp_cause = 'Setting cpu.weight on {} erroneously succeeded'.format(OTHER_CGNAME) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/065-sudo-systemd_cgclassify-v1.py b/lib/libcgroup-3.1.0/tests/ftests/065-sudo-systemd_cgclassify-v1.py deleted file mode 100755 index 850c1362ae4..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/065-sudo-systemd_cgclassify-v1.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgclassify functionality test - '-b' '-g' (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from process import Process -from run import RunError -import consts -import ftests -import time -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '065_cg_in_scope' -OTHER_CGNAME = '065_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test065.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '065cgconfig.conf') - -SYSTEMD_PIDS = '' -OTHER_PIDS = '' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, CONTROLLER, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/{}/'.format(SYSTEMD_CGNAME, CONTROLLER, SLICE, SCOPE) - ) - return result, cause - - # create and check if the cgroup was created under the controller sub-tree - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def create_process_get_pid(config, CGNAME, SLICENAME='', ignore_systemd=False): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup( - config, CONTROLLER, CGNAME, - ignore_systemd=ignore_systemd - ) - - pids = Cgroup.get_pids_in_cgroup(config, os.path.join(SLICENAME, CGNAME), CONTROLLER) - if pids is None: - result = consts.TEST_FAILED - cause = 'No processes were found in cgroup {}'.format(CGNAME) - - return pids, result, cause - - -def test(config): - global SYSTEMD_PIDS, OTHER_PIDS - - result = consts.TEST_PASSED - cause = None - - # Test cgclassify, that creates a process and then uses cgclassify - # to migrate the task the cgroup. - SYSTEMD_PIDS, result, cause = create_process_get_pid( - config, SYSTEMD_CGNAME, - os.path.join(SLICE, SCOPE) - ) - if result == consts.TEST_FAILED: - return result, cause - - OTHER_PIDS, result, tmp_cause = create_process_get_pid( - config, OTHER_CGNAME, - ignore_systemd=True - ) - if result == consts.TEST_FAILED: - return result, cause - - # classify a task from the non-systemd scope cgroup (OTHER_CGNAME) to - # systemd scope cgroup (SYSTEMD_CGNAME). Migration should fail due to - # the incorrect destination cgroup path that gets constructed, without - # the systemd slice/scope when ignore_systemd=True) - try: - Cgroup.classify(config, CONTROLLER, SYSTEMD_CGNAME, OTHER_PIDS, ignore_systemd=True) - except RunError as re: - err_str = 'Error changing group of pid {}: Cgroup does not exist'.format(OTHER_PIDS[0]) - if re.stderr != err_str: - raise re - else: - result = consts.TEST_FAILED - cause = 'Changing group of pid {} erroneously succeeded'.format(OTHER_PIDS[0]) - - # classify a task from the systemd scope cgroup (SYSTEMD_CGNAME) to - # non-systemd scope cgroup (OTHER_CGNAME). Migration should fail due - # to the incorrect destination cgroup path that gets constructed, with - # the systemd slice/scope when ignore_systemd=False) - try: - Cgroup.classify(config, CONTROLLER, OTHER_CGNAME, SYSTEMD_PIDS) - except RunError as re: - err_str = 'Error changing group of pid {}: Cgroup does not exist'.format(SYSTEMD_PIDS[0]) - if re.stderr != err_str: - raise re - else: - result = consts.TEST_FAILED - tmp_cause = 'Changing group of pid {} erroneously succeeded'.format(SYSTEMD_PIDS[0]) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # classify the task from the non-systemd scope cgroup to systemd scope cgroup. - Cgroup.classify(config, CONTROLLER, SYSTEMD_CGNAME, OTHER_PIDS) - - return result, cause - - -def teardown(config): - global SYSTEMD_PIDS, OTHER_PIDS - - Process.kill(config, SYSTEMD_PIDS) - Process.kill(config, OTHER_PIDS) - - # We need a pause, so that cgroup.procs gets updated. - time.sleep(1) - - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/066-sudo-systemd_cgclassify-v2.py b/lib/libcgroup-3.1.0/tests/ftests/066-sudo-systemd_cgclassify-v2.py deleted file mode 100755 index 9f0fd3de8fb..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/066-sudo-systemd_cgclassify-v2.py +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgclassify functionality test - '-b' '-g' (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from process import Process -from run import RunError -import consts -import ftests -import time -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '066_cg_in_scope' -OTHER_CGNAME = '066_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test066.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '066cgconfig.conf') - -SYSTEMD_PIDS = '' -OTHER_PIDS = '' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, None, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/'.format(SYSTEMD_CGNAME, SLICE, SCOPE) - ) - return result, cause - - # With cgroup v2, we can't enable controller for the child cgroup, while - # a task is attached to test066.scope. Attach the task from test066.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, - # so that the cgroup.get() works - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) - - Cgroup.set( - config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', - value='+cpu', ignore_systemd=True - ) - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def create_process_get_pid(config, CGNAME, SLICENAME='', ignore_systemd=False): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup( - config, CONTROLLER, CGNAME, - ignore_systemd=ignore_systemd - ) - - pids = Cgroup.get_pids_in_cgroup(config, os.path.join(SLICENAME, CGNAME), CONTROLLER) - if pids is None: - result = consts.TEST_FAILED - cause = 'No processes were found in cgroup {}'.format(CGNAME) - - return pids, result, cause - - -def test(config): - global SYSTEMD_PIDS, OTHER_PIDS - - result = consts.TEST_PASSED - cause = None - - # Test cgclassify, that creates a process and then uses cgclassify - # to migrate the task the cgroup. - SYSTEMD_PIDS, result, cause = create_process_get_pid( - config, SYSTEMD_CGNAME, - os.path.join(SLICE, SCOPE) - ) - if result == consts.TEST_FAILED: - return result, cause - - OTHER_PIDS, result, tmp_cause = create_process_get_pid( - config, OTHER_CGNAME, - ignore_systemd=True - ) - if result == consts.TEST_FAILED: - return result, cause - - # classify a task from the non-systemd scope cgroup (OTHER_CGNAME) to - # systemd scope cgroup (SYSTEMD_CGNAME). Migration should fail due to - # the incorrect destination cgroup path that gets constructed, without - # the systemd slice/scope when ignore_systemd=True) - try: - Cgroup.classify(config, CONTROLLER, SYSTEMD_CGNAME, OTHER_PIDS, ignore_systemd=True) - except RunError as re: - err_str = 'Error changing group of pid {}: Cgroup does not exist'.format(OTHER_PIDS[0]) - if re.stderr != err_str: - raise re - else: - result = consts.TEST_FAILED - cause = 'Changing group of pid {} erroneously succeeded'.format(OTHER_PIDS[0]) - - # classify a task from the systemd scope cgroup (SYSTEMD_CGNAME) to - # non-systemd scope cgroup (OTHER_CGNAME). Migration should fail due - # to the incorrect destination cgroup path that gets constructed, with - # the systemd slice/scope when ignore_systemd=False) - try: - Cgroup.classify(config, CONTROLLER, OTHER_CGNAME, SYSTEMD_PIDS[1]) - except RunError as re: - err_str = 'Error changing group of pid {}: Cgroup does not exist'.format( - SYSTEMD_PIDS[1]) - if re.stderr != err_str: - raise re - else: - result = consts.TEST_FAILED - tmp_cause = 'Changing group of pid {} erroneously succeeded'.format(SYSTEMD_PIDS[1]) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # classify the task from the non-systemd scope cgroup to systemd scope cgroup. - Cgroup.classify(config, CONTROLLER, SYSTEMD_CGNAME, OTHER_PIDS) - - return result, cause - - -def teardown(config): - global SYSTEMD_PIDS, OTHER_PIDS - - Process.kill(config, SYSTEMD_PIDS) - Process.kill(config, OTHER_PIDS) - - # We need a pause, so that cgroup.procs gets updated. - time.sleep(1) - - os.remove(CONFIG_FILE_NAME) - - try: - Cgroup.delete(config, CONTROLLER, cgname=SLICE, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/067-sudo-systemd_cgexec-v1.py b/lib/libcgroup-3.1.0/tests/ftests/067-sudo-systemd_cgexec-v1.py deleted file mode 100755 index 3a452f65611..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/067-sudo-systemd_cgexec-v1.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgexec functionality test - '-b' '-g' (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from process import Process -from run import RunError -import consts -import ftests -import time -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '067_cg_in_scope' -OTHER_CGNAME = '067_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test067.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '067cgconfig.conf') - -SYSTEMD_PIDS = '' -OTHER_PIDS = '' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, CONTROLLER, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/{}/'.format(SYSTEMD_CGNAME, CONTROLLER, SLICE, SCOPE) - ) - return result, cause - - # create and check if the cgroup was created under the controller sub-tree - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def create_process_get_pid(config, CGNAME, SLICENAME='', ignore_systemd=False): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup( - config, CONTROLLER, CGNAME, cgclassify=False, - ignore_systemd=ignore_systemd - ) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - pids = Cgroup.get_pids_in_cgroup(config, os.path.join(SLICENAME, CGNAME), CONTROLLER) - if pids is None: - result = consts.TEST_FAILED - cause = 'No processes were found in cgroup {}'.format(CGNAME) - - return pids, result, cause - - -def test(config): - global SYSTEMD_PIDS, OTHER_PIDS - - result = consts.TEST_PASSED - cause = None - - # Test cgclassify, that creates a process and then uses cgclassify - # to migrate the task the cgroup. - SYSTEMD_PIDS, result, cause = create_process_get_pid( - config, SYSTEMD_CGNAME, - os.path.join(SLICE, SCOPE) - ) - - OTHER_PIDS, result, tmp_cause = create_process_get_pid( - config, OTHER_CGNAME, - ignore_systemd=True - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - global SYSTEMD_PIDS, OTHER_PIDS - - Process.kill(config, SYSTEMD_PIDS) - Process.kill(config, OTHER_PIDS) - - # We need a pause, so that cgroup.procs gets updated. - time.sleep(1) - - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/068-sudo-systemd_cgexec-v2.py b/lib/libcgroup-3.1.0/tests/ftests/068-sudo-systemd_cgexec-v2.py deleted file mode 100755 index 78945f9afa5..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/068-sudo-systemd_cgexec-v2.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgexec functionality test - '-b' '-g' (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from process import Process -from run import RunError -import consts -import ftests -import time -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '068_cg_in_scope' -OTHER_CGNAME = '068_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test068.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '068cgconfig.conf') - -SYSTEMD_PIDS = None -OTHER_PIDS = None - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, None, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/'.format(SYSTEMD_CGNAME, SLICE, SCOPE) - ) - return result, cause - - # With cgroup v2, we can't enable controller for the child cgroup, while - # a task is attached to test068.scope. Attach the task from test068.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, - # so that the cgroup.get() works - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) - - Cgroup.set( - config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', - value='+cpu', ignore_systemd=True - ) - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def create_process_get_pid(config, CGNAME, SLICENAME='', ignore_systemd=False): - result = consts.TEST_PASSED - cause = None - - config.process.create_process_in_cgroup( - config, CONTROLLER, CGNAME, cgclassify=False, - ignore_systemd=ignore_systemd - ) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - pids = Cgroup.get_pids_in_cgroup(config, os.path.join(SLICENAME, CGNAME), CONTROLLER) - if pids is None: - result = consts.TEST_FAILED - cause = 'No processes were found in cgroup {}'.format(CGNAME) - - return pids, result, cause - - -def test(config): - global SYSTEMD_PIDS, OTHER_PIDS - - result = consts.TEST_PASSED - cause = None - - # Test cgclassify, that creates a process and then uses cgclassify - # to migrate the task the cgroup. - SYSTEMD_PIDS, result, cause = create_process_get_pid( - config, SYSTEMD_CGNAME, - os.path.join(SLICE, SCOPE) - ) - - OTHER_PIDS, result, tmp_cause = create_process_get_pid( - config, OTHER_CGNAME, - ignore_systemd=True - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # SYSTEMD_CGNAME already has the pid of the task, that scope was created - # with and killing it will remove the scope, be careful and pick the newly - # spawned task - SYSTEMD_PIDS = SYSTEMD_PIDS[1] - - return result, cause - - -def teardown(config): - global SYSTEMD_PIDS, OTHER_PIDS - - Process.kill(config, SYSTEMD_PIDS) - Process.kill(config, OTHER_PIDS) - - # We need a pause, so that cgroup.procs gets updated. - time.sleep(1) - - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/069-sudo-systemd_cgxget-cpu-settings-v1.py b/lib/libcgroup-3.1.0/tests/ftests/069-sudo-systemd_cgxget-cpu-settings-v1.py deleted file mode 100755 index 4faa507ff47..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/069-sudo-systemd_cgxget-cpu-settings-v1.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgxget/cgxset functionality test - '-b' '-g' (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '069_cg_in_scope' -OTHER_CGNAME = '069_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test069.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '069cgconfig.conf') - -CGRP_VER_V1 = CgroupVersion.CGROUP_V1 -CGRP_VER_V2 = CgroupVersion.CGROUP_V2 - -TABLE = [ - # writesetting, writeval, writever, readsetting, readval, readver - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.shares', '512', CGRP_VER_V1], - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.weight', '50', CGRP_VER_V2], - - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.shares', '2048', CGRP_VER_V1], - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.weight', '200', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '10000', CGRP_VER_V1, - 'cpu.cfs_quota_us', '10000', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.cfs_period_us', '100000', CGRP_VER_V1], - ['cpu.cfs_period_us', '50000', CGRP_VER_V1, - 'cpu.max', '10000 50000', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '-1', CGRP_VER_V1, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.max', 'max 100000', CGRP_VER_V2], - - ['cpu.max', '5000 25000', CGRP_VER_V2, - 'cpu.max', '5000 25000', CGRP_VER_V2], - ['cpu.max', '6000 26000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '6000', CGRP_VER_V1], - ['cpu.max', '7000 27000', CGRP_VER_V2, - 'cpu.cfs_period_us', '27000', CGRP_VER_V1], - - ['cpu.max', 'max 40000', CGRP_VER_V2, - 'cpu.max', 'max 40000', CGRP_VER_V2], - ['cpu.max', 'max 41000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], -] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, CONTROLLER, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/{}/'.format(SYSTEMD_CGNAME, CONTROLLER, SLICE, SCOPE) - ) - return result, cause - - # create and check if the cgroup was created under the controller sub-tree - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cgrps = {SYSTEMD_CGNAME: False, OTHER_CGNAME: True} - for i in cgrps: - for entry in TABLE: - Cgroup.xset(config, cgname=i, setting=entry[0], value=entry[1], - version=entry[2], ignore_systemd=cgrps[i]) - - out = Cgroup.xget(config, cgname=i, setting=entry[3], - version=entry[5], values_only=True, - print_headers=False, ignore_systemd=cgrps[i]) - if out != entry[4]: - result = consts.TEST_FAILED - tmp_cause = ( - 'After setting {}={}, expected {}={}, but received ' - '{}={}'.format(entry[0], entry[1], entry[3], entry[4], - entry[3], out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py b/lib/libcgroup-3.1.0/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py deleted file mode 100755 index 9e6fe05c394..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/070-sudo-systemd_cgxget-cpu-settings-v2.py +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Advanced cgxget/cgxset functionality test - '-b' '-g' (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -from systemd import Systemd -from run import RunError -import consts -import ftests -import sys -import os - - -CONTROLLER = 'cpu' -SYSTEMD_CGNAME = '070_cg_in_scope' -OTHER_CGNAME = '070_cg_not_in_scope' - -SLICE = 'libcgtests.slice' -SCOPE = 'test070.scope' - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '070cgconfig.conf') - -CGRP_VER_V1 = CgroupVersion.CGROUP_V1 -CGRP_VER_V2 = CgroupVersion.CGROUP_V2 - -TABLE = [ - # writesetting, writeval, writever, readsetting, readval, readver - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.shares', '512', CGRP_VER_V1], - ['cpu.shares', '512', CGRP_VER_V1, 'cpu.weight', '50', CGRP_VER_V2], - - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.shares', '2048', CGRP_VER_V1], - ['cpu.weight', '200', CGRP_VER_V2, 'cpu.weight', '200', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '10000', CGRP_VER_V1, - 'cpu.cfs_quota_us', '10000', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.cfs_period_us', '100000', CGRP_VER_V1], - ['cpu.cfs_period_us', '50000', CGRP_VER_V1, - 'cpu.max', '10000 50000', CGRP_VER_V2], - - ['cpu.cfs_quota_us', '-1', CGRP_VER_V1, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], - ['cpu.cfs_period_us', '100000', CGRP_VER_V1, - 'cpu.max', 'max 100000', CGRP_VER_V2], - - ['cpu.max', '5000 25000', CGRP_VER_V2, - 'cpu.max', '5000 25000', CGRP_VER_V2], - ['cpu.max', '6000 26000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '6000', CGRP_VER_V1], - ['cpu.max', '7000 27000', CGRP_VER_V2, - 'cpu.cfs_period_us', '27000', CGRP_VER_V1], - - ['cpu.max', 'max 40000', CGRP_VER_V2, - 'cpu.max', 'max 40000', CGRP_VER_V2], - ['cpu.max', 'max 41000', CGRP_VER_V2, - 'cpu.cfs_quota_us', '-1', CGRP_VER_V1], -] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V2: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v2 cpu controller' - return result, cause - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - pid = Systemd.write_config_with_pid(config, CONFIG_FILE_NAME, SLICE, SCOPE) - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - # create and check if the cgroup was created under the systemd default path - if not Cgroup.create_and_validate(config, None, SYSTEMD_CGNAME): - result = consts.TEST_FAILED - cause = ( - 'Failed to create systemd delegated cgroup {} under ' - '/sys/fs/cgroup/{}/{}/'.format(SYSTEMD_CGNAME, SLICE, SCOPE) - ) - return result, cause - - # With cgroup v2, we can't enable controller for the child cgroup, while - # a task is attached to test070.scope. Attach the task from test070.scope - # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent, - # so that the cgroup.get() works - Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid) - - Cgroup.set( - config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control', - value='+cpu', ignore_systemd=True - ) - - # create and check if the cgroup was created under the controller root - if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True): - result = consts.TEST_FAILED - cause = ( - 'Failed to create cgroup {} under ' - '/sys/fs/cgroup/{}/'.format(OTHER_CGNAME, CONTROLLER) - ) - - return result, cause - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cgrps = {SYSTEMD_CGNAME: False, OTHER_CGNAME: True} - for i in cgrps: - for entry in TABLE: - Cgroup.xset(config, cgname=i, setting=entry[0], value=entry[1], - version=entry[2], ignore_systemd=cgrps[i]) - - out = Cgroup.xget(config, cgname=i, setting=entry[3], - version=entry[5], values_only=True, - print_headers=False, ignore_systemd=cgrps[i]) - if out != entry[4]: - result = consts.TEST_FAILED - tmp_cause = ( - 'After setting {}={}, expected {}={}, but received ' - '{}={}'.format(entry[0], entry[1], entry[3], entry[4], - entry[3], out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Systemd.remove_scope_slice_conf(config, SLICE, SCOPE, CONTROLLER, CONFIG_FILE_NAME) - - # Incase the error occurs before the creation of OTHER_CGNAME, - # let's ignore the exception - try: - Cgroup.delete(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause] = setup(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/071-sudo-set_default_systemd_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/071-sudo-set_default_systemd_cgroup.py deleted file mode 100755 index 2c45320375b..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/071-sudo-set_default_systemd_cgroup.py +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# set_default_systemd_cgroup functionality test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# Author: Tom Hromatka -# - -from libcgroup import Version, Cgroup, Mode -from cgroup import Cgroup as CgroupCli -from process import Process -import consts -import ftests -import time -import sys -import os - - -OTHER_CGNAME = '071_cg_not_in_scope' -SLICE = 'libcgtests.slice' -SCOPE = 'test071.scope' - -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Test 1 - Ensure _set_default_systemd_cgroup() throws an exception if - # libcgroup doesn't set a default (slice/scope) cgroup path - # - try: - Cgroup._set_default_systemd_cgroup() - except RuntimeError as re: - if 'Failed to set' not in str(re): - result = consts.TEST_FAILED - cause = 'Expected \'Failed to set\' to be in the exception, ' \ - 'received {}'.format(str(re)) - else: - result = consts.TEST_FAILED - cause = '_set_default_systemd_cgroup() erroneously passed' - - # - # Test 2 - write_default_systemd_scope() should succeed if the slice/scope - # are invalid and we're not setting it as the default. If we - # create a cgroup at this point, it should be created at the root - # cgroup level, and the default slice/scope should have no bearing - # - Cgroup.write_default_systemd_scope(SLICE, SCOPE, False) - - pid = config.process.create_process(config) - cg = Cgroup(OTHER_CGNAME, Version.CGROUP_V2) - cg.add_controller(CONTROLLER) - cg.create() - Cgroup.move_process(pid, OTHER_CGNAME, CONTROLLER) - cg_pid = cg.get_processes()[0] - - if pid != cg_pid: - result = consts.TEST_FAILED - tmp_cause = 'Expected pid {} to be in {} cgroup, but received pid {} ' \ - 'via python bindings instead'.format(pid, OTHER_CGNAME, cg_pid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - cli_pid = CgroupCli.get_pids_in_cgroup(config, OTHER_CGNAME, CONTROLLER)[0] - - if pid != cli_pid: - result = consts.TEST_FAILED - tmp_cause = 'Expected pid {} to be in {} cgroup, but received pid {} ' \ - 'via CLI instead'.format(pid, OTHER_CGNAME, cli_pid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - Process.kill(config, pid) - cg.delete() - - # - # Test 3 - Write the slice/scope and attempt to set them as the default. - # This should fail because they haven't been created yet, and thus - # it's an invalid path - # - try: - Cgroup.write_default_systemd_scope(SLICE, SCOPE, True) - except RuntimeError as re: - if 'Failed to set' not in str(re): - result = consts.TEST_FAILED - tmp_cause = 'Expected \'Failed to set\' to be in the exception, ' \ - 'received {}'.format(str(re)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - else: - result = consts.TEST_FAILED - tmp_cause = 'write_default_systemd_scope() erroneously passed' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 4 - Create a systemd scope and set it as the default. Everything - # should work properly in this case - # - pid = None - if Cgroup.cgroup_mode() != Mode.CGROUP_MODE_LEGACY: - pid = config.process.create_process(config) - Cgroup.create_scope(SCOPE, SLICE, pid=pid) - Cgroup.write_default_systemd_scope(SLICE, SCOPE) - - cg = Cgroup('/', Version.CGROUP_V2) - cg_pid = cg.get_processes()[0] - - if pid != cg_pid: - result = consts.TEST_FAILED - tmp_cause = 'Expected pid {} to be in \'/\' cgroup, but received pid {} ' \ - 'instead'.format(pid, cg_pid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - path = Cgroup.get_current_controller_path(pid) - if path != os.path.join('/', SLICE, SCOPE): - result = consts.TEST_FAILED - tmp_cause = 'Expected pid path to be: {}, but received path {} ' \ - 'instead'.format(os.path.join('/', SLICE, SCOPE), path) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - cli_pid = CgroupCli.get_pids_in_cgroup(config, os.path.join(SLICE, SCOPE), CONTROLLER)[0] - - if pid != cli_pid: - result = consts.TEST_FAILED - tmp_cause = 'Expected pid {} to be in {} cgroup, but received pid {} ' \ - 'via CLI instead'.format(pid, os.path.join(SLICE, SCOPE), cli_pid) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause, pid - - -def teardown(config, pid): - if pid: - Process.kill(config, pid) - - # Give systemd a chance to remove the scope - time.sleep(0.5) - - Cgroup.clear_default_systemd_scope() - - try: - cg = Cgroup(SLICE, Version.CGROUP_V2) - cg.delete() - except RuntimeError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - try: - pid = None - [result, cause, pid] = test(config) - finally: - teardown(config, pid) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/072-pybindings-cgroup_get_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/072-pybindings-cgroup_get_cgroup.py deleted file mode 100755 index d2af60b3f2e..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/072-pybindings-cgroup_get_cgroup.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_get_cgroup() test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, Mode -from libcgroup import Cgroup, Version -import consts -import ftests -import sys -import os - - -CGNAME = '072cggetcg/childcg' -CONTROLLERS = ['cpu', 'memory', 'io', 'pids'] - -CGNAME2 = '{}/grandchildcg'.format(CGNAME) - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.cgroup_mode() != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup v2 hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLERS, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Test 1 - Ensure all enabled controllers get populated - # - cgall = Cgroup(CGNAME, Version.CGROUP_V2) - cgall.get() - - if len(cgall.controllers) != len(CONTROLLERS): - result = consts.TEST_FAILED - tmp_cause = 'Expected {} controllers in cgall but received {}'.format( - len(CONTROLLERS), len(cgall.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 2 - Ensure the user can read the "cgroup" pseudo-controller - # - cgcg = Cgroup(CGNAME, Version.CGROUP_V2) - cgcg.add_controller('cgroup') - cgcg.get() - - if len(cgcg.controllers) != 1 or 'cgroup' not in cgcg.controllers.keys(): - result = consts.TEST_FAILED - tmp_cause = 'Expected 1 controller in cgcg but received {}'.format(len(cgcg.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 3 - Ensure the user can read a disabled controller - # - cgcpuset = Cgroup(CGNAME, Version.CGROUP_V2) - cgcpuset.add_controller('cpuset') - cgcpuset.get() - - if len(cgcpuset.controllers) != 1 or 'cpuset' not in cgcpuset.controllers.keys(): - result = consts.TEST_FAILED - tmp_cause = 'Expected 1 controller in cgcpuset but received {}'.format( - len(cgcpuset.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 4 - Ensure the user can read a cgroup with a mix of enabled and hidden controllers - # - cgmix = Cgroup(CGNAME, Version.CGROUP_V2) - cgmix.add_controller('cpuset') - cgmix.add_controller('cgroup') - cgmix.add_controller('memory') - cgmix.get() - - if len(cgmix.controllers) != 3 or 'cpuset' not in cgmix.controllers.keys() or \ - 'cgroup' not in cgmix.controllers.keys() or 'memory' not in cgmix.controllers.keys(): - result = consts.TEST_FAILED - tmp_cause = 'Expected 3 controller in cgmix but received {}'.format( - len(cgcpuset.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 5 - Create a parent/child cgroup with no controllers enabled. Ensure the user can get - # the cgroup with no errors. .get() should populate zero cgroups - # - CgroupCli.subtree_control(config, CGNAME, CONTROLLERS, enable=False, ignore_systemd=True) - CgroupCli.create(config, None, CGNAME2) - - cgempty = Cgroup(CGNAME2, Version.CGROUP_V2) - cgempty.get() - - if len(cgempty.controllers) != 0: - result = consts.TEST_FAILED - tmp_cause = 'Expected 0 controller in cgempty but received {}'.format( - len(cgcpuset.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLERS, CGNAME2, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/073-pybindings-cgroup_add_all_controllers-v2.py b/lib/libcgroup-3.1.0/tests/ftests/073-pybindings-cgroup_add_all_controllers-v2.py deleted file mode 100755 index f4ef20f51a6..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/073-pybindings-cgroup_add_all_controllers-v2.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_add_all_controllers() test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from libcgroup import Cgroup, Version, Mode -from cgroup import Cgroup as CgroupCli -import consts -import ftests -import sys -import os - - -PARENTCG = '073cgggetcg' -CGNAME = '{}/child'.format(PARENTCG) -CONTROLLERS = ['cpu', 'memory', 'pids'] -SUBTREE_CONTROL = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupCli.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLERS, PARENTCG) - - # Ensure that the subtree control file differs from the cgroup.controllers file - CgroupCli.subtree_control(config, PARENTCG, CONTROLLERS, enable=False, ignore_systemd=True) - CgroupCli.subtree_control(config, PARENTCG, SUBTREE_CONTROL, enable=True, ignore_systemd=True) - CgroupCli.get_and_validate(config, PARENTCG, 'cgroup.subtree_control', SUBTREE_CONTROL, True) - - CgroupCli.create(config, CONTROLLERS, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cgget = Cgroup(CGNAME, Version.CGROUP_V2) - cgget.get() - - cgall = Cgroup(CGNAME, Version.CGROUP_V2) - cgall.add_all_controllers() - cgall.get() - - if len(CONTROLLERS) != len(cgall.controllers): - result = consts.TEST_FAILED - tmp_cause = 'Expected {} controllers in cgall but received {}'.format( - len(CONTROLLERS), len(cgall.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - if len(str(cgall)) != len(str(cgget)): - result = consts.TEST_FAILED - tmp_cause = 'Expected {} lines in cgall but received {}'.format( - len(str(cgget)), len(str(cgall))) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLERS, CGNAME) - CgroupCli.delete(config, CONTROLLERS, PARENTCG) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/074-pybindings-cgroup_add_all_controllers-v1.py b/lib/libcgroup-3.1.0/tests/ftests/074-pybindings-cgroup_add_all_controllers-v1.py deleted file mode 100755 index 1207bb29a20..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/074-pybindings-cgroup_add_all_controllers-v1.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_add_all_controllers() test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from libcgroup import Cgroup, Version, Mode -from cgroup import Cgroup as CgroupCli -import consts -import ftests -import sys -import os - -CGNAME = '074cggetcg/child' -CONTROLLERS = ['cpu', 'memory', 'pids'] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupCli.get_cgroup_mode(config) != Mode.CGROUP_MODE_LEGACY: - result = consts.TEST_SKIPPED - cause = 'This test requires the legacy cgroup hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLERS, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - cgall = Cgroup(CGNAME, Version.CGROUP_V1) - cgall.add_all_controllers() - cgall.get() - - controllers = list() - with open('/proc/cgroups') as pc: - for i, line in enumerate(pc.readlines()): - if i == 0: - continue - if int(line.split()[1]) > 0: - # If the hierarchy is greater than zero, then use the controller - controllers.append(line.split()[0]) - - if len(controllers) != len(cgall.controllers): - result = consts.TEST_FAILED - tmp_cause = 'Expected {} controllers in cgall but received {}'.format( - len(CONTROLLERS), len(cgall.controllers)) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - for controller in CONTROLLERS: - if len(str(cgall.controllers[controller])) <= 1: - result = consts.TEST_FAILED - tmp_cause = 'Controller {} was not populated'.format(controller) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLERS, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/075-pybindings-cgroup_compare_cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/075-pybindings-cgroup_compare_cgroup.py deleted file mode 100755 index 21bf2bd4124..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/075-pybindings-cgroup_compare_cgroup.py +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_compare_cgroup() test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli, Mode -from libcgroup import Cgroup, Version -import consts -import ftests -import sys -import os - -CGNAME = '075cgcompare/compare' -CONTROLLERS = ['cpu', 'memory', 'io', 'pids'] - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.cgroup_mode() != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup v2 hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLERS, CGNAME) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Test 1 - Compare matching empty cgroup instances - # - cgempty1 = Cgroup(CGNAME, Version.CGROUP_V2) - cgempty2 = Cgroup(CGNAME, Version.CGROUP_V2) - - if cgempty1 != cgempty2: - result = consts.TEST_FAILED - cause = 'Empty cgroups do not match' - - # - # Test 2 - Compare different empty cgroup instances - # - cgempty3 = Cgroup('foo', Version.CGROUP_V2) - cgempty4 = Cgroup('bar', Version.CGROUP_V2) - - if cgempty3 == cgempty4: - result = consts.TEST_FAILED - tmp_cause = 'Empty cgroups erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 3 - Compare different empty cgroup instances - # - cgempty5 = Cgroup('baz', Version.CGROUP_V1) - cgempty6 = Cgroup('baz', Version.CGROUP_V2) - - if cgempty5 == cgempty6: - result = consts.TEST_FAILED - tmp_cause = 'Empty cgroups erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 4 - Compare cgroups with only the controllers populated - # - cgctrl1 = Cgroup(CGNAME, Version.CGROUP_V2) - cgctrl1.add_all_controllers() - - cgctrl2 = Cgroup(CGNAME, Version.CGROUP_V2) - for controller in CONTROLLERS: - cgctrl2.add_controller(controller) - - if cgctrl1 != cgctrl2: - result = consts.TEST_FAILED - tmp_cause = 'Controller-only cgroups do not match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 5 - Compare populated cgroups - # - cgget1 = Cgroup(CGNAME, Version.CGROUP_V2) - cgget1.add_all_controllers() - cgget1.get() - - cgget2 = Cgroup(CGNAME, Version.CGROUP_V2) - cgget2.get() - - if cgget1 != cgget2: - result = consts.TEST_FAILED - tmp_cause = 'cgget1 and cgget2 cgroups do not match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 6 - Compare cgroups with differing uid/gids - # - cguid1 = Cgroup(CGNAME, Version.CGROUP_V2) - cguid1.set_uid_gid(123, 456, 789, 987) - cguid1.add_all_controllers() - - cguid2 = Cgroup(CGNAME, Version.CGROUP_V2) - cguid2.set_uid_gid(123, 456, 789, 9870) - cguid2.add_all_controllers() - - if cguid1 == cguid2: - result = consts.TEST_FAILED - tmp_cause = 'cguid1 and cguid2 erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - cguid2.set_uid_gid(123, 456, 7890, 987) - if cguid1 == cguid2: - result = consts.TEST_FAILED - tmp_cause = 'cguid1 and cguid2 erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - cguid2.set_uid_gid(123, 4560, 789, 987) - if cguid1 == cguid2: - result = consts.TEST_FAILED - tmp_cause = 'cguid1 and cguid2 erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - cguid2.set_uid_gid(1230, 456, 789, 987) - if cguid1 == cguid2: - result = consts.TEST_FAILED - tmp_cause = 'cguid1 and cguid2 erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 7 - Compare cgroups with matching uid/gids - # - cguid3 = Cgroup(CGNAME, Version.CGROUP_V2) - cguid3.set_uid_gid(2345, 678, 9012, 3456) - cguid3.add_all_controllers() - - cguid4 = Cgroup(CGNAME, Version.CGROUP_V2) - cguid4.set_uid_gid(2345, 678, 9012, 3456) - cguid4.add_all_controllers() - - if cguid3 != cguid4: - result = consts.TEST_FAILED - tmp_cause = 'cguid3 and cguid4 do not match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 8 - Compare cgroups with different controller counts - # - cgctrl3 = Cgroup(CGNAME, Version.CGROUP_V2) - cgctrl3.add_controller(CONTROLLERS[0]) - cgctrl3.add_controller(CONTROLLERS[1]) - - cgctrl4 = Cgroup(CGNAME, Version.CGROUP_V2) - cgctrl4.add_controller(CONTROLLERS[0]) - - if cgctrl3 == cgctrl4: - result = consts.TEST_FAILED - tmp_cause = 'controller-only cgroups erroneously match' - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - CgroupCli.delete(config, CONTROLLERS, CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/076-cgconfig-auto_convert.py b/lib/libcgroup-3.1.0/tests/ftests/076-cgconfig-auto_convert.py deleted file mode 100755 index 751feb2684a..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/076-cgconfig-auto_convert.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgconfigparser auto convert functionality test using a configuration file -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup, CgroupVersion -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' - -CGNAME_V1 = '076cgconfig_v1' -CFS_PERIOD = '100000' -CFS_QUOTA = '50000' -CPU_SHARES = '1024' - -CGNAME_V2 = '076cgconfig_v2' -CFS_MAX = '"max 100000"' -CPU_WEIGHT = '50' - -CONFIG_FILE = ''' -group {} {{ - {} {{ - cpu.cfs_period_us = {}; - cpu.cfs_quota_us = {}; - cpu.shares = {}; - }} -}} -group {} {{ - {} {{ - cpu.max = {}; - cpu.weight = {}; - }} -}}'''.format( - CGNAME_V1, CONTROLLER, CFS_PERIOD, CFS_QUOTA, CPU_SHARES, - CGNAME_V2, CONTROLLER, CFS_MAX, CPU_WEIGHT - ) - -CONFIG_FILE_NAME = os.path.join(os.getcwd(), '078cgconfig.conf') - -TABLE = [ - [CGNAME_V1, 'cpu.weight', CgroupVersion.CGROUP_V2, '100'], - [CGNAME_V1, 'cpu.max', CgroupVersion.CGROUP_V2, '50000 100000'], - [CGNAME_V2, 'cpu.shares', CgroupVersion.CGROUP_V1, '512'], - [CGNAME_V2, 'cpu.cfs_period_us', CgroupVersion.CGROUP_V1, '100000'], - [CGNAME_V2, 'cpu.cfs_quota_us', CgroupVersion.CGROUP_V1, '-1'], - ] - - -def prereqs(config): - return consts.TEST_PASSED, None - - -def setup(config): - f = open(CONFIG_FILE_NAME, 'w') - f.write(CONFIG_FILE) - f.close() - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.configparser(config, load_file=CONFIG_FILE_NAME) - - for entry in TABLE: - out = Cgroup.xget( - config, cgname=entry[0], setting=entry[1], - version=entry[2], values_only=True, print_headers=False - ) - - if out != entry[3]: - result = consts.TEST_FAILED - tmp_cause = ( - 'Expected {}={}, received {}={} ' - ''.format(entry[1], entry[3], entry[1], out) - ) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, CGNAME_V1) - Cgroup.delete(config, CONTROLLER, CGNAME_V2) - os.remove(CONFIG_FILE_NAME) - - -def main(config): - [result, cause] = prereqs(config) - - try: - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/077-pybindings-cgroup_get_procs.py b/lib/libcgroup-3.1.0/tests/ftests/077-pybindings-cgroup_get_procs.py deleted file mode 100755 index f1557897963..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/077-pybindings-cgroup_get_procs.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_get_procs() test using the python bindings -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Version -from process import Process -import consts -import ftests -import sys -import os - - -CGNAME = '077getprocs/cgwithpids' -EMPTY_CGNAME = '077getprocs/cgwithoutpids' -CONTROLLERS = ['cpu', 'pids'] -PID_CNT = 20 - -initial_pid_list = list() - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - global initial_pid_list - CgroupCli.create(config, CONTROLLERS, CGNAME) - CgroupCli.create(config, CONTROLLERS, EMPTY_CGNAME) - - for i in range(0, PID_CNT): - pid = config.process.create_process(config) - initial_pid_list.append(pid) - - CgroupCli.classify(config, CONTROLLERS, CGNAME, initial_pid_list, ignore_systemd=True) - initial_pid_list = initial_pid_list.sort() - - -def test(config): - global initial_pid_list - result = consts.TEST_PASSED - cause = None - - # - # Test 1 - verify pids are properly populated and retrieved from a cgroup - # - cg = Cgroup(CGNAME, Version.CGROUP_V2) - for controller in CONTROLLERS: - cg.add_controller(controller) - pid_list = cg.get_processes().sort() - - if pid_list != initial_pid_list: - result = consts.TEST_FAILED - tmp_cause = 'The pid lists do not match\n{}\n{}'.format(initial_pid_list, pid_list) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 2 - verify there are no pids in the empty cgroup - # - emptycg = Cgroup(EMPTY_CGNAME, Version.CGROUP_V2) - for controller in CONTROLLERS: - emptycg.add_controller(controller) - empty_pid_list = emptycg.get_processes() - - if len(empty_pid_list) != 0: - result = consts.TEST_FAILED - tmp_cause = 'The pid list unexpectedly was populated\n{}'.format(empty_pid_list) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - return result, cause - - -def teardown(config): - global initial_pid_list - - Process.kill(config, initial_pid_list) - CgroupCli.delete(config, CONTROLLERS, EMPTY_CGNAME) - CgroupCli.delete(config, CONTROLLERS, os.path.dirname(CGNAME), recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/078-sudo-cgcreate_systemd_scope.py b/lib/libcgroup-3.1.0/tests/ftests/078-sudo-cgcreate_systemd_scope.py deleted file mode 100755 index 48897d567b7..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/078-sudo-cgcreate_systemd_scope.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to create a systemd scope using cgcreate -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -from process import Process -from libcgroup import Mode -from run import RunError -from log import Log -import consts -import ftests -import sys -import os - -CONTROLLERS = ['cpu', 'pids'] -SLICE = 'libcgroup.slice' -CGNAME = os.path.join(SLICE, '078cgcreate.scope') -IN_SCOPE_CHILD_CGNAME = os.path.join(CGNAME, 'in_scope_childcg') -OUT_OF_SCOPE_CHILD_CGNAME = '078outofscopechild' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.create_and_validate(config, CONTROLLERS, CGNAME, create_scope=True) - - # get the placeholder PID that libcgroup placed in the scope - try: - pid = int(Cgroup.get(config, None, CGNAME, setting='cgroup.procs', - print_headers=False, values_only=True, ignore_systemd=True)) - # use the pid variable so that lint is happy - Log.log_debug('Cgroup {} has pid {}'.format(CGNAME, pid)) - except RunError: - result = consts.TEST_FAILED - cause = 'Failed to read pid in {}\'s cgroup.procs'.format(CGNAME) - return result, cause - - # Since the scope was created without being made the default, we must specify - # the entire path to operate on a child cgroup below the scope. - Cgroup.create_and_validate(config, None, IN_SCOPE_CHILD_CGNAME) - Cgroup.create_and_validate(config, None, OUT_OF_SCOPE_CHILD_CGNAME) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, None, IN_SCOPE_CHILD_CGNAME) - Cgroup.delete(config, None, OUT_OF_SCOPE_CHILD_CGNAME) - - pid = int(Cgroup.get(config, None, CGNAME, setting='cgroup.procs', - print_headers=False, values_only=True, ignore_systemd=True)) - Process.kill(config, pid) - - # systemd will automatically remove the cgroup once there are no more pids in - # the cgroup, so we don't need to delete CGNAME. But let's try to remove the - # slice - try: - Cgroup.delete(config, CONTROLLERS, SLICE) - except RunError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/079-sudo-cgcreate_default_systemd_scope.py b/lib/libcgroup-3.1.0/tests/ftests/079-sudo-cgcreate_default_systemd_scope.py deleted file mode 100755 index c42d371a340..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/079-sudo-cgcreate_default_systemd_scope.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to create a default systemd scope using cgcreate -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup -from process import Process -from libcgroup import Mode -from run import RunError -from log import Log -import consts -import ftests -import sys -import os - -CONTROLLERS = ['cpu', 'pids'] -SLICE = 'libcgroup.slice' -SCOPE_CGNAME = os.path.join(SLICE, '079cgcreate.scope') -CHILD_CGNAME = 'childcg' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.create_and_validate(config, CONTROLLERS, SCOPE_CGNAME, create_scope=True, - set_default_scope=True) - - # get the placeholder PID that libcgroup placed in the scope - try: - pid = int(Cgroup.get(config, None, SCOPE_CGNAME, setting='cgroup.procs', - print_headers=False, values_only=True, ignore_systemd=True)) - # use the pid variable so that lint is happy - Log.log_debug('Cgroup {} has pid {}'.format(SCOPE_CGNAME, pid)) - except RunError: - result = consts.TEST_FAILED - cause = 'Failed to read pid in {}\'s cgroup.procs'.format(SCOPE_CGNAME) - return result, cause - - Cgroup.create_and_validate(config, None, CHILD_CGNAME) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, None, CHILD_CGNAME) - - pid = int(Cgroup.get(config, None, SCOPE_CGNAME, setting='cgroup.procs', - print_headers=False, values_only=True, ignore_systemd=True)) - Process.kill(config, pid) - - # systemd will automatically remove the cgroup once there are no more pids in - # the cgroup, so we don't need to delete CGNAME. But let's try to remove the - # slice - try: - Cgroup.delete(config, CONTROLLERS, SLICE) - except RunError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/080-kernel-domain_invalid.py b/lib/libcgroup-3.1.0/tests/ftests/080-kernel-domain_invalid.py deleted file mode 100755 index 79fdf74c321..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/080-kernel-domain_invalid.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to exercise that libcgroup properly handles cgroups that are marked as "domain invalid" -# -# Copyright (c) 2023 Oracle and/or its affiliates -# Author: Tom Hromatka -# - -from cgroup import Cgroup as Cgroup, Mode -from process import Process -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -PARENTCG = '080domaininvalid' -CHILDCG = os.path.join(PARENTCG, 'childcg') -GRANDCHILDCG = os.path.join(CHILDCG, 'grandchildcg') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if Cgroup.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup v2 hierarchy' - - return result, cause - - -def setup(config): - Cgroup.create(config, CONTROLLER, PARENTCG) - Cgroup.create(config, CONTROLLER, CHILDCG) - - config.process.create_process_in_cgroup(config, CONTROLLER, PARENTCG, ignore_systemd=True) - - -def test(config): - # - # test 1 - ensure that we can create and delete a cgroup (with no controllers) under a - # parent whose type is 'domain invalid' - # - Cgroup.create_and_validate(config, None, GRANDCHILDCG) - Cgroup.delete(config, None, GRANDCHILDCG) - - # - # test 2 - attempt to add a process to the child cgroup. the kernel should not allow this, - # and libcgroup needs to handle this - # - pid = config.process.create_process(config) - try: - Cgroup.classify(config, CONTROLLER, CHILDCG, pid) - except RunError as re: - if 'Operation not supported' not in re.stderr: - raise re - finally: - Process.kill(config, pid) - - # - # test 3 - attempt to enable a controller that enforces the no-processes-in-non-leaf-nodes - # rule. the kernel should not allow this - # - try: - Cgroup.subtree_control(config, CHILDCG, 'memory') - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - - return consts.TEST_PASSED, None - - -def teardown(config): - pids = Cgroup.get_pids_in_cgroup(config, PARENTCG, CONTROLLER) - Process.kill(config, pids) - - Cgroup.delete(config, CONTROLLER, CHILDCG) - Cgroup.delete(config, CONTROLLER, PARENTCG) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/081-pybindings-cgrp_get_curr_ctrl_path-v1.py b/lib/libcgroup-3.1.0/tests/ftests/081-pybindings-cgrp_get_curr_ctrl_path-v1.py deleted file mode 100755 index d4a07b732ab..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/081-pybindings-cgrp_get_curr_ctrl_path-v1.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_get_current_controller_path() test using the python bindings (cgroup v1) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup as CgroupCli, Mode -from libcgroup import Cgroup, Version -from process import Process -import consts -import ftests -import sys -import os - - -CGNAME = '081getctrlpathv1' -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.cgroup_mode() == Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the legacy cgroup v1 hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLER, CGNAME) - - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, ignore_systemd=True) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - expected_path = "/" + CGNAME - pid = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - - cgrp = Cgroup(CGNAME, Version.CGROUP_V2) - # - # Test 1 - get the relative path of cgroup, for the pid's cpu controller. - # It's expected to pass because we had created cgroup on cpu - # hierarchy and moved the task to that group. - # - cgrp_path = cgrp.get_current_controller_path(pid, CONTROLLER) - if cgrp_path != expected_path: - result = consts.TEST_FAILED - cause = 'Expected cgroup path {} got {}'.format(expected_path, cgrp_path) - - # - # Test 2 - get the relative path of cgroup, for the pid's memory controller. - # It's expected to fail because we not had created cgroup. - # - cgrp_path = cgrp.get_current_controller_path(pid, "memory") - if cgrp_path == expected_path: - result = consts.TEST_FAILED - tmp_cause = 'cgroup path unexpectedly formed {}'.format(cgrp_path) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 3 - get the relative path of cgroup, for the pid's invalid controller. - # It's expected to fail because such controller doesn't exists. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, "invalid") - except RuntimeError as re: - if '50011' not in str(re): - raise re - - # - # Test 4 - get the relative path of cgroup, for the pid's pass NULL as - # controller. It's expected to fail because it's not supported - # cgroup v1. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, None) - except RuntimeError as re: - if '50016' not in str(re): - raise re - - # - # Test 5 - get the relative path of cgroup, for the pid's pass int as - # controller. It's expected to fail because string is expected - # for the controller name. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, 1234) - except TypeError as re: - if 'expected controller type string, but passed' not in str(re): - raise re - - return result, cause - - -def teardown(config): - pid = CgroupCli.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - Process.kill(config, pid) - - CgroupCli.delete(config, CONTROLLER, CGNAME) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/082-pybindings-cgrp_get_curr_ctrl_path-v2.py b/lib/libcgroup-3.1.0/tests/ftests/082-pybindings-cgrp_get_curr_ctrl_path-v2.py deleted file mode 100755 index 1426619fe74..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/082-pybindings-cgrp_get_curr_ctrl_path-v2.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# cgroup_get_current_controller_path() test using the python bindings (cgroup v2) -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup as CgroupCli, Mode -from libcgroup import Cgroup, Version -from process import Process -import consts -import ftests -import sys -import os - - -CGNAME = '082getctrlpathv2' -CHILDCG = '082getctrlpathv2/childcg' -CONTROLLER = 'cpu' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.cgroup_mode() != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup v2 hierarchy' - - return result, cause - - -def setup(config): - CgroupCli.create(config, CONTROLLER, CGNAME) - CgroupCli.create(config, CONTROLLER, CHILDCG) - - config.process.create_process_in_cgroup(config, CONTROLLER, CHILDCG, ignore_systemd=True) - - -def test(config): - result = consts.TEST_PASSED - cause = None - - expected_path = "/" + CHILDCG - pid = CgroupCli.get_pids_in_cgroup(config, CHILDCG, CONTROLLER)[0] - cgrp = Cgroup(CGNAME, Version.CGROUP_V2) - - # - # Test 1 - get the relative path of cgroup, for the pid's cpu controller. - # It's expected to pass because we had created cgroup on cpu - # hierarchy and moved the task to that group. - # - cgrp_path = cgrp.get_current_controller_path(pid, CONTROLLER) - if cgrp_path != expected_path: - result = consts.TEST_FAILED - cause = 'Expected cgroup path {} got {}'.format(expected_path, cgrp_path) - - # - # Test 2 - get the relative path of cgroup, for the pid's memory controller. - # It's expected to fail because we not had created cgroup. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, "memory") - except RuntimeError as re: - if '50001' not in str(re): - raise re - - # - # Test 3 - get the relative path of cgroup, for the pid's invalid controller. - # It's expected to fail because such controller doesn't exists. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, "invalid") - except RuntimeError as re: - if '50011' not in str(re): - raise re - - # - # Test 4 - get the relative path of cgroup, for the pid's pass NULL as - # controller. It's expected to return the path with children. - # - cgrp_path = cgrp.get_current_controller_path(pid) - if cgrp_path != expected_path: - result = consts.TEST_FAILED - tmp_cause = 'Expected cgroup path {} got {}'.format(expected_path, cgrp_path) - cause = '\n'.join(filter(None, [cause, tmp_cause])) - - # - # Test 5 - get the relative path of cgroup, for the pid's pass int as - # controller. It's expected to fail because string is expected - # for the controller name. - # - try: - cgrp_path = cgrp.get_current_controller_path(pid, 1234) - except TypeError as re: - if 'expected controller type string, but passed' not in str(re): - raise re - - return result, cause - - -def teardown(config): - pid = CgroupCli.get_pids_in_cgroup(config, CHILDCG, CONTROLLER)[0] - Process.kill(config, pid) - - CgroupCli.delete(config, CONTROLLER, CGNAME, recursive=True) - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/083-pybindings-helpers_cgroup_mode.py b/lib/libcgroup-3.1.0/tests/ftests/083-pybindings-helpers_cgroup_mode.py deleted file mode 100755 index 8808a03be17..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/083-pybindings-helpers_cgroup_mode.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to excerise cgroup_setup_mode() helpers -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup as CgroupCli -from libcgroup import Cgroup, Mode -import consts -import ftests -import sys -import os - - -def prereqs(config): - pass - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - mode1 = Cgroup.cgroup_mode() - mode2 = CgroupCli.get_cgroup_mode(config) - - if mode1 != mode2: - result = consts.TEST_FAILED - cause = 'mode mismatch: libcgroup mode: {}, tests mode: {}'.format(mode1, mode2) - return result, cause - - if mode1 == Mode.CGROUP_MODE_LEGACY: - ret = Cgroup.is_cgroup_mode_legacy() - if ret is False: - result = consts.TEST_FAILED - cause = 'mode mismatch: libcgroup mode: legacy (v1) check, returned false' - elif mode1 == Mode.CGROUP_MODE_HYBRID: - ret = Cgroup.is_cgroup_mode_hybrid() - if ret is False: - result = consts.TEST_FAILED - cause = 'mode mismatch: libcgroup mode: hybrid (v1/v2) check, returned false' - elif mode1 == Mode.CGROUP_MODE_UNIFIED: - ret = Cgroup.is_cgroup_mode_unified() - if ret is False: - result = consts.TEST_FAILED - cause = 'mode mismatch: libcgroup mode: unified (v2) check, returned false' - else: - result = consts.TEST_FAILED - cause = 'Unknown libcgroup mode: {}'.format(mode1) - - return result, cause - - -def teardown(config): - pass - - -def main(config): - prereqs(config) - setup(config) - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/084-sudo-cgcreate_systemd_scope_pid.py b/lib/libcgroup-3.1.0/tests/ftests/084-sudo-cgcreate_systemd_scope_pid.py deleted file mode 100755 index a418928b1fe..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/084-sudo-cgcreate_systemd_scope_pid.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to create a systemd scope with pid using cgcreate -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import Cgroup -from process import Process -from libcgroup import Mode -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLERS = ['cpu', 'pids'] -SLICE = 'libcgroup.slice' -CGNAME1 = os.path.join(SLICE, '084cgcreate1.scope') -CGNAME2 = os.path.join(SLICE, '084cgcreate2.scope') - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if Cgroup.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Test 1: Pass invalid task pid as scope_pid and systemd scope creation - # should fail - # - try: - Cgroup.create_and_validate(config, CONTROLLERS, CGNAME1, create_scope=True, - scope_pid=1000000) - except RunError as re: - if 'Process with ID 1000000 does not exist' not in str(re): - raise re - - # - # Test 2: Pass a valid task pid as scope_pid and systemd scope creation - # will succeed. Read the scope cgroup.procs to find if the task - # passed by us was used as scope task. - # - scope_pid = config.process.create_process(config) - Cgroup.create_and_validate(config, CONTROLLERS, CGNAME1, create_scope=True, scope_pid=scope_pid) - - try: - pid = Cgroup.get_pids_in_cgroup(config, CGNAME1, CONTROLLERS[0])[0] - if scope_pid != pid: - result = consts.TEST_FAILED - cause = 'scope created with other pid {}, expected pid {}'.format(pid, scope_pid) - return result, cause - except RunError: - result = consts.TEST_FAILED - cause = 'Failed to read pid in {}\'s cgroup.procs'.format(CGNAME1) - return result, cause - - # - # Test 3: Pass the already created task pid as scope_pid for a new systemd - # scope. This would mean the CGNAME1 should be killed and the pid - # should be the default scope task of CGNAME2 - Cgroup.create_and_validate(config, CONTROLLERS, CGNAME2, create_scope=True, scope_pid=scope_pid) - - # CGNAME1 should be deleted by the systemd. - try: - pid = Cgroup.get_pids_in_cgroup(config, CGNAME1, CONTROLLERS[0])[0] - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = 'Erroneously succeeded reading cgroup.procs in {}'.format(CGNAME1) - return result, cause - - try: - pid = Cgroup.get_pids_in_cgroup(config, CGNAME2, CONTROLLERS[0])[0] - if scope_pid != pid: - result = consts.TEST_FAILED - cause = 'scope created with other pid {}, expected pid {}'.format(pid, scope_pid) - return result, cause - except RunError: - result = consts.TEST_FAILED - cause = 'Failed to read pid in {}\'s cgroup.procs'.format(CGNAME2) - - return result, cause - - -def teardown(config): - pid = Cgroup.get_pids_in_cgroup(config, CGNAME2, CONTROLLERS[0])[0] - Process.kill(config, pid) - - # systemd will automatically remove the cgroup once there are no more pids in - # the cgroup, so we don't need to delete CGNAME2. But let's try to remove the - # slice - try: - Cgroup.delete(config, CONTROLLERS, SLICE) - except RunError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/085-sudo-cgexec_systemd_scope.py b/lib/libcgroup-3.1.0/tests/ftests/085-sudo-cgexec_systemd_scope.py deleted file mode 100755 index 73fa088b680..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/085-sudo-cgexec_systemd_scope.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to replace idle_thread of scope unit using cgexec -r -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from multiprocessing import active_children -from process import Process -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import time -import sys -import os - -CONTROLLER = 'cpu' -SLICE = 'libcgroup.slice' -CGNAME = os.path.join(SLICE, '085cgcreate.scope') -OUT_OF_SCOPE_CGNAME1 = '085outofscope' -OUT_OF_SCOPE_CGNAME2 = '085outofscope.scope' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - Cgroup.create_and_validate(config, CONTROLLER, CGNAME, create_scope=True) - - # - # Test 1: call cgexec -r to replace idle_thread with infinite while loop - # - idle_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, cgclassify=False, - replace_idle=True) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - if idle_pid == pid: - result = consts.TEST_FAILED - cause = 'Failed to replace scope idle_thread pid {} {}'.format(idle_pid, pid) - return result, cause - - # - # Test 2: call cgexec -r to replace non-idle_thread (while loop, - # previously created) with another while loop. It's expected to fail, - # because only idle_thread is allowed to be replaced. - # - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, - cgclassify=False, replace_idle=True) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - replace_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - if replace_pid != pid: - result = consts.TEST_FAILED - cause = ('Erroneously replaced scope non idle_thread pid {} with ' - 'pid {}'.format(pid, replace_pid)) - return result, cause - - # - # Test 3: create a non-scope cgroup, try creating a task with replace_idle - # set. It should fail way before creating a task, during cgroup name - # check. - Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1) - config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1, - cgclassify=False, replace_idle=True) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME1, CONTROLLER) - if len(pid) != 0: - result = consts.TEST_FAILED - cause = ('Erroneously succeeded in creating task in non scope cgroup: ' - 'pid {}'.format(pid)) - return result, cause - - # - # Test 4: create a non-scope cgroup with .scope suffix, try creating a task with - # replace_idle set. It should fail when trying to find idle_task - # check. - # - Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2) - config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2, - cgclassify=False, replace_idle=True) - - # We need pause, before the cgroups.procs gets updated, post cgexec - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME2, CONTROLLER) - if len(pid) != 0: - result = consts.TEST_FAILED - cause = ('Erroneously succeeded in creating task in non scope cgroup: ' - 'pid {}'.format(pid)) - - return result, cause - - -def teardown(config): - Cgroup.delete(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1) - Cgroup.delete(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2) - - pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - Process.kill(config, pid) - - # kill the process, that was created by us but failed to migrate to the cgroup - active = active_children() - active[0].terminate() - - # systemd will automatically remove the cgroup once there are no more pids in - # the cgroup, so we don't need to delete CGNAME. But let's try to remove the - # slice - try: - Cgroup.delete(config, CONTROLLER, SLICE) - except RunError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/086-sudo-systemd_cmdline_example.py b/lib/libcgroup-3.1.0/tests/ftests/086-sudo-systemd_cmdline_example.py deleted file mode 100755 index 801027d5c4a..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/086-sudo-systemd_cmdline_example.py +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test cgcreate's handling of a failed creation and ensure the directory is deleted -# -# This test is designed to reproduce the steps in -# samples/cmdline/systemd-with-idle-process.md -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from cgroup import Cgroup as CgroupCli -from systemd import Systemd -from process import Process -from libcgroup import Mode -from run import RunError -import ftests -import consts -import sys -import os - -SLICE = 'libcgtests.slice' -SCOPE = '086example.scope' - -CONTROLLER_LIST = ['cpu', 'memory'] - -TMP_CGNAME = 'tmp' -HIGH_CGNAME = 'high-priority' -MED_CGNAME = 'medium-priority' -LOW_CGNAME = 'low-priority' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - return result, cause - - if CgroupCli.get_cgroup_mode(config) != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Step 1 in the example - # sudo cgcreate -c -S -g cpu,memory:mycompany.slice/database.scope - # - CgroupCli.create_and_validate(config, CONTROLLER_LIST, os.path.join(SLICE, SCOPE), - create_scope=True, set_default_scope=True) - - if not Systemd.is_delegated(config, SCOPE): - result = consts.TEST_FAILED - cause = 'Cgroup is not delegated' - return result, cause - - # - # Step 2 in the example - # $ sudo cgcreate -g cpu,memory:mycompany.slice/database.scope/high-priority - # cgcreate: can't create cgroup mycompany.slice/database.scope/high-priority: Operation not - # supported - # - try: - CgroupCli.create_and_validate(config, CONTROLLER_LIST, HIGH_CGNAME) - except RunError as re: - if re.ret != 96 or 'No such file or directory' not in re.stderr: - result = consts.TEST_FAILED - cause = 'Unexpected error when creating {}: {}'.format(HIGH_CGNAME, re.ret) - return result, cause - else: - result = consts.TEST_FAILED - cause = 'Unexpected success when creating {}'.format(HIGH_CGNAME) - return result, cause - - # - # Step 2.i in the example - # sudo cgset -r cgroup.subtree_control="-cpu -memory" / - # - CgroupCli.subtree_control(config, '/', CONTROLLER_LIST, enable=False) - - # - # Step 2.ii in the example - # sudo cgcreate -g :tmp - # sudo cgclassify -g :tmp $(cgget -nv -r cgroup.procs /) - # - CgroupCli.create_and_validate(config, None, TMP_CGNAME) - pids = CgroupCli.get_pids_in_cgroup(config, os.path.join(SLICE, SCOPE), CONTROLLER_LIST[0]) - CgroupCli.classify(config, None, TMP_CGNAME, pids) - - # - # Step 2.iii in the example - # sudo cgset -r cgroup.subtree_control="+cpu +memory" / - # - CgroupCli.subtree_control(config, '/', CONTROLLER_LIST, enable=True) - - # - # Step 2 (finally!) in the example - # sudo cgcreate -g cpu,memory:high-priority -g cpu,memory:medium-priority \ - # -g cpu,memory:low-priority - # - CgroupCli.create_and_validate(config, CONTROLLER_LIST, HIGH_CGNAME) - CgroupCli.create_and_validate(config, CONTROLLER_LIST, MED_CGNAME) - CgroupCli.create_and_validate(config, CONTROLLER_LIST, LOW_CGNAME) - - # - # Step 3.i in the example - # sudo cgset -r memory.low=1G high-priority - # - CgroupCli.set_and_validate(config, HIGH_CGNAME, 'memory.low', '1073741824') - - # - # Step 3.ii in the example - # sudo cgset -r memory.max=2G low-priority - # - CgroupCli.set_and_validate(config, LOW_CGNAME, 'memory.max', '2147483648') - - # - # Step 3.iii in the example - # sudo cgset -r memory.high=3G medium-priority - # - CgroupCli.set_and_validate(config, MED_CGNAME, 'memory.high', '3221225472') - - # - # Step 3.iv in the example - # sudo cgset -r cpu.weight=600 high-priority - # - CgroupCli.set_and_validate(config, HIGH_CGNAME, 'cpu.weight', '600') - - # - # Step 3.v in the example - # sudo cgset -r cpu.weight=300 medium-priority - # - CgroupCli.set_and_validate(config, MED_CGNAME, 'cpu.weight', '300') - - # - # Step 3.vi in the example - # sudo cgset -r cpu.weight=100 low-priority - # - CgroupCli.set_and_validate(config, LOW_CGNAME, 'cpu.weight', '100') - - return result, cause - - -def teardown(config, result): - pids = CgroupCli.get_pids_in_cgroup(config, os.path.join(SLICE, SCOPE, TMP_CGNAME), - CONTROLLER_LIST[0]) - Process.kill(config, pids) - - if result != consts.TEST_PASSED: - # Something went wrong. Let's force the removal of the cgroups just to be safe. - # Note that this should remove the cgroup, but it won't remove it from systemd's - # internal caches, so the system may not return to its 'pristine' prior-to-this-test - # state - try: - CgroupCli.delete(config, None, SLICE) - except RunError: - pass - else: - # There is no need to remove the scope. systemd should automatically remove it - # once there are no processes inside of it - pass - - return consts.TEST_PASSED, None - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config, result) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/087-sudo-move_pid.py b/lib/libcgroup-3.1.0/tests/ftests/087-sudo-move_pid.py deleted file mode 100755 index f5eee7d87da..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/087-sudo-move_pid.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to move a pid to a cgroup -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from libcgroup import Cgroup, Mode, Version -from process import Process -import consts -import ftests -import sys -import os - -CGNAME = '087movepid' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if Cgroup.cgroup_mode() != Mode.CGROUP_MODE_UNIFIED: - result = consts.TEST_SKIPPED - cause = 'This test requires the unified cgroup hierarchy' - - return result, cause - - -def setup(config): - result = consts.TEST_PASSED - cause = None - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.create() - - pid = config.process.create_process(config) - - path = Cgroup.get_current_controller_path(pid) - if path == '/' + CGNAME: - result = consts.TEST_FAILED - cause = 'The PID was already in the destination cgroup {}'.format(CGNAME) - - return result, cause, pid - - -def test(config, pid): - result = consts.TEST_PASSED - cause = None - - Cgroup.move_process(pid, CGNAME) - - path = Cgroup.get_current_controller_path(pid) - if path != '/' + CGNAME: - result = consts.TEST_FAILED - cause = 'Expected the pid to be in {} cgroup, but was instead in {}'.format(CGNAME, path) - - return result, cause - - -def teardown(config, pid): - Process.kill(config, pid) - - cg = Cgroup(CGNAME, Version.CGROUP_V2) - cg.delete() - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - [result, cause, pid] = setup(config) - if result != consts.TEST_PASSED: - teardown(config, pid) - return [result, cause] - - [result, cause] = test(config, pid) - teardown(config, pid) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/088-sudo-cgclassify_systemd_scope.py b/lib/libcgroup-3.1.0/tests/ftests/088-sudo-cgclassify_systemd_scope.py deleted file mode 100755 index 6be897b7851..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/088-sudo-cgclassify_systemd_scope.py +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Test to replace idle_thread of scope unit using cgclassify -r -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from process import Process -from cgroup import Cgroup -from run import RunError -import consts -import ftests -import time -import sys -import os - -CONTROLLER = 'cpu' -SLICE = 'libcgroup.slice' -CGNAME = os.path.join(SLICE, '088cgcreate.scope') -OUT_OF_SCOPE_CGNAME1 = '088outofscope' -OUT_OF_SCOPE_CGNAME2 = '088outofscope.scope' - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if config.args.container: - result = consts.TEST_SKIPPED - cause = 'This test cannot be run within a container' - - return result, cause - - -def setup(config): - pass - - -def test(config): - result = consts.TEST_PASSED - cause = None - - # - # Test 1: call cgclassify -r to replace idle_thread with infinite while loop - # - Cgroup.create_and_validate(config, CONTROLLER, CGNAME, create_scope=True) - idle_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0] - - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, - cgclassify=True, replace_idle=True) - - # We need pause, before the cgroups.procs gets updated, post cgclassify - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - if len(pid) > 1 and idle_pid == pid[0]: - result = consts.TEST_FAILED - cause = 'Failed to replace scope idle_thread pid {}'.format(idle_pid) - return result, cause - - # - # Test 2: call cgclassify -r to replace non-idle_thread (while loop, - # previously created) with another while loop. - # - try: - config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, - cgclassify=True, replace_idle=True) - except RunError as re: - if "Failed to find idle_thread task" not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = 'Erroneously classified a task in scope cgroup {}\n'.format(CGNAME) - return result, cause - - # We need pause, before the cgroups.procs gets updated, post cgclassify - time.sleep(1) - - replace_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - if replace_pid[0] != pid[0]: - result = consts.TEST_FAILED - cause = ('Erroneously replaced scope non idle_thread pid {} with ' - 'pid {}'.format(pid[0], replace_pid[0])) - return result, cause - - # - # Test 3: create a non-scope cgroup, try creating a task with replace_idle - # set. - # - Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1) - try: - config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1, - cgclassify=True, replace_idle=True) - except RunError as re: - if "Failed to find idle_thread task" not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = ('Erroneously classified a task in non scope ' - 'cgroup {}\n'.format(OUT_OF_SCOPE_CGNAME1)) - return result, cause - - # We need pause, before the cgroups.procs gets updated, post cgclassify - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME1, CONTROLLER) - if len(pid) != 0: - result = consts.TEST_FAILED - cause = ('Erroneously classified a task in non scope ' - 'cgroup {}\n'.format(OUT_OF_SCOPE_CGNAME1)) - return result, cause - - # - # Test 4: create a non-scope cgroup with .scope suffix, try creating a task with - # replace_idle set. - # - Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2) - try: - config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2, - cgclassify=True, replace_idle=True) - except RunError as re: - if "Failed to find idle_thread task" not in re.stderr: - raise re - else: - result = consts.TEST_FAILED - cause = ('Erroneously classified a task in non scope ' - 'cgroup {}\n'.format(OUT_OF_SCOPE_CGNAME2)) - return result, cause - - # We need pause, before the cgroups.procs gets updated, post cgclassify - time.sleep(1) - - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME2, CONTROLLER) - if len(pid) != 0: - result = consts.TEST_FAILED - cause = ('Erroneously classified a task in non scope ' - 'cgroup {}\n'.format(OUT_OF_SCOPE_CGNAME2)) - - return result, cause - - -def teardown(config): - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME1, CONTROLLER) - Process.kill(config, pid) - - pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME2, CONTROLLER) - Process.kill(config, pid) - - Cgroup.delete(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1) - Cgroup.delete(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2) - - pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER) - Process.kill(config, pid) - - # systemd will automatically remove the cgroup once there are no more pids in - # the cgroup, so we don't need to delete CGNAME. But let's try to remove the - # slice - try: - Cgroup.delete(config, CONTROLLER, SLICE) - except RunError: - pass - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - setup(config) - - [result, cause] = test(config) - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/998-cgdelete-non-existing-shared-mnt-cgroup-v1.py b/lib/libcgroup-3.1.0/tests/ftests/998-cgdelete-non-existing-shared-mnt-cgroup-v1.py deleted file mode 100755 index 7a969058774..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/998-cgdelete-non-existing-shared-mnt-cgroup-v1.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup recursive cgdelete functionality test for shared mount point on cgroup v1 -# -# Copyright (c) 2023 Oracle and/or its affiliates. -# Author: Kamalesh Babulal -# - -from cgroup import CgroupVersion, Cgroup -from run import RunError -import consts -import ftests -import sys -import os - -CONTROLLER = 'cpu' -CGNAME = 'test' - -expected_err = "cgdelete: cannot remove group '%s': No such file or directory" % CGNAME - - -def prereqs(config): - result = consts.TEST_PASSED - cause = None - - if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpu controller' - return result, cause - - # cpuacct controller is only available on cgroup v1, if an exception - # gets raised, then no cgroup v1 controllers are mounted. - try: - CgroupVersion.get_version('cpuacct') - except IndexError: - result = consts.TEST_SKIPPED - cause = 'This test requires the cgroup v1 cpuacct controller' - - return result, cause - - -def setup(config): - return consts.TEST_PASSED, None - - -def test(config): - result = consts.TEST_PASSED - cause = None - - try: - Cgroup.delete(config, CONTROLLER, CGNAME) - except RunError as re: - if expected_err not in re.stderr and re.ret != 82: - result = consts.TEST_FAILED - cause = 'Expected {}'.format(expected_err) - return result, cause - - try: - Cgroup.delete(config, CONTROLLER, CGNAME, recursive=True) - except RunError as re: - if expected_err not in re.stderr and re.ret != 82: - result = consts.TEST_FAILED - cause = 'Expected {}'.format(expected_err) - - return result, cause - - -def teardown(config): - return consts.TEST_PASSED, None - - -def main(config): - [result, cause] = prereqs(config) - if result != consts.TEST_PASSED: - return [result, cause] - - try: - result = consts.TEST_FAILED - setup(config) - [result, cause] = test(config) - finally: - teardown(config) - - return [result, cause] - - -if __name__ == '__main__': - config = ftests.parse_args() - # this test was invoked directly. run only it - config.args.num = int(os.path.basename(__file__).split('-')[0]) - sys.exit(ftests.main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/Makefile.am b/lib/libcgroup-3.1.0/tests/ftests/Makefile.am deleted file mode 100644 index e38d641bbf9..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/Makefile.am +++ /dev/null @@ -1,122 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup functional tests Makefile.am -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -TESTS = ftests-wrapper.sh - -EXTRA_DIST_PYTHON_UTILS = \ - cgroup.py \ - config.py \ - consts.py \ - container.py \ - controller.py \ - ftests.py \ - __init__.py \ - log.py \ - process.py \ - run.py \ - systemd.py \ - utils.py - -EXTRA_DIST_PYTHON_TESTS = \ - 001-cgget-basic_cgget_v1.py \ - 002-cgdelete-recursive_delete.py \ - 003-cgget-basic_cgget_v2.py \ - 004-cgsnapshot-basic_snapshot_v1.py \ - 005-cgsnapshot-basic_snapshot_v2.py \ - 006-cgrules-basic_cgrules_v1.py \ - 007-cgrules-basic_cgrules_v2.py \ - 008-cgget-multiple_r_flags.py \ - 009-cgget-g_flag_controller_only.py \ - 010-cgget-g_flag_controller_and_cgroup.py \ - 011-cgget-r_flag_two_cgroups.py \ - 012-cgget-multiple_r_flags2.py \ - 013-cgget-multiple_g_flags.py \ - 014-cgget-a_flag.py \ - 015-cgget-multiline_r_flag.py \ - 016-cgget-invalid_options.py \ - 017-cgconfig-load_file.py \ - 018-cgconfig-load_dir.py \ - 019-cgconfig-uidgid_dperm_fperm.py \ - 020-cgconfig-tasks_perms_owner.py \ - 021-cgconfig-invalid_options.py \ - 022-cgset-multiple_r_flag.py \ - 023-cgset-copy_from.py \ - 025-cgset-multiple_cgroups.py \ - 026-cgset-multiple_r_multiple_cgroup.py \ - 027-cgset-invalid_options.py \ - 029-lssubsys-basic_lssubsys.py \ - 030-lssubsys-lssubsys_all.py \ - 031-lscgroup-g_flag.py \ - 032-lscgroup-multiple_g_flags.py \ - 033-cgget-no_flags.py \ - 034-cgexec-basic_cgexec.py \ - 035-cgset-set_cgroup_type.py \ - 036-cgset-multi_thread.py \ - 037-cgxget-cpu_settings.py \ - 038-cgxget-cpuset_settings.py \ - 039-pybindings-cgxget.py \ - 040-pybindings-cgxset.py \ - 041-pybindings-library_version.py \ - 042-cgxget-unmappable.py \ - 043-cgcreate-empty_controller.py \ - 044-pybindings-cgcreate_empty_controller.py \ - 045-pybindings-list_mount_points.py \ - 046-cgexec-empty_controller.py \ - 047-cgcreate-delete_cgrp_shared_mnt.py \ - 048-pybindings-get_cgroup_mode.py \ - 049-sudo-systemd_create_scope.py \ - 050-sudo-systemd_create_scope_w_pid.py \ - 051-sudo-cgroup_get_cgroup.py \ - 052-sudo-cgroup_attach_task.py \ - 053-sudo-cgroup_attach_task_pid.py \ - 054-sudo-set_uid_gid_v2.py \ - 055-sudo-set_uid_gid_v1.py \ - 056-sudo-set_permissions_v2.py \ - 057-sudo-set_permissions_v1.py \ - 058-sudo-systemd_create_scope2.py \ - 059-sudo-invalid_systemd_create_scope2.py \ - 060-sudo-cgconfigparser-systemd.py \ - 061-sudo-g_flag_controller_only_systemd-v1.py \ - 062-sudo-g_flag_controller_only_systemd-v2.py \ - 063-sudo-systemd_cgset-v1.py \ - 064-sudo-systemd_cgset-v2.py \ - 065-sudo-systemd_cgclassify-v1.py \ - 066-sudo-systemd_cgclassify-v2.py \ - 067-sudo-systemd_cgexec-v1.py \ - 068-sudo-systemd_cgexec-v2.py \ - 069-sudo-systemd_cgxget-cpu-settings-v1.py \ - 070-sudo-systemd_cgxget-cpu-settings-v2.py \ - 071-sudo-set_default_systemd_cgroup.py \ - 072-pybindings-cgroup_get_cgroup.py \ - 073-pybindings-cgroup_add_all_controllers-v2.py \ - 074-pybindings-cgroup_add_all_controllers-v1.py \ - 075-pybindings-cgroup_compare_cgroup.py \ - 076-cgconfig-auto_convert.py \ - 077-pybindings-cgroup_get_procs.py \ - 078-sudo-cgcreate_systemd_scope.py \ - 079-sudo-cgcreate_default_systemd_scope.py \ - 080-kernel-domain_invalid.py \ - 081-pybindings-cgrp_get_curr_ctrl_path-v1.py \ - 082-pybindings-cgrp_get_curr_ctrl_path-v2.py \ - 083-pybindings-helpers_cgroup_mode.py \ - 084-sudo-cgcreate_systemd_scope_pid.py \ - 085-sudo-cgexec_systemd_scope.py \ - 086-sudo-systemd_cmdline_example.py \ - 087-sudo-move_pid.py \ - 088-sudo-cgclassify_systemd_scope.py \ - 998-cgdelete-non-existing-shared-mnt-cgroup-v1.py -# Intentionally omit the stress test from the extra dist -# 999-stress-cgroup_init.py - -EXTRA_DIST = README.md ftests-wrapper.sh \ - ${EXTRA_DIST_PYTHON_UTILS} ${EXTRA_DIST_PYTHON_TESTS} - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - -rm -f *.pyc diff --git a/lib/libcgroup-3.1.0/tests/ftests/Makefile.in b/lib/libcgroup-3.1.0/tests/ftests/Makefile.in deleted file mode 100644 index eaa3afb1db7..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/Makefile.in +++ /dev/null @@ -1,971 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 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@ - -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup functional tests Makefile.am -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = tests/ftests -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = @EXEEXT@ .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver -LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/test-driver README.md -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -TESTS = ftests-wrapper.sh -EXTRA_DIST_PYTHON_UTILS = \ - cgroup.py \ - config.py \ - consts.py \ - container.py \ - controller.py \ - ftests.py \ - __init__.py \ - log.py \ - process.py \ - run.py \ - systemd.py \ - utils.py - -EXTRA_DIST_PYTHON_TESTS = \ - 001-cgget-basic_cgget_v1.py \ - 002-cgdelete-recursive_delete.py \ - 003-cgget-basic_cgget_v2.py \ - 004-cgsnapshot-basic_snapshot_v1.py \ - 005-cgsnapshot-basic_snapshot_v2.py \ - 006-cgrules-basic_cgrules_v1.py \ - 007-cgrules-basic_cgrules_v2.py \ - 008-cgget-multiple_r_flags.py \ - 009-cgget-g_flag_controller_only.py \ - 010-cgget-g_flag_controller_and_cgroup.py \ - 011-cgget-r_flag_two_cgroups.py \ - 012-cgget-multiple_r_flags2.py \ - 013-cgget-multiple_g_flags.py \ - 014-cgget-a_flag.py \ - 015-cgget-multiline_r_flag.py \ - 016-cgget-invalid_options.py \ - 017-cgconfig-load_file.py \ - 018-cgconfig-load_dir.py \ - 019-cgconfig-uidgid_dperm_fperm.py \ - 020-cgconfig-tasks_perms_owner.py \ - 021-cgconfig-invalid_options.py \ - 022-cgset-multiple_r_flag.py \ - 023-cgset-copy_from.py \ - 025-cgset-multiple_cgroups.py \ - 026-cgset-multiple_r_multiple_cgroup.py \ - 027-cgset-invalid_options.py \ - 029-lssubsys-basic_lssubsys.py \ - 030-lssubsys-lssubsys_all.py \ - 031-lscgroup-g_flag.py \ - 032-lscgroup-multiple_g_flags.py \ - 033-cgget-no_flags.py \ - 034-cgexec-basic_cgexec.py \ - 035-cgset-set_cgroup_type.py \ - 036-cgset-multi_thread.py \ - 037-cgxget-cpu_settings.py \ - 038-cgxget-cpuset_settings.py \ - 039-pybindings-cgxget.py \ - 040-pybindings-cgxset.py \ - 041-pybindings-library_version.py \ - 042-cgxget-unmappable.py \ - 043-cgcreate-empty_controller.py \ - 044-pybindings-cgcreate_empty_controller.py \ - 045-pybindings-list_mount_points.py \ - 046-cgexec-empty_controller.py \ - 047-cgcreate-delete_cgrp_shared_mnt.py \ - 048-pybindings-get_cgroup_mode.py \ - 049-sudo-systemd_create_scope.py \ - 050-sudo-systemd_create_scope_w_pid.py \ - 051-sudo-cgroup_get_cgroup.py \ - 052-sudo-cgroup_attach_task.py \ - 053-sudo-cgroup_attach_task_pid.py \ - 054-sudo-set_uid_gid_v2.py \ - 055-sudo-set_uid_gid_v1.py \ - 056-sudo-set_permissions_v2.py \ - 057-sudo-set_permissions_v1.py \ - 058-sudo-systemd_create_scope2.py \ - 059-sudo-invalid_systemd_create_scope2.py \ - 060-sudo-cgconfigparser-systemd.py \ - 061-sudo-g_flag_controller_only_systemd-v1.py \ - 062-sudo-g_flag_controller_only_systemd-v2.py \ - 063-sudo-systemd_cgset-v1.py \ - 064-sudo-systemd_cgset-v2.py \ - 065-sudo-systemd_cgclassify-v1.py \ - 066-sudo-systemd_cgclassify-v2.py \ - 067-sudo-systemd_cgexec-v1.py \ - 068-sudo-systemd_cgexec-v2.py \ - 069-sudo-systemd_cgxget-cpu-settings-v1.py \ - 070-sudo-systemd_cgxget-cpu-settings-v2.py \ - 071-sudo-set_default_systemd_cgroup.py \ - 072-pybindings-cgroup_get_cgroup.py \ - 073-pybindings-cgroup_add_all_controllers-v2.py \ - 074-pybindings-cgroup_add_all_controllers-v1.py \ - 075-pybindings-cgroup_compare_cgroup.py \ - 076-cgconfig-auto_convert.py \ - 077-pybindings-cgroup_get_procs.py \ - 078-sudo-cgcreate_systemd_scope.py \ - 079-sudo-cgcreate_default_systemd_scope.py \ - 080-kernel-domain_invalid.py \ - 081-pybindings-cgrp_get_curr_ctrl_path-v1.py \ - 082-pybindings-cgrp_get_curr_ctrl_path-v2.py \ - 083-pybindings-helpers_cgroup_mode.py \ - 084-sudo-cgcreate_systemd_scope_pid.py \ - 085-sudo-cgexec_systemd_scope.py \ - 086-sudo-systemd_cmdline_example.py \ - 087-sudo-move_pid.py \ - 088-sudo-cgclassify_systemd_scope.py \ - 998-cgdelete-non-existing-shared-mnt-cgroup-v1.py - -# Intentionally omit the stress test from the extra dist -# 999-stress-cgroup_init.py -EXTRA_DIST = README.md ftests-wrapper.sh \ - ${EXTRA_DIST_PYTHON_UTILS} ${EXTRA_DIST_PYTHON_TESTS} - -all: all-am - -.SUFFIXES: -.SUFFIXES: .log .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/ftests/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/ftests/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - elif test -n "$$redo_logs"; then \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -ftests-wrapper.sh.log: ftests-wrapper.sh - @p='ftests-wrapper.sh'; \ - b='ftests-wrapper.sh'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: -@am__EXEEXT_TRUE@ @p='$<'; \ -@am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ -@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ -@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f 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: check-am install-am install-strip - -.PHONY: all all-am check check-TESTS check-am clean clean-generic \ - clean-libtool clean-local cscopelist-am ctags-am distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \ - uninstall uninstall-am - -.PRECIOUS: Makefile - - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - -rm -f *.pyc - -# 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/lib/libcgroup-3.1.0/tests/ftests/README.md b/lib/libcgroup-3.1.0/tests/ftests/README.md deleted file mode 100644 index ed3dcb68655..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## Functional Test Suite for libcgroup - -This folder contains the functional test suite for libcgroup. -The functional test suite utilizes lxc containers to guarantee -a non-destructive test environment. - -The tests can be invoked individually, as a group of related -tests, or from automake via the standard 'make check' -command. - -## Invocation - -Run a single test (first cd to tests/ftests): - - ./001-cgget-basic_cgget.py - or - ./ftests.py -N 15 # Run test #015 - -Run a suite of tests (first cd to tests/ftests): - - ./ftests.py -s cgget # Run all cgget tests - -Run all the tests by hand - - ./ftests.py - # This may be advantageous over running make check - # because it will try to re-use the same lxc - # container for all of the tests. This should - # provide a significant performance increase - -Run the tests from automake - - make check - # Then examine the *.trs and *.log files for - # specifics regarding each test result - -## Results - -The test suite will generate test results upon completion of -the test run. An example result is below: - -``` -Test Results: - Run Date: Jun 03 13:41:35 - Passed: 1 test - Skipped: 0 tests - Failed: 0 tests ------------------------------------------------------------------ -Timing Results: - Test Time (sec) - --------------------------------------------------------- - setup 6.95 - 001-cgget-basic_cgget.py 0.07 - teardown 0.00 - --------------------------------------------------------- - Total Run Time 7.02 -``` - -A log file can also be generated to help in debugging failed -tests. Run `ftests.py -h` to view the syntax. - -To generate a log file called foo.log at a debug level (8) run -the following: - - ./ftests.py -l 8 -L foo.log diff --git a/lib/libcgroup-3.1.0/tests/ftests/__init__.py b/lib/libcgroup-3.1.0/tests/ftests/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/lib/libcgroup-3.1.0/tests/ftests/cgroup.py b/lib/libcgroup-3.1.0/tests/ftests/cgroup.py deleted file mode 100644 index 57fb2a70d31..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/cgroup.py +++ /dev/null @@ -1,1199 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup class for the libcgroup functional tests -# -# Copyright (c) 2019-2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from container import ContainerError -from controller import Controller -from run import Run, RunError -import multiprocessing as mp -from libcgroup import Mode -from enum import Enum -import consts -import utils -import time -import copy -import os - - -class CgroupMount(object): - def __init__(self, mount_line, controller=None): - entries = mount_line.split() - - if entries[2] == 'cgroup': - self.version = CgroupVersion.CGROUP_V1 - elif entries[2] == 'cgroup2': - self.version = CgroupVersion.CGROUP_V2 - else: - raise ValueError('Unknown cgroup version') - - self.mount_point = entries[1] - - if controller: - self.controller = controller - else: - self.controller = None - if self.version == CgroupVersion.CGROUP_V1: - self.controller = entries[3].split(',')[-1] - - if self.controller == 'clone_children': - # the cpuset controller may append this option to the end - # rather than the controller name like all other controllers - self.controller = 'cpuset' - - def __str__(self): - out_str = 'CgroupMount' - out_str += '\n\tMount Point = {}'.format(self.mount_point) - out_str += '\n\tCgroup Version = {}'.format(self.version) - if self.controller is not None: - out_str += '\n\tController = {}'.format(self.controller) - - return out_str - - -class CgroupVersion(Enum): - CGROUP_UNK = 0 - CGROUP_V1 = 1 - CGROUP_V2 = 2 - - # given a controller name, get the cgroup version of the controller - @staticmethod - def get_version(controller): - with open('/proc/mounts', 'r') as mntf: - for line in mntf.readlines(): - mnt_path = line.split()[1] - - if line.split()[0] == 'cgroup': - for option in line.split()[3].split(','): - if option == controller: - return CgroupVersion.CGROUP_V1 - elif line.split()[0] == 'cgroup2': - ctrlf_path = os.path.join(mnt_path, 'cgroup.controllers') - with open(ctrlf_path, 'r') as ctrlf: - controllers = ctrlf.readline() - for ctrl in controllers.split(): - if ctrl == controller: - return CgroupVersion.CGROUP_V2 - - raise IndexError( - 'Unknown version for controller {}' - ''.format(controller) - ) - - -class Cgroup(object): - # This class is analogous to libcgroup's struct cgroup - def __init__(self, name): - self.name = name - # self.controllers maps to - # struct cgroup_controller *controller[CG_CONTROLLER_MAX]; - self.controllers = dict() - - self.children = list() - - def __str__(self): - out_str = 'Cgroup {}\n'.format(self.name) - for ctrl_key in self.controllers: - out_str += utils.indent(str(self.controllers[ctrl_key]), 4) - - return out_str - - def __eq__(self, other): - if not isinstance(other, Cgroup): - return False - - if not self.name == other.name: - return False - - if self.controllers != other.controllers: - return False - - return True - - @staticmethod - def build_cmd_path(cmd): - return os.path.join(consts.LIBCG_MOUNT_POINT, - 'src/tools/{}'.format(cmd)) - - @staticmethod - def build_daemon_path(cmd): - return os.path.join(consts.LIBCG_MOUNT_POINT, - 'src/daemon/{}'.format(cmd)) - - @staticmethod - def create(config, controller_list, cgname, user_name=None, - group_name=None, dperm=None, fperm=None, tperm=None, - tasks_user_name=None, tasks_group_name=None, cghelp=False, - ignore_systemd=False, create_scope=False, set_default_scope=False, - scope_pid=-1): - if isinstance(controller_list, str): - controller_list = [controller_list] - - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgcreate')) - - if user_name is not None and group_name is not None: - cmd.append('-a') - cmd.append('{}:{}'.format(user_name, group_name)) - - if dperm is not None: - cmd.append('-d') - cmd.append(dperm) - - if fperm is not None: - cmd.append('-f') - cmd.append(fperm) - - if tperm is not None: - cmd.append('-s') - cmd.append(tperm) - - if tasks_user_name is not None and tasks_group_name is not None: - cmd.append('-t') - cmd.append('{}:{}'.format(tasks_user_name, tasks_group_name)) - - if cghelp: - cmd.append('-h') - - # -b and -c are mutually exclusive but the safety check is done in libcgroup - # itself and thus doesn't need to be done here - - if ignore_systemd: - cmd.append('-b') - - if create_scope: - cmd.append('-c') - - # -S requires -c to be provided, but this is checked in libcgroup itself - - if set_default_scope: - cmd.append('-S') - - # -p requires -c to be provided, but this is too checked in libcgroup itself - - if scope_pid > 1: - cmd.append('-p') - cmd.append('{}'.format(scope_pid)) - - if controller_list: - controllers_and_path = '{}:{}'.format( - ','.join(controller_list), cgname) - else: - controllers_and_path = ':{}'.format(cgname) - - cmd.append('-g') - cmd.append(controllers_and_path) - - if config.args.container: - config.container.run(cmd) - else: - if create_scope: - # creating a scope causes libcgroup to create a child process. - # subprocess.Popen.communicate() will not return until the created - # process and all of its children complete. Get around this by - # timing out the operation - Run.run(cmd, timeout=5) - else: - Run.run(cmd) - - # This is a simple wrapper, that calls Cgroup.create() to create the - # cgroup and cgroup_exists(), which builds the cgroup path and returns - # True if the cgroup exists, False otherwise - @staticmethod - def create_and_validate(config, ctrl_name, cgroup_name, ignore_systemd=False, - create_scope=False, set_default_scope=False, scope_pid=-1): - Cgroup.create(config, ctrl_name, cgroup_name, ignore_systemd=ignore_systemd, - create_scope=create_scope, set_default_scope=set_default_scope, - scope_pid=scope_pid) - return Cgroup.exists(config, ctrl_name, cgroup_name, ignore_systemd=ignore_systemd) - - @staticmethod - def delete(config, controller_list, cgname, recursive=False, ignore_systemd=False): - if isinstance(controller_list, str): - controller_list = [controller_list] - - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgdelete')) - - if recursive: - cmd.append('-r') - - if controller_list: - controllers_and_path = '{}:{}'.format( - ','.join(controller_list), cgname) - else: - controllers_and_path = ':{}'.format(cgname) - - cmd.append('-g') - cmd.append(controllers_and_path) - - if ignore_systemd: - cmd.append('-b') - - if config.args.container: - config.container.run(cmd) - else: - Run.run(cmd) - - @staticmethod - def __set(config, cmd, cgname=None, setting=None, value=None, - copy_from=None, cghelp=False, ignore_systemd=False): - if setting is not None or value is not None: - if isinstance(setting, str) and (isinstance(value, str) or isinstance(value, int)): - cmd.append('-r') - cmd.append('{}={}'.format(setting, str(value))) - elif isinstance(setting, list) and isinstance(value, list): - if len(setting) != len(value): - raise ValueError( - 'Settings list length must equal ' - 'values list length' - ) - - for idx, stg in enumerate(setting): - cmd.append('-r') - cmd.append('{}={}'.format(stg, str(value[idx]))) - else: - raise ValueError( - 'Invalid inputs to cgget:\nsetting: {}\n' - 'value{}' - ''.format(setting, value) - ) - - if copy_from is not None: - cmd.append('--copy-from') - cmd.append(copy_from) - - if cgname is not None: - if isinstance(cgname, str): - # use the string as is - cmd.append(cgname) - elif isinstance(cgname, list): - for cg in cgname: - cmd.append(cg) - - if ignore_systemd: - cmd.append('-b') - - if cghelp: - cmd.append('-h') - - if config.args.container: - return config.container.run(cmd) - else: - return Run.run(cmd) - - @staticmethod - def set(config, cgname=None, setting=None, value=None, copy_from=None, - cghelp=False, ignore_systemd=False): - """cgset equivalent method - - The following variants of cgset are being tested by the - automated functional tests: - - Command Test Number - cgset -r setting=value cgname various - cgset -r setting1=val1 -r setting2=val2 - -r setting3=val2 cgname 022 - cgset --copy_from foo bar 023 - cgset --copy_from foo bar1 bar2 024 - cgset -r setting=value foo bar 025 - cgset -r setting1=value1 setting2=value2 foo bar 026 - various invalid flag combinations 027 - """ - cmd = list() - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgset')) - - return Cgroup.__set(config, cmd, cgname, setting, value, copy_from, - cghelp, ignore_systemd) - - @staticmethod - def xset(config, cgname=None, setting=None, value=None, copy_from=None, - version=CgroupVersion.CGROUP_UNK, cghelp=False, - ignore_unmappable=False, ignore_systemd=False): - """cgxset equivalent method - """ - cmd = list() - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgxset')) - - if version == CgroupVersion.CGROUP_V1: - cmd.append('-1') - elif version == CgroupVersion.CGROUP_V2: - cmd.append('-2') - - if ignore_unmappable: - cmd.append('-i') - - return Cgroup.__set(config, cmd, cgname, setting, value, copy_from, - cghelp, ignore_systemd) - - @staticmethod - def __get(config, cmd, controller=None, cgname=None, setting=None, - print_headers=True, values_only=False, - all_controllers=False, cghelp=False, ignore_systemd=False): - if not print_headers: - cmd.append('-n') - - if values_only: - cmd.append('-v') - - if ignore_systemd: - cmd.append('-b') - - if setting is not None: - if isinstance(setting, str): - # the user provided a simple string. use it as is - cmd.append('-r') - cmd.append(setting) - elif isinstance(setting, list): - for sttng in setting: - cmd.append('-r') - cmd.append(sttng) - else: - raise ValueError('Unsupported setting value') - - if controller is not None: - if isinstance(controller, str) and ':' in controller: - # the user provided a controller:cgroup. use it as is - cmd.append('-g') - cmd.append(controller) - elif isinstance(controller, str): - # the user provided a controller only. use it as is - cmd.append('-g') - cmd.append(controller) - elif isinstance(controller, list): - for ctrl in controller: - cmd.append('-g') - cmd.append(ctrl) - else: - raise ValueError('Unsupported controller value') - - if all_controllers: - cmd.append('-a') - - if cgname is not None: - if isinstance(cgname, str): - # use the string as is - cmd.append(cgname) - elif isinstance(cgname, list): - for cg in cgname: - cmd.append(cg) - - if cghelp: - cmd.append('-h') - - if config.args.container: - ret = config.container.run(cmd) - else: - ret = Run.run(cmd) - - return ret - - @staticmethod - def get(config, controller=None, cgname=None, setting=None, - print_headers=True, values_only=False, - all_controllers=False, cghelp=False, ignore_systemd=False): - """cgget equivalent method - - Returns: - str: The stdout result of cgget - - The following variants of cgget() are being tested by the - automated functional tests: - - Command Test Number - cgget -r cpuset.cpus mycg 001 - cgget -r cpuset.cpus -r cpuset.mems mycg 008 - cgget -g cpu mycg 009 - cgget -g cpu:mycg 010 - cgget -r cpuset.cpus mycg1 mycg2 011 - cgget -r cpuset.cpus -r cpuset.mems mycg1 mycg2 012 - cgget -g cpu -g freezer mycg 013 - cgget -a mycg 014 - cgget -r memory.stat mycg (multiline value read) 015 - various invalid flag combinations 016 - """ - cmd = list() - cmd.append(Cgroup.build_cmd_path('cgget')) - - return Cgroup.__get(config, cmd, controller, cgname, setting, - print_headers, values_only, all_controllers, - cghelp, ignore_systemd) - - @staticmethod - def xget(config, controller=None, cgname=None, setting=None, - print_headers=True, values_only=False, - all_controllers=False, version=CgroupVersion.CGROUP_UNK, - cghelp=False, ignore_unmappable=False, ignore_systemd=False): - """cgxget equivalent method - - Returns: - str: The stdout result of cgxget - """ - cmd = list() - cmd.append(Cgroup.build_cmd_path('cgxget')) - - if version == CgroupVersion.CGROUP_V1: - cmd.append('-1') - elif version == CgroupVersion.CGROUP_V2: - cmd.append('-2') - - if ignore_unmappable: - cmd.append('-i') - - return Cgroup.__get(config, cmd, controller, cgname, setting, - print_headers, values_only, all_controllers, - cghelp, ignore_systemd) - - @staticmethod - def classify(config, controller, cgname, pid_list, sticky=False, - cancel_sticky=False, ignore_systemd=False, replace_idle=False): - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgclassify')) - - if replace_idle: - cmd.append('-r') - - if ignore_systemd: - cmd.append('-b') - - if isinstance(controller, str): - cmd.append('-g') - cmd.append('{}:{}'.format(controller, cgname)) - elif isinstance(controller, list): - controller = ','.join(controller) - cmd.append('-g') - cmd.append('{}:{}'.format(controller, cgname)) - elif controller is None: - cmd.append('-g') - cmd.append(':{}'.format(cgname)) - else: - raise ValueError('Unsupported controller format: {}'.format(type(controller))) - - if isinstance(pid_list, str): - cmd.append(pid_list) - elif isinstance(pid_list, int): - cmd.append(str(pid_list)) - elif isinstance(pid_list, list): - for pid in pid_list: - cmd.append(str(pid)) - - if config.args.container: - config.container.run(cmd) - else: - Run.run(cmd) - - @staticmethod - # given a stdout of cgsnapshot-like data, create a dictionary of cgroup - # objects - def snapshot_to_dict(cgsnapshot_stdout): - cgdict = dict() - - class parsemode(Enum): - UNKNOWN = 0 - GROUP = 1 - CONTROLLER = 2 - SETTING = 3 - PERM = 4 - ADMIN = 5 - TASK = 6 - - mode = parsemode.UNKNOWN - - for line in cgsnapshot_stdout.splitlines(): - line = line.strip() - - if mode == parsemode.UNKNOWN: - if line.startswith('#'): - continue - - elif line.startswith('group') and line.endswith('{'): - cg_name = line.split()[1] - if cg_name in cgdict: - # We already have a cgroup with this name. This block - # of text contains the next controller for this cgroup - cg = cgdict[cg_name] - else: - cg = Cgroup(cg_name) - - mode = parsemode.GROUP - - elif mode == parsemode.GROUP: - if line.startswith('perm {'): - mode = parsemode.PERM - elif line.endswith('{'): - ctrl_name = line.split()[0] - cg.controllers[ctrl_name] = Controller(ctrl_name) - - mode = parsemode.CONTROLLER - elif line.endswith('}'): - # we've found the end of this group - cgdict[cg_name] = cg - - mode = parsemode.UNKNOWN - - elif mode == parsemode.CONTROLLER: - if line.endswith('";'): - # this is a setting on a single line - setting = line.split('=')[0] - value = line.split('=')[1] - - cg.controllers[ctrl_name].settings[setting] = value - - elif line.endswith('}'): - # we've found the end of this controller - mode = parsemode.GROUP - - else: - # this is a multi-line setting - setting = line.split('=')[0] - value = '{}\n'.format(line.split('=')[1]) - mode = parsemode.SETTING - - elif mode == parsemode.SETTING: - if line.endswith('";'): - # this is the last line of the multi-line setting - value += line - - cg.controllers[ctrl_name].settings[setting] = value - mode = parsemode.CONTROLLER - - else: - value += '{}\n'.format(line) - - elif mode == parsemode.PERM: - if line.startswith('admin {'): - mode = parsemode.ADMIN - elif line.startswith('task {'): - mode = parsemode.TASK - elif line.endswith('}'): - mode = parsemode.GROUP - - elif mode == parsemode.ADMIN or mode == parsemode.TASK: - # todo - handle these modes - if line.endswith('}'): - mode = parsemode.PERM - - return cgdict - - @staticmethod - def snapshot(config, controller=None): - cmd = list() - cmd.append(Cgroup.build_cmd_path('cgsnapshot')) - if controller is not None: - cmd.append(controller) - - # ensure the deny list file exists - if config.args.container: - try: - config.container.run( - ['sudo', - 'touch', - '/etc/cgsnapshot_denylist.conf'] - ) - except RunError as re: - if re.ret == 0 and 'unable to resolve host' in re.stderr: - pass - else: - Run.run(['sudo', 'touch', '/etc/cgsnapshot_denylist.conf']) - - try: - if config.args.container: - res = config.container.run(cmd) - else: - res = Run.run(cmd) - except RunError as re: - if re.ret == 0 and \ - 'neither deny nor allow list' in re.stderr: - res = re.stdout - elif re.ret == 0 and 'ERROR: can\'t get' in re.stderr: - res = re.stdout - else: - raise(re) - - # convert the cgsnapshot stdout to a dict of cgroup objects - return Cgroup.snapshot_to_dict(res) - - @staticmethod - def set_cgrules_conf(config, line, append=True): - cmd = list() - - cmd.append('sudo') - cmd.append('su') - cmd.append('-c') - - if append: - redirect_str = '>>' - else: - redirect_str = '>' - - subcmd = '"echo {} {} {}"'.format(line, redirect_str, - consts.CGRULES_FILE) - cmd.append(subcmd) - - if config.args.container: - config.container.run(cmd, shell_bool=True) - else: - Run.run(cmd, shell_bool=True) - - @staticmethod - def init_cgrules(config): - cmd = list() - - cmd.append('sudo') - cmd.append('mkdir') - cmd.append('-p') - cmd.append('/etc/cgconfig.d') - - try: - if config.args.container: - config.container.run(cmd, shell_bool=True) - else: - Run.run(cmd, shell_bool=True) - except RunError as re: - raise re - - cmd2 = list() - - cmd2.append('sudo') - cmd2.append('touch') - cmd2.append('/etc/cgconfig.conf') - - if config.args.container: - config.container.run(cmd2, shell_bool=True) - else: - Run.run(cmd2, shell_bool=True) - - # note that this runs cgrulesengd in this process and does not fork - # the daemon - @staticmethod - def __run_cgrules(config): - cmd = list() - - cmd.append('sudo') - cmd.append(Cgroup.build_daemon_path('cgrulesengd')) - cmd.append('-d') - cmd.append('-n') - - if config.args.container: - raise ValueError( - 'Running cgrules within a container is not ' - 'supported' - ) - else: - Run.run(cmd, shell_bool=True) - - def start_cgrules(self, config): - Cgroup.init_cgrules(config) - - p = mp.Process(target=Cgroup.__run_cgrules, - args=(config, )) - p.start() - time.sleep(2) - - self.children.append(p) - - def join_children(self, config): - # todo - make this smarter. this is ugly, but it works for now - cmd = ['sudo', 'killall', 'cgrulesengd'] - try: - if config.args.container: - config.container.run(cmd, shell_bool=True) - else: - Run.run(cmd, shell_bool=True) - except (RunError, ContainerError): - # ignore any errors during the kill command. this is belt - # and suspenders code - pass - - for child in self.children: - child.join(1) - - @staticmethod - def configparser(config, load_file=None, load_dir=None, dflt_usr=None, - dflt_grp=None, dperm=None, fperm=None, cghelp=False, - tperm=None, tasks_usr=None, tasks_grp=None): - """cgconfigparser equivalent method - - Returns: - str: The stdout result of cgconfigparser - - The following variants of cgconfigparser are being tested by the - automated functional tests: - - Command Test Number - cgconfigparser -l conf_file 017 - cgconfigparser -L conf_dir 018 - cgconfigparser -l conf_file -a usr:grp -d mode -f mode 019 - cgconfigparser -l conf_file -s mode -t usr:grp 020 - cgconfigparser -h 021 - cgconfigparser -l improper_conf_file 021 - """ - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgconfigparser')) - - if load_file is not None: - cmd.append('-l') - cmd.append(load_file) - - if load_dir is not None: - cmd.append('-L') - cmd.append(load_dir) - - if dflt_usr is not None and dflt_grp is not None: - cmd.append('-a') - cmd.append('{}:{}'.format(dflt_usr, dflt_grp)) - - if dperm is not None: - cmd.append('-d') - cmd.append(dperm) - - if fperm is not None: - cmd.append('-f') - cmd.append(fperm) - - if cghelp: - cmd.append('-h') - - if tperm is not None: - cmd.append('-s') - cmd.append(tperm) - - if tasks_usr is not None and tasks_grp is not None: - cmd.append('-t') - cmd.append('{}:{}'.format(tasks_usr, tasks_grp)) - - if config.args.container: - return config.container.run(cmd) - else: - return Run.run(cmd) - - @staticmethod - def __get_controller_mount_point_v1(ctrl_name): - with open('/proc/mounts', 'r') as mntf: - for line in mntf.readlines(): - mnt_path = line.split()[1] - - if ctrl_name is None: - if line.split()[0] == 'cgroup2': - return mnt_path - - if line.split()[0] == 'cgroup': - for option in line.split()[3].split(','): - if option == ctrl_name: - return mnt_path - - raise IndexError( - 'Unknown mount point for controller {}' - ''.format(ctrl_name) - ) - - @staticmethod - def __get_controller_mount_point_v2(ctrl_name): - with open('/proc/mounts', 'r') as mntf: - for line in mntf.readlines(): - mnt_path = line.split()[1] - - if line.split()[0] == 'cgroup2': - if ctrl_name is None: - return mnt_path - - ctrl_file = os.path.join(line.split()[1], - 'cgroup.controllers') - - with open(ctrl_file, 'r') as ctrlf: - controllers = ctrlf.readline() - for controller in controllers.split(): - if controller == ctrl_name: - return mnt_path - - raise IndexError( - 'Unknown mount point for controller {}' - ''.format(ctrl_name) - ) - - @staticmethod - def get_controller_mount_point(ctrl_name): - if ctrl_name is None: - mode = int(Cgroup.get_cgroup_mode(None)) - # map return modes: - # CGROUP_MODE_LEGACY/CGROUP_MODE_HYBRID -> CgroupVersion.CGROUP_V1 - # CGROUP_MODE_UNIFIED -> CgroupVersion.CGROUP_V2 - if mode >= 2: - mode = mode - 1 - vers = CgroupVersion(mode) - else: - vers = CgroupVersion.get_version(ctrl_name) - - if vers == CgroupVersion.CGROUP_V1: - return Cgroup.__get_controller_mount_point_v1(ctrl_name) - elif vers == CgroupVersion.CGROUP_V2: - return Cgroup.__get_controller_mount_point_v2(ctrl_name) - else: - raise ValueError('Unsupported cgroup version') - - @staticmethod - def clear(config, empty=False, cghelp=False, load_file=None, - load_dir=None): - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgclear')) - - if empty: - cmd.append('-e') - - if cghelp: - cmd.append('-h') - - if load_file is not None: - cmd.append('-l') - cmd.append(load_file) - - if load_dir is not None: - cmd.append('-L') - cmd.append(load_dir) - - if config.args.container: - return config.container.run(cmd) - else: - return Run.run(cmd) - - @staticmethod - def lssubsys(config, ls_all=False, cghelp=False, hierarchies=False, - mount_points=False, all_mount_points=False): - cmd = list() - - cmd.append(Cgroup.build_cmd_path('lssubsys')) - - if ls_all: - cmd.append('-a') - - if cghelp: - cmd.append('-h') - - if hierarchies: - cmd.append('-i') - - if mount_points: - cmd.append('-m') - - if all_mount_points: - cmd.append('-M') - - if config.args.container: - ret = config.container.run(cmd) - else: - ret = Run.run(cmd) - - return ret - - @staticmethod - def get_cgroup_mounts(config, expand_v2_mounts=True): - mount_list = list() - - with open('/proc/mounts') as mntf: - for line in mntf.readlines(): - entry = line.split() - - if entry[0] != 'cgroup' and entry[0] != 'cgroup2': - continue - - mount = CgroupMount(line) - - if mount.version == CgroupVersion.CGROUP_V1 or \ - expand_v2_mounts is False: - mount_list.append(mount) - - if entry[1].find(',') > 0: - # multiple controllers are mounted together. Also add the - # first controller to the mount_list - controller = os.path.basename(entry[1].split(',')[0]) - mount = CgroupMount(line, controller=controller) - mount_list.append(mount) - continue - - with open(os.path.join(mount.mount_point, - 'cgroup.controllers')) as ctrlf: - for ctrlf_line in ctrlf.readlines(): - for ctrl in ctrlf_line.split(): - mount_copy = copy.deepcopy(mount) - mount_copy.controller = ctrl - mount_list.append(mount_copy) - - return mount_list - - @staticmethod - def lscgroup(config, cghelp=False, controller=None, path=None): - cmd = list() - - cmd.append(Cgroup.build_cmd_path('lscgroup')) - - if cghelp: - cmd.append('-h') - - if controller is not None and path is not None: - if isinstance(controller, list): - for idx, ctrl in enumerate(controller): - cmd.append('-g') - cmd.append('{}:{}'.format(ctrl, path[idx])) - elif isinstance(controller, str): - cmd.append('-g') - cmd.append('{}:{}'.format(controller, path)) - else: - raise ValueError('Unsupported controller value') - - if config.args.container: - ret = config.container.run(cmd) - else: - ret = Run.run(cmd) - - return ret - - # exec is a keyword in python, so let's name this function cgexec - @staticmethod - def cgexec(config, controller, cgname, cmdline, sticky=False, - cghelp=False, ignore_systemd=False, replace_idle=False): - """cgexec equivalent method - """ - cmd = list() - - if not config.args.container: - cmd.append('sudo') - cmd.append(Cgroup.build_cmd_path('cgexec')) - - if (ignore_systemd): - cmd.append('-b') - - if (replace_idle): - cmd.append('-r') - - cmd.append('-g') - cmd.append('{}:{}'.format(controller, cgname)) - - if sticky: - cmd.append('--sticky') - - if isinstance(cmdline, str): - cmd.append(cmdline) - elif isinstance(cmdline, list): - for entry in cmdline: - cmd.append(str(entry)) - - if cghelp: - cmd.append('-h') - - if config.args.container: - return config.container.run(cmd, shell_bool=True) - else: - return Run.run(cmd, shell_bool=True) - - @staticmethod - def get_pids_in_cgroup(config, cgroup, controller): - mounts = Cgroup.get_cgroup_mounts(config) - - for mount in mounts: - if mount.controller == controller: - proc_file = os.path.join( - mount.mount_point, - cgroup, - 'cgroup.procs' - ) - cmd = ['cat', proc_file] - - if config.args.container: - pids = config.container.run(cmd, shell_bool=True) - else: - pids = Run.run(cmd, shell_bool=True) - - pid_list = list() - for pid in pids.splitlines(): - pid_list.append(int(pid)) - - return pid_list - - return None - - @staticmethod - def get_and_validate(config, cgname, setting, expected_value, ignore_systemd=False): - """get the requested setting and validate the value received - - This is a helper method for the functional tests and there is no - equivalent libcgroup command line interface. This method will - raise a CgroupError if the comparison fails - """ - value = Cgroup.get(config, controller=None, cgname=cgname, - setting=setting, print_headers=False, - values_only=True, ignore_systemd=ignore_systemd) - - if value != expected_value: - raise CgroupError('cgget expected {} but received {}'.format( - expected_value, value)) - - @staticmethod - def set_and_validate(config, cgname, setting, value, ignore_systemd=False): - """set the requested setting and validate the write - - This is a helper method for the functional tests and there is no - equivalent libcgroup command line interface. This method will - raise a CgroupError if the comparison fails - """ - Cgroup.set(config, cgname, setting, value, ignore_systemd=ignore_systemd) - Cgroup.get_and_validate(config, cgname, setting, value, ignore_systemd=ignore_systemd) - - @staticmethod - def get_cgroup_mode(config): - mount_list = Cgroup.get_cgroup_mounts(config, True) - - legacy = False - unified = False - - for mount in mount_list: - # As best I can tell, python doesn't have an easy way to access the statfs() f_type - # field. Let's make our best guess at the cgroup version (legacy, hybrid, or - # unified) by the presence of certain files/folders - - cpu_ctrl = os.path.join(os.path.dirname(mount.mount_point), 'cpu,cpuacct') - if os.path.exists(cpu_ctrl): - legacy = True - - limit_file = os.path.join(mount.mount_point, 'memory.limit_in_bytes') - if os.path.exists(limit_file): - legacy = True - - subtree_file = os.path.join(mount.mount_point, 'cgroup.subtree_control') - if os.path.exists(subtree_file): - unified = True - - subtree_file = os.path.join(os.path.dirname(mount.mount_point), - 'cgroup.subtree_control') - if os.path.exists(subtree_file): - unified = True - - subtree_file = os.path.join(os.path.dirname(mount.mount_point), 'unified', - 'cgroup.subtree_control') - if os.path.exists(subtree_file): - unified = True - - if legacy and unified: - return Mode.CGROUP_MODE_HYBRID - elif legacy: - return Mode.CGROUP_MODE_LEGACY - elif unified: - return Mode.CGROUP_MODE_UNIFIED - else: - raise CgroupError('Unknown cgroup mode') - - @staticmethod - def is_controller_enabled(config, cgroup_name, ctrl_name): - ctrl_path = Cgroup.__get_controller_mount_point_v2(ctrl_name) - parent_cgname = os.path.dirname(cgroup_name) - - subtree_path = os.path.join(ctrl_path, parent_cgname, 'cgroup.controllers') - cmd = ['cat', subtree_path] - - if config.args.container: - controllers = config.container.run(cmd, shell_bool=True) - else: - controllers = Run.run(cmd, shell_bool=True) - - for controller in controllers.split(): - if controller == ctrl_name: - return True - - return False - - @staticmethod - def __exists(config, ctrl_name, cgroup_name, ignore_systemd): - ctrl_mnt = Cgroup.get_controller_mount_point(ctrl_name) - - if (ignore_systemd): - cgrp_path = os.path.join(ctrl_mnt, cgroup_name) - else: - try: - cmd = ['cat', '/run/libcgroup/systemd'] - if config.args.container: - slice_scope_path = config.container.run(cmd, shell_bool=True) - else: - slice_scope_path = Run.run(cmd, shell_bool=True) - except RunError: - return False - - cgrp_path = os.path.join(ctrl_mnt, slice_scope_path, cgroup_name) - - # Every cgroup is populated with cgroup.procs (setup mode agnostic) - # It easier to check of the directory exist by tring to read it - proc_file = os.path.join(cgrp_path, 'cgroup.procs') - cmd = ['cat', proc_file] - try: - if config.args.container: - config.container.run(cmd, shell_bool=True) - else: - Run.run(cmd, shell_bool=True) - except RunError: - return False - - return True - - # This function builds absolute path of the cgroup, using the default - # systemd path and checks if the cgroup exists. The function can build - # path for all three cgroup setup modes, including empty cgroup v2. - @staticmethod - def exists(config, ctrl_name, cgroup_name, ignore_systemd=False): - if ctrl_name is None or type(ctrl_name) == str: - return Cgroup.__exists(config, ctrl_name, cgroup_name, ignore_systemd) - elif type(ctrl_name) == list: - for ctrl in ctrl_name: - if not Cgroup.__exists(config, ctrl, cgroup_name, ignore_systemd): - # if any of the controllers don't exist, fail the check - return False - - # all of the controllers exist, Yippee - return True - else: - raise ValueError("Unsupported type: {}".format(type(ctrl_name))) - - # Method to enable or disable controllers in the subtree control file - @staticmethod - def subtree_control(config, cgname, controllers, enable=True, ignore_systemd=False): - if isinstance(controllers, str): - controllers = [controllers] - elif isinstance(controllers, list): - pass - else: - raise ValueError('Unsupported controller value') - - if enable: - enable_char = '+' - else: - enable_char = '-' - - for ctrl in controllers: - Cgroup.set(config, cgname, 'cgroup.subtree_control', - '{}{}'.format(enable_char, ctrl), ignore_systemd=ignore_systemd) - - -class CgroupError(Exception): - def __init__(self, message): - super(CgroupError, self).__init__(message) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/config.py b/lib/libcgroup-3.1.0/tests/ftests/config.py deleted file mode 100644 index e14d28fe881..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/config.py +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Config class for the libcgroup functional tests -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from container import Container -from process import Process -import consts -import utils -import os - - -class Config(object): - def __init__(self, args, container=None): - self.args = args - self.skip_list = [] - - if self.args.container: - if container: - self.container = container - else: - # Use the default container settings - self.container = Container(name=args.name, - stop_timeout=args.timeout, - arch=None, - distro=args.distro, - release=args.release) - - self.process = Process() - - self.ftest_dir = os.path.dirname(os.path.abspath(__file__)) - self.libcg_dir = os.path.dirname(self.ftest_dir) - - self.test_suite = consts.TESTS_RUN_ALL_SUITES - self.test_num = consts.TESTS_RUN_ALL - self.verbose = False - - def __str__(self): - out_str = 'Configuration\n' - if self.args.container: - out_str += utils.indent(str(self.container), 4) - out_str += utils.indent(str(self.process), 4) - - return out_str - - -class ConfigError(Exception): - def __init__(self, message): - super(ConfigError, self).__init__(message) - - def __str__(self): - out_str = 'ConfigError:\n\tmessage = {}'.format(self.message) - return out_str - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/consts.py b/lib/libcgroup-3.1.0/tests/ftests/consts.py deleted file mode 100644 index 7891aaceff1..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/consts.py +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Constants for the libcgroup functional tests -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -import os - -DEFAULT_LOG_FILE = 'libcgroup-ftests.log' - -LOG_CRITICAL = 1 -LOG_WARNING = 5 -LOG_DEBUG = 8 -DEFAULT_LOG_LEVEL = 5 - -ftest_dir = os.path.dirname(os.path.abspath(__file__)) -tests_dir = os.path.dirname(ftest_dir) -LIBCG_MOUNT_POINT = os.path.dirname(tests_dir) - -DEFAULT_CONTAINER_NAME = 'TestLibcg' -DEFAULT_CONTAINER_DISTRO = 'ubuntu' -DEFAULT_CONTAINER_RELEASE = '22.04' -DEFAULT_CONTAINER_ARCH = 'amd64' -DEFAULT_CONTAINER_STOP_TIMEOUT = 5 - -TESTS_RUN_ALL = -1 -TESTS_RUN_ALL_SUITES = 'allsuites' -TEST_PASSED = 'passed' -TEST_FAILED = 'failed' -TEST_SKIPPED = 'skipped' - -CGRULES_FILE = '/etc/cgrules.conf' - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/container.py b/lib/libcgroup-3.1.0/tests/ftests/container.py deleted file mode 100644 index a54f6a3a4dd..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/container.py +++ /dev/null @@ -1,221 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Container class for the libcgroup functional tests -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from run import Run, RunError -from queue import Queue -import threading as tp -from log import Log -import consts -import time -import os - - -class Container(object): - def __init__(self, name, stop_timeout=None, arch=None, cfg_path=None, - distro=None, release=None): - self.name = name - self.privileged = True - - if stop_timeout: - self.stop_timeout = stop_timeout - else: - self.stop_timeout = consts.DEFAULT_CONTAINER_STOP_TIMEOUT - - if arch: - self.arch = arch - else: - self.arch = consts.DEFAULT_CONTAINER_ARCH - - if distro: - self.distro = distro - else: - self.distro = consts.DEFAULT_CONTAINER_DISTRO - - if release: - self.release = release - else: - self.release = consts.DEFAULT_CONTAINER_RELEASE - - ftest_dir = os.path.dirname(os.path.abspath(__file__)) - tests_dir = os.path.dirname(ftest_dir) - # save off the path to the libcgroup source code - self.libcg_dir = os.path.dirname(tests_dir) - - def __str__(self): - out_str = 'Container {}'.format(self.name) - out_str += '\n\tdistro = {}'.format(self.distro) - out_str += '\n\trelease = {}'.format(self.release) - out_str += '\n\tarch = {}'.format(self.arch) - out_str += '\n\tstop_timeout = {}\n'.format(self.stop_timeout) - - return out_str - - # configure the container to meet our needs - def config(self): - # map our UID and GID to the same UID/GID in the container - cmd = ( - 'printf "uid {} 1000\ngid {} 1000" | sudo lxc config set ' - '{} raw.idmap -' - ''.format(os.getuid(), os.getgid(), self.name) - ) - Run.run(cmd, shell_bool=True) - - # add the libcgroup root directory (where we did the build) into - # the container - cmd2 = list() - if self.privileged: - cmd2.append('sudo') - cmd2.append('lxc') - cmd2.append('config') - cmd2.append('device') - cmd2.append('add') - cmd2.append(self.name) - cmd2.append('libcgsrc') # arbitrary name of device - cmd2.append('disk') - # to appease gcov, mount the libcgroup source at the same path as we - # built it. This can be worked around someday by using - # GCOV_PREFIX_STRIP, but that was more difficult to setup than just - # doing this initially - cmd2.append('source={}'.format(self.libcg_dir)) - cmd2.append('path={}'.format(self.libcg_dir)) - - return Run.run(cmd2) - - def _init_container(self, q): - cmd = list() - - if self.privileged: - cmd.append('sudo') - - cmd.append('lxc') - cmd.append('init') - - cmd.append('{}:{}'.format(self.distro, self.release)) - - cmd.append(self.name) - - try: - Run.run(cmd) - q.put(True) - except Exception: # noqa: E722 - q.put(False) - except BaseException: # noqa: E722 - q.put(False) - - def create(self): - # Github Actions sometimes has timeout issues with the LXC sockets. - # Try this command multiple times in an attempt to work around this - # limitation - - queue = Queue() - sleep_time = 5 - ret = False - - for i in range(5): - thread = tp.Thread(target=self._init_container, args=(queue, )) - thread.start() - - time_cnt = 0 - while thread.is_alive(): - time.sleep(sleep_time) - time_cnt += sleep_time - Log.log_debug('Waiting... {}'.format(time_cnt)) - - ret = queue.get() - if ret: - break - else: - try: - self.delete() - except RunError: - pass - - thread.join() - - if not ret: - raise ContainerError('Failed to create the container') - - def delete(self): - cmd = list() - - if self.privileged: - cmd.append('sudo') - - cmd.append('lxc') - cmd.append('delete') - - cmd.append(self.name) - - return Run.run(cmd) - - def run(self, cntnr_cmd, shell_bool=False): - cmd = list() - - if self.privileged: - cmd.append('sudo') - - cmd.append('lxc') - cmd.append('exec') - - cmd.append(self.name) - - cmd.append('--') - - # concatenate the lxc exec command with the command to be run - # inside the container - if isinstance(cntnr_cmd, str): - cmd.append(cntnr_cmd) - elif isinstance(cntnr_cmd, list): - cmd = cmd + cntnr_cmd - else: - raise ContainerError('Unsupported command type') - - return Run.run(cmd, shell_bool=shell_bool) - - def start(self): - cmd = list() - - if self.privileged: - cmd.append('sudo') - - cmd.append('lxc') - cmd.append('start') - - cmd.append(self.name) - - return Run.run(cmd) - - def stop(self, force=True): - cmd = list() - - if self.privileged: - cmd.append('sudo') - - cmd.append('lxc') - cmd.append('stop') - - cmd.append(self.name) - - if force: - cmd.append('-f') - else: - cmd.append('--timeout') - cmd.append(str(self.stop_timeout)) - - return Run.run(cmd) - - -class ContainerError(Exception): - def __init__(self, message): - super(ContainerError, self).__init__(message) - - def __str__(self): - out_str = 'ContainerError:\n\tmessage = {}'.format(self.message) - return out_str - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/controller.py b/lib/libcgroup-3.1.0/tests/ftests/controller.py deleted file mode 100644 index b80b7c5cac8..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/controller.py +++ /dev/null @@ -1,69 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup class for the libcgroup functional tests -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from log import Log - - -class Controller(object): - # The controller class closely mirrors libcgroup's struct cgroup_controller - def __init__(self, name): - self.name = name - # self.settings maps to - # struct control_value *values[CG_NV_MAX]; - self.settings = dict() - - def __str__(self): - out_str = 'Controller {}\n'.format(self.name) - - for setting_key in self.settings: - out_str += ' {} = {}\n'.format(setting_key, - self.settings[setting_key]) - - return out_str - - def __eq__(self, other): - if not isinstance(other, Controller): - return False - - if not self.name == other.name: - return False - - if not self.settings == other.settings: - self_keys = set(self.settings.keys()) - other_keys = set(other.settings.keys()) - - added = other_keys - self_keys - if added is not None: - for key in added: - Log.log_critical( - 'Other contains {} = {}' - ''.format(key, other.settings[key]) - ) - - removed = self_keys - other_keys - if removed is not None: - for key in removed: - Log.log_critical( - 'Self contains {} = {}' - ''.format(key, self.settings[key]) - ) - - common = self_keys.intersection(other_keys) - for key in common: - if self.settings[key] != other.settings[key]: - Log.log_critical( - 'self{} = {} while other{} = {}' - ''.format(key, self.settings[key], - key, other.settings[key]) - ) - - return False - - return True - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/ftests-wrapper.sh b/lib/libcgroup-3.1.0/tests/ftests/ftests-wrapper.sh deleted file mode 100755 index 7a65de63a88..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/ftests-wrapper.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-only - -# the lock file is removed after all the tests complete -function cleanup() -{ - sudo rm -f "$RUNNER_LOCK_FILE" - exit "$1" -} - -AUTOMAKE_SKIPPED=77 -AUTOMAKE_HARD_ERROR=99 - -# synchronize between different github runners running on -# same VM's, this will stop runners from stomping over -# each other's run. -LIBCGROUP_RUN_DIR="/var/run/libcgroup/" -RUNNER_LOCK_FILE="/var/run/libcgroup/github-runner.lock" -RUNNER_SLEEP_SECS=300 # sleep for 5 minutes -RUNNER_MAX_TRIES=10 # Abort after 50 minutes, if we don't chance to run - -START_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -if [ "$START_DIR" != "$SCRIPT_DIR" ]; then - cp "$SCRIPT_DIR"/*.py "$START_DIR" -fi - -PYTHON_LIBRARY_PATH=(../../src/python/build/lib*) -if [ -d "${PYTHON_LIBRARY_PATH[0]}" ]; then - pushd "${PYTHON_LIBRARY_PATH[0]}" || cleanup $AUTOMAKE_HARD_ERROR - PYTHONPATH="$PYTHONPATH:$(pwd)" - export PYTHONPATH - popd || cleanup $AUTOMAKE_HARD_ERROR -fi - -# If other runners are running then the file exists -# let's wait for 5 minutes -time_waited=0 -pretty_time=0 -while [ -f "$RUNNER_LOCK_FILE" ]; do - if [ "$RUNNER_MAX_TRIES" -le 0 ]; then - echo "Unable to get lock to run the ftests, aborting" - exit 1 - fi - - RUNNER_MAX_TRIES=$(( RUNNER_MAX_TRIES - 1 )) - sleep "$RUNNER_SLEEP_SECS" - - time_waited=$(( time_waited + RUNNER_SLEEP_SECS )) - pretty_time=$(echo $time_waited | awk '{printf "%d:%02d:%02d", $1/3600, ($1/60)%60, $1%60}') - echo "[$pretty_time] Waiting on other runners to complete, $RUNNER_MAX_TRIES retries left" -done - -# take the lock and start executing -sudo mkdir -p "$LIBCGROUP_RUN_DIR" -sudo touch "$RUNNER_LOCK_FILE" - -./ftests.py -l 10 -L "$START_DIR/ftests.py.log" -n Libcg"$RANDOM" -RET1=$? - -./ftests.py -l 10 -L "$START_DIR/ftests-nocontainer.py.log" --no-container \ - -n Libcg"$RANDOM" -RET2=$? - -if [ -z "$srcdir" ]; then - # $srcdir is set by automake but will likely be empty when run by hand and - # that's fine - srcdir="" -else - srcdir=$srcdir"/" -fi - -sudo cp $srcdir../../src/libcgroup_systemd_idle_thread /bin -sudo PYTHONPATH="$PYTHONPATH" ./ftests.py -l 10 -s "sudo" \ - -L "$START_DIR/ftests-nocontainer.py.sudo.log" --no-container -n Libcg"$RANDOM" -RET3=$? -sudo rm /bin/libcgroup_systemd_idle_thread - -if [ "$START_DIR" != "$SCRIPT_DIR" ]; then - rm -f "$START_DIR"/*.py - rm -fr "$START_DIR"/__pycache__ - rm -f ftests.py.log - rm -f ftests-nocontainer.py.log - rm -f ftests-nocontainer.py.sudo.log -fi - -if [[ $RET1 -ne $AUTOMAKE_SKIPPED ]] && [[ $RET1 -ne 0 ]]; then - # always return errors from the first test run - cleanup $RET1 -fi -if [[ $RET2 -ne $AUTOMAKE_SKIPPED ]] && [[ $RET2 -ne 0 ]]; then - # return errors from the second test run - cleanup $RET2 -fi -if [[ $RET3 -ne $AUTOMAKE_SKIPPED ]] && [[ $RET3 -ne 0 ]]; then - # return errors from the third test run - cleanup $RET3 -fi - -if [[ $RET1 -eq 0 ]] || [[ $RET2 -eq 0 ]] || [[ $RET3 -eq 0 ]]; then - cleanup 0 -fi - -if [[ $RET1 -eq $AUTOMAKE_SKIPPED ]] || [[ $RET2 -eq $AUTOMAKE_SKIPPED ]] || - [[ $RET3 -eq $AUTOMAKE_SKIPPED ]]; then - cleanup $AUTOMAKE_SKIPPED -fi - -# I don't think we should ever get here, but better safe than sorry -cleanup $AUTOMAKE_HARD_ERROR diff --git a/lib/libcgroup-3.1.0/tests/ftests/ftests.py b/lib/libcgroup-3.1.0/tests/ftests/ftests.py deleted file mode 100755 index a6aa6af0e90..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/ftests.py +++ /dev/null @@ -1,475 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1-only -# -# Main entry point for the libcgroup functional tests -# -# Copyright (c) 2019-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from config import Config -from run import Run -import datetime -import argparse -import consts -import time -import log -import sys -import os - -setup_time = 0.0 -teardown_time = 0.0 - -Log = log.Log - - -def parse_args(): - parser = argparse.ArgumentParser("Libcgroup Functional Tests") - parser.add_argument( - '-n', '--name', - help='name of the container', - required=False, - type=str, - default=consts.DEFAULT_CONTAINER_NAME - ) - parser.add_argument( - '-d', '--distro', - help='linux distribution to use as a template', - required=False, - type=str, - default=None - ) - parser.add_argument( - '-r', '--release', - help="distribution release, e.g.'trusty'", - required=False, - type=str, - default=None - ) - parser.add_argument( - '-a', '--arch', - help='processor architecture', - required=False, - type=str, - default=None - ) - parser.add_argument( - '-t', '--timeout', - help='wait timeout (sec) before stopping the ' - 'container', - required=False, - type=int, - default=None - ) - - parser.add_argument( - '-l', '--loglevel', - help='log level', - required=False, - type=int, - default=None - ) - parser.add_argument( - '-L', '--logfile', - help='log file', - required=False, - type=str, - default=None - ) - - parser.add_argument( - '-N', '--num', - help='Test number to run. If unspecified, all ' - 'tests are run', - required=False, - default=consts.TESTS_RUN_ALL, - type=int - ) - parser.add_argument( - '-S', '--skip', - help="Test number(s) to skip. If unspecified, all" - " tests are run. To skip multiple tests, " - "separate them via a ',', e.g. '5,7,12'", - required=False, - default='', - type=str - ) - parser.add_argument( - '-s', '--suite', - help='Test suite to run, e.g. cpuset', - required=False, - default=consts.TESTS_RUN_ALL_SUITES, - type=str - ) - - container_parser = parser.add_mutually_exclusive_group(required=False) - container_parser.add_argument( - '--container', - action='store_true', - help='Run the tests in a container. Note ' - 'that some tests cannot be run in a ' - 'container.', - dest='container' - ) - container_parser.add_argument( - '--no-container', - action='store_false', - help='Do not run the tests in a container.' - ' Note that some tests are ' - 'destructive and will modify your ' - 'cgroup hierarchy.', - dest='container' - ) - parser.set_defaults(container=True) - - parser.add_argument( - '-v', '--verbose', - help='Print all information about this test run', - default=True, - required=False, - action="store_false" - ) - - config = Config(parser.parse_args()) - - if config.args.skip is None or config.args.skip == '': - pass - elif config.args.skip.find(',') < 0: - config.skip_list.append(int(config.args.skip)) - else: - # multiple tests are being skipped - for test_num in config.args.skip.split(','): - config.skip_list.append(int(test_num)) - - if config.args.loglevel: - log.log_level = config.args.loglevel - if config.args.logfile: - log.log_file = config.args.logfile - - return config - - -# this function maps the container UID to the host UID. By doing -# this, we can write to a bind-mounted device - and thus generate -# code coverage data in the LXD container -def update_host_subuid(): - subuid_line1 = 'lxd:{}:1'.format(os.getuid()) - subuid_line2 = 'root:{}:1'.format(os.getuid()) - found_line1 = False - found_line2 = False - - with open('/etc/subuid') as ufile: - for line in ufile.readlines(): - if line.strip() == subuid_line1: - found_line1 = True - elif line.strip() == subuid_line2: - found_line2 = True - - if not found_line1: - Run.run('sudo sh -c "echo {} >> /etc/subuid"'.format( - subuid_line1), shell_bool=True) - if not found_line2: - Run.run('sudo sh -c "echo {} >> /etc/subuid"'.format( - subuid_line2), shell_bool=True) - - -# this function maps the container GID to the host GID. By doing -# this, we can write to a bind-mounted device - and thus generate -# code coverage data in the LXD container -def update_host_subgid(): - subgid_line1 = 'lxd:{}:1'.format(os.getgid()) - subgid_line2 = 'root:{}:1'.format(os.getgid()) - found_line1 = False - found_line2 = False - - with open('/etc/subgid') as ufile: - for line in ufile.readlines(): - if line.strip() == subgid_line1: - found_line1 = True - elif line.strip() == subgid_line2: - found_line2 = True - - if not found_line1: - Run.run('sudo sh -c "echo {} >> /etc/subgid"'.format( - subgid_line1), shell_bool=True) - if not found_line2: - Run.run('sudo sh -c "echo {} >> /etc/subgid"'.format( - subgid_line2), shell_bool=True) - - -def setup(config, do_teardown=True, record_time=False): - global setup_time - - start_time = time.time() - if do_teardown: - # belt and suspenders here. In case a previous run wasn't properly - # cleaned up, let's try and clean it up here - try: - teardown(config) - except Exception as e: - # log but ignore all exceptions - Log.log_debug(e) - - if config.args.container: - # this command initializes the lxd storage, networking, etc. - Run.run(['sudo', 'lxd', 'init', '--auto']) - update_host_subuid() - update_host_subgid() - - config.container.create() - config.container.config() - config.container.start() - - # add the libcgroup library to the container's ld - libcgrp_lib_path = os.path.join(consts.LIBCG_MOUNT_POINT, 'src/.libs') - echo_cmd = ([ - 'bash', - '-c', - 'echo {} >> /etc/ld.so.conf.d/libcgroup.conf' - ''.format(libcgrp_lib_path) - ]) - config.container.run(echo_cmd) - config.container.run('ldconfig') - - if record_time: - setup_time = time.time() - start_time - - -def run_tests(config): - passed_tests = [] - failed_tests = [] - skipped_tests = [] - filename_max = 0 - - for root, dirs, filenames in os.walk(config.ftest_dir): - for filename in filenames: - if os.path.splitext(filename)[-1] != ".py": - # ignore non-python files - continue - - filenum = filename.split('-')[0] - - try: - filenum_int = int(filenum) - except ValueError: - # D'oh. This file must not be a test. Skip it - Log.log_debug( - 'Skipping {}. It doesn\'t start with an int' - ''.format(filename) - ) - continue - - try: - filesuite = filename.split('-')[1] - except IndexError: - Log.log_error( - 'Skipping {}. It doesn\'t conform to the ' - 'filename format' - ''.format(filename) - ) - continue - - if config.args.suite == consts.TESTS_RUN_ALL_SUITES or \ - config.args.suite == filesuite: - if config.args.num == consts.TESTS_RUN_ALL or \ - config.args.num == filenum_int: - - if config.args.suite == consts.TESTS_RUN_ALL_SUITES and \ - filesuite == 'sudo': - # Don't run the 'sudo' tests if all tests have been specified. - # The sudo tests must be run as sudo and thus need to be separately - # invoked. - continue - - if filenum_int in config.skip_list: - continue - - if len(filename) > filename_max: - filename_max = len(filename) - - test = __import__(os.path.splitext(filename)[0]) - - failure_cause = None - start_time = time.time() - try: - Log.log_debug('Running test {}.'.format(filename)) - [ret, failure_cause] = test.main(config) - except Exception as e: - # catch all exceptions. you never know when there's - # a crummy test - failure_cause = e - Log.log_debug(e) - ret = consts.TEST_FAILED - finally: - run_time = time.time() - start_time - if ret == consts.TEST_PASSED: - passed_tests.append([filename, run_time]) - elif ret == consts.TEST_FAILED: - failed_tests.append([ - filename, - run_time, - failure_cause - ]) - elif ret == consts.TEST_SKIPPED: - skipped_tests.append([ - filename, - run_time, - failure_cause - ]) - else: - raise ValueError('Unexpected ret: {}'.format(ret)) - - passed_cnt = len(passed_tests) - failed_cnt = len(failed_tests) - skipped_cnt = len(skipped_tests) - - print("-----------------------------------------------------------------") - print("Test Results:") - date_str = datetime.datetime.now().strftime('%b %d %H:%M:%S') - print( - '\t{}{}'.format( - '{0: <35}'.format("Run Date:"), - '{0: >15}'.format(date_str) - ) - ) - - test_str = "{} test(s)".format(passed_cnt) - print( - '\t{}{}'.format( - '{0: <35}'.format("Passed:"), - '{0: >15}'.format(test_str) - ) - ) - - test_str = "{} test(s)".format(skipped_cnt) - print( - '\t{}{}'.format( - '{0: <35}'.format("Skipped:"), - '{0: >15}'.format(test_str) - ) - ) - - test_str = "{} test(s)".format(failed_cnt) - print( - '\t{}{}'.format( - '{0: <35}'.format("Failed:"), - '{0: >15}'.format(test_str) - ) - ) - - for test in failed_tests: - print( - "\t\tTest:\t\t\t\t{} - {}" - ''.format(test[0], str(test[2])) - ) - print("-----------------------------------------------------------------") - - global setup_time - global teardown_time - if config.args.verbose: - print("Timing Results:") - print( - '\t{}{}'.format( - '{0: <{1}}'.format("Test", filename_max), - '{0: >15}'.format("Time (sec)") - ) - ) - print( - # 15 is padding space of "Time (sec)" - '\t{}'.format('-' * (filename_max + 15)) - ) - time_str = "{0: 2.2f}".format(setup_time) - print( - '\t{}{}'.format( - '{0: <{1}}'.format('setup', filename_max), - '{0: >15}'.format(time_str) - ) - ) - - all_tests = passed_tests + skipped_tests + failed_tests - all_tests.sort() - for test in all_tests: - time_str = "{0: 2.2f}".format(test[1]) - print( - '\t{}{}'.format( - '{0: <{1}}'.format(test[0], - filename_max), - '{0: >15}'.format(time_str) - ) - ) - time_str = "{0: 2.2f}".format(teardown_time) - print( - '\t{}{}' - ''.format( - '{0: <{1}}'.format('teardown', filename_max), - '{0: >15}'.format(time_str) - ) - ) - - total_run_time = setup_time + teardown_time - for test in passed_tests: - total_run_time += test[1] - for test in failed_tests: - total_run_time += test[1] - total_str = "{0: 5.2f}".format(total_run_time) - print('\t{}'.format('-' * (filename_max + 15))) - print( - '\t{}{}' - ''.format( - '{0: <{1}}' - ''.format("Total Run Time", filename_max), - '{0: >15}'.format(total_str) - ) - ) - - return [passed_cnt, failed_cnt, skipped_cnt] - - -def teardown(config, record_time=False): - global teardown_time - start_time = time.time() - - config.process.join_children(config) - - if config.args.container: - try: - config.container.stop() - except Exception as e: - # log but ignore all exceptions - Log.log_debug(e) - try: - config.container.delete() - except Exception as e: - # log but ignore all exceptions - Log.log_debug(e) - - if record_time: - teardown_time = time.time() - start_time - - -def main(config): - AUTOMAKE_SKIPPED = 77 - AUTOMAKE_HARD_ERROR = 99 - AUTOMAKE_PASSED = 0 - - try: - setup(config, record_time=True) - [passed_cnt, failed_cnt, skipped_cnt] = run_tests(config) - finally: - teardown(config, record_time=True) - - if failed_cnt > 0: - return failed_cnt - if passed_cnt > 0: - return AUTOMAKE_PASSED - if skipped_cnt > 0: - return AUTOMAKE_SKIPPED - - return AUTOMAKE_HARD_ERROR - - -if __name__ == '__main__': - config = parse_args() - sys.exit(main(config)) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/log.py b/lib/libcgroup-3.1.0/tests/ftests/log.py deleted file mode 100644 index b1763c17ae0..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/log.py +++ /dev/null @@ -1,48 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Log class for the libcgroup functional tests -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# Author: Tom Hromatka -# - -import datetime -import consts - -log_level = consts.DEFAULT_LOG_LEVEL -log_file = consts.DEFAULT_LOG_FILE -log_fd = None - - -class Log(object): - - @staticmethod - def log(msg, msg_level=consts.DEFAULT_LOG_LEVEL): - global log_level, log_file, log_fd - - if log_level >= msg_level: - if log_fd is None: - Log.open_logfd(log_file) - - timestamp = datetime.datetime.now().strftime('%b %d %H:%M:%S') - log_fd.write('{}: {}\n'.format(timestamp, msg)) - - @staticmethod - def open_logfd(log_file): - global log_fd - - log_fd = open(log_file, 'a') - - @staticmethod - def log_critical(msg): - Log.log('CRITICAL: {}'.format(msg), consts.LOG_CRITICAL) - - @staticmethod - def log_warning(msg): - Log.log('WARNING: {}'.format(msg), consts.LOG_WARNING) - - @staticmethod - def log_debug(msg): - Log.log('DEBUG: {}'.format(msg), consts.LOG_DEBUG) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/process.py b/lib/libcgroup-3.1.0/tests/ftests/process.py deleted file mode 100644 index d03de98f0f1..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/process.py +++ /dev/null @@ -1,279 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Cgroup class for the libcgroup functional tests -# -# Copyright (c) 2020-2021 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from container import ContainerError -from cgroup import CgroupVersion -import multiprocessing as mp -from cgroup import Cgroup -from run import RunError -import threading as tp -from run import Run -import time - - -class Process(object): - def __init__(self): - self.children = list() - self.children_pids = list() - - def __str__(self): - out_str = 'Process Class\n' - out_str += '\tchildren = {}\n'.format(self.children) - out_str += '\tchildren_pids = {}\n'.format(self.children_pids) - - return out_str - - @staticmethod - def __thread_infinite_loop(config, sleep_time=1): - while 1: - time.sleep(sleep_time) - - @staticmethod - def __infinite_loop(config, sleep_time=1): - cmd = ["/usr/bin/perl", - "-e", - "'while(1){{sleep({})}};'".format(sleep_time) - ] - - try: - if config.args.container: - config.container.run(cmd, shell_bool=True) - else: - Run.run(cmd, shell_bool=True) - except RunError: - # when the process is killed, a RunError will be thrown. let's - # catch and suppress it - pass - - @staticmethod - def __cgexec_infinite_loop(config, controller, cgname, sleep_time=1, - ignore_systemd=False, replace_idle=False): - cmd = ["/usr/bin/perl", - "-e", - "'while(1){{sleep({})}};'".format(sleep_time) - ] - - try: - Cgroup.cgexec(config, controller, cgname, cmd, ignore_systemd=ignore_systemd, - replace_idle=replace_idle) - except RunError: - # When this process is killed, it will throw a run error. - # Ignore it. - pass - - def __save_child_pid(self, config, sleep_time): - # get the PID of the newly spawned infinite loop - cmd = ( - "ps x | grep perl | grep 'sleep({})' | awk '{{print $1}}'" - "".format(sleep_time) - ) - - if config.args.container: - pid = config.container.run(cmd, shell_bool=True) - else: - pid = Run.run(cmd, shell_bool=True) - - for _pid in pid.splitlines(): - self.children_pids.append(int(_pid)) - - if pid.find('\n') >= 0: - # The second pid in the list contains the actual perl process - pid = pid.splitlines()[1] - - if pid == '' or int(pid) <= 0: - raise ValueError( - 'Failed to get the pid of the child process:' - '{}' - ''.format(pid) - ) - - return int(pid) - - def create_process(self, config): - # To allow for multiple processes to be created, each new process - # sleeps for a different amount of time. This lets us uniquely find - # each process later in this function - sleep_time = len(self.children) + 1 - - p = mp.Process(target=Process.__infinite_loop, - args=(config, sleep_time, )) - p.start() - - # wait for the process to start. If we don't wait, then the getpid - # logic below may not find the process - time.sleep(2) - - pid = self.__save_child_pid(config, sleep_time) - self.children.append(p) - - return pid - - # Create a simple process in the requested cgroup - def create_process_in_cgroup(self, config, controller, cgname, - cgclassify=True, ignore_systemd=False, replace_idle=False): - if cgclassify: - child_pid = self.create_process(config) - Cgroup.classify(config, controller, cgname, child_pid, - ignore_systemd=ignore_systemd, replace_idle=replace_idle) - else: - # use cgexec - - # To allow for multiple processes to be created, each new process - # sleeps for a different amount of time. This lets us uniquely - # find each process later in this function - sleep_time = len(self.children) + 1 - - p = mp.Process(target=Process.__cgexec_infinite_loop, - args=(config, controller, cgname, sleep_time, ignore_systemd, - replace_idle, )) - p.start() - - self.children.append(p) - - def create_threaded_process(self, config, threads_cnt): - threads = list() - - for n in range(threads_cnt): - sleep_time = n + 1 - thread = tp.Thread(target=Process.__thread_infinite_loop, - args=(config, sleep_time, )) - threads.append(thread) - - for thread in threads: - thread.start() - - def create_threaded_process_in_cgroup(self, config, controller, cgname, - threads=2, cgclassify=True, ignore_systemd=False, - replace_idle=False): - - p = mp.Process(target=self.create_threaded_process, - args=(config, threads, )) - p.start() - - if cgclassify: - Cgroup.classify(config, controller, cgname, p.pid, - ignore_systemd=ignore_systemd, replace_idle=replace_idle) - - self.children.append(p) - self.children_pids.append(p.pid) - - return p.pid - - # The caller will block until all children are stopped. - def join_children(self, config): - for child in self.children: - child.join(1) - - for child in self.children_pids: - try: - if config.args.container: - config.container.run(['kill', str(child)]) - else: - Run.run(['kill', str(child)]) - except (RunError, ContainerError): - # ignore any errors during the kill command. this is belt - # and suspenders code - pass - - @staticmethod - def __get_cgroup_v1(config, pid, controller): - cmd = list() - - cmd.append('cat') - cmd.append('/proc/{}/cgroup'.format(pid)) - - if config.args.container: - ret = config.container.run(cmd) - else: - ret = Run.run(cmd) - - for line in ret.splitlines(): - # cgroup v1 appears in /proc/{pid}/cgroup like the following: - # $ cat /proc/1/cgroup - # 12:memory:/ - # 11:hugetlb:/ - # 10:perf_event:/ - # 9:rdma:/ - # 8:devices:/ - # 7:cpuset:/ - # 6:blkio:/ - # 5:cpu,cpuacct:/ - # 4:pids:/ - # 3:freezer:/ - # 2:net_cls,net_prio:/ - # 1:name=systemd:/init.scope - # 0::/init.scope - proc_controllers = line.split(':')[1] - if proc_controllers.find(',') >= 0: - for proc_controller in proc_controllers.split(','): - if controller == proc_controller: - return line.split(':')[2] - else: - if controller == proc_controllers: - return line.split(':')[2] - - raise ValueError('Could not get cgroup for pid {} and controller {}'. - format(pid, controller)) - - @staticmethod - def __get_cgroup_v2(config, pid, controller): - cmd = list() - - cmd.append('cat') - cmd.append('/proc/{}/cgroup'.format(pid)) - - if config.args.container: - ret = config.container.run(cmd) - else: - ret = Run.run(cmd) - - for line in ret.splitlines(): - # cgroup v2 appears in /proc/{pid}/cgroup like the following: - # $ cat /proc/1/cgroup - # 0::/init.scope - if line.find('::') < 0: - # we have identified this controller is cgroup v2, - # ignore any cgroup v1 controllers - continue - - return line.split(':')[2] - - raise ValueError( - 'Could not get cgroup for pid {} and controller {}' - ''.format(pid, controller) - ) - - # given a PID and a cgroup controller, what cgroup is this PID a member of - @staticmethod - def get_cgroup(config, pid, controller): - version = CgroupVersion.get_version(controller) - - if version == CgroupVersion.CGROUP_V1: - return Process.__get_cgroup_v1(config, pid, controller) - elif version == CgroupVersion.CGROUP_V2: - return Process.__get_cgroup_v2(config, pid, controller) - - raise ValueError("get_cgroup() shouldn't reach this point") - - @staticmethod - def kill(config, pids): - if not pids: - return - - if type(pids) == str: - pids = [int(pid) for pid in pids.splitlines()] - elif type(pids) == int: - pids = [pids] - - for pid in pids: - if config.args.container: - config.container.run(['kill', '-9', str(pid)]) - else: - Run.run(['kill', '-9', str(pid)]) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/run.py b/lib/libcgroup-3.1.0/tests/ftests/run.py deleted file mode 100644 index c985162d00d..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/run.py +++ /dev/null @@ -1,119 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Run class for the libcgroup functional tests -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# Author: Tom Hromatka -# - -from subprocess import TimeoutExpired -from log import Log -import subprocess -import time - - -class Run(object): - @staticmethod - def __run(command, shell_bool, timeout): - if shell_bool: - if isinstance(command, str): - # nothing to do. command is already formatted as a string - pass - elif isinstance(command, list): - command = ' '.join(command) - else: - raise ValueError('Unsupported command type') - - subproc = subprocess.Popen(command, shell=shell_bool, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - - if timeout: - try: - out, err = subproc.communicate(timeout=timeout) - ret = subproc.returncode - - out = out.strip().decode('UTF-8') - err = err.strip().decode('UTF-8') - except TimeoutExpired as te: - if te.stdout: - out = te.stdout.strip().decode('UTF-8') - else: - out = '' - if te.stderr: - err = te.stderr.strip().decode('UTF-8') - else: - err = '' - - if len(err): - ret = -1 - else: - ret = 0 - else: - out, err = subproc.communicate() - ret = subproc.returncode - - out = out.strip().decode('UTF-8') - err = err.strip().decode('UTF-8') - - if shell_bool: - Log.log_debug( - 'run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}' - '\n\tstderr = {}' - ''.format(command, ret, out, err) - ) - else: - Log.log_debug( - 'run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}' - '\n\tstderr = {}' - ''.format(' '.join(command), ret, out, err) - ) - - return ret, out, err - - @staticmethod - def run(command, shell_bool=False, ignore_profiling_errors=True, timeout=None): - ret, out, err = Run.__run(command, shell_bool, timeout) - - if err.find('Error: websocket: bad handshake') >= 0: - # LXD sometimes throws this error on underpowered machines. - # Wait a bit, then try the request again - Log.log_error('Received \'{}\' error. Re-running command'.format(err)) - time.sleep(5) - ret, out, err = Run.__run(command, shell_bool, timeout) - - if ret != 0: - raise RunError("Command '{}' failed".format(''.join(command)), - command, ret, out, err) - if ret != 0 or len(err) > 0: - if err.find('WARNING: cgroup v2 is not fully supported yet') >= 0: - # LXD throws the above warning on systems that are fully - # running cgroup v2. Ignore this warning, but fail if any - # other warnings/errors are raised - pass - elif ignore_profiling_errors and err.find('profiling') >= 0: - pass - else: - raise RunError("Command '{}' failed".format(''.join(command)), - command, ret, out, err) - - return out - - -class RunError(Exception): - def __init__(self, message, command, ret, stdout, stderr): - super(RunError, self).__init__(message) - - self.command = command - self.ret = ret - self.stdout = stdout - self.stderr = stderr - - def __str__(self): - out_str = 'RunError:\n\tcommand = {}\n\tret = {}'.format( - self.command, self.ret) - out_str += '\n\tstdout = {}\n\tstderr = {}'.format(self.stdout, - self.stderr) - return out_str - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/ftests/systemd.py b/lib/libcgroup-3.1.0/tests/ftests/systemd.py deleted file mode 100644 index 826f3c4032c..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/systemd.py +++ /dev/null @@ -1,76 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Systemd class for the libcgroup functional tests -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from run import Run, RunError -from cgroup import Cgroup -import os - - -class Systemd(object): - @staticmethod - def is_delegated(config, scope_name): - cmd = ['systemctl', 'show', '-P', 'Delegate', scope_name] - try: - out = Run.run(cmd, shell_bool=True) - - if out == 'yes': - return True - else: - return False - except RunError as re: - if re.stderr.find('invalid option') >= 0: - # This version of systemd is too old for the '-P' flag. At this time, I don't - # think there's a way to verify the scope is delegated. Lie and return true - # until we figure out something better :( - return True - raise re - - # This function creates a task and writes its pid into systemd - # configuration file, that gets passed to the cgconfigparser tool to - # create systemd slice/scope. - @staticmethod - def write_config_with_pid(config, config_fname, _slice, scope, setdefault="yes"): - pid = config.process.create_process(config) - config_file = '''systemd {{ - slice = {}; - scope = {}; - setdefault = {}; - pid = {}; - }}'''.format(_slice, scope, setdefault, pid) - - f = open(config_fname, 'w') - f.write(config_file) - f.close() - - return pid - - # Stopping the systemd scope, will kill the default task in the scope - # and remove scope cgroup but will not remove the slice, that needs to - # removed manually. - @staticmethod - def remove_scope_slice_conf(config, _slice, scope, controller, config_fname=None): - if config_fname: - os.remove(config_fname) - - try: - if config.args.container: - config.container.run(['systemctl', 'stop', '{}'.format(scope)], - shell_bool=True) - else: - Run.run(['sudo', 'systemctl', 'stop', '{}'.format(scope)], shell_bool=True) - except RunError as re: - if 'scope not loaded' in re.stderr: - raise re - - # In case the error occurs before the creation of slice/scope and - # we may very well be on the teardown path, ignore the exception - try: - Cgroup.delete(config, controller, cgname=_slice, ignore_systemd=True) - except RunError as re: - if 'No such file or directory' not in re.stderr: - raise re diff --git a/lib/libcgroup-3.1.0/tests/ftests/utils.py b/lib/libcgroup-3.1.0/tests/ftests/utils.py deleted file mode 100644 index a0fb6ee4293..00000000000 --- a/lib/libcgroup-3.1.0/tests/ftests/utils.py +++ /dev/null @@ -1,82 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Utility functions for the libcgroup functional tests -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# Author: Tom Hromatka -# - -from run import Run - - -# function to indent a block of text by cnt number of spaces -def indent(in_str, cnt): - leading_indent = cnt * ' ' - return ''.join(leading_indent + line for line in in_str.splitlines(True)) - - -def get_file_owner_uid(config, filename): - cmd = list() - cmd.append('stat') - cmd.append('-c') - cmd.append("'%u'") - cmd.append(filename) - - if config.args.container: - return int(config.container.run(cmd, shell_bool=True)) - else: - return int(Run.run(cmd, shell_bool=True)) - - -def get_file_owner_username(config, filename): - cmd = list() - cmd.append('stat') - cmd.append('-c') - cmd.append("'%U'") - cmd.append(filename) - - if config.args.container: - return config.container.run(cmd, shell_bool=True) - else: - return Run.run(cmd, shell_bool=True) - - -def get_file_owner_gid(config, filename): - cmd = list() - cmd.append('stat') - cmd.append('-c') - cmd.append("'%g'") - cmd.append(filename) - - if config.args.container: - return int(config.container.run(cmd, shell_bool=True)) - else: - return int(Run.run(cmd, shell_bool=True)) - - -def get_file_owner_group_name(config, filename): - cmd = list() - cmd.append('stat') - cmd.append('-c') - cmd.append("'%G'") - cmd.append(filename) - - if config.args.container: - return config.container.run(cmd, shell_bool=True) - else: - return Run.run(cmd, shell_bool=True) - - -def get_file_permissions(config, filename): - cmd = list() - cmd.append('stat') - cmd.append('-c') - cmd.append("'%a'") - cmd.append(filename) - - if config.args.container: - return config.container.run(cmd, shell_bool=True) - else: - return Run.run(cmd, shell_bool=True) - -# vim: set et ts=4 sw=4: diff --git a/lib/libcgroup-3.1.0/tests/gunit/001-path.cpp b/lib/libcgroup-3.1.0/tests/gunit/001-path.cpp deleted file mode 100644 index 5bf853244f3..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/001-path.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cg_build_path() - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class BuildPathV1Test : public ::testing::Test { - protected: - - /** - * Setup this test case - * - * This test case calls cg_build_path() to generate various - * cgroup paths. The SetUp() routine creates a simple mount - * table that can be used to verify cg_build_path() behavior. - * - * cg_mount_table for this test is as follows: - * name mount_point index - * ----------------------------------------------------- - * controller0 /sys/fs/cgroup/controller0 0 - * controller1 /sys/fs/cgroup/controller1 1 - * controller2 /sys/fs/cgroup/controller2 2 - * controller3 /sys/fs/cgroup/controller3 3 - * controller4 /sys/fs/cgroup/controller4 4 - * controller5 /sys/fs/cgroup/controller5 5 - * - * Note that controllers 1 and 5 are also given namespaces - */ - void SetUp() override { - char NAMESPACE1[] = "ns1"; - char NAMESPACE5[] = "ns5"; - const int ENTRY_CNT = 6; - int i, ret; - - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(cg_namespace_table, 0, - CG_CONTROLLER_MAX * sizeof(cg_namespace_table[0])); - - // Populate the mount table - for (i = 0; i < ENTRY_CNT; i++) { - snprintf(cg_mount_table[i].name, CONTROL_NAMELEN_MAX, - "controller%d", i); - cg_mount_table[i].index = i; - - ret = snprintf(cg_mount_table[i].mount.path, FILENAME_MAX, - "/sys/fs/cgroup/%s", cg_mount_table[i].name); - ASSERT_LT(ret, sizeof(cg_mount_table[i].mount.path)); - - cg_mount_table[i].mount.next = NULL; - } - - // Give a couple of the entries a namespace as well - cg_namespace_table[1] = NAMESPACE1; - cg_namespace_table[5] = NAMESPACE5; - } -}; - -/** - * No matching controller test - * @param BuildPathV1Test googletest test case name - * @param BuildPathV1_ControllerMismatch test name - * - * This test will walk through the entire controller mount table - * and fail to find a match. - * https://github.com/libcgroup/libcgroup/blob/62f76650db84c0a25f76ece3a79d9d16a1e9f931/src/api.c#L1300 - */ -TEST_F(BuildPathV1Test, BuildPathV1_ControllerMismatch) -{ - char *name = NULL; - char path[FILENAME_MAX]; - /* type intentionally _does not_ match any controllers */ - char type[] = "FOO"; - char *out; - - out = cg_build_path(name, path, type); - ASSERT_STREQ(out, NULL); -} - -/** - * Matching controller test - * @param BuildPathV1Test googletest test case name - * @param BuildPathV1_ControllerMatch test name - * - * This test finds a matching controller in the mount table. Both the - * namespace and the cgroup name are NULL. - */ -TEST_F(BuildPathV1Test, BuildPathV1_ControllerMatch) -{ - char *name = NULL; - char path[FILENAME_MAX]; - char type[] = "controller0"; - char *out; - - out = cg_build_path(name, path, type); - ASSERT_STREQ(out, "/sys/fs/cgroup/controller0/"); -} - -/** - * Matching controller test with a cgroup name - * @param BuildPathV1Test googletest test case name - * @param BuildPathV1_ControllerMatchWithName test name - * - * This test finds a matching controller in the mount table. The - * namespace is NULL, but a valid cgroup name is provided. This - * exercises the `if (name)` statement - * https://github.com/libcgroup/libcgroup/blob/62f76650db84c0a25f76ece3a79d9d16a1e9f931/src/api.c#L1289 - */ -TEST_F(BuildPathV1Test, BuildPathV1_ControllerMatchWithName) -{ - char name[] = "TomsCgroup1"; - char path[FILENAME_MAX]; - char type[] = "controller3"; - char *out; - - out = cg_build_path(name, path, type); - ASSERT_STREQ(out, "/sys/fs/cgroup/controller3/TomsCgroup1/"); -} - -/** - * Matching controller test with a namespace - * @param BuildPathV1Test googletest test case name - * @param BuildPathV1_ControllerMatchWithNs test name - * - * This test finds a matching controller in the mount table. The - * namespace is valid, but the cgroup name is NULL. This exercises - * exercises the `if (cg_namespace_table[i])` statement - * https://github.com/libcgroup/libcgroup/blob/62f76650db84c0a25f76ece3a79d9d16a1e9f931/src/api.c#L1278 - */ -TEST_F(BuildPathV1Test, BuildPathV1_ControllerMatchWithNs) -{ - char *name = NULL; - char path[FILENAME_MAX]; - char type[] = "controller1"; - char *out; - - out = cg_build_path(name, path, type); - ASSERT_STREQ(out, "/sys/fs/cgroup/controller1/ns1/"); -} - -/** - * Matching controller test with a namespace and a cgroup name - * @param BuildPathV1Test googletest test case name - * @param BuildPathV1_ControllerMatchWithNameAndNs test name - * - * This test finds a matching controller in the mount table. Both the - * namespace and the cgroup name are valid. This exercises both if - * statements in cg_build_path_locked(). - */ -TEST_F(BuildPathV1Test, BuildPathV1_ControllerMatchWithNameAndNs) -{ - char name[] = "TomsCgroup2"; - char path[FILENAME_MAX]; - char type[] = "controller5"; - char *out; - - out = cg_build_path(name, path, type); - ASSERT_STREQ(out, "/sys/fs/cgroup/controller5/ns5/TomsCgroup2/"); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/002-cgroup_parse_rules_options.cpp b/lib/libcgroup-3.1.0/tests/gunit/002-cgroup_parse_rules_options.cpp deleted file mode 100644 index 63d3c6263e0..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/002-cgroup_parse_rules_options.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_parse_rules_options() - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class ParseRulesOptionsTest : public ::testing::Test { -}; - -TEST_F(ParseRulesOptionsTest, RulesOptions_Ignore) -{ - struct cgroup_rule rule; - char options[] = "ignore"; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, 0); - ASSERT_EQ(rule.is_ignore, true); -} - -TEST_F(ParseRulesOptionsTest, RulesOptions_IgnoreWithComma) -{ - struct cgroup_rule rule; - char options[] = "ignore,"; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, 0); - ASSERT_EQ(rule.is_ignore, true); -} - -TEST_F(ParseRulesOptionsTest, RulesOptions_InvalidOption) -{ - struct cgroup_rule rule; - char options[] = "ignoretypo"; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, -EINVAL); - ASSERT_EQ(rule.is_ignore, false); -} - -TEST_F(ParseRulesOptionsTest, RulesOptions_InvalidOption2) -{ - struct cgroup_rule rule; - char options[] = "ignore,foobar"; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, -EINVAL); - ASSERT_EQ(rule.is_ignore, true); -} - -TEST_F(ParseRulesOptionsTest, RulesOptions_EmptyOptions) -{ - struct cgroup_rule rule; - char options[] = ""; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, -EINVAL); - ASSERT_EQ(rule.is_ignore, false); -} - -TEST_F(ParseRulesOptionsTest, RulesOptions_NullOptions) -{ - struct cgroup_rule rule; - char *options = NULL; - int ret; - - rule.is_ignore = false; - - ret = cgroup_parse_rules_options(options, &rule); - ASSERT_EQ(ret, -EINVAL); - ASSERT_EQ(rule.is_ignore, false); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/003-cg_get_cgroups_from_proc_cgroups.cpp b/lib/libcgroup-3.1.0/tests/gunit/003-cg_get_cgroups_from_proc_cgroups.cpp deleted file mode 100644 index e03139f2048..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/003-cg_get_cgroups_from_proc_cgroups.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cg_get_cgroups_from_proc_cgroups() - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class GetCgroupsFromProcCgroupsTest : public ::testing::Test { -}; - -static void CreateCgroupProcFile(const char * const contents) -{ - FILE *f; - - f = fopen(TEST_PROC_PID_CGROUP_FILE, "w"); - ASSERT_NE(f, nullptr); - - fprintf(f, "%s", contents); - fclose(f); -} - - -TEST_F(GetCgroupsFromProcCgroupsTest, ReadSingleLine) -{ -#undef LIST_LEN -#define LIST_LEN 3 - char contents[] = - "5:pids:/user.slice/user-1000.slice/session-1.scope\n"; - char *controller_list[LIST_LEN]; - char *cgroup_list[LIST_LEN]; - pid_t pid = 1234; - int ret, i; - - for (i = 0; i < LIST_LEN; i++) { - controller_list[i] = NULL; - cgroup_list[i] = NULL; - } - - CreateCgroupProcFile(contents); - - ret = cg_get_cgroups_from_proc_cgroups(pid, cgroup_list, - controller_list, LIST_LEN); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(controller_list[0], "pids"); - ASSERT_STREQ(cgroup_list[0], - "user.slice/user-1000.slice/session-1.scope"); -} - -TEST_F(GetCgroupsFromProcCgroupsTest, ReadSingleLine2) -{ -#undef LIST_LEN -#define LIST_LEN 1 - char contents[] = - "5:cpu,cpuacct:/\n"; - char *controller_list[LIST_LEN]; - char *cgroup_list[LIST_LEN]; - pid_t pid = 1234; - int ret, i; - - for (i = 0; i < LIST_LEN; i++) { - controller_list[i] = NULL; - cgroup_list[i] = NULL; - } - - CreateCgroupProcFile(contents); - - ret = cg_get_cgroups_from_proc_cgroups(pid, cgroup_list, - controller_list, LIST_LEN); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(controller_list[0], "cpu,cpuacct"); - ASSERT_STREQ(cgroup_list[0], "/"); -} - -TEST_F(GetCgroupsFromProcCgroupsTest, ReadEmptyController) -{ -#undef LIST_LEN -#define LIST_LEN 1 - char contents[] = - "0::/user.slice/user-1000.slice/session-1.scope\n"; - char *controller_list[LIST_LEN]; - char *cgroup_list[LIST_LEN]; - pid_t pid = 1234; - int ret, i; - - for (i = 0; i < LIST_LEN; i++) { - controller_list[i] = NULL; - cgroup_list[i] = NULL; - } - - CreateCgroupProcFile(contents); - - ret = cg_get_cgroups_from_proc_cgroups(pid, cgroup_list, - controller_list, LIST_LEN); - ASSERT_EQ(ret, 0); - ASSERT_EQ(controller_list[0], nullptr); - ASSERT_EQ(cgroup_list[0], nullptr); -} - -TEST_F(GetCgroupsFromProcCgroupsTest, ReadExampleFile) -{ - char contents[] = - "12:memory:/user/johndoe/0\n" - "11:perf_event:/\n" - "10:rdma:/\n" - "9:blkio:/user.slice\n" - "8:cpu,cpuacct:/myCgroup\n" - "7:freezer:/user/johndoe/0\n" - "6:net_cls,net_prio:/\n" - "5:pids:/user.slice/user-1000.slice/session-1.scope\n" - "4:devices:/user.slice\n" - "3:cpuset:/\n" - "2:hugetlb:/\n" - "1:name=systemd:/user.slice/user-1000.slice/session-1.scope\n" - "0::/user.slice/user-1000.slice/session-1.scope\n"; - char *controller_list[MAX_MNT_ELEMENTS]; - char *cgroup_list[MAX_MNT_ELEMENTS]; - pid_t pid = 5678; - int ret, i; - - for (i = 0; i < MAX_MNT_ELEMENTS; i++) { - controller_list[i] = NULL; - cgroup_list[i] = NULL; - } - - CreateCgroupProcFile(contents); - - ret = cg_get_cgroups_from_proc_cgroups(pid, cgroup_list, - controller_list, MAX_MNT_ELEMENTS); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(controller_list[0], "memory"); - ASSERT_STREQ(cgroup_list[0], "user/johndoe/0"); - ASSERT_STREQ(controller_list[1], "perf_event"); - ASSERT_STREQ(cgroup_list[1], "/"); - ASSERT_STREQ(controller_list[2], "rdma"); - ASSERT_STREQ(cgroup_list[2], "/"); - ASSERT_STREQ(controller_list[3], "blkio"); - ASSERT_STREQ(cgroup_list[3], "user.slice"); - ASSERT_STREQ(controller_list[4], "cpu,cpuacct"); - ASSERT_STREQ(cgroup_list[4], "myCgroup"); - ASSERT_STREQ(controller_list[5], "freezer"); - ASSERT_STREQ(cgroup_list[5], "user/johndoe/0"); - ASSERT_STREQ(controller_list[6], "net_cls,net_prio"); - ASSERT_STREQ(cgroup_list[6], "/"); - ASSERT_STREQ(controller_list[7], "pids"); - ASSERT_STREQ(cgroup_list[7], "user.slice/user-1000.slice/session-1.scope"); - ASSERT_STREQ(controller_list[8], "devices"); - ASSERT_STREQ(cgroup_list[8], "user.slice"); - ASSERT_STREQ(controller_list[9], "cpuset"); - ASSERT_STREQ(cgroup_list[9], "/"); - ASSERT_STREQ(controller_list[10], "hugetlb"); - ASSERT_STREQ(cgroup_list[10], "/"); - ASSERT_STREQ(controller_list[11], "name=systemd"); - ASSERT_STREQ(cgroup_list[11], "user.slice/user-1000.slice/session-1.scope"); - - ASSERT_EQ(controller_list[12], nullptr); - ASSERT_EQ(cgroup_list[12], nullptr); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/004-cgroup_compare_ignore_rule.cpp b/lib/libcgroup-3.1.0/tests/gunit/004-cgroup_compare_ignore_rule.cpp deleted file mode 100644 index 13d6f481f86..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/004-cgroup_compare_ignore_rule.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_compare_ignore_rule() - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class CgroupCompareIgnoreRuleTest : public ::testing::Test { -}; - -static void CreateCgroupProcFile(const char * const contents) -{ - FILE *f; - - f = fopen(TEST_PROC_PID_CGROUP_FILE, "w"); - ASSERT_NE(f, nullptr); - - fprintf(f, "%s", contents); - fclose(f); -} - -TEST_F(CgroupCompareIgnoreRuleTest, NotAnIgnore) -{ - char procname[] = "myprocess"; - struct cgroup_rule rule; - pid_t pid = 1234; - bool ret; - - rule.is_ignore = false; - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, SimpleMatch) -{ - char proc_file_contents[] = - "7:cpuacct:/SimpleMatchCgroup"; - char rule_controller[] = "cpuacct"; - char procname[] = "procfoo"; - struct cgroup_rule rule; - pid_t pid = 2345; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = NULL; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "SimpleMatchCgroup"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, CgroupsDontMatch) -{ - char proc_file_contents[] = - "2:cpuacct:CloseButNotQuite"; - char rule_controller[] = "cpuacct"; - char procname[] = "procfoo2"; - struct cgroup_rule rule; - pid_t pid = 4567; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "CloseButNotQuit"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, ControllersDontMatch) -{ - char proc_file_contents[] = - "5:memory:MyCgroup"; - char rule_controller[] = "cpuacct"; - char procname[] = "procfoo3"; - struct cgroup_rule rule; - pid_t pid = 5678; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "MyCgroup"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, CombinedControllers) -{ - char proc_file_contents[] = - "13:cpu,cpuacct:/containercg"; - char rule_controller[] = "cpuacct"; - char procname[] = "docker"; - struct cgroup_rule rule = {0}; - pid_t pid = 6789; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - rule.controllers[1] = NULL; - sprintf(rule.destination, "containercg"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, MatchChildFolder) -{ - char proc_file_contents[] = - "7:cpuset:/parentcg/childcg/grandchildcg"; - char rule_controller[] = "cpuset"; - char procname[] = "childprocess"; - struct cgroup_rule rule; - pid_t pid = 7890; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "parentcg/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, MatchGrandchildFolder) -{ - char proc_file_contents[] = - "1:hugetlb:/parentcg/childcg/grandchildcg"; - char rule_controller[] = "hugetlb"; - char procname[] = "granchildprocess"; - struct cgroup_rule rule; - pid_t pid = 8901; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = NULL; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "parentcg/childcg/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -/** - * This test is designed to highlight the case where the user has not put a - * trailing slash at the end of the rule's destination. By design, this will - * cause the rule to match a wide variety of cases. - * - * For example, given the rule destination of "Folder". The following - * behavior would be observed: - * Process Location Matches the rule? - * Folder Yes - * Folders Yes - * Folder/AnotherFolder Yes - * Folder2 Yes - * Folder3/ChildFolder Yes - * Folde No - */ -TEST_F(CgroupCompareIgnoreRuleTest, MatchSimilarChildFolder) -{ - char proc_file_contents[] = - "1:hugetlb:/parentcg/childcg2"; - char rule_controller[] = "hugetlb"; - char procname[] = "granchildprocess"; - struct cgroup_rule rule; - pid_t pid = 8901; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = NULL; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "parentcg/childcg"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, RealWorldMatch) -{ - char proc_file_contents[] = - "12:memory:/user/johndoe/0\n" - "11:perf_event:/\n" - "10:rdma:/\n" - "9:blkio:/user.slice\n" - "8:cpu,cpuacct:/myCgroup\n" - "7:freezer:/user/johndoe/0\n" - "6:net_cls,net_prio:/\n" - "5:pids:/user.slice/user-1000.slice/session-1.scope\n" - "4:devices:/user.slice\n" - "3:cpuset:/\n" - "2:hugetlb:/\n" - "1:name=systemd:/user.slice/user-1000.slice/session-1.scope\n" - "0::/user.slice/user-1000.slice/session-1.scope\n"; - char rule_controller[] = "cpu"; - char procname[] = "granchildprocess"; - struct cgroup_rule rule; - pid_t pid = 8901; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = NULL; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "myCgroup/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, RealWorldNoMatch) -{ - char proc_file_contents[] = - "12:memory:/user/johndoe/0\n" - "11:perf_event:/\n" - "10:rdma:/\n" - "9:blkio:/user.slice\n" - "8:cpu,cpuacct:/myCgroup\n" - "7:freezer:/user/johndoe/0\n" - "6:net_cls,net_prio:/NetCgroup\n" - "5:pids:/user.slice/user-1000.slice/session-1.scope\n" - "4:devices:/user.slice\n" - "3:cpuset:/\n" - "2:hugetlb:/\n" - "1:name=systemd:/user.slice/user-1000.slice/session-1.scope\n" - "0::/user.slice/user-1000.slice/session-1.scope\n"; - char rule_controller[] = "net_cls"; - char procname[] = "NotMatching"; - struct cgroup_rule rule; - pid_t pid = 9012; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = NULL; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "NetCgroup2"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, SimilarFolderNoMatch) -{ - char proc_file_contents[] = - "4:memory:/folder1"; - char rule_controller[] = "memory"; - char procname[] = "childprocess"; - struct cgroup_rule rule; - pid_t pid = 2345; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "folder/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, RootDestinationMatch) -{ - char proc_file_contents[] = - "2:freezer:/"; - char rule_controller[] = "freezer"; - char procname[] = "ANewProcess"; - struct cgroup_rule rule; - pid_t pid = 3456; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, RootDestinationNoMatch) -{ - char proc_file_contents[] = - "2:freezer:/somerandomcg"; - char rule_controller[] = "freezer"; - char procname[] = "ANewProcess"; - struct cgroup_rule rule; - pid_t pid = 3456; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "/"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(CgroupCompareIgnoreRuleTest, WildcardProcnameSimpleMatch) -{ - char proc_file_contents[] = - "7:cpuacct:/MatchCgroup"; - char rule_controller[] = "cpuacct"; - char rule_procname[] = "ssh*"; - char procname[] = "sshd"; - struct cgroup_rule rule; - pid_t pid = 1234; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = rule_procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "MatchCgroup"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(CgroupCompareIgnoreRuleTest, WildcardProcnameNoMatch) -{ - char proc_file_contents[] = - "7:cpuacct:/AnotherCgroup"; - char rule_controller[] = "cpuacct"; - char rule_procname[] = "httpd*"; - char procname[] = "httpx"; - struct cgroup_rule rule; - pid_t pid = 1234; - bool ret; - - CreateCgroupProcFile(proc_file_contents); - - rule.procname = rule_procname; - rule.is_ignore = true; - rule.controllers[0] = rule_controller; - sprintf(rule.destination, "AnotherCgroup"); - - ret = cgroup_compare_ignore_rule(&rule, pid, procname); - ASSERT_EQ(ret, false); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/005-cgroup_compare_wildcard_procname.cpp b/lib/libcgroup-3.1.0/tests/gunit/005-cgroup_compare_wildcard_procname.cpp deleted file mode 100644 index cea19eabe21..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/005-cgroup_compare_wildcard_procname.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_compare_wildcard_procname() - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class ProcnameWildcardTest : public ::testing::Test { -}; - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_NoAsterisk) -{ - char rule_procname[] = "systemd"; - char procname[] = "bash"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_AsteriskNoMatch) -{ - char rule_procname[] = "BobIsYour*"; - char procname[] = "Linda"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_AsteriskMatch) -{ - char rule_procname[] = "HelloWorl*"; - char procname[] = "HelloWorld"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_AsteriskNoMatch2) -{ - char rule_procname[] = "HelloW*"; - char procname[] = "Hello"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_AsteriskMatchExactly) -{ - char rule_procname[] = "strace*"; - char procname[] = "strace"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, true); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_NoAsteriskMatchExactly) -{ - char rule_procname[] = "systemd-cgls"; - char procname[] = "systemd-cgls"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, false); -} - -TEST_F(ProcnameWildcardTest, ProcnameWildcard_AsteriskFirstChar) -{ - char rule_procname[] = "*"; - char procname[] = "tomcat"; - bool ret; - - ret = cgroup_compare_wildcard_procname(rule_procname, procname); - ASSERT_EQ(ret, true); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/006-cgroup_get_cgroup.cpp b/lib/libcgroup-3.1.0/tests/gunit/006-cgroup_get_cgroup.cpp deleted file mode 100644 index e2f43f97c8b..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/006-cgroup_get_cgroup.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_get_cgroup() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include -#include -#include -using namespace std; - -#include - -#include "gtest/gtest.h" -#include "libcgroup-internal.h" - -#define MAX_NAMES 5 - -enum ctrl_enum { - CTRL_CPU, - CTRL_FREEZER, - CTRL_MEMORY, - CTRL_CPUSET, - CTRL_NAMESPACES, - CTRL_NETNS, - - CTRL_CNT -}; - -static const char * const PARENT_DIR = "test006cgroup"; - -static const char * const CONTROLLERS[] = { - "cpu", - "freezer", - "memory", - "cpuset", - "namespaces", - "netns", -}; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); - -static const char * const NAMES[][MAX_NAMES] = { - {"tasks", "cpu.shares", "cpu.weight", "cpu.foo", NULL}, - {"tasks", NULL, NULL, NULL, NULL}, - {"tasks", "memory.limit_in_bytes", "memory.memsw.limit_in_bytes", NULL, NULL}, - {"tasks", "cpuset.exclusive", "cpuset.foo", "cpuset.bar", "cpuset.x"}, - {"tasks", "namespaces.blah", NULL, NULL, NULL}, - {"tasks", "netns.foo", "netns.bar", "netns.baz", NULL}, -}; -static const int NAMES_CNT = sizeof(NAMES) / sizeof(NAMES[0]); - -static const char * const VALUES[][MAX_NAMES] = { - {"1234", "512", "100", "abc123", NULL}, - {"2345\n3456", NULL, NULL, NULL, NULL}, - {"456\n678\n890", "8675309", "1024000", NULL, NULL}, - {"\0", "1", "limit=32412039", "9223372036854771712", "partition"}, - {"59832", "The Quick Brown Fox", NULL, NULL, NULL}, - {"987\n654", "root", "/sys/fs", "0xdeadbeef", NULL}, -}; -static const int VALUES_CNT = sizeof(VALUES) / sizeof(VALUES[0]); - -static const char * const CG_NAME = "tomcatcg"; -static const mode_t MODE = S_IRWXU | S_IRWXG | S_IRWXO; - -class CgroupGetCgroupTest : public ::testing::Test { - protected: - - void CreateNames(const char * const names[], - const char * const values[], - const char * const ctrl_name) - { - char tmp_path[FILENAME_MAX]; - FILE *f; - int i; - - for (i = 0; i < NAMES_CNT; i++) { - if (names[i] == NULL) - break; - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s/%s/%s", - PARENT_DIR, ctrl_name, CG_NAME, names[i]); - - f = fopen(tmp_path, "w"); - ASSERT_NE(f, nullptr); - - fprintf(f, "%s", values[i]); - fclose(f); - } - } - - void SetUp() override - { - char tmp_path[FILENAME_MAX]; - int i, j, names_len, ret; - - ASSERT_EQ(NAMES_CNT, CONTROLLERS_CNT); - ASSERT_EQ(NAMES_CNT, VALUES_CNT); - - ret = cgroup_init(); - ASSERT_EQ(ret, 0); - - ret = mkdir(PARENT_DIR, MODE); - ASSERT_EQ(ret, 0); - - /* - * Artificially populate the mount table with local - * directories - */ - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(&cg_namespace_table, 0, sizeof(cg_namespace_table)); - - for (i = 0; i < CONTROLLERS_CNT; i++) { - snprintf(cg_mount_table[i].name, CONTROL_NAMELEN_MAX, - "%s", CONTROLLERS[i]); - snprintf(cg_mount_table[i].mount.path, FILENAME_MAX, - "%s/%s", PARENT_DIR, CONTROLLERS[i]); - cg_mount_table[i].version = CGROUP_V1; - - ret = mkdir(cg_mount_table[i].mount.path, MODE); - ASSERT_EQ(ret, 0); - - /* - * arbitrarily don't make the cgroup directory in - * the freezer controller - */ - if (i == CTRL_FREEZER) - continue; - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s/%s", - PARENT_DIR, CONTROLLERS[i], CG_NAME); - ret = mkdir(tmp_path, MODE); - ASSERT_EQ(ret, 0); - - CreateNames(NAMES[i], VALUES[i], CONTROLLERS[i]); - } - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override - { - int ret = 0; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -static void vectorize_cg(const struct cgroup * const cg, - vector& cg_vec) -{ - const char *cgname, *cgcname, *value; - int i, j; - - for (i = 0; i < cg->index; i++) { - for (j = 0; j < cg->controller[i]->index; j++) { - string cgname(cg->name); - string cgcname(cg->controller[i]->name); - string name(cg->controller[i]->values[j]->name); - string value(cg->controller[i]->values[j]->value); - - cg_vec.push_back(cgcname + "+" + cgname + "+" + - name + "+" + value); - } - } - - sort(cg_vec.begin(), cg_vec.end()); -} - -static void vectorize_testdata(vector& test_vec) -{ - string cgname(CG_NAME); - int i, j; - - for (i = 0; i < CTRL_CNT; i++) { - for (j = 0; j < MAX_NAMES; j++) { - if (NAMES[i][j] == NULL) - continue; - - if (strcmp(NAMES[i][j], "tasks") == 0) - /* - * The tasks files isn't listed by - * cgroup_get_cgroup() - */ - continue; - - string cgcname(CONTROLLERS[i]); - string name(NAMES[i][j]); - string value(VALUES[i][j]); - - test_vec.push_back(cgcname + "+" + cgname + "+" + - name + "+" + value); - } - } - - sort(test_vec.begin(), test_vec.end()); -} - -TEST_F(CgroupGetCgroupTest, CgroupGetCgroup1) -{ - vector cg_vec, test_vec; - struct cgroup *cg = NULL; - int ret; - - cg = cgroup_new_cgroup(CG_NAME); - ASSERT_NE(cg, nullptr); - - ret = cgroup_get_cgroup(cg); - ASSERT_EQ(ret, 0); - - vectorize_cg(cg, cg_vec); - vectorize_testdata(test_vec); - - ASSERT_EQ(cg_vec, test_vec); - - if (cg) - free(cg); -} - -/* - * This test must be last because it makes destructive changes to the cgroup hierarchy - */ -TEST_F(CgroupGetCgroupTest, CgroupGetCgroup_NoTasksFile) -{ - char tmp_path[FILENAME_MAX]; - struct cgroup *cg = NULL; - int ret; - - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s/%s/tasks", - PARENT_DIR, CONTROLLERS[CONTROLLERS_CNT - 1], CG_NAME); - ret = rmrf(tmp_path); - ASSERT_EQ(ret, 0); - - cg = cgroup_new_cgroup(CG_NAME); - ASSERT_NE(cg, nullptr); - - ret = cgroup_get_cgroup(cg); - ASSERT_EQ(ret, ECGOTHER); - - if (cg) - free(cg); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/007-cgroup_process_v1_mount.cpp b/lib/libcgroup-3.1.0/tests/gunit/007-cgroup_process_v1_mount.cpp deleted file mode 100644 index f661e70aa9b..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/007-cgroup_process_v1_mount.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_process_v1_mnt() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include - -#include "gtest/gtest.h" -#include "libcgroup-internal.h" - -static int mnt_tbl_idx = 0; - -class CgroupProcessV1MntTest : public ::testing::Test { -}; - -TEST_F(CgroupProcessV1MntTest, AddV1Mount) -{ - char *controllers[] = {"cpu", "memory", NULL}; - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup", - .mnt_dir = "/sys/fs/cgroup/memory", - .mnt_type = "cgroup", - .mnt_opts = "rw,nosuid,nodev,noexec,relatime,seclabel,memory", - }; - int ret; - - ret = cgroup_process_v1_mnt(controllers, &ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 1); - ASSERT_STREQ(cg_mount_table[0].name, "memory"); - ASSERT_STREQ(cg_mount_table[0].mount.path, ent.mnt_dir); -} - -/* The AddV1Mount() test above added the memory controller to the - * cg_mount_table[]. Now let's add another mount point of the - * memory controller to test the duplicate mount handling - */ -TEST_F(CgroupProcessV1MntTest, AddV1Mount_Duplicate) -{ - char *controllers[] = {"cpu", "cpuset", "memory", NULL}; - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup", - .mnt_dir = "/cgroup/memory", - .mnt_type = "cgroup", - .mnt_opts = "rw,nosuid,nodev,noexec,relatime,seclabel,memory", - }; - int ret; - - ASSERT_EQ(NULL, cg_mount_table[0].mount.next); - - ret = cgroup_process_v1_mnt(controllers, &ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 1); - ASSERT_STREQ(cg_mount_table[0].mount.next->path, ent.mnt_dir); -} - -TEST_F(CgroupProcessV1MntTest, AddV1NamedMount) -{ - char *controllers[] = {"cpu", "memory", "systemd", NULL}; - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup", - .mnt_dir = "/sys/fs/cgroup/systemd", - .mnt_type = "cgroup", - .mnt_opts = "rw,nosuid,nodev,noexec,relatime,seclabel,name=systemd", - }; - int ret; - - ret = cgroup_process_v1_mnt(controllers, &ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 1); - ASSERT_STREQ(cg_mount_table[0].name, "memory"); - /* The systemd hierarchy should not be mounted due to it being - * excluded by the OPAQUE_HIERARCHY option - */ -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/008-cgroup_process_v2_mount.cpp b/lib/libcgroup-3.1.0/tests/gunit/008-cgroup_process_v2_mount.cpp deleted file mode 100644 index a68c8ed72d1..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/008-cgroup_process_v2_mount.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_process_v2_mnt() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include -#include - -#include "gtest/gtest.h" -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test008cgroup"; -static const char * const PARENT2_DIR = "test008cgroup2"; -static const mode_t MODE = S_IRWXU | S_IRWXG | S_IRWXO; - -static const char * const CONTROLLERS[] = { - "cpuset", - "cpu", - "io", - "memory", - "pids", - "rdma", -}; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); - -static int mnt_tbl_idx = 0; - -class CgroupProcessV2MntTest : public ::testing::Test { - protected: - - void CreateHierarchy(const char * const dir) - { - char tmp_path[FILENAME_MAX]; - int i, ret; - FILE *f; - - ret = mkdir(dir, MODE); - ASSERT_EQ(ret, 0); - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, "%s/cgroup.controllers", - dir); - - f = fopen(tmp_path, "w"); - ASSERT_NE(f, nullptr); - - for (i = 0; i < CONTROLLERS_CNT; i++) - fprintf(f, "%s ", CONTROLLERS[i]); - - fclose(f); - } - - void SetUp() override - { - char tmp_path[FILENAME_MAX]; - int i, ret; - FILE *f; - - CreateHierarchy(PARENT_DIR); - - /* make another directory to test the duplicate logic */ - CreateHierarchy(PARENT2_DIR); - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override - { - int ret = 0; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - - ret = rmrf(PARENT2_DIR); - ASSERT_EQ(ret, 0); - } -}; - -TEST_F(CgroupProcessV2MntTest, AddV2Mount) -{ - char *mnt_dir = strdup(PARENT_DIR); - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup2", - .mnt_dir = mnt_dir, - .mnt_type = "cgroup2", - .mnt_opts = "rw,relatime,seclabel", - }; - int ret; - - ret = cgroup_process_v2_mnt(&ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 7); - ASSERT_STREQ(cg_mount_table[0].name, "cpuset"); - ASSERT_STREQ(cg_mount_table[1].name, "cpu"); - ASSERT_STREQ(cg_mount_table[2].name, "io"); - ASSERT_STREQ(cg_mount_table[3].name, "memory"); - ASSERT_STREQ(cg_mount_table[4].name, "pids"); - ASSERT_STREQ(cg_mount_table[5].name, "rdma"); - ASSERT_STREQ(cg_mount_table[6].name, "cgroup"); - - ASSERT_STREQ(cg_mount_table[0].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[1].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[2].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[3].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[4].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[5].mount.path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[6].mount.path, ent.mnt_dir); -} - -TEST_F(CgroupProcessV2MntTest, AddV2Mount_Duplicate) -{ - char *mnt_dir = strdup(PARENT2_DIR); - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup2", - .mnt_dir = mnt_dir, - .mnt_type = "cgroup2", - .mnt_opts = "rw,relatime,seclabel", - }; - int ret; - - ret = cgroup_process_v2_mnt(&ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 7); - ASSERT_STREQ(cg_mount_table[0].name, "cpuset"); - ASSERT_STREQ(cg_mount_table[1].name, "cpu"); - ASSERT_STREQ(cg_mount_table[2].name, "io"); - ASSERT_STREQ(cg_mount_table[3].name, "memory"); - ASSERT_STREQ(cg_mount_table[4].name, "pids"); - ASSERT_STREQ(cg_mount_table[5].name, "rdma"); - ASSERT_STREQ(cg_mount_table[6].name, "cgroup"); - - ASSERT_STREQ(cg_mount_table[0].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[1].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[2].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[3].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[4].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[5].mount.next->path, ent.mnt_dir); - ASSERT_STREQ(cg_mount_table[6].mount.next->path, ent.mnt_dir); -} - -/* - * This test must be last because it makes destructive changes to the cgroup hierarchy - */ -TEST_F(CgroupProcessV2MntTest, EmptyControllersFile) -{ - char tmp_path[FILENAME_MAX]; - char *mnt_dir = strdup(PARENT_DIR); - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup2", - .mnt_dir = mnt_dir, - .mnt_type = "cgroup2", - .mnt_opts = "rw,relatime,seclabel", - }; - FILE *f; - int ret; - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, "%s/cgroup.controllers", - PARENT_DIR); - - /* clear the cgroup.controllers file */ - f = fopen(tmp_path, "w"); - ASSERT_NE(f, nullptr); - fclose(f); - - /* reset the mount table count */ - mnt_tbl_idx = 0; - - ret = cgroup_process_v2_mnt(&ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, ECGEOF); - ASSERT_EQ(mnt_tbl_idx, 0); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/009-cgroup_set_values_recursive.cpp b/lib/libcgroup-3.1.0/tests/gunit/009-cgroup_set_values_recursive.cpp deleted file mode 100644 index 7e6bad9ccc7..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/009-cgroup_set_values_recursive.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_set_values_recursive() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test009cgroup/"; - -static const char * const NAMES[] = { - "cpu.weight", - "cpu.weight.nice", - "cpu.foo", - "cpu.bar" -}; -static const int NAMES_CNT = sizeof(NAMES) / sizeof(NAMES[0]); - -static const char * const VALUES[] = { - "999", - "15", - "random", - "data" -}; -static const int VALUES_CNT = sizeof(VALUES) / sizeof(VALUES[0]); - - -class SetValuesRecursiveTest : public ::testing::Test { - protected: - - void SetUp() override { - char tmp_path[FILENAME_MAX]; - int ret, i; - FILE *f; - - ASSERT_EQ(NAMES_CNT, VALUES_CNT); - - ret = mkdir(PARENT_DIR, S_IRWXU | S_IRWXG | S_IRWXO); - ASSERT_EQ(ret, 0); - - for (i = 0; i < NAMES_CNT; i++) { - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, NAMES[i]); - ASSERT_GT(ret, 0); - - f = fopen(tmp_path, "w"); - fclose(f); - } - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override { - int ret; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -TEST_F(SetValuesRecursiveTest, SuccessfulSetValues) -{ - char tmp_path[FILENAME_MAX], buf[4092]; - struct cgroup_controller ctrlr = {0}; - int ret, i; - char *val; - FILE *f; - - ret = snprintf(ctrlr.name, CONTROL_NAMELEN_MAX, "cpu"); - ASSERT_GT(ret, 0); - - for (i = 0; i < NAMES_CNT; i++) { - ctrlr.values[i] = (struct control_value *)calloc(1, - sizeof(struct control_value)); - ASSERT_NE(ctrlr.values[i], nullptr); - - strncpy(ctrlr.values[i]->name, NAMES[i], FILENAME_MAX); - strncpy(ctrlr.values[i]->value, VALUES[i], - CG_CONTROL_VALUE_MAX); - if (i == 0) - ctrlr.values[i]->dirty = true; - else - ctrlr.values[i]->dirty = false; - ctrlr.index++; - } - - ret = cgroup_set_values_recursive(PARENT_DIR, &ctrlr, false); - ASSERT_EQ(ret, 0); - - for (i = 0; i < NAMES_CNT; i++) { - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, NAMES[i]); - ASSERT_GT(ret, 0); - - f = fopen(tmp_path, "r"); - ASSERT_NE(f, nullptr); - - val = fgets(buf, sizeof(buf), f); - ASSERT_NE(val, nullptr); - ASSERT_STREQ(buf, VALUES[i]); - fclose(f); - } -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/010-cgroup_chown_chmod_tasks.cpp b/lib/libcgroup-3.1.0/tests/gunit/010-cgroup_chown_chmod_tasks.cpp deleted file mode 100644 index 7ad351e3aba..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/010-cgroup_chown_chmod_tasks.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_chown_chmod_tasks() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test010cgroup"; -static const mode_t MODE = S_IRWXU | S_IRWXG | S_IRWXO; - -class ChownChmodTasksTest : public ::testing::Test { - protected: - - void SetUp() override { - char tasks_path[FILENAME_MAX]; - int ret; - FILE *f; - - ret = mkdir(PARENT_DIR, MODE); - ASSERT_EQ(ret, 0); - - memset(tasks_path, 0, sizeof(tasks_path)); - ret = snprintf(tasks_path, FILENAME_MAX - 1, "%s/tasks", - PARENT_DIR); - ASSERT_GT(ret, 0); - - f = fopen(tasks_path, "w"); - fclose(f); - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override { - int ret; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -TEST_F(ChownChmodTasksTest, SuccessfulChownChmod) -{ - mode_t mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IROTH; - char tasks_path[FILENAME_MAX]; - uid_t uid = getuid(); - gid_t gid = getgid(); - struct stat statbuf; - int ret; - - ret = cgroup_chown_chmod_tasks(PARENT_DIR, uid, gid, mode); - ASSERT_EQ(ret, 0); - - memset(tasks_path, 0, sizeof(tasks_path)); - ret = snprintf(tasks_path, FILENAME_MAX - 1, "%s/tasks", - PARENT_DIR); - ASSERT_GT(ret, 0); - - ret = stat(tasks_path, &statbuf); - ASSERT_EQ(ret, 0); - - ASSERT_EQ(statbuf.st_uid, uid); - ASSERT_EQ(statbuf.st_gid, gid); - ASSERT_EQ(statbuf.st_mode & 0777, mode); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/011-cgroupv2_subtree_control.cpp b/lib/libcgroup-3.1.0/tests/gunit/011-cgroupv2_subtree_control.cpp deleted file mode 100644 index 05ab8f5a29c..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/011-cgroupv2_subtree_control.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroupv2_subtree_control() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test011cgroup/"; -static const char * const SUBTREE_FILE = "cgroup.subtree_control"; - - -class SubtreeControlTest : public ::testing::Test { - protected: - - void SetUp() override { - char tmp_path[FILENAME_MAX]; - int ret, i; - FILE *f; - - ret = mkdir(PARENT_DIR, S_IRWXU | S_IRWXG | S_IRWXO); - ASSERT_EQ(ret, 0); - - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, SUBTREE_FILE); - ASSERT_GT(ret, 0); - - f = fopen(tmp_path, "w"); - fclose(f); - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) { - return remove(fpath); - } - - int rmrf(const char * const path) -{ - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override { - int ret; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -TEST_F(SubtreeControlTest, AddController) -{ - char tmp_path[FILENAME_MAX], buf[4092]; - char ctrlr_name[] = "cpu"; - int ret; - FILE *f; - - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, SUBTREE_FILE); - ASSERT_GT(ret, 0); - - /* erase the contents of the file */ - f = fopen(tmp_path, "w"); - fclose(f); - - ret = cgroupv2_subtree_control(PARENT_DIR, ctrlr_name, true); - ASSERT_EQ(ret, 0); - - f = fopen(tmp_path, "r"); - ASSERT_NE(f, nullptr); - - while (fgets(buf, sizeof(buf), f)) - ASSERT_STREQ(buf, "+cpu"); - fclose(f); -} - -TEST_F(SubtreeControlTest, RemoveController) -{ - char tmp_path[FILENAME_MAX], buf[4092]; - char ctrlr_name[] = "memory"; - int ret; - FILE *f; - - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, SUBTREE_FILE); - ASSERT_GT(ret, 0); - - /* erase the contents of the file */ - f = fopen(tmp_path, "w"); - fclose(f); - - ret = cgroupv2_subtree_control(PARENT_DIR, ctrlr_name, false); - ASSERT_EQ(ret, 0); - - f = fopen(tmp_path, "r"); - ASSERT_NE(f, nullptr); - - while (fgets(buf, sizeof(buf), f)) - ASSERT_STREQ(buf, "-memory"); - fclose(f); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/012-cgroup_create_cgroup.cpp b/lib/libcgroup-3.1.0/tests/gunit/012-cgroup_create_cgroup.cpp deleted file mode 100644 index dbe7c534281..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/012-cgroup_create_cgroup.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_create_cgroup() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include -#include - -#include "gtest/gtest.h" -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test012cgroup"; -static const mode_t MODE = S_IRWXU | S_IRWXG | S_IRWXO; - -static const char * const CONTROLLERS[] = { - "cpu", - "freezer", - "memory", - "cpuset", - "namespaces", - "netns", -}; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); - -static cg_version_t VERSIONS[] = { - CGROUP_V1, - CGROUP_V2, - CGROUP_V2, - CGROUP_V1, - CGROUP_V1, - CGROUP_V2, -}; -static const int VERSIONS_CNT = - sizeof(VERSIONS) / sizeof(VERSIONS[0]); - -class CgroupCreateCgroupTest : public ::testing::Test { - protected: - - void SetUp() override - { - char tmp_path[FILENAME_MAX]; - int ret, i; - FILE *f; - - ASSERT_EQ(VERSIONS_CNT, CONTROLLERS_CNT); - - ret = mkdir(PARENT_DIR, MODE); - ASSERT_EQ(ret, 0); - - /* - * Artificially populate the mount table with local - * directories - */ - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(&cg_namespace_table, 0, sizeof(cg_namespace_table)); - - for (i = 0; i < CONTROLLERS_CNT; i++) { - snprintf(cg_mount_table[i].name, CONTROL_NAMELEN_MAX, - "%s", CONTROLLERS[i]); - cg_mount_table[i].version = VERSIONS[i]; - - switch (VERSIONS[i]) { - case CGROUP_V1: - snprintf(cg_mount_table[i].mount.path, - FILENAME_MAX, "%s/%s", PARENT_DIR, - CONTROLLERS[i]); - - ret = mkdir(cg_mount_table[i].mount.path, MODE); - ASSERT_EQ(ret, 0); - break; - case CGROUP_V2: - snprintf(cg_mount_table[i].mount.path, - FILENAME_MAX, "%s", PARENT_DIR); - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, - "%s/cgroup.subtree_control", - PARENT_DIR); - - f = fopen(tmp_path, "w"); - ASSERT_NE(f, nullptr); - fclose(f); - break; - default: - /* we shouldn't get here. fail the test */ - ASSERT_TRUE(false); - } - } - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override - { - int ret = 0; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -static void verify_cgroup_created(const char * const cg_name, - const char * const ctrl) -{ - char tmp_path[FILENAME_MAX]; - DIR *dir; - - memset(tmp_path, 0, sizeof(tmp_path)); - - if (ctrl) - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s/%s", - PARENT_DIR, ctrl, cg_name); - else - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s", - PARENT_DIR, cg_name); - - dir = opendir(tmp_path); - ASSERT_NE(dir, nullptr); - closedir(dir); -} - -static void verify_subtree_contents(const char * const expected) -{ - char tmp_path[FILENAME_MAX], buf[4092]; - FILE *f; - - memset(tmp_path, 0, sizeof(tmp_path)); - snprintf(tmp_path, FILENAME_MAX - 1, "%s/cgroup.subtree_control", - PARENT_DIR); - f = fopen(tmp_path, "r"); - ASSERT_NE(f, nullptr); - - while (fgets(buf, sizeof(buf), f)) - ASSERT_STREQ(buf, expected); - fclose(f); -} - -TEST_F(CgroupCreateCgroupTest, CgroupCreateCgroupV1) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg = NULL; - const char * const ctrl_name = "cpu"; - const char * const cg_name = "MyV1Cgroup"; - int ret; - - cg = cgroup_new_cgroup(cg_name); - ASSERT_NE(cg, nullptr); - - ctrl = cgroup_add_controller(cg, ctrl_name); - ASSERT_NE(ctrl, nullptr); - - ret = cgroup_create_cgroup(cg, 1); - ASSERT_EQ(ret, 0); - - verify_cgroup_created(cg_name, ctrl_name); -} - -TEST_F(CgroupCreateCgroupTest, CgroupCreateCgroupV2) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg = NULL; - const char * const ctrl_name = "freezer"; - const char * const cg_name = "MyV2Cgroup"; - int ret; - - cg = cgroup_new_cgroup(cg_name); - ASSERT_NE(cg, nullptr); - - ctrl = cgroup_add_controller(cg, ctrl_name); - ASSERT_NE(ctrl, nullptr); - - ret = cgroup_create_cgroup(cg, 0); - ASSERT_EQ(ret, 0); - - verify_cgroup_created(cg_name, NULL); - verify_subtree_contents("+freezer"); -} - -TEST_F(CgroupCreateCgroupTest, CgroupCreateCgroupV1AndV2) -{ - struct cgroup_controller *ctrl; - struct cgroup *cg = NULL; - const char * const ctrl1_name = "memory"; - const char * const ctrl2_name = "cpuset"; - const char * const cg_name = "MyV1AndV2Cgroup"; - int ret; - - cg = cgroup_new_cgroup(cg_name); - ASSERT_NE(cg, nullptr); - - ctrl = cgroup_add_controller(cg, ctrl1_name); - ASSERT_NE(ctrl, nullptr); - ctrl = NULL; - ctrl = cgroup_add_controller(cg, ctrl2_name); - ASSERT_NE(ctrl, nullptr); - - ret = cgroup_create_cgroup(cg, 1); - ASSERT_EQ(ret, 0); - - verify_cgroup_created(cg_name, NULL); - verify_cgroup_created(cg_name, ctrl2_name); - verify_subtree_contents("+memory"); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/013-cgroup_build_tasks_procs_path.cpp b/lib/libcgroup-3.1.0/tests/gunit/013-cgroup_build_tasks_procs_path.cpp deleted file mode 100644 index d5392cdcc5f..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/013-cgroup_build_tasks_procs_path.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroup_build_tasks_procs_path() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class BuildTasksProcPathTest : public ::testing::Test { - protected: - - /** - * Setup this test case - * - * This test case calls cg_build_path() to generate various - * cgroup paths. The SetUp() routine creates a simple mount - * table that can be used to verify cg_build_path() behavior. - * - * cg_mount_table for this test is as follows: - * name mount_point index version - * ---------------------------------------------------------- - * controller0 /sys/fs/cgroup/controller0 0 UNK - * controller1 /sys/fs/cgroup/controller1 1 2 - * controller2 /sys/fs/cgroup/controller2 2 1 - * controller3 /sys/fs/cgroup/controller3 3 2 - * controller4 /sys/fs/cgroup/controller4 4 1 - * controller5 /sys/fs/cgroup/controller5 5 2 - * - * Note that controllers 1 and 4 are also given namespaces - */ - void SetUp() override { - char NAMESPACE1[] = "ns1"; - char NAMESPACE4[] = "ns4"; - const int ENTRY_CNT = 6; - int i, ret; - - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(cg_namespace_table, 0, - CG_CONTROLLER_MAX * sizeof(cg_namespace_table[0])); - - // Populate the mount table - for (i = 0; i < ENTRY_CNT; i++) { - snprintf(cg_mount_table[i].name, CONTROL_NAMELEN_MAX, - "controller%d", i); - cg_mount_table[i].index = i; - - ret = snprintf(cg_mount_table[i].mount.path, FILENAME_MAX, - "/sys/fs/cgroup/%s", cg_mount_table[i].name); - ASSERT_LT(ret, sizeof(cg_mount_table[i].mount.path)); - - cg_mount_table[i].mount.next = NULL; - - if (i == 0) - cg_mount_table[i].version = CGROUP_UNK; - else - cg_mount_table[i].version = - (cg_version_t)((i % 2) + 1); - } - - // Give a couple of the entries a namespace as well - cg_namespace_table[1] = NAMESPACE1; - cg_namespace_table[4] = NAMESPACE4; - } -}; - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_ControllerNotFound) -{ - char ctrlname[] = "InvalidCtrlr"; - char path[FILENAME_MAX]; - char cgname[] = "foo"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, ECGOTHER); - ASSERT_STREQ(path, "\0"); -} - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_UnknownCgVersion) -{ - char ctrlname[] = "controller0"; - char path[FILENAME_MAX]; - char cgname[] = "bar"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, ECGOTHER); - ASSERT_STREQ(path, "\0"); -} - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_CgV1) -{ - char ctrlname[] = "controller2"; - char path[FILENAME_MAX]; - char cgname[] = "Container7"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(path, "/sys/fs/cgroup/controller2/Container7/tasks"); -} - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_CgV2) -{ - char ctrlname[] = "controller3"; - struct cgroup_controller ctrlr = {0}; - char path[FILENAME_MAX]; - char cgname[] = "tomcat"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(path, "/sys/fs/cgroup/controller3/tomcat/cgroup.procs"); -} - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_CgV1WithNs) -{ - char ctrlname[] = "controller4"; - struct cgroup_controller ctrlr = {0}; - char path[FILENAME_MAX]; - char cgname[] = "database12"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(path, "/sys/fs/cgroup/controller4/ns4/database12/tasks"); -} - -TEST_F(BuildTasksProcPathTest, BuildTasksProcPathTest_CgV2WithNs) -{ - char ctrlname[] = "controller1"; - struct cgroup_controller ctrlr = {0}; - char path[FILENAME_MAX]; - char cgname[] = "server"; - int ret; - - ret = cgroup_build_tasks_procs_path(path, sizeof(path), cgname, - ctrlname); - ASSERT_EQ(ret, 0); - ASSERT_STREQ(path, "/sys/fs/cgroup/controller1/ns1/server/cgroup.procs"); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/014-cgroupv2_get_subtree_control.cpp b/lib/libcgroup-3.1.0/tests/gunit/014-cgroupv2_get_subtree_control.cpp deleted file mode 100644 index a0b8e226903..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/014-cgroupv2_get_subtree_control.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroupv2_get_subtree_control() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include -#include -#include -#include -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test013cgroup/"; -static const char * const SUBTREE_FILE = "cgroup.subtree_control"; - - -class GetSubtreeControlTest : public ::testing::Test { - protected: - - void SetUp() override { - char tmp_path[FILENAME_MAX]; - int ret, i; - FILE *f; - - ret = mkdir(PARENT_DIR, S_IRWXU | S_IRWXG | S_IRWXO); - ASSERT_EQ(ret, 0); - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) { - return remove(fpath); - } - - int rmrf(const char * const path) -{ - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override { - int ret; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -static void write_subtree_file(const char * const contents, ssize_t len) -{ - char tmp_path[FILENAME_MAX]; - ssize_t bytes_written; - int ret, fd; - - memset(tmp_path, 0, sizeof(tmp_path)); - ret = snprintf(tmp_path, FILENAME_MAX - 1, "%s%s", - PARENT_DIR, SUBTREE_FILE); - ASSERT_GT(ret, 0); - - fd = open(tmp_path, O_WRONLY | O_TRUNC | O_CREAT, S_IRWXU | S_IRWXG); - ASSERT_GT(fd, 0); - - bytes_written = write(fd, contents, len); - ASSERT_EQ(bytes_written, len); - close(fd); -} - -TEST_F(GetSubtreeControlTest, SingleControllerEnabled) -{ - char ctrlr_name[] = "cpu"; - char subtree_contents[] = "cpu\n"; - bool enabled = false; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, 0); - ASSERT_EQ(enabled, true); -} - -TEST_F(GetSubtreeControlTest, SingleControllerNoMatch) -{ - char ctrlr_name[] = "cpu"; - char subtree_contents[] = "cpuset\n"; - bool enabled = true; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, ECGROUPNOTMOUNTED); - ASSERT_EQ(enabled, false); -} - -TEST_F(GetSubtreeControlTest, SingleControllerNoMatch2) -{ - char ctrlr_name[] = "cpuset"; - char subtree_contents[] = "cpu\n"; - bool enabled = true; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, ECGROUPNOTMOUNTED); - ASSERT_EQ(enabled, false); -} - -TEST_F(GetSubtreeControlTest, MultipleControllersEnabled) -{ - char ctrlr_name[] = "cpu"; - char subtree_contents[] = "cpu cpuset io memory pids\n"; - bool enabled = false; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, 0); - ASSERT_EQ(enabled, true); -} - -TEST_F(GetSubtreeControlTest, MultipleControllersEnabled2) -{ - char ctrlr_name[] = "pids"; - char subtree_contents[] = "cpu cpuset io memory pids\n"; - bool enabled = false; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, 0); - ASSERT_EQ(enabled, true); -} - -TEST_F(GetSubtreeControlTest, MultipleControllersNoMatch) -{ - char ctrlr_name[] = "network"; - char subtree_contents[] = "cpu cpuset io memory pids\n"; - bool enabled = true; - int ret; - - write_subtree_file(subtree_contents, strlen(subtree_contents)); - - ret = cgroupv2_get_subtree_control(PARENT_DIR, ctrlr_name, &enabled); - ASSERT_EQ(ret, ECGROUPNOTMOUNTED); - ASSERT_EQ(enabled, false); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/015-cgroupv2_controller_enabled.cpp b/lib/libcgroup-3.1.0/tests/gunit/015-cgroupv2_controller_enabled.cpp deleted file mode 100644 index f5ad47c2fde..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/015-cgroupv2_controller_enabled.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for cgroupv2_controller_enabled() - * - * Copyright (c) 2020 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include -#include -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -static const char * const PARENT_DIR = "test015cgroup"; -static const mode_t MODE = S_IRWXU | S_IRWXG | S_IRWXO; - -static const char * const CHILD_DIRS[] = { - "test1-v1cgroup", - "test2-rootcgroup", - "test3-ctrlrenabled", - "test4-ctrlrdisabled", -}; -static const int CHILD_DIRS_CNT = - sizeof(CHILD_DIRS) / sizeof(CHILD_DIRS[0]); - -static const char * const CONTROLLERS[] = { - "cpu", - "cpuset", - "io", - "memory", - "net_cls", - "pids", -}; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); - -static const enum cg_version_t VERSIONS[] = { - CGROUP_V2, - CGROUP_V1, - CGROUP_V2, - CGROUP_V2, - CGROUP_V2, - CGROUP_V2, -}; -static const int VERSIONS_CNT = - sizeof(VERSIONS) / sizeof(VERSIONS[0]); - -class CgroupV2ControllerEnabled : public ::testing::Test { - protected: - - void InitChildDir(const char dirname[]) - { - char tmp_path[FILENAME_MAX] = {0}; - int ret; - - /* create the directory */ - snprintf(tmp_path, FILENAME_MAX - 1, "%s/%s", - PARENT_DIR, dirname); - ret = mkdir(tmp_path, MODE); - ASSERT_EQ(ret, 0); - } - - void InitMountTable(void) - { - char tmp_path[FILENAME_MAX] = {0}; - int ret, i; - FILE *f; - - ASSERT_EQ(VERSIONS_CNT, CONTROLLERS_CNT); - - snprintf(tmp_path, FILENAME_MAX - 1, - "%s/cgroup.subtree_control", PARENT_DIR); - - f = fopen(tmp_path, "w"); - ASSERT_NE(f, nullptr); - fprintf(f, "cpu io memory pids\n"); - fclose(f); - - /* - * Artificially populate the mount table with local - * directories - */ - memset(&cg_mount_table, 0, sizeof(cg_mount_table)); - memset(&cg_namespace_table, 0, sizeof(cg_namespace_table)); - - for (i = 0; i < CONTROLLERS_CNT; i++) { - snprintf(cg_mount_table[i].name, CONTROL_NAMELEN_MAX, - "%s", CONTROLLERS[i]); - snprintf(cg_mount_table[i].mount.path, FILENAME_MAX, - "%s", PARENT_DIR); - cg_mount_table[i].version = VERSIONS[i]; - } - } - - void SetUp() override - { - int ret, i; - - ret = mkdir(PARENT_DIR, MODE); - ASSERT_EQ(ret, 0); - - InitMountTable(); - - for (i = 0; i < CHILD_DIRS_CNT; i++) - InitChildDir(CHILD_DIRS[i]); - } - - /* - * https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c - */ - static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, - struct FTW *ftwbuf) - { - return remove(fpath); - } - - int rmrf(const char * const path) - { - return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); - } - - void TearDown() override - { - int ret = 0; - - ret = rmrf(PARENT_DIR); - ASSERT_EQ(ret, 0); - } -}; - -TEST_F(CgroupV2ControllerEnabled, CgroupV1Controller) -{ - char ctrlr_name[] = "cpuset"; - char cg_name[] = "foo"; - int ret; - - ret = cgroupv2_controller_enabled(cg_name, ctrlr_name); - ASSERT_EQ(ret, 0); -} - -TEST_F(CgroupV2ControllerEnabled, RootCgroup) -{ - char ctrlr_name[] = "cpu"; - char cg_name[] = "/"; - int ret; - - ret = cgroupv2_controller_enabled(cg_name, ctrlr_name); - ASSERT_EQ(ret, 0); -} - -TEST_F(CgroupV2ControllerEnabled, ControllerEnabled) -{ - char ctrlr_name[] = "pids"; - char cg_name[] = "test3-ctrlrenabled"; - int ret; - - ret = cgroupv2_controller_enabled(cg_name, ctrlr_name); - ASSERT_EQ(ret, 0); -} - -TEST_F(CgroupV2ControllerEnabled, ControllerDisabled) -{ - char ctrlr_name[] = "net_cls"; - char cg_name[] = "test4-ctrlrdisabled"; - int ret; - - ret = cgroupv2_controller_enabled(cg_name, ctrlr_name); - ASSERT_EQ(ret, ECGROUPNOTMOUNTED); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/016-cgset_parse_r_flag.cpp b/lib/libcgroup-3.1.0/tests/gunit/016-cgset_parse_r_flag.cpp deleted file mode 100644 index 728c98b6936..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/016-cgset_parse_r_flag.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for parse_r_flag() in cgset - * - * Copyright (c) 2021 Oracle and/or its affiliates. - * Author: Tom Hromatka - */ - -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" -#include "tools-common.h" - -static const char * const PARENT_DIR = "test016cgset/"; - -static const char * const NAME = "io.max"; -static const char * const VALUE = "\"8:16 wbps=1024\""; - -class CgsetParseRFlagTest : public ::testing::Test { -}; - -TEST_F(CgsetParseRFlagTest, EqualCharInValue) -{ - struct control_value name_value; - char name_value_str[4092]; - int ret; - - ret = snprintf(name_value_str, sizeof(name_value_str) -1, - "%s=%s", NAME, VALUE); - ASSERT_GT(ret, 0); - - ret = parse_r_flag("cgset", name_value_str, &name_value); - ASSERT_EQ(ret, 0); - - ASSERT_STREQ(name_value.name, NAME); - ASSERT_STREQ(name_value.value, VALUE); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/017-API_fuzz_test.cpp b/lib/libcgroup-3.1.0/tests/gunit/017-API_fuzz_test.cpp deleted file mode 100644 index 969cfdb6324..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/017-API_fuzz_test.cpp +++ /dev/null @@ -1,650 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest for fuzz testing APIs with negative values. - * - * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. - * Author: Kamalesh Babulal - */ - -#include - -#include "gtest/gtest.h" - -#include "libcgroup-internal.h" - -class APIArgsTest: public :: testing:: Test { - protected: - - void SetUp() override { - /* Stub */ - } -}; - -/** - * Pass NULL cgroup for setting permissions - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_permissions test name - * - * This test will pass NULL cgroup to the cgroup_set_permissions() - * and check it handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_set_permissions) -{ - mode_t dir_mode, ctrl_mode, task_mode; - struct cgroup * cgroup = NULL; - - dir_mode = (S_IRWXU | S_IXGRP | S_IXOTH); - ctrl_mode = (S_IRUSR | S_IWUSR | S_IRGRP); - task_mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); - - testing::internal::CaptureStdout(); - - cgroup_set_permissions(cgroup, dir_mode, ctrl_mode, task_mode); - - std::string result = testing::internal::GetCapturedStdout(); - ASSERT_EQ(result, "Error: Cgroup, operation not allowed\n"); -} - -/** - * Pass NULL cgroup name for creating a cgroup - * @param APIArgsTest googletest test case name - * @param API_cgroup_new_cgroup test name - * - * This test will pass NULL cgroup name to the cgroup_new_cgroup() - * and check it handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_new_cgroup) -{ - struct cgroup *cgroup = NULL; - char *name = NULL; - - cgroup = cgroup_new_cgroup(name); - ASSERT_EQ(cgroup, nullptr); -} - -/** - * Test arguments passed to set a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_string test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_set_value_string() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_set_value_string) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - char * name = NULL, *value = NULL; - struct cgroup *cgroup = NULL; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_set_value_string(cgc, name, value); - ASSERT_EQ(ret, 50011); - - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // case 2 - // cgc = valid, name = NULL, value = NULL - ret = cgroup_set_value_string(cgc, name, value); - ASSERT_EQ(ret, 50011); - - name = strdup("cgroup.shares"); - ASSERT_NE(name, nullptr); - - // case 3 - // cgc = valid, name = valid, value = NULL - ret = cgroup_set_value_string(cgc, name, value); - ASSERT_EQ(ret, 50011); - - free(name); - name = NULL; - - value = strdup("1024"); - ASSERT_NE(value, nullptr); - - // case 4 - // cgc = valid, name = NULL, value = valid - ret = cgroup_set_value_string(cgc, name, value); - ASSERT_EQ(ret, 50011); - - free(value); -} - -/** - * Test arguments passed to get a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_get_value_string test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_get_value_string() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_get_value_string) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - char *name = NULL, *value = NULL; - struct cgroup *cgroup = NULL; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_get_value_string(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // case 2 - // cgc = valid, name = NULL, value = NULL - ret = cgroup_get_value_string(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - name = strdup("cgroup.shares"); - ASSERT_NE(name, nullptr); - - // case 3 - // cgc = valid, name = valid, value = NULL - ret = cgroup_get_value_string(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - free(name); - name = NULL; - - // case 4 - // cgc = valid, name = valid, value = NULL - ret = cgroup_get_value_string(cgc, name, &value); - ASSERT_EQ(ret, 50011); - - free(value); -} - -/** - * Test arguments passed to add controller to a cgroup - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_string test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_add_controller() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_add_controller) -{ - const char * const cg_name = "FuzzerCgroup"; - const char * const cg_ctrl = "cpu"; - const char * const new_cg_ctrl = NULL; - struct cgroup_controller *cgc = NULL; - struct cgroup *cgroup = NULL; - int ret; - - // case 1 - // cgrp = NULL, name = NULL - cgc = cgroup_add_controller(cgroup, new_cg_ctrl); - ASSERT_EQ(cgroup, nullptr); - - // case 2 - // cgrp = NULL, name = valid - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_EQ(cgroup, nullptr); - - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // case 3 - // cgrp = valid, name = NULL - cgc = cgroup_add_controller(cgroup, new_cg_ctrl); - ASSERT_EQ(cgc, nullptr); -} - -/** - * Test arguments passed to add a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_string test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_add_value_string() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_add_value_string) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller *cgc = NULL; - const char * const cg_ctrl = "cpu"; - struct cgroup *cgroup = NULL; - char * ctrl_value = NULL; - char * ctrl_name = NULL; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_add_value_string(cgc, ctrl_name, ctrl_value); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = NULL - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - ret = cgroup_add_value_string(cgc, ctrl_name, ctrl_value); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = NULL - ctrl_name = strdup("cpu.shares"); - ASSERT_NE(ctrl_name, nullptr); - - ret = cgroup_add_value_string(cgc, ctrl_name, ctrl_value); - ASSERT_EQ(ret, 0); - - // case 4 - // cgc = valid, name = NULL, value = valid - free(ctrl_name); - ctrl_name = NULL; - - ctrl_value = strdup("1024"); - ASSERT_NE(ctrl_value, nullptr); - - ret = cgroup_add_value_string(cgc, ctrl_name, ctrl_value); - ASSERT_EQ(ret, 50011); - - free(ctrl_value); -} - -TEST_F(APIArgsTest, API_cgroup_get_uid_gid) -{ - const char * const cg_name = "FuzzerCgroup"; - uid_t tasks_uid, control_uid; - gid_t tasks_gid, control_gid; - - struct cgroup *cgroup = NULL; - int ret; - // case 1 - // cgroup = NULL, tasks_uid = NULL, tasks_gid = NULL, control_uid = NULL, - // control_uid = NULL - ret = cgroup_get_uid_gid(cgroup, NULL, NULL, NULL, NULL); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgroup = valid, tasks_uid = NULL, tasks_gid = NULL, control_uid = NULL, - // control_uid = NULL - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - ret = cgroup_get_uid_gid(cgroup, NULL, NULL, NULL, NULL); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgroup = valid, tasks_uid = valid, tasks_gid = NULL, control_uid = NULL, - // control_uid = NULL - ret = cgroup_get_uid_gid(cgroup, &tasks_uid, NULL, NULL, NULL); - ASSERT_EQ(ret, 50011); - - // case 4 - // cgroup = valid, tasks_uid = valid, tasks_gid = valid, control_uid = NULL, - // control_uid = NULL - ret = cgroup_get_uid_gid(cgroup, &tasks_uid, &tasks_gid, NULL, NULL); - ASSERT_EQ(ret, 50011); - - // case 5 - // cgroup = valid, tasks_uid = valid, tasks_gid = valid, control_uid = valid, - // control_uid = NULL - ret = cgroup_get_uid_gid(cgroup, &tasks_uid, &tasks_gid, &control_uid, NULL); - ASSERT_EQ(ret, 50011); - - // case 6 - // cgroup = valid, tasks_uid = valid, tasks_gid = valid, control_uid = valid, - // control_uid = valid - ret = cgroup_get_uid_gid(cgroup, &tasks_uid, &tasks_gid, &control_uid, &control_gid); - ASSERT_EQ(ret, 0); -} - -/** - * Test arguments passed to set a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_int64 test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_set_value_int64() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_set_value_int64) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - struct cgroup *cgroup = NULL; - int64_t value = 1024; - char * name = NULL; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = valid - ret = cgroup_set_value_int64(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = valid - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpu.shares, so that cgc->index > 0 - ret = cgroup_set_value_int64(cgc, "cpu.shares", 1024); - ASSERT_EQ(ret, 0); - - ret = cgroup_set_value_int64(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = valid - name = strdup("cpu.shares"); - ASSERT_NE(name, nullptr); - - ret = cgroup_set_value_int64(cgc, name, value); - ASSERT_EQ(ret, 0); - - // check if the value was set right - ret = cgroup_get_value_int64(cgc, name, &value); - ASSERT_EQ(ret, 0); - ASSERT_EQ(value, 1024); - - free(name); -} - -/** - * Test arguments passed to get a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_get_value_int64 test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_get_value_int64() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_get_value_int64) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - struct cgroup *cgroup = NULL; - char * name = NULL; - int64_t value; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_get_value_int64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = NULL - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpu.shares, so that cgc->index > 0 - ret = cgroup_set_value_int64(cgc, "cpu.shares", 1024); - ASSERT_EQ(ret, 0); - - ret = cgroup_get_value_int64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = NULL - name = strdup("cpu.shares"); - ASSERT_NE(name, nullptr); - - ret = cgroup_get_value_int64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 4 - // cgc = valid, name = valid, value = NULL - free(name); - name = NULL; - - ret = cgroup_get_value_int64(cgc, name, &value); - ASSERT_EQ(ret, 50011); -} - -/** - * Test arguments passed to set a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_uint64 test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_set_value_uint64() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_set_value_uint64) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - struct cgroup *cgroup = NULL; - u_int64_t value = 1024; - char * name = NULL; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = valid - ret = cgroup_set_value_uint64(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = valid - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpu.shares, so that cgc->index > 0 - ret = cgroup_set_value_uint64(cgc, "cpu.shares", 1024); - ASSERT_EQ(ret, 0); - - ret = cgroup_set_value_uint64(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = valid - name = strdup("cpu.shares"); - ASSERT_NE(name, nullptr); - - ret = cgroup_set_value_uint64(cgc, name, value); - ASSERT_EQ(ret, 0); - - // check if the value was set right - ret = cgroup_get_value_uint64(cgc, name, &value); - ASSERT_EQ(ret, 0); - ASSERT_EQ(value, 1024); - - free(name); -} - -/** - * Test arguments passed to get a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_get_value_uint64 test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_get_value_uint64() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_get_value_uint64) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpu"; - struct cgroup *cgroup = NULL; - char * name = NULL; - u_int64_t value; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_get_value_uint64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = NULL - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpu.shares, so that cgc->index > 0 - ret = cgroup_set_value_uint64(cgc, "cpu.shares", 1024); - ASSERT_EQ(ret, 0); - - ret = cgroup_get_value_uint64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = NULL - name = strdup("cpu.shares"); - ASSERT_NE(name, nullptr); - - ret = cgroup_get_value_uint64(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 4 - // cgc = valid, name = NULL, value = valid - free(name); - name = NULL; - - ret = cgroup_get_value_uint64(cgc, name, &value); - ASSERT_EQ(ret, 50011); -} - -/** - * Test arguments passed to set a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_set_value_bool test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_set_value_bool() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_set_value_bool) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpuset"; - struct cgroup *cgroup = NULL; - char * name = NULL; - bool value = 1; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = valid - ret = cgroup_set_value_bool(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = valid - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpuset.cpu_exclusive, so that cgc->index > 0 - ret = cgroup_set_value_bool(cgc, "cpuset.cpu_exclusive", 0); - ASSERT_EQ(ret, 0); - - ret = cgroup_set_value_bool(cgc, name, value); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = valid - name = strdup("cpuset.cpu_exclusive"); - ASSERT_NE(name, nullptr); - - ret = cgroup_set_value_bool(cgc, name, value); - ASSERT_EQ(ret, 0); - - // check if the value was set right - ret = cgroup_get_value_bool(cgc, name, &value); - ASSERT_EQ(ret, 0); - ASSERT_EQ(value, 1); - - free(name); -} - -/** - * Test arguments passed to get a controller's setting - * @param APIArgsTest googletest test case name - * @param API_cgroup_get_value_bool test name - * - * This test will pass a combination of valid and NULL as - * arguments to cgroup_get_value_bool() and check if it - * handles it gracefully. - */ -TEST_F(APIArgsTest, API_cgroup_get_value_bool) -{ - const char * const cg_name = "FuzzerCgroup"; - struct cgroup_controller * cgc = NULL; - const char * const cg_ctrl = "cpuset"; - struct cgroup *cgroup = NULL; - char * name = NULL; - bool value; - int ret; - - // case 1 - // cgc = NULL, name = NULL, value = NULL - ret = cgroup_get_value_bool(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 2 - // cgc = valid, name = NULL, value = NULL - cgroup = cgroup_new_cgroup(cg_name); - ASSERT_NE(cgroup, nullptr); - - cgc = cgroup_add_controller(cgroup, cg_ctrl); - ASSERT_NE(cgroup, nullptr); - - // set cpuset.cpu_exclusive, so that cgc->index > 0 - ret = cgroup_set_value_bool(cgc, "cpuset.cpu_exclusive", 0); - ASSERT_EQ(ret, 0); - - ret = cgroup_get_value_bool(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 3 - // cgc = valid, name = valid, value = NULL - name = strdup("cpuset.cpu_exclusive"); - ASSERT_NE(name, nullptr); - - ret = cgroup_get_value_bool(cgc, name, NULL); - ASSERT_EQ(ret, 50011); - - // case 4 - // cgc = valid, name = NULL, value = valid - free(name); - name = NULL; - - ret = cgroup_get_value_bool(cgc, name, &value); - ASSERT_EQ(ret, 50011); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/Makefile.am b/lib/libcgroup-3.1.0/tests/gunit/Makefile.am deleted file mode 100644 index 353567b47ea..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup googletests Makefile.am -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# Author: Tom Hromatka -# - -AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/tools \ - -I$(top_srcdir)/googletest/googletest/include \ - -I$(top_srcdir)/googletest/googletest \ - -std=c++11 \ - -Wno-write-strings \ - -DSTATIC= \ - -DUNIT_TEST -LDADD = $(top_builddir)/src/.libs/libcgroupfortesting.la \ - $(top_builddir)/src/tools/.libs/libcgset.la - -EXTRA_DIST = $(top_srcdir)/googletest/googletest/libgtest.so \ - $(top_srcdir)/googletest/googletest/libgtest_main.so \ - $(top_srcdir)/googletest/googletest/include \ - libcgroup_unittest.map - -check_PROGRAMS = gtest -TESTS = gtest - -gtest_SOURCES = gtest.cpp \ - 001-path.cpp \ - 002-cgroup_parse_rules_options.cpp \ - 003-cg_get_cgroups_from_proc_cgroups.cpp \ - 004-cgroup_compare_ignore_rule.cpp \ - 005-cgroup_compare_wildcard_procname.cpp \ - 006-cgroup_get_cgroup.cpp \ - 007-cgroup_process_v1_mount.cpp \ - 008-cgroup_process_v2_mount.cpp \ - 009-cgroup_set_values_recursive.cpp \ - 010-cgroup_chown_chmod_tasks.cpp \ - 011-cgroupv2_subtree_control.cpp \ - 012-cgroup_create_cgroup.cpp \ - 013-cgroup_build_tasks_procs_path.cpp \ - 014-cgroupv2_get_subtree_control.cpp \ - 015-cgroupv2_controller_enabled.cpp \ - 016-cgset_parse_r_flag.cpp \ - 017-API_fuzz_test.cpp - -gtest_LDFLAGS = -L$(top_srcdir)/googletest/googletest -l:libgtest.so \ - -rpath $(abs_top_srcdir)/googletest/googletest - -clean-local: - ${RM} test-procpidcgroup diff --git a/lib/libcgroup-3.1.0/tests/gunit/Makefile.in b/lib/libcgroup-3.1.0/tests/gunit/Makefile.in deleted file mode 100644 index 15eeb00ceeb..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/Makefile.in +++ /dev/null @@ -1,1141 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 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@ - -# SPDX-License-Identifier: LGPL-2.1-only -# -# libcgroup googletests Makefile.am -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# Author: Tom Hromatka -# -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = gtest$(EXEEXT) -TESTS = gtest$(EXEEXT) -subdir = tests/gunit -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am_gtest_OBJECTS = gtest.$(OBJEXT) 001-path.$(OBJEXT) \ - 002-cgroup_parse_rules_options.$(OBJEXT) \ - 003-cg_get_cgroups_from_proc_cgroups.$(OBJEXT) \ - 004-cgroup_compare_ignore_rule.$(OBJEXT) \ - 005-cgroup_compare_wildcard_procname.$(OBJEXT) \ - 006-cgroup_get_cgroup.$(OBJEXT) \ - 007-cgroup_process_v1_mount.$(OBJEXT) \ - 008-cgroup_process_v2_mount.$(OBJEXT) \ - 009-cgroup_set_values_recursive.$(OBJEXT) \ - 010-cgroup_chown_chmod_tasks.$(OBJEXT) \ - 011-cgroupv2_subtree_control.$(OBJEXT) \ - 012-cgroup_create_cgroup.$(OBJEXT) \ - 013-cgroup_build_tasks_procs_path.$(OBJEXT) \ - 014-cgroupv2_get_subtree_control.$(OBJEXT) \ - 015-cgroupv2_controller_enabled.$(OBJEXT) \ - 016-cgset_parse_r_flag.$(OBJEXT) 017-API_fuzz_test.$(OBJEXT) -gtest_OBJECTS = $(am_gtest_OBJECTS) -gtest_LDADD = $(LDADD) -gtest_DEPENDENCIES = $(top_builddir)/src/.libs/libcgroupfortesting.la \ - $(top_builddir)/src/tools/.libs/libcgset.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -gtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(gtest_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/001-path.Po \ - ./$(DEPDIR)/002-cgroup_parse_rules_options.Po \ - ./$(DEPDIR)/003-cg_get_cgroups_from_proc_cgroups.Po \ - ./$(DEPDIR)/004-cgroup_compare_ignore_rule.Po \ - ./$(DEPDIR)/005-cgroup_compare_wildcard_procname.Po \ - ./$(DEPDIR)/006-cgroup_get_cgroup.Po \ - ./$(DEPDIR)/007-cgroup_process_v1_mount.Po \ - ./$(DEPDIR)/008-cgroup_process_v2_mount.Po \ - ./$(DEPDIR)/009-cgroup_set_values_recursive.Po \ - ./$(DEPDIR)/010-cgroup_chown_chmod_tasks.Po \ - ./$(DEPDIR)/011-cgroupv2_subtree_control.Po \ - ./$(DEPDIR)/012-cgroup_create_cgroup.Po \ - ./$(DEPDIR)/013-cgroup_build_tasks_procs_path.Po \ - ./$(DEPDIR)/014-cgroupv2_get_subtree_control.Po \ - ./$(DEPDIR)/015-cgroupv2_controller_enabled.Po \ - ./$(DEPDIR)/016-cgset_parse_r_flag.Po \ - ./$(DEPDIR)/017-API_fuzz_test.Po ./$(DEPDIR)/gtest.Po -am__mv = mv -f -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_@AM_V@) -am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) -am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -SOURCES = $(gtest_SOURCES) -DIST_SOURCES = $(gtest_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = @EXEEXT@ .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver -LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/build-aux/depcomp \ - $(top_srcdir)/build-aux/test-driver -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILECMD = @FILECMD@ -GCOV = @GCOV@ -GENHTML = @GENHTML@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBOBJS = @LIBOBJS@ -LIBRARY_VERSION_MAJOR = @LIBRARY_VERSION_MAJOR@ -LIBRARY_VERSION_MINOR = @LIBRARY_VERSION_MINOR@ -LIBRARY_VERSION_RELEASE = @LIBRARY_VERSION_RELEASE@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -REALLY_YACC = @REALLY_YACC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pamlibdir = @pamlibdir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/tools \ - -I$(top_srcdir)/googletest/googletest/include \ - -I$(top_srcdir)/googletest/googletest \ - -std=c++11 \ - -Wno-write-strings \ - -DSTATIC= \ - -DUNIT_TEST - -LDADD = $(top_builddir)/src/.libs/libcgroupfortesting.la \ - $(top_builddir)/src/tools/.libs/libcgset.la - -EXTRA_DIST = $(top_srcdir)/googletest/googletest/libgtest.so \ - $(top_srcdir)/googletest/googletest/libgtest_main.so \ - $(top_srcdir)/googletest/googletest/include \ - libcgroup_unittest.map - -gtest_SOURCES = gtest.cpp \ - 001-path.cpp \ - 002-cgroup_parse_rules_options.cpp \ - 003-cg_get_cgroups_from_proc_cgroups.cpp \ - 004-cgroup_compare_ignore_rule.cpp \ - 005-cgroup_compare_wildcard_procname.cpp \ - 006-cgroup_get_cgroup.cpp \ - 007-cgroup_process_v1_mount.cpp \ - 008-cgroup_process_v2_mount.cpp \ - 009-cgroup_set_values_recursive.cpp \ - 010-cgroup_chown_chmod_tasks.cpp \ - 011-cgroupv2_subtree_control.cpp \ - 012-cgroup_create_cgroup.cpp \ - 013-cgroup_build_tasks_procs_path.cpp \ - 014-cgroupv2_get_subtree_control.cpp \ - 015-cgroupv2_controller_enabled.cpp \ - 016-cgset_parse_r_flag.cpp \ - 017-API_fuzz_test.cpp - -gtest_LDFLAGS = -L$(top_srcdir)/googletest/googletest -l:libgtest.so \ - -rpath $(abs_top_srcdir)/googletest/googletest - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/gunit/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/gunit/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -gtest$(EXEEXT): $(gtest_OBJECTS) $(gtest_DEPENDENCIES) $(EXTRA_gtest_DEPENDENCIES) - @rm -f gtest$(EXEEXT) - $(AM_V_CXXLD)$(gtest_LINK) $(gtest_OBJECTS) $(gtest_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/001-path.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/002-cgroup_parse_rules_options.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/003-cg_get_cgroups_from_proc_cgroups.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/004-cgroup_compare_ignore_rule.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/005-cgroup_compare_wildcard_procname.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/006-cgroup_get_cgroup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/007-cgroup_process_v1_mount.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/008-cgroup_process_v2_mount.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/009-cgroup_set_values_recursive.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/010-cgroup_chown_chmod_tasks.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/011-cgroupv2_subtree_control.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/012-cgroup_create_cgroup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/013-cgroup_build_tasks_procs_path.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/014-cgroupv2_get_subtree_control.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/015-cgroupv2_controller_enabled.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/016-cgset_parse_r_flag.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/017-API_fuzz_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtest.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.cpp.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - elif test -n "$$redo_logs"; then \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: $(check_PROGRAMS) - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all $(check_PROGRAMS) - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -gtest.log: gtest$(EXEEXT) - @p='gtest$(EXEEXT)'; \ - b='gtest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: -@am__EXEEXT_TRUE@ @p='$<'; \ -@am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ -@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ -@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ - mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/001-path.Po - -rm -f ./$(DEPDIR)/002-cgroup_parse_rules_options.Po - -rm -f ./$(DEPDIR)/003-cg_get_cgroups_from_proc_cgroups.Po - -rm -f ./$(DEPDIR)/004-cgroup_compare_ignore_rule.Po - -rm -f ./$(DEPDIR)/005-cgroup_compare_wildcard_procname.Po - -rm -f ./$(DEPDIR)/006-cgroup_get_cgroup.Po - -rm -f ./$(DEPDIR)/007-cgroup_process_v1_mount.Po - -rm -f ./$(DEPDIR)/008-cgroup_process_v2_mount.Po - -rm -f ./$(DEPDIR)/009-cgroup_set_values_recursive.Po - -rm -f ./$(DEPDIR)/010-cgroup_chown_chmod_tasks.Po - -rm -f ./$(DEPDIR)/011-cgroupv2_subtree_control.Po - -rm -f ./$(DEPDIR)/012-cgroup_create_cgroup.Po - -rm -f ./$(DEPDIR)/013-cgroup_build_tasks_procs_path.Po - -rm -f ./$(DEPDIR)/014-cgroupv2_get_subtree_control.Po - -rm -f ./$(DEPDIR)/015-cgroupv2_controller_enabled.Po - -rm -f ./$(DEPDIR)/016-cgset_parse_r_flag.Po - -rm -f ./$(DEPDIR)/017-API_fuzz_test.Po - -rm -f ./$(DEPDIR)/gtest.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/001-path.Po - -rm -f ./$(DEPDIR)/002-cgroup_parse_rules_options.Po - -rm -f ./$(DEPDIR)/003-cg_get_cgroups_from_proc_cgroups.Po - -rm -f ./$(DEPDIR)/004-cgroup_compare_ignore_rule.Po - -rm -f ./$(DEPDIR)/005-cgroup_compare_wildcard_procname.Po - -rm -f ./$(DEPDIR)/006-cgroup_get_cgroup.Po - -rm -f ./$(DEPDIR)/007-cgroup_process_v1_mount.Po - -rm -f ./$(DEPDIR)/008-cgroup_process_v2_mount.Po - -rm -f ./$(DEPDIR)/009-cgroup_set_values_recursive.Po - -rm -f ./$(DEPDIR)/010-cgroup_chown_chmod_tasks.Po - -rm -f ./$(DEPDIR)/011-cgroupv2_subtree_control.Po - -rm -f ./$(DEPDIR)/012-cgroup_create_cgroup.Po - -rm -f ./$(DEPDIR)/013-cgroup_build_tasks_procs_path.Po - -rm -f ./$(DEPDIR)/014-cgroupv2_get_subtree_control.Po - -rm -f ./$(DEPDIR)/015-cgroupv2_controller_enabled.Po - -rm -f ./$(DEPDIR)/016-cgset_parse_r_flag.Po - -rm -f ./$(DEPDIR)/017-API_fuzz_test.Po - -rm -f ./$(DEPDIR)/gtest.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ - clean-local cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am recheck tags tags-am uninstall \ - uninstall-am - -.PRECIOUS: Makefile - - -clean-local: - ${RM} test-procpidcgroup - -# 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/lib/libcgroup-3.1.0/tests/gunit/gtest.cpp b/lib/libcgroup-3.1.0/tests/gunit/gtest.cpp deleted file mode 100644 index b48200b09f9..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/gtest.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ -/** - * libcgroup googletest main entry point - * - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * Author: Tom Hromatka - */ - -#include "gtest/gtest.h" - -int main(int argc, char **argv) -{ - ::testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); -} diff --git a/lib/libcgroup-3.1.0/tests/gunit/libcgroup_unittest.map b/lib/libcgroup-3.1.0/tests/gunit/libcgroup_unittest.map deleted file mode 100644 index d2af56c2bb1..00000000000 --- a/lib/libcgroup-3.1.0/tests/gunit/libcgroup_unittest.map +++ /dev/null @@ -1,130 +0,0 @@ -CGROUP_0.32 { -global: - cgroup_init; - cgroup_attach_task; - cgroup_modify_cgroup; - cgroup_create_cgroup; - cgroup_delete_cgroup; - cgroup_attach_task_pid; - cgroup_get_cgroup; - cgroup_create_cgroup_from_parent; - cgroup_copy_cgroup; - cgroup_change_cgroup_uid_gid; - cgroup_change_cgroup_path; - cgroup_new_cgroup; - cgroup_add_controller; - cgroup_free; - cgroup_free_controllers; - cgroup_add_value_string; - cgroup_add_value_int64; - cgroup_add_value_uint64; - cgroup_add_value_bool; - cgroup_compare_cgroup; - cgroup_compare_controllers; - cgroup_set_uid_gid; - cgroup_get_uid_gid; - cgroup_get_value_string; - cgroup_set_value_string; - cgroup_get_value_int64; - cgroup_set_value_int64; - cgroup_get_value_uint64; - cgroup_set_value_uint64; - cgroup_get_value_bool; - cgroup_set_value_bool; - cgroup_change_cgroup_uid_gid_flags; - cgroup_print_rules_config; - cgroup_reload_cached_rules; - cgroup_init_rules_cache; - cgroup_get_current_controller_path; - cgroup_config_load_config; - *; -}; - -CGROUP_0.32.1 { -global: - cgroup_strerror; -} CGROUP_0.32; - -CGROUP_0.33 { -global: - cgroup_get_last_errno; - cgroup_walk_tree_begin; - cgroup_walk_tree_next; - cgroup_walk_tree_end; -} CGROUP_0.32.1; - -CGROUP_0.34 { -global: - cgroup_get_task_begin; - cgroup_get_task_end; - cgroup_get_task_next; - cgroup_read_stats_begin; - cgroup_read_stats_next; - cgroup_read_stats_end; - cgroup_walk_tree_set_flags; - cgroup_get_controller_end; - cgroup_get_controller_next; - cgroup_get_controller_begin; - cgroup_unload_cgroups; - cgroup_get_controller; - cgroup_get_uid_gid_from_procfs; - cgroup_get_subsys_mount_point; - cgroup_get_procname_from_procfs; - cgroup_register_unchanged_process; - cgroup_change_cgroup_flags; -} CGROUP_0.33; - -CGROUP_0.35 { -global: - create_cgroup_from_name_value_pairs; - cgroup_delete_cgroup_ext; - cgroup_get_all_controller_begin; - cgroup_get_all_controller_next; - cgroup_get_all_controller_end; - cgroup_get_value_name_count; - cgroup_get_value_name; -} CGROUP_0.34; - -CGROUP_0.36 { -} CGROUP_0.35; - -CGROUP_0.37 { - cgroup_get_procs; - cgroup_read_value_begin; - cgroup_read_value_next; - cgroup_read_value_end; - cg_chmod_recursive; -} CGROUP_0.36; - -CGROUP_0.38 { - cgroup_get_subsys_mount_point_begin; - cgroup_get_subsys_mount_point_next; - cgroup_get_subsys_mount_point_end; - cgroup_set_permissions; - cgroup_config_unload_config; - cgroup_config_set_default; -} CGROUP_0.37; - -CGROUP_0.39 { - cgroup_reload_cached_templates; - cgroup_init_templates_cache; - cgroup_config_create_template_group; - cgroup_change_all_cgroups; - cgroup_set_logger; - cgroup_set_default_logger; - cgroup_set_loglevel; - cgroup_log; - cgroup_parse_log_level_str; -} CGROUP_0.38; - -CGROUP_0.40 { - cgroup_templates_cache_set_source_files; - cgroup_load_templates_cache_from_files; -} CGROUP_0.39; - -CGROUP_0.41 { -} CGROUP_0.40; - -CGROUP_0.42 { - cgroup_add_all_controllers; -} CGROUP_0.41;