pax_global_header00006660000000000000000000000064132527370720014522gustar00rootroot0000000000000052 comment=6e9af4cbbaa74e5f5e58d9c70dd65901c4fe1425 usbguard-0.7.2+ds/000077500000000000000000000000001325273707200137465ustar00rootroot00000000000000usbguard-0.7.2+ds/CHANGELOG.md000066400000000000000000000336161325273707200155700ustar00rootroot00000000000000# Change Log ## 0.7.2 - 2018-01-22 ### Fixed/Changed - Fixed memory leaks in usbguard::Hash class. - Fixed file descriptor leaks in usbguard::SysFSDevice class. - Skip audit backend logging when no backend was set. ### Added - Added zsh completion & other scripts to the distribution tarball. ## 0.7.1 - 2017-11-30 ### Added - CLI: usbguard watch command now includes an -e option to run an executable for every received event. Event data are passed to the executable via environment variables. - usbguard-daemon: added "-K" option which can disable logging to console. - Added zsh autocompletion support. - usbguard-daemon: added "-f" option which enabled double-fork daemonization procedure. - Added AuditBackend usbguard-daemon configuration option for selecting audit log backend. - Linux Audit support via new LinuxAudit backend. - Added missing RuleCondition.hpp header file to the public API headers. - Code Style specification via AStyle configuration file. ### Removed - Removed Utility.hpp header file from public API headers - Reduced usage of raw C pointers throughout the code ### Changed - Qt Applet: disabled session management - usbguard-daemon console logging output is enabled by default now. Previously, the -k option had to be passed to enable the output. - Replaced --enable-maintainer-mode configure option with --enable-full-test-suite option. When the new option is not used during the configure phase, only a basic set of test is run during the make check phase. - usbguard-daemon now opens configuration in read-only mode - Fixed UEventDeviceManager to work with Linux Kernel >= 4.13 - Refactored audit logging to support different audit log backends - Reformatted source code to conform to the code style. - Made the configuration parser strict. Unknown directives and wrong syntax will cause an error. - Reformated documentation from markdown to asciidoc format. ## 0.7.0 - 2017-04-12 ### Added - Added InsertedDevicePolicy configuration option to control the policy method for inserted devices. - Added RestoreControllerDeviceState configuration option. - Added DeviceManagerBackend configuration option. This option can be used to select from several device manager backend implementations. - Implemented an uevent based device manager backend. - Added setParameter, getParameter IPC (incl. D-Bus) methods. - Added set-parameter, get-parameter CLI subcommands. - Qt Applet: Added Spanish (es_AR) translation. - Create empty rules.conf file at install time (make install). - Support for numeric UID/GID values in IPCAllowedUsers and IPCAllowedGroups settings. - If bash completion support is detected at configure time, install the bash completion script during make install. - Added new configuration setting: IPCAccessControlFiles. - IPC access is now configurable down to a section and privilege level per user and/or group. - Added add-user, remove-user usbuard CLI subcommands for creating, removing IPC access control files. - Added AuditFilePath configuration option for setting the location of the USBGuard audit events log file path. If set, the usbguard-daemon will log policy and device related actions and whether they succeeded or not. ### Removed - Removed UDev based device manager backend and UDev related dependencies. - Removed UDev development files/API dependecy ### Changed - Reset Linux root hub bcdDevice value before updating device hash. This is a backwards incompatible change because it changes how the device hash is computed for Linux root hub devices. - Refactored low-level USB device handling into SysFSDevice class which represents a device in the /sys filesystem (sysfs). - Removed usage of `readdir_r` because it's obsolete. Replaced with readdir with the assumption that its usage is thread-safe if the directory handle passed to it is not shared between threads. - Extended test suite with use case tests. - Install the usbguard-daemon configuration and policy file with strict file permissions to prevent policy leaks. - Fixed several memory leaks. - Don't pre-resolve user and group names in IPCAllowedUsers and IPCAllowedGroups settings. Instead, resolve the name during the IPC authentication phase. - Changed default values of PresentDevicePolicy (to apply-policy) and IPCAllowedGroups (removed wheel group entry) settings in the shipped usbguard-daemon.conf configuration file. ## 0.6.2 - 2016-09-18 ### Changed - Wait for disconnect in IPCClient dtor if needed - Qt Applet: Fixed loading of decision method and default decision settings ## 0.6.1 - 2016-09-16 ### Changed - Refactored logging subsystem - Fixed handling of IPC disconnect in the IPCClient class - Qt Applet: Fixed handling of main window minimization and maximization - Fixed building on architectures that don't provide required atomic operations. The libatomic emulation library will be used in such cases. - Fixed several typos in the documentation ### Added - Implemented a simple internal logger - Access to the logger via public API - Improved logging coverage. Logging output can be enabled either via CLI options or by setting the `USBGUARD_DEBUG` environment variable to 1. - Qt Applet: UI translation support. - Qt Applet: Czech (cs_CZ) translation ### Removed - Removed spdlog dependency ## 0.6.0 - 2016-09-04 ### Changed - Fixed the daemon to use the match target when matching device rules. This fixes matching devices against the rules in the policy. - Switched to protobuf based IPC - Simplified the IPC and D-Bus interfaces - Refactored custom exceptions ### Added - Added DevicePresenceChanged signal for notifying about device insertions, updates and removals - Added DevicePolicyChanged signal for notifying about device policy changes. - Added ExceptionMessage signal for sending asynchronous exceptions to the IPC/D-Bus clients. - Extended the usbguard CLI watch subcommand with the ability to wait for the IPC connection to become available. See the new `-w` and `-o` options for details. ### Removed - Removed nlohmann/json submodule - Removed allowDevice, blockDevice and rejectDevice methods from the IPC and D-Bus interface. - Removed DeviceAllowed, DeviceBlocked and DeviceRejected signals from the IPC and D-Bus interface (replaced by single signal) - Removed DeviceInserted, DevicePresent and DeviceRemoved signals from the IPC and D-Bus interface (replaced by single signal) ## 0.5.14 - 2016-08-18 ### Changed - Fixed unknown descriptor type handling ## 0.5.13 - 2016-08-16 ### Changed - refactored USB parser to support multiple handlers per USB descriptor type - Qt Applet: device list should be always expanded ### Added - added support for an audio device related endpoint descriptor ## 0.5.12 - 2016-08-14 ### Changed - Fixed a bug in matching USB interface types with wildcards - usbguard-daemon will now abort at startup if the rule file contains syntax error instead of continuing with an empty rule set ## 0.5.11 - 2016-08-13 ### Added - Maintainer script for spellchecking source archive files - Rule::Attribute class for representing the rule attributes - USBDeviceID class for representing the USB device ID - configure script option to control the bundling of PEGTL source files - id attribute to the rule language for specifying the USB device ID - Added a parent device ID field (and methods) to the Device class which tracks the ID of the parent device - Implemented "parent-hash" attribute for associating a device with its parent device. - The QtSvg module/library is now needed to compile the Qt applet - Qt Applet: Device Dialog settings work now - Qt Applet: The settings state is now remembered (via Qt's QSettings class) - Qt Applet: Implemented serial number masking - Qt Applet: Initial implementation of DeviceDialog window position randomization - Qt Applet: IPC exceptions are shown in the message log - Qt Applet: added an initial implementation of the device list with the ability to change authorization target for each device - Qt Applet: show a grey version of the USBGuard icon in IPC disconnected state - usbguard-daemon.conf: added DeviceRulesWithPort setting (set to false by default) - Added support for selecting crypto backend library at compile time using the --with-crypto-library configure script switch ### Changed - **IMPORTANT**: The device hash value computation was changed to include the USB descriptor data. Additionally, the algorithm was changed to SHA-256 and the hash value representation to base64. These changes are backwards incompatible and existing policies that use the hash attribute need to be updated. - Reimplemented the rule parser using PEGTL - Changed public API of the Rule and Device classes because of the new Rule::Attribute class rule attribute representation - Extended the public IPCClient::IPCDisconnected method to include exception related information - All rule attributes now support both the single and multivalued form - A rule attribute can now be specified only once - The default usbguard-daemon.conf and usbguard.service files now respect the paths set by the configure script - New Qt applet icons with - Fixed Qt applet so that it doesn't show an empty window when starting - Qt Applet: Reject button is hidden by default. - Updated usbguard-daemon manual page - Permanent device specific rules managed by allowDevice, blockDevice and rejectDevice actions are now handled properly. Existing device rules are updated instead of just appending new rules to the policy. - usbguard-daemon.conf: changed the default configuration value of PresentControllerPolicy to keep - Changed the device hashing algorithm to SHA-256 - Switched hash value representation from hex to base64 ### Removed - Removed Quex related files - The "from Rule" Device class constructor was removed because it's use case is unclear and it wasn't used anywhere ## 0.5.10 - 2016-07-08 ### Changed - Changed versioning scheme to include a release number. Releases will be rolled out more often during a milestone (x.y -- currently 0.5) development. - Enhancements of the usbguard command-line interface. - Manual pages are now generated from their source (markdown) during the build process. - A default usbguard-daemon configuration file is now installed. ### Added - Merged usbguard-applet-qt (sub)project into usbguard. - Added a D-Bus bridge component which exposes a D-Bus interface to usbguard. ### Fixed - Fixed USB descriptor data parsing. Previously, many real-world cases of descriptors weren't parsed correctly because of a naive implementation of the parser. - Fixed systemd integration. - Fixed issues: #84, #83, #80, #79, #78, #77, #76, #75, #74, #73, #72, #71, #70, #69, #68, #56, #54, #53, #51, #50, #44. ## 0.4 - 2016-02-07 ### Changed - The daemon is now capable of dropping process capabilities and uses a seccomp based syscall whitelist. Options to enable these features were added to the usbguard-daemon command. - Devices connected at the start of the daemon are now recognized and the DevicePresent signal is sent for each of them. - The library API was extended with the Device and DeviceManager classes. - Implemented the usbguard CLI, see usbguard(1) for available commands. - Initial authorization policies can be now easily generated using the usbguard generate-policy command. - Extended the rule language with rule conditions. See usbguard-rules.conf(5) for details. - Moved logging code into the shared library. You can use static methods of the Logger class to configure logging behaviour. - Removed the bundled libsodium and libqb libraries. ### Added - New configuration options for setting the implicit policy target and how to handle the present devices are now available. ### Fixed - String values read from the device are now properly escaped and length limits on these values are enforced. - Fixed several bugs. - Resolved issues: #46, #45, #41, #40, #37, #32, #31, #28, #25, #24, #21, #16, #13, #9, #4 ### Removed - The device hashing procedure was altered and generates different hash values. If you are using the hash attribute in your rules, you'll have to update the values. - The bundled libsodium and libqb were removed. You'll have to compile and install them separately if your distribution doesn't provide them as packages. ## 0.3p3 - 2015-04-14 ### Changed - use AC_CHECK_HEADER instead of a pkg-config based check for json and spdlog - make check target available ## 0.3p2 - 2015-04-02 ### Changed - SHM permissions are set to uid of the client process and gid of the daemon with rw-rw---- mode (0660). - added --with-bundled-json and --with-bundled-spdlog configure options to enable/disable the usage of the bundled libraries ## 0.3p1 - 2015-04-10 ### Removed - removed bundled cppformat copylib ## 0.3 - 2015-04-09 ### Changed - Implemented a DAC based IPC access control ## Added - Ship man pages for usbguard-daemon, usbguard-daemon.conf and usbguard-rules.conf - Ship the LICENSE file ### Fixed - Fixed appending of permanent rules - Fixed distribution RPM spec file. Thanks to Petr Lautrbach and Ralf Corsepius for review. - Resolved issues: #18 #19 #13 ## 0.2 - 2015-04-03 ### Changed - Reworked device hashing. - Rule language changes - set operators - renamed "port" to "via-port" - added "with-interface" matching attribute - removed the "class" attribute - The IPCClient, ConfigFile, Rule and RuleSet classes are now shipped in a shared library. - Created abstract interface for OS specific USB device handling. - Changed default daemon config path to /etc/usbguard/usbguard-daemon.conf. - Implemented basic USB descriptor structure parsing and improved interface type handling - The IPC API was changed: - added new signal, DevicePresent, which signals that a device was already present at the start of the IPC session - the DeviceInserted and DevicePresent signals pass interface types that the device supports - the explicit string arguments of the signals are now passed as a map ### Added - Support for modifying permanent rules over the IPC interface. ### Fixed - Resolved issues: #1 #2 #5 #6 #10 #11 usbguard-0.7.2+ds/LICENSE000066400000000000000000000431531325273707200147610ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) {year} {fullname} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. usbguard-0.7.2+ds/Makefile.am000066400000000000000000000470701325273707200160120ustar00rootroot00000000000000## ## Copyright (C) 2016 Red Hat, 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 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 . ## ## Authors: Daniel Kopecek ## Jiri Vymazal ## SUBDIRS=src/Tests/ ACLOCAL_AMFLAGS= -I m4 EXTRA_DIST =\ LICENSE \ usbguard-daemon.conf.in \ usbguard.service.in \ VERSION \ CHANGELOG.md \ src/astylerc \ scripts/usbguard-zsh-completion \ scripts/modeline.vim \ scripts/astyle.sh \ scripts/reformat-sources.sh \ scripts/usb-descriptor-collect.sh BUILT_SOURCES=\ src/build-config.h $(top_builddir)/src/build-config.h: $(top_builddir)/src/build-config.h.in $(SED) \ -e "s|[$$]{localstatedir}|${localstatedir}|g" \ -e "s|[$$]{exec_prefix}|${prefix}|g" \ -e "s|[$$]{datarootdir}|${datarootdir}|g" \ -e "s|[$$]{datadir}|${pkgdatadir}|g" \ -e "s|[$$]{sysconfdir}|${sysconfdir}|g" \ -e "s|[$$]{prefix}|${prefix}|g" \ -e "s|[$$]{PACKAGE_TARNAME}|${PACKAGE_TARNAME}|g" \ $^ > $@ || rm -f $@ DISTCLEANFILES=\ $(BUILT_SOURCES) CLEANFILES= man_ADOC_FILES=\ doc/man/usbguard.1.adoc \ doc/man/usbguard-dbus.8.adoc \ doc/man/usbguard-applet-qt.1.adoc \ doc/man/usbguard-daemon.8.adoc \ doc/man/usbguard-daemon.conf.5.adoc \ doc/man/usbguard-rules.conf.5.adoc man_ROFF_FILES=\ $(man_ADOC_FILES:.adoc=.roff) EXTRA_DIST+=\ $(man_ADOC_FILES) BUILT_SOURCES+=\ $(man_ROFF_FILES) CLEANFILES+=\ $(man_ROFF_FILES) \ $(man_ROFF_FILES:.roff=) $(top_builddir)/%.roff: %.adoc $(MKDIR_P) $$(dirname $@) $(ASCIIDOCTOR) -v -b manpage $^ -o $(top_builddir)/$@ $(INSTALL) -m 644 $(top_builddir)/$@ $(top_builddir)/$(@:.roff=) install-data-hook: install-daemon-conf install-systemd-service install-data-dbus uninstall-hook: uninstall-daemon-conf uninstall-systemd-service uninstall-data-dbus CLEANFILES+=\ $(top_builddir)/usbguard-daemon.conf usbguard-daemon.conf: $(top_builddir)/usbguard-daemon.conf.in $(SED) \ -e "s|%sysconfdir%|${sysconfdir}|g" \ -e "s|%localstatedir%|${localstatedir}|g" \ $^ > $@ || rm -f $@ usbguard_confdir= $(sysconfdir)/usbguard distuninstallcheck_listfiles= find . -type f ! -name rules.conf -print install-daemon-conf: $(top_builddir)/usbguard-daemon.conf $(MKDIR_P) $(DESTDIR)/$(usbguard_confdir) $(MKDIR_P) $(DESTDIR)/$(usbguard_confdir)/IPCAccessControl.d $(MKDIR_P) $(DESTDIR)/${localstatedir}/log/usbguard $(INSTALL) -m 600 $(top_builddir)/usbguard-daemon.conf \ $(DESTDIR)/$(usbguard_confdir)/usbguard-daemon.conf if ! test -f "$(DESTDIR)/$(usbguard_confdir)/rules.conf"; then \ touch $(DESTDIR)/$(usbguard_confdir)/rules.conf && \ chmod 600 $(DESTDIR)/$(usbguard_confdir)/rules.conf; \ fi uninstall-daemon-conf: rm -f $(DESTDIR)/$(usbguard_confdir)/usbguard-daemon.conf if SYSTEMD_SUPPORT_ENABLED CLEANFILES+=\ $(top_builddir)/usbguard.service usbguard.service: $(top_srcdir)/usbguard.service.in $(SED) -e "s|%sbindir%|${sbindir}|" -e "s|%sysconfdir%|${sysconfdir}|" $^ > $@ || rm -f $@ install-systemd-service: $(top_builddir)/usbguard.service $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) $(INSTALL) -m 644 $(top_builddir)/usbguard.service \ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard.service uninstall-systemd-service: rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard.service else install-systemd-service: uninstall-systemd-service: endif man8_MANS=\ $(top_builddir)/doc/man/usbguard-daemon.8 man5_MANS=\ $(top_builddir)/doc/man/usbguard-daemon.conf.5 \ $(top_builddir)/doc/man/usbguard-rules.conf.5 man1_MANS=\ $(top_builddir)/doc/man/usbguard.1 AM_CPPFLAGS=\ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/Library/public pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libusbguard.pc lib_LTLIBRARIES=\ libusbguard.la libusbguard_la_CPPFLAGS=\ -fPIC \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/Library \ -I$(top_srcdir)/src/Library/public \ -I$(top_builddir)/src/Library/IPC \ @qb_CFLAGS@ \ @protobuf_CFLAGS@ \ @crypto_CFLAGS@ \ @pegtl_CFLAGS@ libusbguard_la_LDFLAGS=\ -no-undefined \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) libusbguard_la_LIBADD=\ @qb_LIBS@ \ @protobuf_LIBS@ \ @crypto_LIBS@ \ @pegtl_LIBS@ \ @atomic_LIBS@ EXTRA_DIST+=\ src/Library/IPC/Devices.proto \ src/Library/IPC/Exception.proto \ src/Library/IPC/Message.proto \ src/Library/IPC/Policy.proto \ src/Library/IPC/Rule.proto \ src/Library/IPC/Parameter.proto nodist_libusbguard_la_SOURCES=\ src/Library/IPC/Message.pb.cc \ src/Library/IPC/Message.pb.h \ src/Library/IPC/Rule.pb.cc \ src/Library/IPC/Rule.pb.h \ src/Library/IPC/Devices.pb.cc \ src/Library/IPC/Devices.pb.h \ src/Library/IPC/Exception.pb.cc \ src/Library/IPC/Exception.pb.h \ src/Library/IPC/Policy.pb.cc \ src/Library/IPC/Policy.pb.h \ src/Library/IPC/Parameter.pb.cc \ src/Library/IPC/Parameter.pb.h BUILT_SOURCES+=\ $(nodist_libusbguard_la_SOURCES) CLEANFILES+=\ $(nodist_libusbguard_la_SOURCES) libusbguard_la_SOURCES=\ src/Common/ByteOrder.hpp \ src/Common/FDInputStream.hpp \ src/Common/Thread.hpp \ src/Common/Utility.cpp \ src/Common/Utility.hpp \ src/Library/AllowedMatchesCondition.cpp \ src/Library/AllowedMatchesCondition.hpp \ src/Library/Base64.cpp \ src/Library/Base64.hpp \ src/Library/ConfigFilePrivate.cpp \ src/Library/ConfigFilePrivate.hpp \ src/Library/DeviceManagerPrivate.cpp \ src/Library/DeviceManagerPrivate.hpp \ src/Library/DevicePrivate.cpp \ src/Library/DevicePrivate.hpp \ src/Library/FixedStateCondition.cpp \ src/Library/FixedStateCondition.hpp \ src/Library/Hash.cpp \ src/Library/Hash.hpp \ src/Library/IPCClientPrivate.cpp \ src/Library/IPCClientPrivate.hpp \ src/Library/IPCPrivate.cpp \ src/Library/IPCPrivate.hpp \ src/Library/IPCServerPrivate.cpp \ src/Library/IPCServerPrivate.hpp \ src/Library/Init.cpp \ src/Library/KeyValueParser.cpp \ src/Library/KeyValueParser.hpp \ src/Library/LocaltimeCondition.cpp \ src/Library/LocaltimeCondition.hpp \ src/Library/RandomStateCondition.cpp \ src/Library/RandomStateCondition.hpp \ src/Library/RuleAppliedCondition.cpp \ src/Library/RuleAppliedCondition.hpp \ src/Library/RuleEvaluatedCondition.cpp \ src/Library/RuleEvaluatedCondition.hpp \ src/Library/RuleParser/Actions.hpp \ src/Library/RuleParser/Grammar.hpp \ src/Library/RulePrivate.cpp \ src/Library/RulePrivate.hpp \ src/Library/RuleSetPrivate.cpp \ src/Library/RuleSetPrivate.hpp \ src/Library/SysFSDevice.cpp \ src/Library/SysFSDevice.hpp \ src/Library/UEvent.cpp \ src/Library/UEvent.hpp \ src/Library/UEventDeviceManager.cpp \ src/Library/UEventDeviceManager.hpp \ src/Library/UEventParser.cpp \ src/Library/UEventParser.hpp \ src/Library/Utility.cpp \ src/Library/Utility.hpp \ src/Library/public/usbguard/Audit.cpp \ src/Library/public/usbguard/Audit.hpp \ src/Library/public/usbguard/ConfigFile.cpp \ src/Library/public/usbguard/Device.cpp \ src/Library/public/usbguard/DeviceManager.cpp \ src/Library/public/usbguard/DeviceManagerHooks.cpp \ src/Library/public/usbguard/IPCClient.cpp \ src/Library/public/usbguard/IPCServer.cpp \ src/Library/public/usbguard/Logger.cpp \ src/Library/public/usbguard/Policy.cpp \ src/Library/public/usbguard/Rule.cpp \ src/Library/public/usbguard/RuleCondition.cpp \ src/Library/public/usbguard/RuleParser.cpp \ src/Library/public/usbguard/RuleParser.hpp \ src/Library/public/usbguard/RuleSet.cpp \ src/Library/public/usbguard/Typedefs.cpp \ src/Library/public/usbguard/USB.cpp \ src/Library/public/usbguard/USBGuard.cpp pkginclude_HEADERS=\ src/Library/public/usbguard/Audit.hpp \ src/Library/public/usbguard/ConfigFile.hpp \ src/Library/public/usbguard/Device.hpp \ src/Library/public/usbguard/DeviceManager.hpp \ src/Library/public/usbguard/DeviceManagerHooks.hpp \ src/Library/public/usbguard/Exception.hpp \ src/Library/public/usbguard/IPCClient.hpp \ src/Library/public/usbguard/IPCServer.hpp \ src/Library/public/usbguard/Interface.hpp \ src/Library/public/usbguard/Logger.hpp \ src/Library/public/usbguard/Policy.hpp \ src/Library/public/usbguard/Predicates.hpp \ src/Library/public/usbguard/Rule.hpp \ src/Library/public/usbguard/RuleCondition.hpp \ src/Library/public/usbguard/RuleSet.hpp \ src/Library/public/usbguard/Typedefs.hpp \ src/Library/public/usbguard/USB.hpp \ src/Library/public/usbguard/USBGuard.hpp # Workaround for generated protobuf code mishaps #``` # error: no previous declaration for 'void usbguard::IPC::protobuf_Message_2eproto::AddDescriptorImpl()' [-Werror=missing-declarations] # void AddDescriptorImpl() { # ^~~~~~~~~~~~~~~~~ #``` %.pb.lo : CXXFLAGS += -Wno-missing-declarations %.pb.cc %.pb.h: %.proto $(MKDIR_P) $(top_builddir)/src/Library/IPC @PROTOC@ --cpp_out=$(top_builddir)/src/Library/IPC --proto_path=$(top_srcdir)/src/Library/IPC "$<" sed -i -e '1i#ifndef __clang_analyzer__' -e '$$a#endif' "$@" sbin_PROGRAMS=\ usbguard-daemon usbguard_daemon_SOURCES=\ src/Daemon/Daemon.cpp \ src/Daemon/Daemon.hpp \ src/Daemon/main.cpp \ src/Daemon/Seccomp.c \ src/Daemon/Seccomp.h \ src/Common/Utility.hpp \ src/Common/Utility.cpp \ src/Daemon/FileAuditBackend.hpp \ src/Daemon/FileAuditBackend.cpp \ src/Daemon/LinuxAuditBackend.hpp \ src/Daemon/LinuxAuditBackend.cpp usbguard_daemon_CPPFLAGS=\ -fPIE \ $(AM_CPPFLAGS) \ @seccomp_CFLAGS@ \ @libcapng_CFLAGS@ \ @audit_CFLAGS@ usbguard_daemon_LDADD=\ $(top_builddir)/libusbguard.la \ @seccomp_LIBS@ \ @libcapng_LIBS@ \ @audit_LIBS@ EXTRA_DIST +=\ README.adoc \ src/ThirdParty/Catch \ src/ThirdParty/PEGTL bin_PROGRAMS=\ usbguard \ usbguard-rule-parser usbguard_SOURCES=\ src/CLI/usbguard.cpp \ src/CLI/usbguard.hpp \ src/CLI/usbguard-list-devices.hpp \ src/CLI/usbguard-list-devices.cpp \ src/CLI/usbguard-allow-device.hpp \ src/CLI/usbguard-allow-device.cpp \ src/CLI/usbguard-block-device.hpp \ src/CLI/usbguard-block-device.cpp \ src/CLI/usbguard-reject-device.hpp \ src/CLI/usbguard-reject-device.cpp \ src/CLI/usbguard-list-rules.hpp \ src/CLI/usbguard-list-rules.cpp \ src/CLI/usbguard-append-rule.hpp \ src/CLI/usbguard-append-rule.cpp \ src/CLI/usbguard-remove-rule.hpp \ src/CLI/usbguard-remove-rule.cpp \ src/CLI/usbguard-generate-policy.cpp \ src/CLI/usbguard-generate-policy.hpp \ src/CLI/usbguard-watch.hpp \ src/CLI/usbguard-watch.cpp \ src/CLI/IPCSignalWatcher.hpp \ src/CLI/IPCSignalWatcher.cpp \ src/CLI/PolicyGenerator.hpp \ src/CLI/PolicyGenerator.cpp \ src/CLI/usbguard-read-descriptor.hpp \ src/CLI/usbguard-read-descriptor.cpp \ src/CLI/usbguard-set-parameter.hpp \ src/CLI/usbguard-set-parameter.cpp \ src/CLI/usbguard-get-parameter.hpp \ src/CLI/usbguard-get-parameter.cpp \ src/CLI/usbguard-add-user.cpp \ src/CLI/usbguard-add-user.hpp \ src/CLI/usbguard-remove-user.cpp \ src/CLI/usbguard-remove-user.hpp usbguard_CPPFLAGS=\ -fPIE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/CLI usbguard_LDADD=\ $(top_builddir)/libusbguard.la if BASH_COMPLETION_ENABLED bashcompletiondir = $(BASH_COMPLETION_DIR) dist_bashcompletion_DATA = $(top_srcdir)/scripts/bash_completion/usbguard endif usbguard_rule_parser_SOURCES=\ src/CLI/usbguard-rule-parser.cpp usbguard_rule_parser_CPPFLAGS=\ -fPIE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/CLI usbguard_rule_parser_LDADD=\ $(top_builddir)/libusbguard.la # # DBus Bridge # if DBUS_ENABLED sbin_PROGRAMS+= usbguard-dbus man8_MANS+=\ $(top_builddir)/doc/man/usbguard-dbus.8 BUILT_SOURCES+=\ src/DBus/DBusInterface.xml.cstr \ src/DBus/org.usbguard.service \ src/DBus/usbguard-dbus.service EXTRA_DIST+=\ src/DBus/org.usbguard.conf \ src/DBus/org.usbguard.service.in \ src/DBus/usbguard-dbus.service.in \ src/DBus/org.usbguard.policy \ src/DBus/DBusInterface.xml CLEANFILES+=\ $(top_builddir)/src/DBus/org.usbguard.service \ $(top_builddir)/src/DBus/usbguard-dbus.service \ $(top_builddir)/src/DBus/DBusInterface.xml.cstr usbguard_dbus_SOURCES=\ src/DBus/gdbus-server.cpp \ src/DBus/DBusBridge.cpp \ src/DBus/DBusBridge.hpp usbguard_dbus_CPPFLAGS=\ -fPIE \ $(AM_CPPFLAGS) \ -I$(top_builddir)/src/DBus \ @dbus_CFLAGS@ usbguard_dbus_LDADD=\ $(top_builddir)/libusbguard.la \ @dbus_LIBS@ %.xml: xmllint "$(top_srcdir)/$@" > /dev/null %.xml.cstr: %.xml XMLLINT_INDENT="" xmllint --noblanks --format "$<" |\ sed -n -e '// d; s|\"|\\"|g; s|.*|"&"|; p' > "$(top_builddir)/$@" %.service: %.service.in sed -e "s|%{sbindir}%|$(sbindir)|" "$<" > "$(top_builddir)/$@" install-data-dbus: $(top_builddir)/src/DBus/org.usbguard.service install-polkit-policy install-systemd-dbus-service $(MKDIR_P) $(DESTDIR)$(DBUS_SERVICES_DIR) && \ $(INSTALL_DATA) $(top_builddir)/src/DBus/org.usbguard.service $(DESTDIR)$(DBUS_SERVICES_DIR) $(MKDIR_P) $(DESTDIR)$(DBUS_BUSCONFIG_DIR) && \ $(INSTALL_DATA) $(top_srcdir)/src/DBus/org.usbguard.conf $(DESTDIR)$(DBUS_BUSCONFIG_DIR) uninstall-data-dbus: uninstall-polkit-policy uninstall-systemd-dbus-service rm -f $(DESTDIR)$(DBUS_SERVICES_DIR)/org.usbguard.service rmdir $(DESTDIR)$(DBUS_SERVICES_DIR) rm -f $(DESTDIR)$(DBUS_BUSCONFIG_DIR)/org.usbguard.conf rmdir $(DESTDIR)$(DBUS_BUSCONFIG_DIR) dbus-docs: $(top_srcdir)/src/DBus/DBusInterface.xml # # Copy the input files to builddir because gdbus-codegen # doesn't provide an option to store the output files somewhere # else than in the directory where the input files are. And we # don't want to create files in the srcdir when building. # $(MKDIR_P) "$(top_builddir)/src/DBus" cp "$<" "$(top_builddir)/src/DBus/" $(GDBUS_CODEGEN) --interface-prefix org.usbguard --generate-docbook=docbook \ "$(top_builddir)/src/DBus/DBusInterface.xml" for docbook in $(top_builddir)/docbook-org.usbguard.*.xml; do \ $(XSLTPROC) -o "$$(basename -s .xml $$docbook).html" \ "$(top_srcdir)/src/ThirdParty/xsl-stylesheets/xhtml-1_1/docbook.xsl" \ "$(top_builddir)/$$docbook"; \ done if POLICYKIT_ENABLED install-polkit-policy: $(MKDIR_P) $(DESTDIR)$(POLKIT_POLICY_DIR) && \ $(INSTALL_DATA) $(top_srcdir)/src/DBus/org.usbguard.policy $(DESTDIR)$(POLKIT_POLICY_DIR) uninstall-polkit-policy: rm -f $(DESTDIR)$(POLKIT_POLICY_DIR)/org.usbguard.policy rmdir $(DESTDIR)$(POLKIT_POLICY_DIR) else install-polkit-policy: uninstall-polkit-policy: endif if SYSTEMD_SUPPORT_ENABLED install-systemd-dbus-service: $(top_builddir)/src/DBus/usbguard-dbus.service $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) && \ $(INSTALL_DATA) $(top_builddir)/src/DBus/usbguard-dbus.service $(DESTDIR)$(SYSTEMD_UNIT_DIR) uninstall-systemd-dbus-service: rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-dbus.service rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) else install-systemd-dbus-service: uninstall-systemd-dbus-service: endif else install-data-dbus: uninstall-data-dbus: endif #DBUS_ENABLED # # Qt GUI # usbguard_applet_qt_TRANSLATIONS=\ src/GUI.Qt/translations/cs_CZ.ts \ src/GUI.Qt/translations/es_AR.ts usbguard_applet_qt_UIHEADERS=\ src/GUI.Qt/DeviceDialog.ui.h \ src/GUI.Qt/MainWindow.ui.h usbguard_applet_qt_RESOURCES=\ src/GUI.Qt/resources/usbguard-icon.svg \ src/GUI.Qt/resources/usbguard-icon-warning.svg \ src/GUI.Qt/resources/usbguard-icon-inactive.svg usbguard_applet_qt_SOURCES_BASE=\ src/GUI.Qt/main.cpp \ src/GUI.Qt/DeviceDialog.cpp \ src/GUI.Qt/DeviceDialog.h \ src/GUI.Qt/MainWindow.cpp \ src/GUI.Qt/MainWindow.h \ src/GUI.Qt/DeviceModel.cpp \ src/GUI.Qt/DeviceModel.h \ src/GUI.Qt/SessionBlocker.cpp \ src/GUI.Qt/SessionBlocker.h \ src/GUI.Qt/TargetDelegate.cpp \ src/GUI.Qt/TargetDelegate.h EXTRA_DIST+=\ src/GUI.Qt/DeviceDialog.ui \ src/GUI.Qt/MainWindow.ui \ src/GUI.Qt/usbguard-applet-qt.desktop.in \ $(usbguard_applet_qt_RESOURCES) \ $(usbguard_applet_qt_SOURCES_BASE) \ $(usbguard_applet_qt_TRANSLATIONS) if GUI_QT_ENABLED bin_PROGRAMS+= usbguard-applet-qt desktopdir = $(datadir)/applications desktop_DATA = $(top_builddir)/src/GUI.Qt/usbguard-applet-qt.desktop appicondir = $(datadir)/icons/hicolor/scalable/apps appicon_DATA = src/GUI.Qt/resources/usbguard-icon.svg man1_MANS +=\ $(top_builddir)/doc/man/usbguard-applet-qt.1 BUILT_SOURCES+=\ $(usbguard_applet_qt_UIHEADERS) \ $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) \ src/GUI.Qt/usbguard.qrc CLEANFILES +=\ $(usbguard_applet_qt_UIHEADERS) \ $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) \ $(top_builddir)/src/GUI.Qt/DeviceDialog.moc.cpp \ $(top_builddir)/src/GUI.Qt/MainWindow.moc.cpp \ $(top_builddir)/src/GUI.Qt/usbguard.qrc.cpp \ $(top_builddir)/src/GUI.Qt/usbguard.qrc \ $(top_builddir)/src/GUI.Qt/DeviceModel.moc.cpp \ $(top_builddir)/src/GUI.Qt/SessionBlocker.moc.cpp \ $(top_builddir)/src/GUI.Qt/TargetDelegate.moc.cpp nodist_usbguard_applet_qt_SOURCES=\ $(usbguard_applet_qt_SOURCES_BASE) \ src/GUI.Qt/DeviceDialog.moc.cpp \ src/GUI.Qt/MainWindow.moc.cpp \ src/GUI.Qt/usbguard.qrc.cpp \ src/GUI.Qt/DeviceModel.moc.cpp \ src/GUI.Qt/SessionBlocker.moc.cpp \ src/GUI.Qt/TargetDelegate.moc.cpp usbguard_applet_qt_LDADD=\ $(top_builddir)/libusbguard.la \ @qt_LIBS@ usbguard_applet_qt_CPPFLAGS=\ -fPIE -fPIC \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/GUI.Qt \ -I$(top_builddir)/src/GUI.Qt \ @qt_CFLAGS@ %.qm: %.ts $(MKDIR_P) "$(top_builddir)/$(shell dirname $@)" @QTLRELEASE@ "$<" -qm "$@" %.moc.cpp: %.h @QTMOC@ -f"$(shell basename $<)" -I$(top_srcdir)/src/GUI.Qt -o$(top_builddir)/$@ $(DEFS) $(DEFAULT_INCLUDES) $(MOC_CPPFLAGS) $< %.ui.h: %.ui @QTUIC@ -g cpp -o $(top_builddir)/$@ $< # Workaround for older Qt generated code addressing: #``` # src/GUI.Qt/usbguard.qrc.cpp: In function ‘int qInitResources()’: # src/GUI.Qt/usbguard.qrc.cpp:2171:25: error: no previous declaration for # ‘int qInitResources()’ [-Werror=missing-declarations] # int QT_MANGLE_NAMESPACE(qInitResources)() #``` %.qrc.$(OBJEXT) : CXXFLAGS += -Wno-missing-declarations %.qrc.cpp: %.qrc @QTRCC@ -o $(top_builddir)/$@ $< %.qrc: $(usbguard_applet_qt_RESOURCES) $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) echo '' > "$@.tmp" echo '' >> "$@.tmp" for file in $(usbguard_applet_qt_RESOURCES); do \ base=$$(basename $$file); \ echo "$(abs_top_srcdir)/$$file" >> "$@.tmp"; \ done echo '' >> "$@.tmp" echo '' >> "$@.tmp" for file in $(usbguard_applet_qt_TRANSLATIONS); do \ base=$$(basename -s .ts $$file); \ echo "$(abs_top_builddir)/src/GUI.Qt/translations/$$base.qm" >> "$@.tmp"; \ done echo '' >> "$@.tmp" echo '' >> "$@.tmp" mv "$@.tmp" "$@" endif $(DIST_ARCHIVES): test -f "$@" || $(MAKE) dist release-files: $(DIST_ARCHIVES) $(eval RELEASE_DIR:="release.$(PACKAGE)-$(VERSION)") $(eval GPG:=$(shell test -n "$$QUBES_GPG_DOMAIN" && echo qubes-gpg-client || echo gpg2)) $(MKDIR_P) $(RELEASE_DIR) cp $(DIST_ARCHIVES) $(RELEASE_DIR) cd $(RELEASE_DIR) && $(GPG) -b -a -o - $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sig cd $(RELEASE_DIR) && openssl sha256 $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sum analyze-clang: $(eval ANALYSIS_ROOT:=$(shell mktemp -d -t usbguard-analyze-clang.XXXXXX)) $(eval JOBS:=$(shell grep -c '^processor' /proc/cpuinfo 2> /dev/null || echo 1)) cd "$(ANALYSIS_ROOT)" && scan-build $(abs_top_srcdir)/configure $(ANALYZE_CONFIGURE_ARGS) cd "$(ANALYSIS_ROOT)" && scan-build \ --status-bugs -maxloop 8 -disable-checker deadcode.DeadStores -o "$(abs_top_builddir)" \ make -j$(JOBS) rm -rf "$(ANALYSIS_ROOT)" # # overriding 'check' target to enable "make check" to perform build as well # check: all $(MAKE) $(AM_MAKEFLAGS) check-recursive usbguard-0.7.2+ds/Makefile.in000066400000000000000000010070331325273707200160170ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ @SYSTEMD_SUPPORT_ENABLED_TRUE@am__append_1 = \ @SYSTEMD_SUPPORT_ENABLED_TRUE@ $(top_builddir)/usbguard.service sbin_PROGRAMS = usbguard-daemon$(EXEEXT) $(am__EXEEXT_2) bin_PROGRAMS = usbguard$(EXEEXT) usbguard-rule-parser$(EXEEXT) \ $(am__EXEEXT_1) # # DBus Bridge # @DBUS_ENABLED_TRUE@am__append_2 = usbguard-dbus @DBUS_ENABLED_TRUE@am__append_3 = \ @DBUS_ENABLED_TRUE@ $(top_builddir)/doc/man/usbguard-dbus.8 @DBUS_ENABLED_TRUE@am__append_4 = \ @DBUS_ENABLED_TRUE@ src/DBus/DBusInterface.xml.cstr \ @DBUS_ENABLED_TRUE@ src/DBus/org.usbguard.service \ @DBUS_ENABLED_TRUE@ src/DBus/usbguard-dbus.service @DBUS_ENABLED_TRUE@am__append_5 = \ @DBUS_ENABLED_TRUE@ src/DBus/org.usbguard.conf \ @DBUS_ENABLED_TRUE@ src/DBus/org.usbguard.service.in \ @DBUS_ENABLED_TRUE@ src/DBus/usbguard-dbus.service.in \ @DBUS_ENABLED_TRUE@ src/DBus/org.usbguard.policy \ @DBUS_ENABLED_TRUE@ src/DBus/DBusInterface.xml @DBUS_ENABLED_TRUE@am__append_6 = \ @DBUS_ENABLED_TRUE@ $(top_builddir)/src/DBus/org.usbguard.service \ @DBUS_ENABLED_TRUE@ $(top_builddir)/src/DBus/usbguard-dbus.service \ @DBUS_ENABLED_TRUE@ $(top_builddir)/src/DBus/DBusInterface.xml.cstr @GUI_QT_ENABLED_TRUE@am__append_7 = usbguard-applet-qt @GUI_QT_ENABLED_TRUE@am__append_8 = \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/doc/man/usbguard-applet-qt.1 @GUI_QT_ENABLED_TRUE@am__append_9 = \ @GUI_QT_ENABLED_TRUE@ $(usbguard_applet_qt_UIHEADERS) \ @GUI_QT_ENABLED_TRUE@ $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard.qrc @GUI_QT_ENABLED_TRUE@am__append_10 = \ @GUI_QT_ENABLED_TRUE@ $(usbguard_applet_qt_UIHEADERS) \ @GUI_QT_ENABLED_TRUE@ $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/DeviceDialog.moc.cpp \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/MainWindow.moc.cpp \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/usbguard.qrc.cpp \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/usbguard.qrc \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/DeviceModel.moc.cpp \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/SessionBlocker.moc.cpp \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/src/GUI.Qt/TargetDelegate.moc.cpp subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/libgcrypt.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_bashcompletion_DATA_DIST) \ $(pkginclude_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/build-config.h.in CONFIG_CLEAN_FILES = libusbguard.pc \ src/GUI.Qt/usbguard-applet-qt.desktop CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(appicondir)" "$(DESTDIR)$(desktopdir)" \ "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libusbguard_la_DEPENDENCIES = am__dirstamp = $(am__leading_dot)dirstamp am_libusbguard_la_OBJECTS = src/Common/libusbguard_la-Utility.lo \ src/Library/libusbguard_la-AllowedMatchesCondition.lo \ src/Library/libusbguard_la-Base64.lo \ src/Library/libusbguard_la-ConfigFilePrivate.lo \ src/Library/libusbguard_la-DeviceManagerPrivate.lo \ src/Library/libusbguard_la-DevicePrivate.lo \ src/Library/libusbguard_la-FixedStateCondition.lo \ src/Library/libusbguard_la-Hash.lo \ src/Library/libusbguard_la-IPCClientPrivate.lo \ src/Library/libusbguard_la-IPCPrivate.lo \ src/Library/libusbguard_la-IPCServerPrivate.lo \ src/Library/libusbguard_la-Init.lo \ src/Library/libusbguard_la-KeyValueParser.lo \ src/Library/libusbguard_la-LocaltimeCondition.lo \ src/Library/libusbguard_la-RandomStateCondition.lo \ src/Library/libusbguard_la-RuleAppliedCondition.lo \ src/Library/libusbguard_la-RuleEvaluatedCondition.lo \ src/Library/libusbguard_la-RulePrivate.lo \ src/Library/libusbguard_la-RuleSetPrivate.lo \ src/Library/libusbguard_la-SysFSDevice.lo \ src/Library/libusbguard_la-UEvent.lo \ src/Library/libusbguard_la-UEventDeviceManager.lo \ src/Library/libusbguard_la-UEventParser.lo \ src/Library/libusbguard_la-Utility.lo \ src/Library/public/usbguard/libusbguard_la-Audit.lo \ src/Library/public/usbguard/libusbguard_la-ConfigFile.lo \ src/Library/public/usbguard/libusbguard_la-Device.lo \ src/Library/public/usbguard/libusbguard_la-DeviceManager.lo \ src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo \ src/Library/public/usbguard/libusbguard_la-IPCClient.lo \ src/Library/public/usbguard/libusbguard_la-IPCServer.lo \ src/Library/public/usbguard/libusbguard_la-Logger.lo \ src/Library/public/usbguard/libusbguard_la-Policy.lo \ src/Library/public/usbguard/libusbguard_la-Rule.lo \ src/Library/public/usbguard/libusbguard_la-RuleCondition.lo \ src/Library/public/usbguard/libusbguard_la-RuleParser.lo \ src/Library/public/usbguard/libusbguard_la-RuleSet.lo \ src/Library/public/usbguard/libusbguard_la-Typedefs.lo \ src/Library/public/usbguard/libusbguard_la-USB.lo \ src/Library/public/usbguard/libusbguard_la-USBGuard.lo nodist_libusbguard_la_OBJECTS = \ src/Library/IPC/libusbguard_la-Message.pb.lo \ src/Library/IPC/libusbguard_la-Rule.pb.lo \ src/Library/IPC/libusbguard_la-Devices.pb.lo \ src/Library/IPC/libusbguard_la-Exception.pb.lo \ src/Library/IPC/libusbguard_la-Policy.pb.lo \ src/Library/IPC/libusbguard_la-Parameter.pb.lo libusbguard_la_OBJECTS = $(am_libusbguard_la_OBJECTS) \ $(nodist_libusbguard_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 = libusbguard_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libusbguard_la_LDFLAGS) \ $(LDFLAGS) -o $@ @GUI_QT_ENABLED_TRUE@am__EXEEXT_1 = usbguard-applet-qt$(EXEEXT) @DBUS_ENABLED_TRUE@am__EXEEXT_2 = usbguard-dbus$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_usbguard_OBJECTS = src/CLI/usbguard-usbguard.$(OBJEXT) \ src/CLI/usbguard-usbguard-list-devices.$(OBJEXT) \ src/CLI/usbguard-usbguard-allow-device.$(OBJEXT) \ src/CLI/usbguard-usbguard-block-device.$(OBJEXT) \ src/CLI/usbguard-usbguard-reject-device.$(OBJEXT) \ src/CLI/usbguard-usbguard-list-rules.$(OBJEXT) \ src/CLI/usbguard-usbguard-append-rule.$(OBJEXT) \ src/CLI/usbguard-usbguard-remove-rule.$(OBJEXT) \ src/CLI/usbguard-usbguard-generate-policy.$(OBJEXT) \ src/CLI/usbguard-usbguard-watch.$(OBJEXT) \ src/CLI/usbguard-IPCSignalWatcher.$(OBJEXT) \ src/CLI/usbguard-PolicyGenerator.$(OBJEXT) \ src/CLI/usbguard-usbguard-read-descriptor.$(OBJEXT) \ src/CLI/usbguard-usbguard-set-parameter.$(OBJEXT) \ src/CLI/usbguard-usbguard-get-parameter.$(OBJEXT) \ src/CLI/usbguard-usbguard-add-user.$(OBJEXT) \ src/CLI/usbguard-usbguard-remove-user.$(OBJEXT) usbguard_OBJECTS = $(am_usbguard_OBJECTS) usbguard_DEPENDENCIES = $(top_builddir)/libusbguard.la am__objects_1 = src/GUI.Qt/usbguard_applet_qt-main.$(OBJEXT) \ src/GUI.Qt/usbguard_applet_qt-DeviceDialog.$(OBJEXT) \ src/GUI.Qt/usbguard_applet_qt-MainWindow.$(OBJEXT) \ src/GUI.Qt/usbguard_applet_qt-DeviceModel.$(OBJEXT) \ src/GUI.Qt/usbguard_applet_qt-SessionBlocker.$(OBJEXT) \ src/GUI.Qt/usbguard_applet_qt-TargetDelegate.$(OBJEXT) @GUI_QT_ENABLED_TRUE@nodist_usbguard_applet_qt_OBJECTS = \ @GUI_QT_ENABLED_TRUE@ $(am__objects_1) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.$(OBJEXT) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.$(OBJEXT) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.$(OBJEXT) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.$(OBJEXT) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.$(OBJEXT) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.$(OBJEXT) usbguard_applet_qt_OBJECTS = $(nodist_usbguard_applet_qt_OBJECTS) @GUI_QT_ENABLED_TRUE@usbguard_applet_qt_DEPENDENCIES = \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/libusbguard.la am_usbguard_daemon_OBJECTS = \ src/Daemon/usbguard_daemon-Daemon.$(OBJEXT) \ src/Daemon/usbguard_daemon-main.$(OBJEXT) \ src/Daemon/usbguard_daemon-Seccomp.$(OBJEXT) \ src/Common/usbguard_daemon-Utility.$(OBJEXT) \ src/Daemon/usbguard_daemon-FileAuditBackend.$(OBJEXT) \ src/Daemon/usbguard_daemon-LinuxAuditBackend.$(OBJEXT) usbguard_daemon_OBJECTS = $(am_usbguard_daemon_OBJECTS) usbguard_daemon_DEPENDENCIES = $(top_builddir)/libusbguard.la am__usbguard_dbus_SOURCES_DIST = src/DBus/gdbus-server.cpp \ src/DBus/DBusBridge.cpp src/DBus/DBusBridge.hpp @DBUS_ENABLED_TRUE@am_usbguard_dbus_OBJECTS = src/DBus/usbguard_dbus-gdbus-server.$(OBJEXT) \ @DBUS_ENABLED_TRUE@ src/DBus/usbguard_dbus-DBusBridge.$(OBJEXT) usbguard_dbus_OBJECTS = $(am_usbguard_dbus_OBJECTS) @DBUS_ENABLED_TRUE@usbguard_dbus_DEPENDENCIES = \ @DBUS_ENABLED_TRUE@ $(top_builddir)/libusbguard.la am_usbguard_rule_parser_OBJECTS = \ src/CLI/usbguard_rule_parser-usbguard-rule-parser.$(OBJEXT) usbguard_rule_parser_OBJECTS = $(am_usbguard_rule_parser_OBJECTS) usbguard_rule_parser_DEPENDENCIES = $(top_builddir)/libusbguard.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)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles 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 = 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 = $(libusbguard_la_SOURCES) $(nodist_libusbguard_la_SOURCES) \ $(usbguard_SOURCES) $(nodist_usbguard_applet_qt_SOURCES) \ $(usbguard_daemon_SOURCES) $(usbguard_dbus_SOURCES) \ $(usbguard_rule_parser_SOURCES) DIST_SOURCES = $(libusbguard_la_SOURCES) $(usbguard_SOURCES) \ $(usbguard_daemon_SOURCES) $(am__usbguard_dbus_SOURCES_DIST) \ $(usbguard_rule_parser_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 man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man5_MANS) $(man8_MANS) am__dist_bashcompletion_DATA_DIST = \ $(top_srcdir)/scripts/bash_completion/usbguard DATA = $(appicon_DATA) $(desktop_DATA) $(dist_bashcompletion_DATA) \ $(pkgconfig_DATA) HEADERS = $(pkginclude_HEADERS) 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 dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libusbguard.pc.in \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing \ $(top_srcdir)/src/GUI.Qt/usbguard-applet-qt.desktop.in \ $(top_srcdir)/src/build-config.h.in.in config/compile \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/ltmain.sh config/missing 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 GZIP_ENV = --best DIST_TARGETS = dist-gzip am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ ANALYZE_CONFIGURE_ARGS = @ANALYZE_CONFIGURE_ARGS@ AR = @AR@ ASCIIDOCTOR = @ASCIIDOCTOR@ ASPELL = @ASPELL@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BUSCONFIG_DIR = @DBUS_BUSCONFIG_DIR@ DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GDBUS_CODEGEN = @GDBUS_CODEGEN@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLKIT_POLICY_DIR = @POLKIT_POLICY_DIR@ PROTOC = @PROTOC@ QT4LRELEASE = @QT4LRELEASE@ QT4MOC = @QT4MOC@ QT4RCC = @QT4RCC@ QT4UIC = @QT4UIC@ QT5LRELEASE = @QT5LRELEASE@ QT5MOC = @QT5MOC@ QT5RCC = @QT5RCC@ QT5UIC = @QT5UIC@ QTLRELEASE = @QTLRELEASE@ QTMOC = @QTMOC@ QTRCC = @QTRCC@ QTUIC = @QTUIC@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@ VERSION = @VERSION@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ atomic_LIBS = @atomic_LIBS@ audit_CFLAGS = @audit_CFLAGS@ audit_LIBS = @audit_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ catch_CFLAGS = @catch_CFLAGS@ catch_LIBS = @catch_LIBS@ crypto_CFLAGS = @crypto_CFLAGS@ crypto_LIBS = @crypto_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dbus_CFLAGS = @dbus_CFLAGS@ dbus_LIBS = @dbus_LIBS@ 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@ libcapng_CFLAGS = @libcapng_CFLAGS@ libcapng_LIBS = @libcapng_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pegtl_AC_CFLAGS = @pegtl_AC_CFLAGS@ pegtl_CFLAGS = @pegtl_CFLAGS@ pegtl_LIBS = @pegtl_LIBS@ polkit_CFLAGS = @polkit_CFLAGS@ polkit_LIBS = @polkit_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ protobuf_CFLAGS = @protobuf_CFLAGS@ protobuf_LIBS = @protobuf_LIBS@ psdir = @psdir@ qb_CFLAGS = @qb_CFLAGS@ qb_LIBS = @qb_LIBS@ qt4_CFLAGS = @qt4_CFLAGS@ qt4_LIBS = @qt4_LIBS@ qt5_CFLAGS = @qt5_CFLAGS@ qt5_LIBS = @qt5_LIBS@ qt_CFLAGS = @qt_CFLAGS@ qt_LIBS = @qt_LIBS@ sbindir = @sbindir@ seccomp_CFLAGS = @seccomp_CFLAGS@ seccomp_LIBS = @seccomp_LIBS@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src/Tests/ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = LICENSE usbguard-daemon.conf.in usbguard.service.in \ VERSION CHANGELOG.md src/astylerc \ scripts/usbguard-zsh-completion scripts/modeline.vim \ scripts/astyle.sh scripts/reformat-sources.sh \ scripts/usb-descriptor-collect.sh $(man_ADOC_FILES) \ src/Library/IPC/Devices.proto src/Library/IPC/Exception.proto \ src/Library/IPC/Message.proto src/Library/IPC/Policy.proto \ src/Library/IPC/Rule.proto src/Library/IPC/Parameter.proto \ README.adoc src/ThirdParty/Catch src/ThirdParty/PEGTL \ $(am__append_5) src/GUI.Qt/DeviceDialog.ui \ src/GUI.Qt/MainWindow.ui \ src/GUI.Qt/usbguard-applet-qt.desktop.in \ $(usbguard_applet_qt_RESOURCES) \ $(usbguard_applet_qt_SOURCES_BASE) \ $(usbguard_applet_qt_TRANSLATIONS) BUILT_SOURCES = src/build-config.h $(man_ROFF_FILES) \ $(nodist_libusbguard_la_SOURCES) $(am__append_4) \ $(am__append_9) DISTCLEANFILES = \ $(BUILT_SOURCES) CLEANFILES = $(man_ROFF_FILES) $(man_ROFF_FILES:.roff=) \ $(top_builddir)/usbguard-daemon.conf $(am__append_1) \ $(nodist_libusbguard_la_SOURCES) $(am__append_6) \ $(am__append_10) man_ADOC_FILES = \ doc/man/usbguard.1.adoc \ doc/man/usbguard-dbus.8.adoc \ doc/man/usbguard-applet-qt.1.adoc \ doc/man/usbguard-daemon.8.adoc \ doc/man/usbguard-daemon.conf.5.adoc \ doc/man/usbguard-rules.conf.5.adoc man_ROFF_FILES = \ $(man_ADOC_FILES:.adoc=.roff) usbguard_confdir = $(sysconfdir)/usbguard distuninstallcheck_listfiles = find . -type f ! -name rules.conf -print man8_MANS = $(top_builddir)/doc/man/usbguard-daemon.8 $(am__append_3) man5_MANS = \ $(top_builddir)/doc/man/usbguard-daemon.conf.5 \ $(top_builddir)/doc/man/usbguard-rules.conf.5 man1_MANS = $(top_builddir)/doc/man/usbguard.1 $(am__append_8) AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/Library/public pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libusbguard.pc lib_LTLIBRARIES = \ libusbguard.la libusbguard_la_CPPFLAGS = \ -fPIC \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/Library \ -I$(top_srcdir)/src/Library/public \ -I$(top_builddir)/src/Library/IPC \ @qb_CFLAGS@ \ @protobuf_CFLAGS@ \ @crypto_CFLAGS@ \ @pegtl_CFLAGS@ libusbguard_la_LDFLAGS = \ -no-undefined \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) libusbguard_la_LIBADD = \ @qb_LIBS@ \ @protobuf_LIBS@ \ @crypto_LIBS@ \ @pegtl_LIBS@ \ @atomic_LIBS@ nodist_libusbguard_la_SOURCES = \ src/Library/IPC/Message.pb.cc \ src/Library/IPC/Message.pb.h \ src/Library/IPC/Rule.pb.cc \ src/Library/IPC/Rule.pb.h \ src/Library/IPC/Devices.pb.cc \ src/Library/IPC/Devices.pb.h \ src/Library/IPC/Exception.pb.cc \ src/Library/IPC/Exception.pb.h \ src/Library/IPC/Policy.pb.cc \ src/Library/IPC/Policy.pb.h \ src/Library/IPC/Parameter.pb.cc \ src/Library/IPC/Parameter.pb.h libusbguard_la_SOURCES = \ src/Common/ByteOrder.hpp \ src/Common/FDInputStream.hpp \ src/Common/Thread.hpp \ src/Common/Utility.cpp \ src/Common/Utility.hpp \ src/Library/AllowedMatchesCondition.cpp \ src/Library/AllowedMatchesCondition.hpp \ src/Library/Base64.cpp \ src/Library/Base64.hpp \ src/Library/ConfigFilePrivate.cpp \ src/Library/ConfigFilePrivate.hpp \ src/Library/DeviceManagerPrivate.cpp \ src/Library/DeviceManagerPrivate.hpp \ src/Library/DevicePrivate.cpp \ src/Library/DevicePrivate.hpp \ src/Library/FixedStateCondition.cpp \ src/Library/FixedStateCondition.hpp \ src/Library/Hash.cpp \ src/Library/Hash.hpp \ src/Library/IPCClientPrivate.cpp \ src/Library/IPCClientPrivate.hpp \ src/Library/IPCPrivate.cpp \ src/Library/IPCPrivate.hpp \ src/Library/IPCServerPrivate.cpp \ src/Library/IPCServerPrivate.hpp \ src/Library/Init.cpp \ src/Library/KeyValueParser.cpp \ src/Library/KeyValueParser.hpp \ src/Library/LocaltimeCondition.cpp \ src/Library/LocaltimeCondition.hpp \ src/Library/RandomStateCondition.cpp \ src/Library/RandomStateCondition.hpp \ src/Library/RuleAppliedCondition.cpp \ src/Library/RuleAppliedCondition.hpp \ src/Library/RuleEvaluatedCondition.cpp \ src/Library/RuleEvaluatedCondition.hpp \ src/Library/RuleParser/Actions.hpp \ src/Library/RuleParser/Grammar.hpp \ src/Library/RulePrivate.cpp \ src/Library/RulePrivate.hpp \ src/Library/RuleSetPrivate.cpp \ src/Library/RuleSetPrivate.hpp \ src/Library/SysFSDevice.cpp \ src/Library/SysFSDevice.hpp \ src/Library/UEvent.cpp \ src/Library/UEvent.hpp \ src/Library/UEventDeviceManager.cpp \ src/Library/UEventDeviceManager.hpp \ src/Library/UEventParser.cpp \ src/Library/UEventParser.hpp \ src/Library/Utility.cpp \ src/Library/Utility.hpp \ src/Library/public/usbguard/Audit.cpp \ src/Library/public/usbguard/Audit.hpp \ src/Library/public/usbguard/ConfigFile.cpp \ src/Library/public/usbguard/Device.cpp \ src/Library/public/usbguard/DeviceManager.cpp \ src/Library/public/usbguard/DeviceManagerHooks.cpp \ src/Library/public/usbguard/IPCClient.cpp \ src/Library/public/usbguard/IPCServer.cpp \ src/Library/public/usbguard/Logger.cpp \ src/Library/public/usbguard/Policy.cpp \ src/Library/public/usbguard/Rule.cpp \ src/Library/public/usbguard/RuleCondition.cpp \ src/Library/public/usbguard/RuleParser.cpp \ src/Library/public/usbguard/RuleParser.hpp \ src/Library/public/usbguard/RuleSet.cpp \ src/Library/public/usbguard/Typedefs.cpp \ src/Library/public/usbguard/USB.cpp \ src/Library/public/usbguard/USBGuard.cpp pkginclude_HEADERS = \ src/Library/public/usbguard/Audit.hpp \ src/Library/public/usbguard/ConfigFile.hpp \ src/Library/public/usbguard/Device.hpp \ src/Library/public/usbguard/DeviceManager.hpp \ src/Library/public/usbguard/DeviceManagerHooks.hpp \ src/Library/public/usbguard/Exception.hpp \ src/Library/public/usbguard/IPCClient.hpp \ src/Library/public/usbguard/IPCServer.hpp \ src/Library/public/usbguard/Interface.hpp \ src/Library/public/usbguard/Logger.hpp \ src/Library/public/usbguard/Policy.hpp \ src/Library/public/usbguard/Predicates.hpp \ src/Library/public/usbguard/Rule.hpp \ src/Library/public/usbguard/RuleCondition.hpp \ src/Library/public/usbguard/RuleSet.hpp \ src/Library/public/usbguard/Typedefs.hpp \ src/Library/public/usbguard/USB.hpp \ src/Library/public/usbguard/USBGuard.hpp usbguard_daemon_SOURCES = \ src/Daemon/Daemon.cpp \ src/Daemon/Daemon.hpp \ src/Daemon/main.cpp \ src/Daemon/Seccomp.c \ src/Daemon/Seccomp.h \ src/Common/Utility.hpp \ src/Common/Utility.cpp \ src/Daemon/FileAuditBackend.hpp \ src/Daemon/FileAuditBackend.cpp \ src/Daemon/LinuxAuditBackend.hpp \ src/Daemon/LinuxAuditBackend.cpp usbguard_daemon_CPPFLAGS = \ -fPIE \ $(AM_CPPFLAGS) \ @seccomp_CFLAGS@ \ @libcapng_CFLAGS@ \ @audit_CFLAGS@ usbguard_daemon_LDADD = \ $(top_builddir)/libusbguard.la \ @seccomp_LIBS@ \ @libcapng_LIBS@ \ @audit_LIBS@ usbguard_SOURCES = \ src/CLI/usbguard.cpp \ src/CLI/usbguard.hpp \ src/CLI/usbguard-list-devices.hpp \ src/CLI/usbguard-list-devices.cpp \ src/CLI/usbguard-allow-device.hpp \ src/CLI/usbguard-allow-device.cpp \ src/CLI/usbguard-block-device.hpp \ src/CLI/usbguard-block-device.cpp \ src/CLI/usbguard-reject-device.hpp \ src/CLI/usbguard-reject-device.cpp \ src/CLI/usbguard-list-rules.hpp \ src/CLI/usbguard-list-rules.cpp \ src/CLI/usbguard-append-rule.hpp \ src/CLI/usbguard-append-rule.cpp \ src/CLI/usbguard-remove-rule.hpp \ src/CLI/usbguard-remove-rule.cpp \ src/CLI/usbguard-generate-policy.cpp \ src/CLI/usbguard-generate-policy.hpp \ src/CLI/usbguard-watch.hpp \ src/CLI/usbguard-watch.cpp \ src/CLI/IPCSignalWatcher.hpp \ src/CLI/IPCSignalWatcher.cpp \ src/CLI/PolicyGenerator.hpp \ src/CLI/PolicyGenerator.cpp \ src/CLI/usbguard-read-descriptor.hpp \ src/CLI/usbguard-read-descriptor.cpp \ src/CLI/usbguard-set-parameter.hpp \ src/CLI/usbguard-set-parameter.cpp \ src/CLI/usbguard-get-parameter.hpp \ src/CLI/usbguard-get-parameter.cpp \ src/CLI/usbguard-add-user.cpp \ src/CLI/usbguard-add-user.hpp \ src/CLI/usbguard-remove-user.cpp \ src/CLI/usbguard-remove-user.hpp usbguard_CPPFLAGS = \ -fPIE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/CLI usbguard_LDADD = \ $(top_builddir)/libusbguard.la @BASH_COMPLETION_ENABLED_TRUE@bashcompletiondir = $(BASH_COMPLETION_DIR) @BASH_COMPLETION_ENABLED_TRUE@dist_bashcompletion_DATA = $(top_srcdir)/scripts/bash_completion/usbguard usbguard_rule_parser_SOURCES = \ src/CLI/usbguard-rule-parser.cpp usbguard_rule_parser_CPPFLAGS = \ -fPIE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/CLI usbguard_rule_parser_LDADD = \ $(top_builddir)/libusbguard.la @DBUS_ENABLED_TRUE@usbguard_dbus_SOURCES = \ @DBUS_ENABLED_TRUE@ src/DBus/gdbus-server.cpp \ @DBUS_ENABLED_TRUE@ src/DBus/DBusBridge.cpp \ @DBUS_ENABLED_TRUE@ src/DBus/DBusBridge.hpp @DBUS_ENABLED_TRUE@usbguard_dbus_CPPFLAGS = \ @DBUS_ENABLED_TRUE@ -fPIE \ @DBUS_ENABLED_TRUE@ $(AM_CPPFLAGS) \ @DBUS_ENABLED_TRUE@ -I$(top_builddir)/src/DBus \ @DBUS_ENABLED_TRUE@ @dbus_CFLAGS@ @DBUS_ENABLED_TRUE@usbguard_dbus_LDADD = \ @DBUS_ENABLED_TRUE@ $(top_builddir)/libusbguard.la \ @DBUS_ENABLED_TRUE@ @dbus_LIBS@ # # Qt GUI # usbguard_applet_qt_TRANSLATIONS = \ src/GUI.Qt/translations/cs_CZ.ts \ src/GUI.Qt/translations/es_AR.ts usbguard_applet_qt_UIHEADERS = \ src/GUI.Qt/DeviceDialog.ui.h \ src/GUI.Qt/MainWindow.ui.h usbguard_applet_qt_RESOURCES = \ src/GUI.Qt/resources/usbguard-icon.svg \ src/GUI.Qt/resources/usbguard-icon-warning.svg \ src/GUI.Qt/resources/usbguard-icon-inactive.svg usbguard_applet_qt_SOURCES_BASE = \ src/GUI.Qt/main.cpp \ src/GUI.Qt/DeviceDialog.cpp \ src/GUI.Qt/DeviceDialog.h \ src/GUI.Qt/MainWindow.cpp \ src/GUI.Qt/MainWindow.h \ src/GUI.Qt/DeviceModel.cpp \ src/GUI.Qt/DeviceModel.h \ src/GUI.Qt/SessionBlocker.cpp \ src/GUI.Qt/SessionBlocker.h \ src/GUI.Qt/TargetDelegate.cpp \ src/GUI.Qt/TargetDelegate.h @GUI_QT_ENABLED_TRUE@desktopdir = $(datadir)/applications @GUI_QT_ENABLED_TRUE@desktop_DATA = $(top_builddir)/src/GUI.Qt/usbguard-applet-qt.desktop @GUI_QT_ENABLED_TRUE@appicondir = $(datadir)/icons/hicolor/scalable/apps @GUI_QT_ENABLED_TRUE@appicon_DATA = src/GUI.Qt/resources/usbguard-icon.svg @GUI_QT_ENABLED_TRUE@nodist_usbguard_applet_qt_SOURCES = \ @GUI_QT_ENABLED_TRUE@ $(usbguard_applet_qt_SOURCES_BASE) \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/DeviceDialog.moc.cpp \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/MainWindow.moc.cpp \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/usbguard.qrc.cpp \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/DeviceModel.moc.cpp \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/SessionBlocker.moc.cpp \ @GUI_QT_ENABLED_TRUE@ src/GUI.Qt/TargetDelegate.moc.cpp @GUI_QT_ENABLED_TRUE@usbguard_applet_qt_LDADD = \ @GUI_QT_ENABLED_TRUE@ $(top_builddir)/libusbguard.la \ @GUI_QT_ENABLED_TRUE@ @qt_LIBS@ @GUI_QT_ENABLED_TRUE@usbguard_applet_qt_CPPFLAGS = \ @GUI_QT_ENABLED_TRUE@ -fPIE -fPIC \ @GUI_QT_ENABLED_TRUE@ $(AM_CPPFLAGS) \ @GUI_QT_ENABLED_TRUE@ -I$(top_srcdir)/src/GUI.Qt \ @GUI_QT_ENABLED_TRUE@ -I$(top_builddir)/src/GUI.Qt \ @GUI_QT_ENABLED_TRUE@ @qt_CFLAGS@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .cc .cpp .lo .o .obj 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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/build-config.h.in: src/stamp-h1 @test -f $@ || rm -f src/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 src/stamp-h1: $(top_srcdir)/src/build-config.h.in.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/build-config.h.in $(top_srcdir)/src/build-config.h.in.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/build-config.h.in src/stamp-h1 libusbguard.pc: $(top_builddir)/config.status $(srcdir)/libusbguard.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ src/GUI.Qt/usbguard-applet-qt.desktop: $(top_builddir)/config.status $(top_srcdir)/src/GUI.Qt/usbguard-applet-qt.desktop.in cd $(top_builddir) && $(SHELL) ./config.status $@ 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}; \ } src/Common/$(am__dirstamp): @$(MKDIR_P) src/Common @: > src/Common/$(am__dirstamp) src/Common/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/Common/$(DEPDIR) @: > src/Common/$(DEPDIR)/$(am__dirstamp) src/Common/libusbguard_la-Utility.lo: src/Common/$(am__dirstamp) \ src/Common/$(DEPDIR)/$(am__dirstamp) src/Library/$(am__dirstamp): @$(MKDIR_P) src/Library @: > src/Library/$(am__dirstamp) src/Library/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/Library/$(DEPDIR) @: > src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-AllowedMatchesCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-Base64.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-ConfigFilePrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-DeviceManagerPrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-DevicePrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-FixedStateCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-Hash.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-IPCClientPrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-IPCPrivate.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-IPCServerPrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-Init.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-KeyValueParser.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-LocaltimeCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-RandomStateCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-RuleAppliedCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-RuleEvaluatedCondition.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-RulePrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-RuleSetPrivate.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-SysFSDevice.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-UEvent.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-UEventDeviceManager.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-UEventParser.lo: \ src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/libusbguard_la-Utility.lo: src/Library/$(am__dirstamp) \ src/Library/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/$(am__dirstamp): @$(MKDIR_P) src/Library/public/usbguard @: > src/Library/public/usbguard/$(am__dirstamp) src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/Library/public/usbguard/$(DEPDIR) @: > src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Audit.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-ConfigFile.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Device.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-DeviceManager.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-IPCClient.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-IPCServer.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Logger.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Policy.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Rule.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-RuleCondition.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-RuleParser.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-RuleSet.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-Typedefs.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-USB.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/public/usbguard/libusbguard_la-USBGuard.lo: \ src/Library/public/usbguard/$(am__dirstamp) \ src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/$(am__dirstamp): @$(MKDIR_P) src/Library/IPC @: > src/Library/IPC/$(am__dirstamp) src/Library/IPC/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/Library/IPC/$(DEPDIR) @: > src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Message.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Rule.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Devices.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Exception.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Policy.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) src/Library/IPC/libusbguard_la-Parameter.pb.lo: \ src/Library/IPC/$(am__dirstamp) \ src/Library/IPC/$(DEPDIR)/$(am__dirstamp) libusbguard.la: $(libusbguard_la_OBJECTS) $(libusbguard_la_DEPENDENCIES) $(EXTRA_libusbguard_la_DEPENDENCIES) $(AM_V_CXXLD)$(libusbguard_la_LINK) -rpath $(libdir) $(libusbguard_la_OBJECTS) $(libusbguard_la_LIBADD) $(LIBS) 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 src/CLI/$(am__dirstamp): @$(MKDIR_P) src/CLI @: > src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/CLI/$(DEPDIR) @: > src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard.$(OBJEXT): src/CLI/$(am__dirstamp) \ src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-list-devices.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-allow-device.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-block-device.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-reject-device.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-list-rules.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-append-rule.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-remove-rule.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-generate-policy.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-watch.$(OBJEXT): src/CLI/$(am__dirstamp) \ src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-IPCSignalWatcher.$(OBJEXT): src/CLI/$(am__dirstamp) \ src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-PolicyGenerator.$(OBJEXT): src/CLI/$(am__dirstamp) \ src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-read-descriptor.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-set-parameter.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-get-parameter.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-add-user.$(OBJEXT): src/CLI/$(am__dirstamp) \ src/CLI/$(DEPDIR)/$(am__dirstamp) src/CLI/usbguard-usbguard-remove-user.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) usbguard$(EXEEXT): $(usbguard_OBJECTS) $(usbguard_DEPENDENCIES) $(EXTRA_usbguard_DEPENDENCIES) @rm -f usbguard$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(usbguard_OBJECTS) $(usbguard_LDADD) $(LIBS) src/GUI.Qt/$(am__dirstamp): @$(MKDIR_P) src/GUI.Qt @: > src/GUI.Qt/$(am__dirstamp) src/GUI.Qt/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/GUI.Qt/$(DEPDIR) @: > src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-main.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-DeviceDialog.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-MainWindow.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-DeviceModel.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-SessionBlocker.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-TargetDelegate.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.$(OBJEXT): \ src/GUI.Qt/$(am__dirstamp) \ src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) usbguard-applet-qt$(EXEEXT): $(usbguard_applet_qt_OBJECTS) $(usbguard_applet_qt_DEPENDENCIES) $(EXTRA_usbguard_applet_qt_DEPENDENCIES) @rm -f usbguard-applet-qt$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(usbguard_applet_qt_OBJECTS) $(usbguard_applet_qt_LDADD) $(LIBS) src/Daemon/$(am__dirstamp): @$(MKDIR_P) src/Daemon @: > src/Daemon/$(am__dirstamp) src/Daemon/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/Daemon/$(DEPDIR) @: > src/Daemon/$(DEPDIR)/$(am__dirstamp) src/Daemon/usbguard_daemon-Daemon.$(OBJEXT): \ src/Daemon/$(am__dirstamp) \ src/Daemon/$(DEPDIR)/$(am__dirstamp) src/Daemon/usbguard_daemon-main.$(OBJEXT): src/Daemon/$(am__dirstamp) \ src/Daemon/$(DEPDIR)/$(am__dirstamp) src/Daemon/usbguard_daemon-Seccomp.$(OBJEXT): \ src/Daemon/$(am__dirstamp) \ src/Daemon/$(DEPDIR)/$(am__dirstamp) src/Common/usbguard_daemon-Utility.$(OBJEXT): \ src/Common/$(am__dirstamp) \ src/Common/$(DEPDIR)/$(am__dirstamp) src/Daemon/usbguard_daemon-FileAuditBackend.$(OBJEXT): \ src/Daemon/$(am__dirstamp) \ src/Daemon/$(DEPDIR)/$(am__dirstamp) src/Daemon/usbguard_daemon-LinuxAuditBackend.$(OBJEXT): \ src/Daemon/$(am__dirstamp) \ src/Daemon/$(DEPDIR)/$(am__dirstamp) usbguard-daemon$(EXEEXT): $(usbguard_daemon_OBJECTS) $(usbguard_daemon_DEPENDENCIES) $(EXTRA_usbguard_daemon_DEPENDENCIES) @rm -f usbguard-daemon$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(usbguard_daemon_OBJECTS) $(usbguard_daemon_LDADD) $(LIBS) src/DBus/$(am__dirstamp): @$(MKDIR_P) src/DBus @: > src/DBus/$(am__dirstamp) src/DBus/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/DBus/$(DEPDIR) @: > src/DBus/$(DEPDIR)/$(am__dirstamp) src/DBus/usbguard_dbus-gdbus-server.$(OBJEXT): \ src/DBus/$(am__dirstamp) src/DBus/$(DEPDIR)/$(am__dirstamp) src/DBus/usbguard_dbus-DBusBridge.$(OBJEXT): src/DBus/$(am__dirstamp) \ src/DBus/$(DEPDIR)/$(am__dirstamp) usbguard-dbus$(EXEEXT): $(usbguard_dbus_OBJECTS) $(usbguard_dbus_DEPENDENCIES) $(EXTRA_usbguard_dbus_DEPENDENCIES) @rm -f usbguard-dbus$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(usbguard_dbus_OBJECTS) $(usbguard_dbus_LDADD) $(LIBS) src/CLI/usbguard_rule_parser-usbguard-rule-parser.$(OBJEXT): \ src/CLI/$(am__dirstamp) src/CLI/$(DEPDIR)/$(am__dirstamp) usbguard-rule-parser$(EXEEXT): $(usbguard_rule_parser_OBJECTS) $(usbguard_rule_parser_DEPENDENCIES) $(EXTRA_usbguard_rule_parser_DEPENDENCIES) @rm -f usbguard-rule-parser$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(usbguard_rule_parser_OBJECTS) $(usbguard_rule_parser_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/CLI/*.$(OBJEXT) -rm -f src/Common/*.$(OBJEXT) -rm -f src/Common/*.lo -rm -f src/DBus/*.$(OBJEXT) -rm -f src/Daemon/*.$(OBJEXT) -rm -f src/GUI.Qt/*.$(OBJEXT) -rm -f src/Library/*.$(OBJEXT) -rm -f src/Library/*.lo -rm -f src/Library/IPC/*.$(OBJEXT) -rm -f src/Library/IPC/*.lo -rm -f src/Library/public/usbguard/*.$(OBJEXT) -rm -f src/Library/public/usbguard/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard-usbguard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Common/$(DEPDIR)/libusbguard_la-Utility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Common/$(DEPDIR)/usbguard_daemon-Utility.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Daemon/$(DEPDIR)/usbguard_daemon-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-AllowedMatchesCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-Base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-ConfigFilePrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-DeviceManagerPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-DevicePrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-FixedStateCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-Hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-IPCClientPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-IPCPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-IPCServerPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-Init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-KeyValueParser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-LocaltimeCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-RandomStateCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-RuleAppliedCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-RuleEvaluatedCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-RulePrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-RuleSetPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-SysFSDevice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-UEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-UEventDeviceManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-UEventParser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/$(DEPDIR)/libusbguard_la-Utility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Devices.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Exception.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Message.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Parameter.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Policy.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/IPC/$(DEPDIR)/libusbguard_la-Rule.pb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Audit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-ConfigFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManagerHooks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCClient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCServer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Policy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Rule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleCondition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleParser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Typedefs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USBGuard.Plo@am__quote@ .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 $@ $< src/Daemon/usbguard_daemon-Seccomp.o: src/Daemon/Seccomp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/Daemon/usbguard_daemon-Seccomp.o -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Tpo -c -o src/Daemon/usbguard_daemon-Seccomp.o `test -f 'src/Daemon/Seccomp.c' || echo '$(srcdir)/'`src/Daemon/Seccomp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Daemon/Seccomp.c' object='src/Daemon/usbguard_daemon-Seccomp.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) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/Daemon/usbguard_daemon-Seccomp.o `test -f 'src/Daemon/Seccomp.c' || echo '$(srcdir)/'`src/Daemon/Seccomp.c src/Daemon/usbguard_daemon-Seccomp.obj: src/Daemon/Seccomp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/Daemon/usbguard_daemon-Seccomp.obj -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Tpo -c -o src/Daemon/usbguard_daemon-Seccomp.obj `if test -f 'src/Daemon/Seccomp.c'; then $(CYGPATH_W) 'src/Daemon/Seccomp.c'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/Seccomp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-Seccomp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Daemon/Seccomp.c' object='src/Daemon/usbguard_daemon-Seccomp.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) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/Daemon/usbguard_daemon-Seccomp.obj `if test -f 'src/Daemon/Seccomp.c'; then $(CYGPATH_W) 'src/Daemon/Seccomp.c'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/Seccomp.c'; fi` .cc.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 $@ $< .cc.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) '$<'` .cc.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 $@ $< src/Common/libusbguard_la-Utility.lo: src/Common/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Common/libusbguard_la-Utility.lo -MD -MP -MF src/Common/$(DEPDIR)/libusbguard_la-Utility.Tpo -c -o src/Common/libusbguard_la-Utility.lo `test -f 'src/Common/Utility.cpp' || echo '$(srcdir)/'`src/Common/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Common/$(DEPDIR)/libusbguard_la-Utility.Tpo src/Common/$(DEPDIR)/libusbguard_la-Utility.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Common/Utility.cpp' object='src/Common/libusbguard_la-Utility.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Common/libusbguard_la-Utility.lo `test -f 'src/Common/Utility.cpp' || echo '$(srcdir)/'`src/Common/Utility.cpp src/Library/libusbguard_la-AllowedMatchesCondition.lo: src/Library/AllowedMatchesCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-AllowedMatchesCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-AllowedMatchesCondition.Tpo -c -o src/Library/libusbguard_la-AllowedMatchesCondition.lo `test -f 'src/Library/AllowedMatchesCondition.cpp' || echo '$(srcdir)/'`src/Library/AllowedMatchesCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-AllowedMatchesCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-AllowedMatchesCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/AllowedMatchesCondition.cpp' object='src/Library/libusbguard_la-AllowedMatchesCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-AllowedMatchesCondition.lo `test -f 'src/Library/AllowedMatchesCondition.cpp' || echo '$(srcdir)/'`src/Library/AllowedMatchesCondition.cpp src/Library/libusbguard_la-Base64.lo: src/Library/Base64.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-Base64.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-Base64.Tpo -c -o src/Library/libusbguard_la-Base64.lo `test -f 'src/Library/Base64.cpp' || echo '$(srcdir)/'`src/Library/Base64.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-Base64.Tpo src/Library/$(DEPDIR)/libusbguard_la-Base64.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/Base64.cpp' object='src/Library/libusbguard_la-Base64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-Base64.lo `test -f 'src/Library/Base64.cpp' || echo '$(srcdir)/'`src/Library/Base64.cpp src/Library/libusbguard_la-ConfigFilePrivate.lo: src/Library/ConfigFilePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-ConfigFilePrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-ConfigFilePrivate.Tpo -c -o src/Library/libusbguard_la-ConfigFilePrivate.lo `test -f 'src/Library/ConfigFilePrivate.cpp' || echo '$(srcdir)/'`src/Library/ConfigFilePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-ConfigFilePrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-ConfigFilePrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/ConfigFilePrivate.cpp' object='src/Library/libusbguard_la-ConfigFilePrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-ConfigFilePrivate.lo `test -f 'src/Library/ConfigFilePrivate.cpp' || echo '$(srcdir)/'`src/Library/ConfigFilePrivate.cpp src/Library/libusbguard_la-DeviceManagerPrivate.lo: src/Library/DeviceManagerPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-DeviceManagerPrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-DeviceManagerPrivate.Tpo -c -o src/Library/libusbguard_la-DeviceManagerPrivate.lo `test -f 'src/Library/DeviceManagerPrivate.cpp' || echo '$(srcdir)/'`src/Library/DeviceManagerPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-DeviceManagerPrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-DeviceManagerPrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/DeviceManagerPrivate.cpp' object='src/Library/libusbguard_la-DeviceManagerPrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-DeviceManagerPrivate.lo `test -f 'src/Library/DeviceManagerPrivate.cpp' || echo '$(srcdir)/'`src/Library/DeviceManagerPrivate.cpp src/Library/libusbguard_la-DevicePrivate.lo: src/Library/DevicePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-DevicePrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-DevicePrivate.Tpo -c -o src/Library/libusbguard_la-DevicePrivate.lo `test -f 'src/Library/DevicePrivate.cpp' || echo '$(srcdir)/'`src/Library/DevicePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-DevicePrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-DevicePrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/DevicePrivate.cpp' object='src/Library/libusbguard_la-DevicePrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-DevicePrivate.lo `test -f 'src/Library/DevicePrivate.cpp' || echo '$(srcdir)/'`src/Library/DevicePrivate.cpp src/Library/libusbguard_la-FixedStateCondition.lo: src/Library/FixedStateCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-FixedStateCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-FixedStateCondition.Tpo -c -o src/Library/libusbguard_la-FixedStateCondition.lo `test -f 'src/Library/FixedStateCondition.cpp' || echo '$(srcdir)/'`src/Library/FixedStateCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-FixedStateCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-FixedStateCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/FixedStateCondition.cpp' object='src/Library/libusbguard_la-FixedStateCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-FixedStateCondition.lo `test -f 'src/Library/FixedStateCondition.cpp' || echo '$(srcdir)/'`src/Library/FixedStateCondition.cpp src/Library/libusbguard_la-Hash.lo: src/Library/Hash.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-Hash.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-Hash.Tpo -c -o src/Library/libusbguard_la-Hash.lo `test -f 'src/Library/Hash.cpp' || echo '$(srcdir)/'`src/Library/Hash.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-Hash.Tpo src/Library/$(DEPDIR)/libusbguard_la-Hash.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/Hash.cpp' object='src/Library/libusbguard_la-Hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-Hash.lo `test -f 'src/Library/Hash.cpp' || echo '$(srcdir)/'`src/Library/Hash.cpp src/Library/libusbguard_la-IPCClientPrivate.lo: src/Library/IPCClientPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-IPCClientPrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-IPCClientPrivate.Tpo -c -o src/Library/libusbguard_la-IPCClientPrivate.lo `test -f 'src/Library/IPCClientPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCClientPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-IPCClientPrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-IPCClientPrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPCClientPrivate.cpp' object='src/Library/libusbguard_la-IPCClientPrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-IPCClientPrivate.lo `test -f 'src/Library/IPCClientPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCClientPrivate.cpp src/Library/libusbguard_la-IPCPrivate.lo: src/Library/IPCPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-IPCPrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-IPCPrivate.Tpo -c -o src/Library/libusbguard_la-IPCPrivate.lo `test -f 'src/Library/IPCPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-IPCPrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-IPCPrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPCPrivate.cpp' object='src/Library/libusbguard_la-IPCPrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-IPCPrivate.lo `test -f 'src/Library/IPCPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCPrivate.cpp src/Library/libusbguard_la-IPCServerPrivate.lo: src/Library/IPCServerPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-IPCServerPrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-IPCServerPrivate.Tpo -c -o src/Library/libusbguard_la-IPCServerPrivate.lo `test -f 'src/Library/IPCServerPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCServerPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-IPCServerPrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-IPCServerPrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPCServerPrivate.cpp' object='src/Library/libusbguard_la-IPCServerPrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-IPCServerPrivate.lo `test -f 'src/Library/IPCServerPrivate.cpp' || echo '$(srcdir)/'`src/Library/IPCServerPrivate.cpp src/Library/libusbguard_la-Init.lo: src/Library/Init.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-Init.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-Init.Tpo -c -o src/Library/libusbguard_la-Init.lo `test -f 'src/Library/Init.cpp' || echo '$(srcdir)/'`src/Library/Init.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-Init.Tpo src/Library/$(DEPDIR)/libusbguard_la-Init.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/Init.cpp' object='src/Library/libusbguard_la-Init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-Init.lo `test -f 'src/Library/Init.cpp' || echo '$(srcdir)/'`src/Library/Init.cpp src/Library/libusbguard_la-KeyValueParser.lo: src/Library/KeyValueParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-KeyValueParser.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-KeyValueParser.Tpo -c -o src/Library/libusbguard_la-KeyValueParser.lo `test -f 'src/Library/KeyValueParser.cpp' || echo '$(srcdir)/'`src/Library/KeyValueParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-KeyValueParser.Tpo src/Library/$(DEPDIR)/libusbguard_la-KeyValueParser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/KeyValueParser.cpp' object='src/Library/libusbguard_la-KeyValueParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-KeyValueParser.lo `test -f 'src/Library/KeyValueParser.cpp' || echo '$(srcdir)/'`src/Library/KeyValueParser.cpp src/Library/libusbguard_la-LocaltimeCondition.lo: src/Library/LocaltimeCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-LocaltimeCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-LocaltimeCondition.Tpo -c -o src/Library/libusbguard_la-LocaltimeCondition.lo `test -f 'src/Library/LocaltimeCondition.cpp' || echo '$(srcdir)/'`src/Library/LocaltimeCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-LocaltimeCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-LocaltimeCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/LocaltimeCondition.cpp' object='src/Library/libusbguard_la-LocaltimeCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-LocaltimeCondition.lo `test -f 'src/Library/LocaltimeCondition.cpp' || echo '$(srcdir)/'`src/Library/LocaltimeCondition.cpp src/Library/libusbguard_la-RandomStateCondition.lo: src/Library/RandomStateCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-RandomStateCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-RandomStateCondition.Tpo -c -o src/Library/libusbguard_la-RandomStateCondition.lo `test -f 'src/Library/RandomStateCondition.cpp' || echo '$(srcdir)/'`src/Library/RandomStateCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-RandomStateCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-RandomStateCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/RandomStateCondition.cpp' object='src/Library/libusbguard_la-RandomStateCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-RandomStateCondition.lo `test -f 'src/Library/RandomStateCondition.cpp' || echo '$(srcdir)/'`src/Library/RandomStateCondition.cpp src/Library/libusbguard_la-RuleAppliedCondition.lo: src/Library/RuleAppliedCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-RuleAppliedCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-RuleAppliedCondition.Tpo -c -o src/Library/libusbguard_la-RuleAppliedCondition.lo `test -f 'src/Library/RuleAppliedCondition.cpp' || echo '$(srcdir)/'`src/Library/RuleAppliedCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-RuleAppliedCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-RuleAppliedCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/RuleAppliedCondition.cpp' object='src/Library/libusbguard_la-RuleAppliedCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-RuleAppliedCondition.lo `test -f 'src/Library/RuleAppliedCondition.cpp' || echo '$(srcdir)/'`src/Library/RuleAppliedCondition.cpp src/Library/libusbguard_la-RuleEvaluatedCondition.lo: src/Library/RuleEvaluatedCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-RuleEvaluatedCondition.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-RuleEvaluatedCondition.Tpo -c -o src/Library/libusbguard_la-RuleEvaluatedCondition.lo `test -f 'src/Library/RuleEvaluatedCondition.cpp' || echo '$(srcdir)/'`src/Library/RuleEvaluatedCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-RuleEvaluatedCondition.Tpo src/Library/$(DEPDIR)/libusbguard_la-RuleEvaluatedCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/RuleEvaluatedCondition.cpp' object='src/Library/libusbguard_la-RuleEvaluatedCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-RuleEvaluatedCondition.lo `test -f 'src/Library/RuleEvaluatedCondition.cpp' || echo '$(srcdir)/'`src/Library/RuleEvaluatedCondition.cpp src/Library/libusbguard_la-RulePrivate.lo: src/Library/RulePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-RulePrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-RulePrivate.Tpo -c -o src/Library/libusbguard_la-RulePrivate.lo `test -f 'src/Library/RulePrivate.cpp' || echo '$(srcdir)/'`src/Library/RulePrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-RulePrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-RulePrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/RulePrivate.cpp' object='src/Library/libusbguard_la-RulePrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-RulePrivate.lo `test -f 'src/Library/RulePrivate.cpp' || echo '$(srcdir)/'`src/Library/RulePrivate.cpp src/Library/libusbguard_la-RuleSetPrivate.lo: src/Library/RuleSetPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-RuleSetPrivate.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-RuleSetPrivate.Tpo -c -o src/Library/libusbguard_la-RuleSetPrivate.lo `test -f 'src/Library/RuleSetPrivate.cpp' || echo '$(srcdir)/'`src/Library/RuleSetPrivate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-RuleSetPrivate.Tpo src/Library/$(DEPDIR)/libusbguard_la-RuleSetPrivate.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/RuleSetPrivate.cpp' object='src/Library/libusbguard_la-RuleSetPrivate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-RuleSetPrivate.lo `test -f 'src/Library/RuleSetPrivate.cpp' || echo '$(srcdir)/'`src/Library/RuleSetPrivate.cpp src/Library/libusbguard_la-SysFSDevice.lo: src/Library/SysFSDevice.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-SysFSDevice.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-SysFSDevice.Tpo -c -o src/Library/libusbguard_la-SysFSDevice.lo `test -f 'src/Library/SysFSDevice.cpp' || echo '$(srcdir)/'`src/Library/SysFSDevice.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-SysFSDevice.Tpo src/Library/$(DEPDIR)/libusbguard_la-SysFSDevice.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/SysFSDevice.cpp' object='src/Library/libusbguard_la-SysFSDevice.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-SysFSDevice.lo `test -f 'src/Library/SysFSDevice.cpp' || echo '$(srcdir)/'`src/Library/SysFSDevice.cpp src/Library/libusbguard_la-UEvent.lo: src/Library/UEvent.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-UEvent.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-UEvent.Tpo -c -o src/Library/libusbguard_la-UEvent.lo `test -f 'src/Library/UEvent.cpp' || echo '$(srcdir)/'`src/Library/UEvent.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-UEvent.Tpo src/Library/$(DEPDIR)/libusbguard_la-UEvent.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/UEvent.cpp' object='src/Library/libusbguard_la-UEvent.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-UEvent.lo `test -f 'src/Library/UEvent.cpp' || echo '$(srcdir)/'`src/Library/UEvent.cpp src/Library/libusbguard_la-UEventDeviceManager.lo: src/Library/UEventDeviceManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-UEventDeviceManager.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-UEventDeviceManager.Tpo -c -o src/Library/libusbguard_la-UEventDeviceManager.lo `test -f 'src/Library/UEventDeviceManager.cpp' || echo '$(srcdir)/'`src/Library/UEventDeviceManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-UEventDeviceManager.Tpo src/Library/$(DEPDIR)/libusbguard_la-UEventDeviceManager.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/UEventDeviceManager.cpp' object='src/Library/libusbguard_la-UEventDeviceManager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-UEventDeviceManager.lo `test -f 'src/Library/UEventDeviceManager.cpp' || echo '$(srcdir)/'`src/Library/UEventDeviceManager.cpp src/Library/libusbguard_la-UEventParser.lo: src/Library/UEventParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-UEventParser.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-UEventParser.Tpo -c -o src/Library/libusbguard_la-UEventParser.lo `test -f 'src/Library/UEventParser.cpp' || echo '$(srcdir)/'`src/Library/UEventParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-UEventParser.Tpo src/Library/$(DEPDIR)/libusbguard_la-UEventParser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/UEventParser.cpp' object='src/Library/libusbguard_la-UEventParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-UEventParser.lo `test -f 'src/Library/UEventParser.cpp' || echo '$(srcdir)/'`src/Library/UEventParser.cpp src/Library/libusbguard_la-Utility.lo: src/Library/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/libusbguard_la-Utility.lo -MD -MP -MF src/Library/$(DEPDIR)/libusbguard_la-Utility.Tpo -c -o src/Library/libusbguard_la-Utility.lo `test -f 'src/Library/Utility.cpp' || echo '$(srcdir)/'`src/Library/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/$(DEPDIR)/libusbguard_la-Utility.Tpo src/Library/$(DEPDIR)/libusbguard_la-Utility.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/Utility.cpp' object='src/Library/libusbguard_la-Utility.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/libusbguard_la-Utility.lo `test -f 'src/Library/Utility.cpp' || echo '$(srcdir)/'`src/Library/Utility.cpp src/Library/public/usbguard/libusbguard_la-Audit.lo: src/Library/public/usbguard/Audit.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Audit.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Audit.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Audit.lo `test -f 'src/Library/public/usbguard/Audit.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Audit.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Audit.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Audit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Audit.cpp' object='src/Library/public/usbguard/libusbguard_la-Audit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Audit.lo `test -f 'src/Library/public/usbguard/Audit.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Audit.cpp src/Library/public/usbguard/libusbguard_la-ConfigFile.lo: src/Library/public/usbguard/ConfigFile.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-ConfigFile.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-ConfigFile.Tpo -c -o src/Library/public/usbguard/libusbguard_la-ConfigFile.lo `test -f 'src/Library/public/usbguard/ConfigFile.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/ConfigFile.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-ConfigFile.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-ConfigFile.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/ConfigFile.cpp' object='src/Library/public/usbguard/libusbguard_la-ConfigFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-ConfigFile.lo `test -f 'src/Library/public/usbguard/ConfigFile.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/ConfigFile.cpp src/Library/public/usbguard/libusbguard_la-Device.lo: src/Library/public/usbguard/Device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Device.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Device.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Device.lo `test -f 'src/Library/public/usbguard/Device.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Device.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Device.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Device.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Device.cpp' object='src/Library/public/usbguard/libusbguard_la-Device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Device.lo `test -f 'src/Library/public/usbguard/Device.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Device.cpp src/Library/public/usbguard/libusbguard_la-DeviceManager.lo: src/Library/public/usbguard/DeviceManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-DeviceManager.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManager.Tpo -c -o src/Library/public/usbguard/libusbguard_la-DeviceManager.lo `test -f 'src/Library/public/usbguard/DeviceManager.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/DeviceManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManager.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManager.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/DeviceManager.cpp' object='src/Library/public/usbguard/libusbguard_la-DeviceManager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-DeviceManager.lo `test -f 'src/Library/public/usbguard/DeviceManager.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/DeviceManager.cpp src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo: src/Library/public/usbguard/DeviceManagerHooks.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManagerHooks.Tpo -c -o src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo `test -f 'src/Library/public/usbguard/DeviceManagerHooks.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/DeviceManagerHooks.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManagerHooks.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-DeviceManagerHooks.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/DeviceManagerHooks.cpp' object='src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-DeviceManagerHooks.lo `test -f 'src/Library/public/usbguard/DeviceManagerHooks.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/DeviceManagerHooks.cpp src/Library/public/usbguard/libusbguard_la-IPCClient.lo: src/Library/public/usbguard/IPCClient.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-IPCClient.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCClient.Tpo -c -o src/Library/public/usbguard/libusbguard_la-IPCClient.lo `test -f 'src/Library/public/usbguard/IPCClient.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/IPCClient.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCClient.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCClient.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/IPCClient.cpp' object='src/Library/public/usbguard/libusbguard_la-IPCClient.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-IPCClient.lo `test -f 'src/Library/public/usbguard/IPCClient.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/IPCClient.cpp src/Library/public/usbguard/libusbguard_la-IPCServer.lo: src/Library/public/usbguard/IPCServer.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-IPCServer.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCServer.Tpo -c -o src/Library/public/usbguard/libusbguard_la-IPCServer.lo `test -f 'src/Library/public/usbguard/IPCServer.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/IPCServer.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCServer.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-IPCServer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/IPCServer.cpp' object='src/Library/public/usbguard/libusbguard_la-IPCServer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-IPCServer.lo `test -f 'src/Library/public/usbguard/IPCServer.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/IPCServer.cpp src/Library/public/usbguard/libusbguard_la-Logger.lo: src/Library/public/usbguard/Logger.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Logger.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Logger.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Logger.lo `test -f 'src/Library/public/usbguard/Logger.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Logger.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Logger.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Logger.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Logger.cpp' object='src/Library/public/usbguard/libusbguard_la-Logger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Logger.lo `test -f 'src/Library/public/usbguard/Logger.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Logger.cpp src/Library/public/usbguard/libusbguard_la-Policy.lo: src/Library/public/usbguard/Policy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Policy.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Policy.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Policy.lo `test -f 'src/Library/public/usbguard/Policy.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Policy.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Policy.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Policy.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Policy.cpp' object='src/Library/public/usbguard/libusbguard_la-Policy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Policy.lo `test -f 'src/Library/public/usbguard/Policy.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Policy.cpp src/Library/public/usbguard/libusbguard_la-Rule.lo: src/Library/public/usbguard/Rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Rule.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Rule.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Rule.lo `test -f 'src/Library/public/usbguard/Rule.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Rule.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Rule.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Rule.cpp' object='src/Library/public/usbguard/libusbguard_la-Rule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Rule.lo `test -f 'src/Library/public/usbguard/Rule.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Rule.cpp src/Library/public/usbguard/libusbguard_la-RuleCondition.lo: src/Library/public/usbguard/RuleCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-RuleCondition.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleCondition.Tpo -c -o src/Library/public/usbguard/libusbguard_la-RuleCondition.lo `test -f 'src/Library/public/usbguard/RuleCondition.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleCondition.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleCondition.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleCondition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/RuleCondition.cpp' object='src/Library/public/usbguard/libusbguard_la-RuleCondition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-RuleCondition.lo `test -f 'src/Library/public/usbguard/RuleCondition.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleCondition.cpp src/Library/public/usbguard/libusbguard_la-RuleParser.lo: src/Library/public/usbguard/RuleParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-RuleParser.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleParser.Tpo -c -o src/Library/public/usbguard/libusbguard_la-RuleParser.lo `test -f 'src/Library/public/usbguard/RuleParser.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleParser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleParser.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleParser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/RuleParser.cpp' object='src/Library/public/usbguard/libusbguard_la-RuleParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-RuleParser.lo `test -f 'src/Library/public/usbguard/RuleParser.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleParser.cpp src/Library/public/usbguard/libusbguard_la-RuleSet.lo: src/Library/public/usbguard/RuleSet.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-RuleSet.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleSet.Tpo -c -o src/Library/public/usbguard/libusbguard_la-RuleSet.lo `test -f 'src/Library/public/usbguard/RuleSet.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleSet.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleSet.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-RuleSet.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/RuleSet.cpp' object='src/Library/public/usbguard/libusbguard_la-RuleSet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-RuleSet.lo `test -f 'src/Library/public/usbguard/RuleSet.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/RuleSet.cpp src/Library/public/usbguard/libusbguard_la-Typedefs.lo: src/Library/public/usbguard/Typedefs.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-Typedefs.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Typedefs.Tpo -c -o src/Library/public/usbguard/libusbguard_la-Typedefs.lo `test -f 'src/Library/public/usbguard/Typedefs.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Typedefs.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Typedefs.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-Typedefs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/Typedefs.cpp' object='src/Library/public/usbguard/libusbguard_la-Typedefs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-Typedefs.lo `test -f 'src/Library/public/usbguard/Typedefs.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/Typedefs.cpp src/Library/public/usbguard/libusbguard_la-USB.lo: src/Library/public/usbguard/USB.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-USB.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USB.Tpo -c -o src/Library/public/usbguard/libusbguard_la-USB.lo `test -f 'src/Library/public/usbguard/USB.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/USB.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USB.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USB.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/USB.cpp' object='src/Library/public/usbguard/libusbguard_la-USB.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-USB.lo `test -f 'src/Library/public/usbguard/USB.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/USB.cpp src/Library/public/usbguard/libusbguard_la-USBGuard.lo: src/Library/public/usbguard/USBGuard.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/public/usbguard/libusbguard_la-USBGuard.lo -MD -MP -MF src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USBGuard.Tpo -c -o src/Library/public/usbguard/libusbguard_la-USBGuard.lo `test -f 'src/Library/public/usbguard/USBGuard.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/USBGuard.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USBGuard.Tpo src/Library/public/usbguard/$(DEPDIR)/libusbguard_la-USBGuard.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/public/usbguard/USBGuard.cpp' object='src/Library/public/usbguard/libusbguard_la-USBGuard.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/public/usbguard/libusbguard_la-USBGuard.lo `test -f 'src/Library/public/usbguard/USBGuard.cpp' || echo '$(srcdir)/'`src/Library/public/usbguard/USBGuard.cpp src/Library/IPC/libusbguard_la-Message.pb.lo: src/Library/IPC/Message.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Message.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Message.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Message.pb.lo `test -f 'src/Library/IPC/Message.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Message.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Message.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Message.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Message.pb.cc' object='src/Library/IPC/libusbguard_la-Message.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Message.pb.lo `test -f 'src/Library/IPC/Message.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Message.pb.cc src/Library/IPC/libusbguard_la-Rule.pb.lo: src/Library/IPC/Rule.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Rule.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Rule.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Rule.pb.lo `test -f 'src/Library/IPC/Rule.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Rule.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Rule.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Rule.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Rule.pb.cc' object='src/Library/IPC/libusbguard_la-Rule.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Rule.pb.lo `test -f 'src/Library/IPC/Rule.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Rule.pb.cc src/Library/IPC/libusbguard_la-Devices.pb.lo: src/Library/IPC/Devices.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Devices.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Devices.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Devices.pb.lo `test -f 'src/Library/IPC/Devices.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Devices.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Devices.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Devices.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Devices.pb.cc' object='src/Library/IPC/libusbguard_la-Devices.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Devices.pb.lo `test -f 'src/Library/IPC/Devices.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Devices.pb.cc src/Library/IPC/libusbguard_la-Exception.pb.lo: src/Library/IPC/Exception.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Exception.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Exception.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Exception.pb.lo `test -f 'src/Library/IPC/Exception.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Exception.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Exception.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Exception.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Exception.pb.cc' object='src/Library/IPC/libusbguard_la-Exception.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Exception.pb.lo `test -f 'src/Library/IPC/Exception.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Exception.pb.cc src/Library/IPC/libusbguard_la-Policy.pb.lo: src/Library/IPC/Policy.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Policy.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Policy.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Policy.pb.lo `test -f 'src/Library/IPC/Policy.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Policy.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Policy.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Policy.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Policy.pb.cc' object='src/Library/IPC/libusbguard_la-Policy.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Policy.pb.lo `test -f 'src/Library/IPC/Policy.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Policy.pb.cc src/Library/IPC/libusbguard_la-Parameter.pb.lo: src/Library/IPC/Parameter.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Library/IPC/libusbguard_la-Parameter.pb.lo -MD -MP -MF src/Library/IPC/$(DEPDIR)/libusbguard_la-Parameter.pb.Tpo -c -o src/Library/IPC/libusbguard_la-Parameter.pb.lo `test -f 'src/Library/IPC/Parameter.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Parameter.pb.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Library/IPC/$(DEPDIR)/libusbguard_la-Parameter.pb.Tpo src/Library/IPC/$(DEPDIR)/libusbguard_la-Parameter.pb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Library/IPC/Parameter.pb.cc' object='src/Library/IPC/libusbguard_la-Parameter.pb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libusbguard_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Library/IPC/libusbguard_la-Parameter.pb.lo `test -f 'src/Library/IPC/Parameter.pb.cc' || echo '$(srcdir)/'`src/Library/IPC/Parameter.pb.cc src/CLI/usbguard-usbguard.o: src/CLI/usbguard.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard.Tpo -c -o src/CLI/usbguard-usbguard.o `test -f 'src/CLI/usbguard.cpp' || echo '$(srcdir)/'`src/CLI/usbguard.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard.cpp' object='src/CLI/usbguard-usbguard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard.o `test -f 'src/CLI/usbguard.cpp' || echo '$(srcdir)/'`src/CLI/usbguard.cpp src/CLI/usbguard-usbguard.obj: src/CLI/usbguard.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard.Tpo -c -o src/CLI/usbguard-usbguard.obj `if test -f 'src/CLI/usbguard.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard.cpp' object='src/CLI/usbguard-usbguard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard.obj `if test -f 'src/CLI/usbguard.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard.cpp'; fi` src/CLI/usbguard-usbguard-list-devices.o: src/CLI/usbguard-list-devices.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-list-devices.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Tpo -c -o src/CLI/usbguard-usbguard-list-devices.o `test -f 'src/CLI/usbguard-list-devices.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-list-devices.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-list-devices.cpp' object='src/CLI/usbguard-usbguard-list-devices.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-list-devices.o `test -f 'src/CLI/usbguard-list-devices.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-list-devices.cpp src/CLI/usbguard-usbguard-list-devices.obj: src/CLI/usbguard-list-devices.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-list-devices.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Tpo -c -o src/CLI/usbguard-usbguard-list-devices.obj `if test -f 'src/CLI/usbguard-list-devices.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-list-devices.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-list-devices.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-list-devices.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-list-devices.cpp' object='src/CLI/usbguard-usbguard-list-devices.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-list-devices.obj `if test -f 'src/CLI/usbguard-list-devices.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-list-devices.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-list-devices.cpp'; fi` src/CLI/usbguard-usbguard-allow-device.o: src/CLI/usbguard-allow-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-allow-device.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Tpo -c -o src/CLI/usbguard-usbguard-allow-device.o `test -f 'src/CLI/usbguard-allow-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-allow-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-allow-device.cpp' object='src/CLI/usbguard-usbguard-allow-device.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-allow-device.o `test -f 'src/CLI/usbguard-allow-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-allow-device.cpp src/CLI/usbguard-usbguard-allow-device.obj: src/CLI/usbguard-allow-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-allow-device.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Tpo -c -o src/CLI/usbguard-usbguard-allow-device.obj `if test -f 'src/CLI/usbguard-allow-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-allow-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-allow-device.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-allow-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-allow-device.cpp' object='src/CLI/usbguard-usbguard-allow-device.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-allow-device.obj `if test -f 'src/CLI/usbguard-allow-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-allow-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-allow-device.cpp'; fi` src/CLI/usbguard-usbguard-block-device.o: src/CLI/usbguard-block-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-block-device.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Tpo -c -o src/CLI/usbguard-usbguard-block-device.o `test -f 'src/CLI/usbguard-block-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-block-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-block-device.cpp' object='src/CLI/usbguard-usbguard-block-device.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-block-device.o `test -f 'src/CLI/usbguard-block-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-block-device.cpp src/CLI/usbguard-usbguard-block-device.obj: src/CLI/usbguard-block-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-block-device.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Tpo -c -o src/CLI/usbguard-usbguard-block-device.obj `if test -f 'src/CLI/usbguard-block-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-block-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-block-device.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-block-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-block-device.cpp' object='src/CLI/usbguard-usbguard-block-device.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-block-device.obj `if test -f 'src/CLI/usbguard-block-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-block-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-block-device.cpp'; fi` src/CLI/usbguard-usbguard-reject-device.o: src/CLI/usbguard-reject-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-reject-device.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Tpo -c -o src/CLI/usbguard-usbguard-reject-device.o `test -f 'src/CLI/usbguard-reject-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-reject-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-reject-device.cpp' object='src/CLI/usbguard-usbguard-reject-device.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-reject-device.o `test -f 'src/CLI/usbguard-reject-device.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-reject-device.cpp src/CLI/usbguard-usbguard-reject-device.obj: src/CLI/usbguard-reject-device.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-reject-device.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Tpo -c -o src/CLI/usbguard-usbguard-reject-device.obj `if test -f 'src/CLI/usbguard-reject-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-reject-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-reject-device.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-reject-device.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-reject-device.cpp' object='src/CLI/usbguard-usbguard-reject-device.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-reject-device.obj `if test -f 'src/CLI/usbguard-reject-device.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-reject-device.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-reject-device.cpp'; fi` src/CLI/usbguard-usbguard-list-rules.o: src/CLI/usbguard-list-rules.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-list-rules.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Tpo -c -o src/CLI/usbguard-usbguard-list-rules.o `test -f 'src/CLI/usbguard-list-rules.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-list-rules.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-list-rules.cpp' object='src/CLI/usbguard-usbguard-list-rules.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-list-rules.o `test -f 'src/CLI/usbguard-list-rules.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-list-rules.cpp src/CLI/usbguard-usbguard-list-rules.obj: src/CLI/usbguard-list-rules.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-list-rules.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Tpo -c -o src/CLI/usbguard-usbguard-list-rules.obj `if test -f 'src/CLI/usbguard-list-rules.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-list-rules.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-list-rules.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-list-rules.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-list-rules.cpp' object='src/CLI/usbguard-usbguard-list-rules.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-list-rules.obj `if test -f 'src/CLI/usbguard-list-rules.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-list-rules.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-list-rules.cpp'; fi` src/CLI/usbguard-usbguard-append-rule.o: src/CLI/usbguard-append-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-append-rule.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Tpo -c -o src/CLI/usbguard-usbguard-append-rule.o `test -f 'src/CLI/usbguard-append-rule.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-append-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-append-rule.cpp' object='src/CLI/usbguard-usbguard-append-rule.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-append-rule.o `test -f 'src/CLI/usbguard-append-rule.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-append-rule.cpp src/CLI/usbguard-usbguard-append-rule.obj: src/CLI/usbguard-append-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-append-rule.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Tpo -c -o src/CLI/usbguard-usbguard-append-rule.obj `if test -f 'src/CLI/usbguard-append-rule.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-append-rule.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-append-rule.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-append-rule.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-append-rule.cpp' object='src/CLI/usbguard-usbguard-append-rule.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-append-rule.obj `if test -f 'src/CLI/usbguard-append-rule.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-append-rule.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-append-rule.cpp'; fi` src/CLI/usbguard-usbguard-remove-rule.o: src/CLI/usbguard-remove-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-remove-rule.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Tpo -c -o src/CLI/usbguard-usbguard-remove-rule.o `test -f 'src/CLI/usbguard-remove-rule.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-remove-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-remove-rule.cpp' object='src/CLI/usbguard-usbguard-remove-rule.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-remove-rule.o `test -f 'src/CLI/usbguard-remove-rule.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-remove-rule.cpp src/CLI/usbguard-usbguard-remove-rule.obj: src/CLI/usbguard-remove-rule.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-remove-rule.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Tpo -c -o src/CLI/usbguard-usbguard-remove-rule.obj `if test -f 'src/CLI/usbguard-remove-rule.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-remove-rule.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-remove-rule.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-remove-rule.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-remove-rule.cpp' object='src/CLI/usbguard-usbguard-remove-rule.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-remove-rule.obj `if test -f 'src/CLI/usbguard-remove-rule.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-remove-rule.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-remove-rule.cpp'; fi` src/CLI/usbguard-usbguard-generate-policy.o: src/CLI/usbguard-generate-policy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-generate-policy.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Tpo -c -o src/CLI/usbguard-usbguard-generate-policy.o `test -f 'src/CLI/usbguard-generate-policy.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-generate-policy.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-generate-policy.cpp' object='src/CLI/usbguard-usbguard-generate-policy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-generate-policy.o `test -f 'src/CLI/usbguard-generate-policy.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-generate-policy.cpp src/CLI/usbguard-usbguard-generate-policy.obj: src/CLI/usbguard-generate-policy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-generate-policy.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Tpo -c -o src/CLI/usbguard-usbguard-generate-policy.obj `if test -f 'src/CLI/usbguard-generate-policy.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-generate-policy.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-generate-policy.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-generate-policy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-generate-policy.cpp' object='src/CLI/usbguard-usbguard-generate-policy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-generate-policy.obj `if test -f 'src/CLI/usbguard-generate-policy.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-generate-policy.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-generate-policy.cpp'; fi` src/CLI/usbguard-usbguard-watch.o: src/CLI/usbguard-watch.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-watch.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Tpo -c -o src/CLI/usbguard-usbguard-watch.o `test -f 'src/CLI/usbguard-watch.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-watch.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-watch.cpp' object='src/CLI/usbguard-usbguard-watch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-watch.o `test -f 'src/CLI/usbguard-watch.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-watch.cpp src/CLI/usbguard-usbguard-watch.obj: src/CLI/usbguard-watch.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-watch.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Tpo -c -o src/CLI/usbguard-usbguard-watch.obj `if test -f 'src/CLI/usbguard-watch.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-watch.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-watch.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-watch.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-watch.cpp' object='src/CLI/usbguard-usbguard-watch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-watch.obj `if test -f 'src/CLI/usbguard-watch.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-watch.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-watch.cpp'; fi` src/CLI/usbguard-IPCSignalWatcher.o: src/CLI/IPCSignalWatcher.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-IPCSignalWatcher.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Tpo -c -o src/CLI/usbguard-IPCSignalWatcher.o `test -f 'src/CLI/IPCSignalWatcher.cpp' || echo '$(srcdir)/'`src/CLI/IPCSignalWatcher.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Tpo src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/IPCSignalWatcher.cpp' object='src/CLI/usbguard-IPCSignalWatcher.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-IPCSignalWatcher.o `test -f 'src/CLI/IPCSignalWatcher.cpp' || echo '$(srcdir)/'`src/CLI/IPCSignalWatcher.cpp src/CLI/usbguard-IPCSignalWatcher.obj: src/CLI/IPCSignalWatcher.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-IPCSignalWatcher.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Tpo -c -o src/CLI/usbguard-IPCSignalWatcher.obj `if test -f 'src/CLI/IPCSignalWatcher.cpp'; then $(CYGPATH_W) 'src/CLI/IPCSignalWatcher.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/IPCSignalWatcher.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Tpo src/CLI/$(DEPDIR)/usbguard-IPCSignalWatcher.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/IPCSignalWatcher.cpp' object='src/CLI/usbguard-IPCSignalWatcher.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-IPCSignalWatcher.obj `if test -f 'src/CLI/IPCSignalWatcher.cpp'; then $(CYGPATH_W) 'src/CLI/IPCSignalWatcher.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/IPCSignalWatcher.cpp'; fi` src/CLI/usbguard-PolicyGenerator.o: src/CLI/PolicyGenerator.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-PolicyGenerator.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Tpo -c -o src/CLI/usbguard-PolicyGenerator.o `test -f 'src/CLI/PolicyGenerator.cpp' || echo '$(srcdir)/'`src/CLI/PolicyGenerator.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Tpo src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/PolicyGenerator.cpp' object='src/CLI/usbguard-PolicyGenerator.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-PolicyGenerator.o `test -f 'src/CLI/PolicyGenerator.cpp' || echo '$(srcdir)/'`src/CLI/PolicyGenerator.cpp src/CLI/usbguard-PolicyGenerator.obj: src/CLI/PolicyGenerator.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-PolicyGenerator.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Tpo -c -o src/CLI/usbguard-PolicyGenerator.obj `if test -f 'src/CLI/PolicyGenerator.cpp'; then $(CYGPATH_W) 'src/CLI/PolicyGenerator.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/PolicyGenerator.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Tpo src/CLI/$(DEPDIR)/usbguard-PolicyGenerator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/PolicyGenerator.cpp' object='src/CLI/usbguard-PolicyGenerator.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-PolicyGenerator.obj `if test -f 'src/CLI/PolicyGenerator.cpp'; then $(CYGPATH_W) 'src/CLI/PolicyGenerator.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/PolicyGenerator.cpp'; fi` src/CLI/usbguard-usbguard-read-descriptor.o: src/CLI/usbguard-read-descriptor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-read-descriptor.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Tpo -c -o src/CLI/usbguard-usbguard-read-descriptor.o `test -f 'src/CLI/usbguard-read-descriptor.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-read-descriptor.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-read-descriptor.cpp' object='src/CLI/usbguard-usbguard-read-descriptor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-read-descriptor.o `test -f 'src/CLI/usbguard-read-descriptor.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-read-descriptor.cpp src/CLI/usbguard-usbguard-read-descriptor.obj: src/CLI/usbguard-read-descriptor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-read-descriptor.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Tpo -c -o src/CLI/usbguard-usbguard-read-descriptor.obj `if test -f 'src/CLI/usbguard-read-descriptor.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-read-descriptor.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-read-descriptor.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-read-descriptor.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-read-descriptor.cpp' object='src/CLI/usbguard-usbguard-read-descriptor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-read-descriptor.obj `if test -f 'src/CLI/usbguard-read-descriptor.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-read-descriptor.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-read-descriptor.cpp'; fi` src/CLI/usbguard-usbguard-set-parameter.o: src/CLI/usbguard-set-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-set-parameter.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Tpo -c -o src/CLI/usbguard-usbguard-set-parameter.o `test -f 'src/CLI/usbguard-set-parameter.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-set-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-set-parameter.cpp' object='src/CLI/usbguard-usbguard-set-parameter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-set-parameter.o `test -f 'src/CLI/usbguard-set-parameter.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-set-parameter.cpp src/CLI/usbguard-usbguard-set-parameter.obj: src/CLI/usbguard-set-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-set-parameter.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Tpo -c -o src/CLI/usbguard-usbguard-set-parameter.obj `if test -f 'src/CLI/usbguard-set-parameter.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-set-parameter.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-set-parameter.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-set-parameter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-set-parameter.cpp' object='src/CLI/usbguard-usbguard-set-parameter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-set-parameter.obj `if test -f 'src/CLI/usbguard-set-parameter.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-set-parameter.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-set-parameter.cpp'; fi` src/CLI/usbguard-usbguard-get-parameter.o: src/CLI/usbguard-get-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-get-parameter.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Tpo -c -o src/CLI/usbguard-usbguard-get-parameter.o `test -f 'src/CLI/usbguard-get-parameter.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-get-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-get-parameter.cpp' object='src/CLI/usbguard-usbguard-get-parameter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-get-parameter.o `test -f 'src/CLI/usbguard-get-parameter.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-get-parameter.cpp src/CLI/usbguard-usbguard-get-parameter.obj: src/CLI/usbguard-get-parameter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-get-parameter.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Tpo -c -o src/CLI/usbguard-usbguard-get-parameter.obj `if test -f 'src/CLI/usbguard-get-parameter.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-get-parameter.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-get-parameter.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-get-parameter.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-get-parameter.cpp' object='src/CLI/usbguard-usbguard-get-parameter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-get-parameter.obj `if test -f 'src/CLI/usbguard-get-parameter.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-get-parameter.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-get-parameter.cpp'; fi` src/CLI/usbguard-usbguard-add-user.o: src/CLI/usbguard-add-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-add-user.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Tpo -c -o src/CLI/usbguard-usbguard-add-user.o `test -f 'src/CLI/usbguard-add-user.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-add-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-add-user.cpp' object='src/CLI/usbguard-usbguard-add-user.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-add-user.o `test -f 'src/CLI/usbguard-add-user.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-add-user.cpp src/CLI/usbguard-usbguard-add-user.obj: src/CLI/usbguard-add-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-add-user.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Tpo -c -o src/CLI/usbguard-usbguard-add-user.obj `if test -f 'src/CLI/usbguard-add-user.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-add-user.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-add-user.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-add-user.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-add-user.cpp' object='src/CLI/usbguard-usbguard-add-user.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-add-user.obj `if test -f 'src/CLI/usbguard-add-user.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-add-user.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-add-user.cpp'; fi` src/CLI/usbguard-usbguard-remove-user.o: src/CLI/usbguard-remove-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-remove-user.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Tpo -c -o src/CLI/usbguard-usbguard-remove-user.o `test -f 'src/CLI/usbguard-remove-user.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-remove-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-remove-user.cpp' object='src/CLI/usbguard-usbguard-remove-user.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-remove-user.o `test -f 'src/CLI/usbguard-remove-user.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-remove-user.cpp src/CLI/usbguard-usbguard-remove-user.obj: src/CLI/usbguard-remove-user.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard-usbguard-remove-user.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Tpo -c -o src/CLI/usbguard-usbguard-remove-user.obj `if test -f 'src/CLI/usbguard-remove-user.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-remove-user.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-remove-user.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Tpo src/CLI/$(DEPDIR)/usbguard-usbguard-remove-user.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-remove-user.cpp' object='src/CLI/usbguard-usbguard-remove-user.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard-usbguard-remove-user.obj `if test -f 'src/CLI/usbguard-remove-user.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-remove-user.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-remove-user.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-main.o: src/GUI.Qt/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-main.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-main.o `test -f 'src/GUI.Qt/main.cpp' || echo '$(srcdir)/'`src/GUI.Qt/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/main.cpp' object='src/GUI.Qt/usbguard_applet_qt-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-main.o `test -f 'src/GUI.Qt/main.cpp' || echo '$(srcdir)/'`src/GUI.Qt/main.cpp src/GUI.Qt/usbguard_applet_qt-main.obj: src/GUI.Qt/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-main.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-main.obj `if test -f 'src/GUI.Qt/main.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/main.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/main.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/main.cpp' object='src/GUI.Qt/usbguard_applet_qt-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-main.obj `if test -f 'src/GUI.Qt/main.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/main.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/main.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-DeviceDialog.o: src/GUI.Qt/DeviceDialog.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceDialog.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.o `test -f 'src/GUI.Qt/DeviceDialog.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceDialog.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceDialog.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceDialog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.o `test -f 'src/GUI.Qt/DeviceDialog.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceDialog.cpp src/GUI.Qt/usbguard_applet_qt-DeviceDialog.obj: src/GUI.Qt/DeviceDialog.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceDialog.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.obj `if test -f 'src/GUI.Qt/DeviceDialog.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceDialog.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceDialog.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceDialog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.obj `if test -f 'src/GUI.Qt/DeviceDialog.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceDialog.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-MainWindow.o: src/GUI.Qt/MainWindow.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-MainWindow.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.o `test -f 'src/GUI.Qt/MainWindow.cpp' || echo '$(srcdir)/'`src/GUI.Qt/MainWindow.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/MainWindow.cpp' object='src/GUI.Qt/usbguard_applet_qt-MainWindow.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.o `test -f 'src/GUI.Qt/MainWindow.cpp' || echo '$(srcdir)/'`src/GUI.Qt/MainWindow.cpp src/GUI.Qt/usbguard_applet_qt-MainWindow.obj: src/GUI.Qt/MainWindow.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-MainWindow.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.obj `if test -f 'src/GUI.Qt/MainWindow.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/MainWindow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/MainWindow.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/MainWindow.cpp' object='src/GUI.Qt/usbguard_applet_qt-MainWindow.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.obj `if test -f 'src/GUI.Qt/MainWindow.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/MainWindow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/MainWindow.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-DeviceModel.o: src/GUI.Qt/DeviceModel.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceModel.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.o `test -f 'src/GUI.Qt/DeviceModel.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceModel.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceModel.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceModel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.o `test -f 'src/GUI.Qt/DeviceModel.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceModel.cpp src/GUI.Qt/usbguard_applet_qt-DeviceModel.obj: src/GUI.Qt/DeviceModel.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceModel.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.obj `if test -f 'src/GUI.Qt/DeviceModel.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceModel.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceModel.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceModel.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceModel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.obj `if test -f 'src/GUI.Qt/DeviceModel.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceModel.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceModel.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-SessionBlocker.o: src/GUI.Qt/SessionBlocker.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-SessionBlocker.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.o `test -f 'src/GUI.Qt/SessionBlocker.cpp' || echo '$(srcdir)/'`src/GUI.Qt/SessionBlocker.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/SessionBlocker.cpp' object='src/GUI.Qt/usbguard_applet_qt-SessionBlocker.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.o `test -f 'src/GUI.Qt/SessionBlocker.cpp' || echo '$(srcdir)/'`src/GUI.Qt/SessionBlocker.cpp src/GUI.Qt/usbguard_applet_qt-SessionBlocker.obj: src/GUI.Qt/SessionBlocker.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-SessionBlocker.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.obj `if test -f 'src/GUI.Qt/SessionBlocker.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/SessionBlocker.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/SessionBlocker.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/SessionBlocker.cpp' object='src/GUI.Qt/usbguard_applet_qt-SessionBlocker.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.obj `if test -f 'src/GUI.Qt/SessionBlocker.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/SessionBlocker.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/SessionBlocker.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-TargetDelegate.o: src/GUI.Qt/TargetDelegate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-TargetDelegate.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.o `test -f 'src/GUI.Qt/TargetDelegate.cpp' || echo '$(srcdir)/'`src/GUI.Qt/TargetDelegate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/TargetDelegate.cpp' object='src/GUI.Qt/usbguard_applet_qt-TargetDelegate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.o `test -f 'src/GUI.Qt/TargetDelegate.cpp' || echo '$(srcdir)/'`src/GUI.Qt/TargetDelegate.cpp src/GUI.Qt/usbguard_applet_qt-TargetDelegate.obj: src/GUI.Qt/TargetDelegate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-TargetDelegate.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.obj `if test -f 'src/GUI.Qt/TargetDelegate.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/TargetDelegate.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/TargetDelegate.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/TargetDelegate.cpp' object='src/GUI.Qt/usbguard_applet_qt-TargetDelegate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.obj `if test -f 'src/GUI.Qt/TargetDelegate.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/TargetDelegate.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/TargetDelegate.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.o: src/GUI.Qt/DeviceDialog.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.o `test -f 'src/GUI.Qt/DeviceDialog.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceDialog.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceDialog.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.o `test -f 'src/GUI.Qt/DeviceDialog.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceDialog.moc.cpp src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.obj: src/GUI.Qt/DeviceDialog.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.obj `if test -f 'src/GUI.Qt/DeviceDialog.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceDialog.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceDialog.moc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceDialog.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceDialog.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceDialog.moc.obj `if test -f 'src/GUI.Qt/DeviceDialog.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceDialog.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceDialog.moc.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.o: src/GUI.Qt/MainWindow.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.o `test -f 'src/GUI.Qt/MainWindow.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/MainWindow.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/MainWindow.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.o `test -f 'src/GUI.Qt/MainWindow.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/MainWindow.moc.cpp src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.obj: src/GUI.Qt/MainWindow.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.obj `if test -f 'src/GUI.Qt/MainWindow.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/MainWindow.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/MainWindow.moc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-MainWindow.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/MainWindow.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-MainWindow.moc.obj `if test -f 'src/GUI.Qt/MainWindow.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/MainWindow.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/MainWindow.moc.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.o: src/GUI.Qt/usbguard.qrc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.o `test -f 'src/GUI.Qt/usbguard.qrc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/usbguard.qrc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/usbguard.qrc.cpp' object='src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.o `test -f 'src/GUI.Qt/usbguard.qrc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/usbguard.qrc.cpp src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.obj: src/GUI.Qt/usbguard.qrc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.obj `if test -f 'src/GUI.Qt/usbguard.qrc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/usbguard.qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/usbguard.qrc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-usbguard.qrc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/usbguard.qrc.cpp' object='src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-usbguard.qrc.obj `if test -f 'src/GUI.Qt/usbguard.qrc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/usbguard.qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/usbguard.qrc.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.o: src/GUI.Qt/DeviceModel.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.o `test -f 'src/GUI.Qt/DeviceModel.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceModel.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceModel.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.o `test -f 'src/GUI.Qt/DeviceModel.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/DeviceModel.moc.cpp src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.obj: src/GUI.Qt/DeviceModel.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.obj `if test -f 'src/GUI.Qt/DeviceModel.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceModel.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceModel.moc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-DeviceModel.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/DeviceModel.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-DeviceModel.moc.obj `if test -f 'src/GUI.Qt/DeviceModel.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/DeviceModel.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/DeviceModel.moc.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.o: src/GUI.Qt/SessionBlocker.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.o `test -f 'src/GUI.Qt/SessionBlocker.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/SessionBlocker.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/SessionBlocker.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.o `test -f 'src/GUI.Qt/SessionBlocker.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/SessionBlocker.moc.cpp src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.obj: src/GUI.Qt/SessionBlocker.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.obj `if test -f 'src/GUI.Qt/SessionBlocker.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/SessionBlocker.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/SessionBlocker.moc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-SessionBlocker.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/SessionBlocker.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-SessionBlocker.moc.obj `if test -f 'src/GUI.Qt/SessionBlocker.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/SessionBlocker.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/SessionBlocker.moc.cpp'; fi` src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.o: src/GUI.Qt/TargetDelegate.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.o -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.o `test -f 'src/GUI.Qt/TargetDelegate.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/TargetDelegate.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/TargetDelegate.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.o `test -f 'src/GUI.Qt/TargetDelegate.moc.cpp' || echo '$(srcdir)/'`src/GUI.Qt/TargetDelegate.moc.cpp src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.obj: src/GUI.Qt/TargetDelegate.moc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.obj -MD -MP -MF src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Tpo -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.obj `if test -f 'src/GUI.Qt/TargetDelegate.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/TargetDelegate.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/TargetDelegate.moc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Tpo src/GUI.Qt/$(DEPDIR)/usbguard_applet_qt-TargetDelegate.moc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/GUI.Qt/TargetDelegate.moc.cpp' object='src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_applet_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/GUI.Qt/usbguard_applet_qt-TargetDelegate.moc.obj `if test -f 'src/GUI.Qt/TargetDelegate.moc.cpp'; then $(CYGPATH_W) 'src/GUI.Qt/TargetDelegate.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/src/GUI.Qt/TargetDelegate.moc.cpp'; fi` src/Daemon/usbguard_daemon-Daemon.o: src/Daemon/Daemon.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-Daemon.o -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Tpo -c -o src/Daemon/usbguard_daemon-Daemon.o `test -f 'src/Daemon/Daemon.cpp' || echo '$(srcdir)/'`src/Daemon/Daemon.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/Daemon.cpp' object='src/Daemon/usbguard_daemon-Daemon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-Daemon.o `test -f 'src/Daemon/Daemon.cpp' || echo '$(srcdir)/'`src/Daemon/Daemon.cpp src/Daemon/usbguard_daemon-Daemon.obj: src/Daemon/Daemon.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-Daemon.obj -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Tpo -c -o src/Daemon/usbguard_daemon-Daemon.obj `if test -f 'src/Daemon/Daemon.cpp'; then $(CYGPATH_W) 'src/Daemon/Daemon.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/Daemon.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-Daemon.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/Daemon.cpp' object='src/Daemon/usbguard_daemon-Daemon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-Daemon.obj `if test -f 'src/Daemon/Daemon.cpp'; then $(CYGPATH_W) 'src/Daemon/Daemon.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/Daemon.cpp'; fi` src/Daemon/usbguard_daemon-main.o: src/Daemon/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-main.o -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-main.Tpo -c -o src/Daemon/usbguard_daemon-main.o `test -f 'src/Daemon/main.cpp' || echo '$(srcdir)/'`src/Daemon/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-main.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/main.cpp' object='src/Daemon/usbguard_daemon-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-main.o `test -f 'src/Daemon/main.cpp' || echo '$(srcdir)/'`src/Daemon/main.cpp src/Daemon/usbguard_daemon-main.obj: src/Daemon/main.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-main.obj -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-main.Tpo -c -o src/Daemon/usbguard_daemon-main.obj `if test -f 'src/Daemon/main.cpp'; then $(CYGPATH_W) 'src/Daemon/main.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/main.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-main.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/main.cpp' object='src/Daemon/usbguard_daemon-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-main.obj `if test -f 'src/Daemon/main.cpp'; then $(CYGPATH_W) 'src/Daemon/main.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/main.cpp'; fi` src/Common/usbguard_daemon-Utility.o: src/Common/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Common/usbguard_daemon-Utility.o -MD -MP -MF src/Common/$(DEPDIR)/usbguard_daemon-Utility.Tpo -c -o src/Common/usbguard_daemon-Utility.o `test -f 'src/Common/Utility.cpp' || echo '$(srcdir)/'`src/Common/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Common/$(DEPDIR)/usbguard_daemon-Utility.Tpo src/Common/$(DEPDIR)/usbguard_daemon-Utility.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Common/Utility.cpp' object='src/Common/usbguard_daemon-Utility.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Common/usbguard_daemon-Utility.o `test -f 'src/Common/Utility.cpp' || echo '$(srcdir)/'`src/Common/Utility.cpp src/Common/usbguard_daemon-Utility.obj: src/Common/Utility.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Common/usbguard_daemon-Utility.obj -MD -MP -MF src/Common/$(DEPDIR)/usbguard_daemon-Utility.Tpo -c -o src/Common/usbguard_daemon-Utility.obj `if test -f 'src/Common/Utility.cpp'; then $(CYGPATH_W) 'src/Common/Utility.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Common/Utility.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Common/$(DEPDIR)/usbguard_daemon-Utility.Tpo src/Common/$(DEPDIR)/usbguard_daemon-Utility.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Common/Utility.cpp' object='src/Common/usbguard_daemon-Utility.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Common/usbguard_daemon-Utility.obj `if test -f 'src/Common/Utility.cpp'; then $(CYGPATH_W) 'src/Common/Utility.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Common/Utility.cpp'; fi` src/Daemon/usbguard_daemon-FileAuditBackend.o: src/Daemon/FileAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-FileAuditBackend.o -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Tpo -c -o src/Daemon/usbguard_daemon-FileAuditBackend.o `test -f 'src/Daemon/FileAuditBackend.cpp' || echo '$(srcdir)/'`src/Daemon/FileAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/FileAuditBackend.cpp' object='src/Daemon/usbguard_daemon-FileAuditBackend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-FileAuditBackend.o `test -f 'src/Daemon/FileAuditBackend.cpp' || echo '$(srcdir)/'`src/Daemon/FileAuditBackend.cpp src/Daemon/usbguard_daemon-FileAuditBackend.obj: src/Daemon/FileAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-FileAuditBackend.obj -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Tpo -c -o src/Daemon/usbguard_daemon-FileAuditBackend.obj `if test -f 'src/Daemon/FileAuditBackend.cpp'; then $(CYGPATH_W) 'src/Daemon/FileAuditBackend.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/FileAuditBackend.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-FileAuditBackend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/FileAuditBackend.cpp' object='src/Daemon/usbguard_daemon-FileAuditBackend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-FileAuditBackend.obj `if test -f 'src/Daemon/FileAuditBackend.cpp'; then $(CYGPATH_W) 'src/Daemon/FileAuditBackend.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/FileAuditBackend.cpp'; fi` src/Daemon/usbguard_daemon-LinuxAuditBackend.o: src/Daemon/LinuxAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-LinuxAuditBackend.o -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Tpo -c -o src/Daemon/usbguard_daemon-LinuxAuditBackend.o `test -f 'src/Daemon/LinuxAuditBackend.cpp' || echo '$(srcdir)/'`src/Daemon/LinuxAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/LinuxAuditBackend.cpp' object='src/Daemon/usbguard_daemon-LinuxAuditBackend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-LinuxAuditBackend.o `test -f 'src/Daemon/LinuxAuditBackend.cpp' || echo '$(srcdir)/'`src/Daemon/LinuxAuditBackend.cpp src/Daemon/usbguard_daemon-LinuxAuditBackend.obj: src/Daemon/LinuxAuditBackend.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/Daemon/usbguard_daemon-LinuxAuditBackend.obj -MD -MP -MF src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Tpo -c -o src/Daemon/usbguard_daemon-LinuxAuditBackend.obj `if test -f 'src/Daemon/LinuxAuditBackend.cpp'; then $(CYGPATH_W) 'src/Daemon/LinuxAuditBackend.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/LinuxAuditBackend.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Tpo src/Daemon/$(DEPDIR)/usbguard_daemon-LinuxAuditBackend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/Daemon/LinuxAuditBackend.cpp' object='src/Daemon/usbguard_daemon-LinuxAuditBackend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/Daemon/usbguard_daemon-LinuxAuditBackend.obj `if test -f 'src/Daemon/LinuxAuditBackend.cpp'; then $(CYGPATH_W) 'src/Daemon/LinuxAuditBackend.cpp'; else $(CYGPATH_W) '$(srcdir)/src/Daemon/LinuxAuditBackend.cpp'; fi` src/DBus/usbguard_dbus-gdbus-server.o: src/DBus/gdbus-server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/DBus/usbguard_dbus-gdbus-server.o -MD -MP -MF src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Tpo -c -o src/DBus/usbguard_dbus-gdbus-server.o `test -f 'src/DBus/gdbus-server.cpp' || echo '$(srcdir)/'`src/DBus/gdbus-server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Tpo src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/DBus/gdbus-server.cpp' object='src/DBus/usbguard_dbus-gdbus-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/DBus/usbguard_dbus-gdbus-server.o `test -f 'src/DBus/gdbus-server.cpp' || echo '$(srcdir)/'`src/DBus/gdbus-server.cpp src/DBus/usbguard_dbus-gdbus-server.obj: src/DBus/gdbus-server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/DBus/usbguard_dbus-gdbus-server.obj -MD -MP -MF src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Tpo -c -o src/DBus/usbguard_dbus-gdbus-server.obj `if test -f 'src/DBus/gdbus-server.cpp'; then $(CYGPATH_W) 'src/DBus/gdbus-server.cpp'; else $(CYGPATH_W) '$(srcdir)/src/DBus/gdbus-server.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Tpo src/DBus/$(DEPDIR)/usbguard_dbus-gdbus-server.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/DBus/gdbus-server.cpp' object='src/DBus/usbguard_dbus-gdbus-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/DBus/usbguard_dbus-gdbus-server.obj `if test -f 'src/DBus/gdbus-server.cpp'; then $(CYGPATH_W) 'src/DBus/gdbus-server.cpp'; else $(CYGPATH_W) '$(srcdir)/src/DBus/gdbus-server.cpp'; fi` src/DBus/usbguard_dbus-DBusBridge.o: src/DBus/DBusBridge.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/DBus/usbguard_dbus-DBusBridge.o -MD -MP -MF src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Tpo -c -o src/DBus/usbguard_dbus-DBusBridge.o `test -f 'src/DBus/DBusBridge.cpp' || echo '$(srcdir)/'`src/DBus/DBusBridge.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Tpo src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/DBus/DBusBridge.cpp' object='src/DBus/usbguard_dbus-DBusBridge.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/DBus/usbguard_dbus-DBusBridge.o `test -f 'src/DBus/DBusBridge.cpp' || echo '$(srcdir)/'`src/DBus/DBusBridge.cpp src/DBus/usbguard_dbus-DBusBridge.obj: src/DBus/DBusBridge.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/DBus/usbguard_dbus-DBusBridge.obj -MD -MP -MF src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Tpo -c -o src/DBus/usbguard_dbus-DBusBridge.obj `if test -f 'src/DBus/DBusBridge.cpp'; then $(CYGPATH_W) 'src/DBus/DBusBridge.cpp'; else $(CYGPATH_W) '$(srcdir)/src/DBus/DBusBridge.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Tpo src/DBus/$(DEPDIR)/usbguard_dbus-DBusBridge.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/DBus/DBusBridge.cpp' object='src/DBus/usbguard_dbus-DBusBridge.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_dbus_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/DBus/usbguard_dbus-DBusBridge.obj `if test -f 'src/DBus/DBusBridge.cpp'; then $(CYGPATH_W) 'src/DBus/DBusBridge.cpp'; else $(CYGPATH_W) '$(srcdir)/src/DBus/DBusBridge.cpp'; fi` src/CLI/usbguard_rule_parser-usbguard-rule-parser.o: src/CLI/usbguard-rule-parser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_rule_parser_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard_rule_parser-usbguard-rule-parser.o -MD -MP -MF src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Tpo -c -o src/CLI/usbguard_rule_parser-usbguard-rule-parser.o `test -f 'src/CLI/usbguard-rule-parser.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-rule-parser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Tpo src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-rule-parser.cpp' object='src/CLI/usbguard_rule_parser-usbguard-rule-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_rule_parser_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard_rule_parser-usbguard-rule-parser.o `test -f 'src/CLI/usbguard-rule-parser.cpp' || echo '$(srcdir)/'`src/CLI/usbguard-rule-parser.cpp src/CLI/usbguard_rule_parser-usbguard-rule-parser.obj: src/CLI/usbguard-rule-parser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_rule_parser_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/CLI/usbguard_rule_parser-usbguard-rule-parser.obj -MD -MP -MF src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Tpo -c -o src/CLI/usbguard_rule_parser-usbguard-rule-parser.obj `if test -f 'src/CLI/usbguard-rule-parser.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-rule-parser.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-rule-parser.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Tpo src/CLI/$(DEPDIR)/usbguard_rule_parser-usbguard-rule-parser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CLI/usbguard-rule-parser.cpp' object='src/CLI/usbguard_rule_parser-usbguard-rule-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(usbguard_rule_parser_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/CLI/usbguard_rule_parser-usbguard-rule-parser.obj `if test -f 'src/CLI/usbguard-rule-parser.cpp'; then $(CYGPATH_W) 'src/CLI/usbguard-rule-parser.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CLI/usbguard-rule-parser.cpp'; fi` .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 -rm -rf src/Common/.libs src/Common/_libs -rm -rf src/Library/.libs src/Library/_libs -rm -rf src/Library/IPC/.libs src/Library/IPC/_libs -rm -rf src/Library/public/usbguard/.libs src/Library/public/usbguard/_libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ 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='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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: $(man5_MANS) @$(NORMAL_INSTALL) @list1='$(man5_MANS)'; \ list2=''; \ 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='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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: $(man8_MANS) @$(NORMAL_INSTALL) @list1='$(man8_MANS)'; \ list2=''; \ 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='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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) install-appiconDATA: $(appicon_DATA) @$(NORMAL_INSTALL) @list='$(appicon_DATA)'; test -n "$(appicondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appicondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appicondir)" || 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)$(appicondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appicondir)" || exit $$?; \ done uninstall-appiconDATA: @$(NORMAL_UNINSTALL) @list='$(appicon_DATA)'; test -n "$(appicondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appicondir)'; $(am__uninstall_files_from_dir) install-desktopDATA: $(desktop_DATA) @$(NORMAL_INSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || 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)$(desktopdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ done uninstall-desktopDATA: @$(NORMAL_UNINSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) install-dist_bashcompletionDATA: $(dist_bashcompletion_DATA) @$(NORMAL_INSTALL) @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bashcompletiondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bashcompletiondir)" || 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)$(bashcompletiondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompletiondir)" || exit $$?; \ done uninstall-dist_bashcompletionDATA: @$(NORMAL_UNINSTALL) @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(bashcompletiondir)'; $(am__uninstall_files_from_dir) 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) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(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: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(appicondir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -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 src/CLI/$(DEPDIR)/$(am__dirstamp) -rm -f src/CLI/$(am__dirstamp) -rm -f src/Common/$(DEPDIR)/$(am__dirstamp) -rm -f src/Common/$(am__dirstamp) -rm -f src/DBus/$(DEPDIR)/$(am__dirstamp) -rm -f src/DBus/$(am__dirstamp) -rm -f src/Daemon/$(DEPDIR)/$(am__dirstamp) -rm -f src/Daemon/$(am__dirstamp) -rm -f src/GUI.Qt/$(DEPDIR)/$(am__dirstamp) -rm -f src/GUI.Qt/$(am__dirstamp) -rm -f src/Library/$(DEPDIR)/$(am__dirstamp) -rm -f src/Library/$(am__dirstamp) -rm -f src/Library/IPC/$(DEPDIR)/$(am__dirstamp) -rm -f src/Library/IPC/$(am__dirstamp) -rm -f src/Library/public/usbguard/$(DEPDIR)/$(am__dirstamp) -rm -f src/Library/public/usbguard/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf src/CLI/$(DEPDIR) src/Common/$(DEPDIR) src/DBus/$(DEPDIR) src/Daemon/$(DEPDIR) src/GUI.Qt/$(DEPDIR) src/Library/$(DEPDIR) src/Library/IPC/$(DEPDIR) src/Library/public/usbguard/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile 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-appiconDATA install-desktopDATA \ install-dist_bashcompletionDATA install-man \ install-pkgconfigDATA install-pkgincludeHEADERS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-man5 install-man8 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 -rf src/CLI/$(DEPDIR) src/Common/$(DEPDIR) src/DBus/$(DEPDIR) src/Daemon/$(DEPDIR) src/GUI.Qt/$(DEPDIR) src/Library/$(DEPDIR) src/Library/IPC/$(DEPDIR) src/Library/public/usbguard/$(DEPDIR) -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-appiconDATA uninstall-binPROGRAMS \ uninstall-desktopDATA uninstall-dist_bashcompletionDATA \ uninstall-libLTLIBRARIES uninstall-man uninstall-pkgconfigDATA \ uninstall-pkgincludeHEADERS uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .MAKE: $(am__recursive_targets) all check install install-am \ install-data-am install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-binPROGRAMS \ clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-appiconDATA install-binPROGRAMS install-data \ install-data-am install-data-hook install-desktopDATA \ install-dist_bashcompletionDATA 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-man1 install-man5 install-man8 install-pdf \ install-pdf-am install-pkgconfigDATA install-pkgincludeHEADERS \ install-ps install-ps-am install-sbinPROGRAMS 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-appiconDATA uninstall-binPROGRAMS \ uninstall-desktopDATA uninstall-dist_bashcompletionDATA \ uninstall-hook uninstall-libLTLIBRARIES uninstall-man \ uninstall-man1 uninstall-man5 uninstall-man8 \ uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile $(top_builddir)/src/build-config.h: $(top_builddir)/src/build-config.h.in $(SED) \ -e "s|[$$]{localstatedir}|${localstatedir}|g" \ -e "s|[$$]{exec_prefix}|${prefix}|g" \ -e "s|[$$]{datarootdir}|${datarootdir}|g" \ -e "s|[$$]{datadir}|${pkgdatadir}|g" \ -e "s|[$$]{sysconfdir}|${sysconfdir}|g" \ -e "s|[$$]{prefix}|${prefix}|g" \ -e "s|[$$]{PACKAGE_TARNAME}|${PACKAGE_TARNAME}|g" \ $^ > $@ || rm -f $@ $(top_builddir)/%.roff: %.adoc $(MKDIR_P) $$(dirname $@) $(ASCIIDOCTOR) -v -b manpage $^ -o $(top_builddir)/$@ $(INSTALL) -m 644 $(top_builddir)/$@ $(top_builddir)/$(@:.roff=) install-data-hook: install-daemon-conf install-systemd-service install-data-dbus uninstall-hook: uninstall-daemon-conf uninstall-systemd-service uninstall-data-dbus usbguard-daemon.conf: $(top_builddir)/usbguard-daemon.conf.in $(SED) \ -e "s|%sysconfdir%|${sysconfdir}|g" \ -e "s|%localstatedir%|${localstatedir}|g" \ $^ > $@ || rm -f $@ install-daemon-conf: $(top_builddir)/usbguard-daemon.conf $(MKDIR_P) $(DESTDIR)/$(usbguard_confdir) $(MKDIR_P) $(DESTDIR)/$(usbguard_confdir)/IPCAccessControl.d $(MKDIR_P) $(DESTDIR)/${localstatedir}/log/usbguard $(INSTALL) -m 600 $(top_builddir)/usbguard-daemon.conf \ $(DESTDIR)/$(usbguard_confdir)/usbguard-daemon.conf if ! test -f "$(DESTDIR)/$(usbguard_confdir)/rules.conf"; then \ touch $(DESTDIR)/$(usbguard_confdir)/rules.conf && \ chmod 600 $(DESTDIR)/$(usbguard_confdir)/rules.conf; \ fi uninstall-daemon-conf: rm -f $(DESTDIR)/$(usbguard_confdir)/usbguard-daemon.conf @SYSTEMD_SUPPORT_ENABLED_TRUE@usbguard.service: $(top_srcdir)/usbguard.service.in @SYSTEMD_SUPPORT_ENABLED_TRUE@ $(SED) -e "s|%sbindir%|${sbindir}|" -e "s|%sysconfdir%|${sysconfdir}|" $^ > $@ || rm -f $@ @SYSTEMD_SUPPORT_ENABLED_TRUE@install-systemd-service: $(top_builddir)/usbguard.service @SYSTEMD_SUPPORT_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) @SYSTEMD_SUPPORT_ENABLED_TRUE@ $(INSTALL) -m 644 $(top_builddir)/usbguard.service \ @SYSTEMD_SUPPORT_ENABLED_TRUE@ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard.service @SYSTEMD_SUPPORT_ENABLED_TRUE@uninstall-systemd-service: @SYSTEMD_SUPPORT_ENABLED_TRUE@ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard.service @SYSTEMD_SUPPORT_ENABLED_FALSE@install-systemd-service: @SYSTEMD_SUPPORT_ENABLED_FALSE@uninstall-systemd-service: # Workaround for generated protobuf code mishaps #``` # error: no previous declaration for 'void usbguard::IPC::protobuf_Message_2eproto::AddDescriptorImpl()' [-Werror=missing-declarations] # void AddDescriptorImpl() { # ^~~~~~~~~~~~~~~~~ #``` %.pb.lo : CXXFLAGS += -Wno-missing-declarations %.pb.cc %.pb.h: %.proto $(MKDIR_P) $(top_builddir)/src/Library/IPC @PROTOC@ --cpp_out=$(top_builddir)/src/Library/IPC --proto_path=$(top_srcdir)/src/Library/IPC "$<" sed -i -e '1i#ifndef __clang_analyzer__' -e '$$a#endif' "$@" @DBUS_ENABLED_TRUE@%.xml: @DBUS_ENABLED_TRUE@ xmllint "$(top_srcdir)/$@" > /dev/null @DBUS_ENABLED_TRUE@%.xml.cstr: %.xml @DBUS_ENABLED_TRUE@ XMLLINT_INDENT="" xmllint --noblanks --format "$<" |\ @DBUS_ENABLED_TRUE@ sed -n -e '// d; s|\"|\\"|g; s|.*|"&"|; p' > "$(top_builddir)/$@" @DBUS_ENABLED_TRUE@%.service: %.service.in @DBUS_ENABLED_TRUE@ sed -e "s|%{sbindir}%|$(sbindir)|" "$<" > "$(top_builddir)/$@" @DBUS_ENABLED_TRUE@install-data-dbus: $(top_builddir)/src/DBus/org.usbguard.service install-polkit-policy install-systemd-dbus-service @DBUS_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(DBUS_SERVICES_DIR) && \ @DBUS_ENABLED_TRUE@ $(INSTALL_DATA) $(top_builddir)/src/DBus/org.usbguard.service $(DESTDIR)$(DBUS_SERVICES_DIR) @DBUS_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(DBUS_BUSCONFIG_DIR) && \ @DBUS_ENABLED_TRUE@ $(INSTALL_DATA) $(top_srcdir)/src/DBus/org.usbguard.conf $(DESTDIR)$(DBUS_BUSCONFIG_DIR) @DBUS_ENABLED_TRUE@uninstall-data-dbus: uninstall-polkit-policy uninstall-systemd-dbus-service @DBUS_ENABLED_TRUE@ rm -f $(DESTDIR)$(DBUS_SERVICES_DIR)/org.usbguard.service @DBUS_ENABLED_TRUE@ rmdir $(DESTDIR)$(DBUS_SERVICES_DIR) @DBUS_ENABLED_TRUE@ rm -f $(DESTDIR)$(DBUS_BUSCONFIG_DIR)/org.usbguard.conf @DBUS_ENABLED_TRUE@ rmdir $(DESTDIR)$(DBUS_BUSCONFIG_DIR) @DBUS_ENABLED_TRUE@dbus-docs: $(top_srcdir)/src/DBus/DBusInterface.xml # # Copy the input files to builddir because gdbus-codegen # doesn't provide an option to store the output files somewhere # else than in the directory where the input files are. And we # don't want to create files in the srcdir when building. # @DBUS_ENABLED_TRUE@ $(MKDIR_P) "$(top_builddir)/src/DBus" @DBUS_ENABLED_TRUE@ cp "$<" "$(top_builddir)/src/DBus/" @DBUS_ENABLED_TRUE@ $(GDBUS_CODEGEN) --interface-prefix org.usbguard --generate-docbook=docbook \ @DBUS_ENABLED_TRUE@ "$(top_builddir)/src/DBus/DBusInterface.xml" @DBUS_ENABLED_TRUE@ for docbook in $(top_builddir)/docbook-org.usbguard.*.xml; do \ @DBUS_ENABLED_TRUE@ $(XSLTPROC) -o "$$(basename -s .xml $$docbook).html" \ @DBUS_ENABLED_TRUE@ "$(top_srcdir)/src/ThirdParty/xsl-stylesheets/xhtml-1_1/docbook.xsl" \ @DBUS_ENABLED_TRUE@ "$(top_builddir)/$$docbook"; \ @DBUS_ENABLED_TRUE@ done @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@install-polkit-policy: @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(POLKIT_POLICY_DIR) && \ @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@ $(INSTALL_DATA) $(top_srcdir)/src/DBus/org.usbguard.policy $(DESTDIR)$(POLKIT_POLICY_DIR) @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@uninstall-polkit-policy: @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@ rm -f $(DESTDIR)$(POLKIT_POLICY_DIR)/org.usbguard.policy @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_TRUE@ rmdir $(DESTDIR)$(POLKIT_POLICY_DIR) @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_FALSE@install-polkit-policy: @DBUS_ENABLED_TRUE@@POLICYKIT_ENABLED_FALSE@uninstall-polkit-policy: @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@install-systemd-dbus-service: $(top_builddir)/src/DBus/usbguard-dbus.service @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) && \ @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@ $(INSTALL_DATA) $(top_builddir)/src/DBus/usbguard-dbus.service $(DESTDIR)$(SYSTEMD_UNIT_DIR) @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@uninstall-systemd-dbus-service: @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-dbus.service @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_TRUE@ rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_FALSE@install-systemd-dbus-service: @DBUS_ENABLED_TRUE@@SYSTEMD_SUPPORT_ENABLED_FALSE@uninstall-systemd-dbus-service: @DBUS_ENABLED_FALSE@install-data-dbus: @DBUS_ENABLED_FALSE@uninstall-data-dbus: @GUI_QT_ENABLED_TRUE@%.qm: %.ts @GUI_QT_ENABLED_TRUE@ $(MKDIR_P) "$(top_builddir)/$(shell dirname $@)" @GUI_QT_ENABLED_TRUE@ @QTLRELEASE@ "$<" -qm "$@" @GUI_QT_ENABLED_TRUE@%.moc.cpp: %.h @GUI_QT_ENABLED_TRUE@ @QTMOC@ -f"$(shell basename $<)" -I$(top_srcdir)/src/GUI.Qt -o$(top_builddir)/$@ $(DEFS) $(DEFAULT_INCLUDES) $(MOC_CPPFLAGS) $< @GUI_QT_ENABLED_TRUE@%.ui.h: %.ui @GUI_QT_ENABLED_TRUE@ @QTUIC@ -g cpp -o $(top_builddir)/$@ $< # Workaround for older Qt generated code addressing: #``` # src/GUI.Qt/usbguard.qrc.cpp: In function ‘int qInitResources()’: # src/GUI.Qt/usbguard.qrc.cpp:2171:25: error: no previous declaration for # ‘int qInitResources()’ [-Werror=missing-declarations] # int QT_MANGLE_NAMESPACE(qInitResources)() #``` @GUI_QT_ENABLED_TRUE@%.qrc.$(OBJEXT) : CXXFLAGS += -Wno-missing-declarations @GUI_QT_ENABLED_TRUE@%.qrc.cpp: %.qrc @GUI_QT_ENABLED_TRUE@ @QTRCC@ -o $(top_builddir)/$@ $< @GUI_QT_ENABLED_TRUE@%.qrc: $(usbguard_applet_qt_RESOURCES) $(usbguard_applet_qt_TRANSLATIONS:.ts=.qm) @GUI_QT_ENABLED_TRUE@ echo '' > "$@.tmp" @GUI_QT_ENABLED_TRUE@ echo '' >> "$@.tmp" @GUI_QT_ENABLED_TRUE@ for file in $(usbguard_applet_qt_RESOURCES); do \ @GUI_QT_ENABLED_TRUE@ base=$$(basename $$file); \ @GUI_QT_ENABLED_TRUE@ echo "$(abs_top_srcdir)/$$file" >> "$@.tmp"; \ @GUI_QT_ENABLED_TRUE@ done @GUI_QT_ENABLED_TRUE@ echo '' >> "$@.tmp" @GUI_QT_ENABLED_TRUE@ echo '' >> "$@.tmp" @GUI_QT_ENABLED_TRUE@ for file in $(usbguard_applet_qt_TRANSLATIONS); do \ @GUI_QT_ENABLED_TRUE@ base=$$(basename -s .ts $$file); \ @GUI_QT_ENABLED_TRUE@ echo "$(abs_top_builddir)/src/GUI.Qt/translations/$$base.qm" >> "$@.tmp"; \ @GUI_QT_ENABLED_TRUE@ done @GUI_QT_ENABLED_TRUE@ echo '' >> "$@.tmp" @GUI_QT_ENABLED_TRUE@ echo '' >> "$@.tmp" @GUI_QT_ENABLED_TRUE@ mv "$@.tmp" "$@" $(DIST_ARCHIVES): test -f "$@" || $(MAKE) dist release-files: $(DIST_ARCHIVES) $(eval RELEASE_DIR:="release.$(PACKAGE)-$(VERSION)") $(eval GPG:=$(shell test -n "$$QUBES_GPG_DOMAIN" && echo qubes-gpg-client || echo gpg2)) $(MKDIR_P) $(RELEASE_DIR) cp $(DIST_ARCHIVES) $(RELEASE_DIR) cd $(RELEASE_DIR) && $(GPG) -b -a -o - $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sig cd $(RELEASE_DIR) && openssl sha256 $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sum analyze-clang: $(eval ANALYSIS_ROOT:=$(shell mktemp -d -t usbguard-analyze-clang.XXXXXX)) $(eval JOBS:=$(shell grep -c '^processor' /proc/cpuinfo 2> /dev/null || echo 1)) cd "$(ANALYSIS_ROOT)" && scan-build $(abs_top_srcdir)/configure $(ANALYZE_CONFIGURE_ARGS) cd "$(ANALYSIS_ROOT)" && scan-build \ --status-bugs -maxloop 8 -disable-checker deadcode.DeadStores -o "$(abs_top_builddir)" \ make -j$(JOBS) rm -rf "$(ANALYSIS_ROOT)" # # overriding 'check' target to enable "make check" to perform build as well # check: all $(MAKE) $(AM_MAKEFLAGS) check-recursive # 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: usbguard-0.7.2+ds/README.adoc000066400000000000000000000065221325273707200155400ustar00rootroot00000000000000USBGuard ======== :toc: [.clearfix] -- [.left] image::https://travis-ci.org/USBGuard/usbguard.svg?branch=master[Travis CI, link=https://travis-ci.org/USBGuard/usbguard] [.left] image::https://coveralls.io/repos/github/USBGuard/usbguard/badge.svg[Coverage, link=https://coveralls.io/github/USBGuard/usbguard] [.left] image::https://img.shields.io/github/license/USBGuard/usbguard.svg[License, link=https://github.com/USBGuard/usbguard/#license] -- == About USBGuard is a software framework for implementing USB device authorization policies (what kind of USB devices are authorized) as well as method of use policies (how a USB device may interact with the system). Simply put, it is a USB device whitelisting tool. WARNING: The 0.x releases are not production ready packages. They serve for tech-preview and user feedback purposes only. Please share your feedback or request a feature in the Github issue trackers for each project: * https://github.com/USBGuard/usbguard/issues/new[Report a bug or request a feature in *usbguard*] == Documentation * User Guide (TBA) * Manual Pages ** <> ** <> ** <> ** <> ** <> ** <> == Compilation & Installation To compile the sources from a release tarball, you'll need the development files for: * https://github.com/ClusterLabs/libqb[libqb] - used for local UNIX socket based IPC * https://github.com/google/protobuf[protobuf] - used for IPC message (de)serialization * https://download.libsodium.org[libsodium] or https://www.gnupg.org/software/libgcrypt[libgcrypt] - used for hashing * https://asciidoctor.org[asciidoctor] - needed to generate documentation Optionally, you may want to install: * https://github.com/seccomp/libseccomp[libseccomp] - used to implement a syscall whitelist * https://people.redhat.com/sgrubb/libcap-ng/[libcap-ng] - used to drop process capabilities And then do: $ ./configure --with-crypto-library=sodium # or "gcrypt", based on your preference $ make $ sudo make install After the sources are successfully built, you can run the test suite by executing: $ make check If you want to compile the sources in a cloned repository, you'll have to run the `./autogen.sh` script. It will fetch the sources (via git submodules) of https://github.com/taocpp/PEGTL/[PEGTL] and https://github.com/philsquared/Catch[Catch]. The script will then initialize the autotools based build system. == License Copyright (C) 2015-2017 Red Hat, 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 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 . usbguard-0.7.2+ds/VERSION000066400000000000000000000000061325273707200150120ustar00rootroot000000000000000.7.2 usbguard-0.7.2+ds/aclocal.m4000066400000000000000000001533701325273707200156170ustar00rootroot00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2014 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.15' 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.15], [], [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.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 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-2014 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-2014 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-2014 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 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-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 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 to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 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-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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_check_compile_flag.m4]) m4_include([m4/libgcrypt.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]) usbguard-0.7.2+ds/config/000077500000000000000000000000001325273707200152135ustar00rootroot00000000000000usbguard-0.7.2+ds/config/compile000077500000000000000000000162451325273707200166010ustar00rootroot00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/config/config.guess000077500000000000000000001256441325273707200175470ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-10-02' # 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: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64el:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: usbguard-0.7.2+ds/config/config.sub000077500000000000000000001067371325273707200172140ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-09-05' # 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: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: usbguard-0.7.2+ds/config/depcomp000077500000000000000000000560161325273707200166000ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/config/install-sh000077500000000000000000000345231325273707200172260ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. 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 dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac 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=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/config/ltmain.sh000066400000000000000000011707711325273707200170510ustar00rootroot00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # 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=: ;; # # 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 # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # 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_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse 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 [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_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 propogate 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+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # 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+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break 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 ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # 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+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 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= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _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; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -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=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $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|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) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: usbguard-0.7.2+ds/config/missing000077500000000000000000000153301325273707200166140ustar00rootroot00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 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=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/config/test-driver000077500000000000000000000110401325273707200174050ustar00rootroot00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/configure000077500000000000000000025574621325273707200157020ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for usbguard 0.7.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: usbguard@usbguard.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='usbguard' PACKAGE_TARNAME='usbguard' PACKAGE_VERSION='0.7.2' PACKAGE_STRING='usbguard 0.7.2' PACKAGE_BUGREPORT='usbguard@usbguard.org' PACKAGE_URL='' ac_unique_file="src/" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS BASH_COMPLETION_ENABLED_FALSE BASH_COMPLETION_ENABLED_TRUE FULL_TEST_SUITE_ENABLED_FALSE FULL_TEST_SUITE_ENABLED_TRUE POLICYKIT_ENABLED_FALSE POLICYKIT_ENABLED_TRUE DBUS_ENABLED_FALSE DBUS_ENABLED_TRUE GUI_QT_ENABLED_FALSE GUI_QT_ENABLED_TRUE SYSTEMD_SUPPORT_ENABLED_FALSE SYSTEMD_SUPPORT_ENABLED_TRUE BASH_COMPLETION_DIR ANALYZE_CONFIGURE_ARGS SYSTEMD_UNIT_DIR BASH_COMPLETION_LIBS BASH_COMPLETION_CFLAGS LIBOBJS ALLOCA ASPELL ASCIIDOCTOR POLKIT_POLICY_DIR polkit_LIBS polkit_CFLAGS DBUS_BUSCONFIG_DIR DBUS_SERVICES_DIR GDBUS_CODEGEN XSLTPROC XMLLINT dbus_LIBS dbus_CFLAGS qt_LIBS qt_CFLAGS QTLRELEASE QTRCC QTUIC QTMOC QT4LRELEASE QT4RCC QT4UIC QT4MOC qt4_LIBS qt4_CFLAGS QT5LRELEASE QT5RCC QT5UIC QT5MOC qt5_LIBS qt5_CFLAGS pegtl_LIBS pegtl_AC_CFLAGS pegtl_CFLAGS catch_LIBS catch_CFLAGS PROTOC protobuf_LIBS protobuf_CFLAGS libcapng_LIBS libcapng_CFLAGS seccomp_LIBS seccomp_CFLAGS audit_LIBS audit_CFLAGS crypto_LIBS crypto_CFLAGS LIBGCRYPT_LIBS LIBGCRYPT_CFLAGS LIBGCRYPT_CONFIG sodium_LIBS sodium_CFLAGS qb_LIBS qb_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG atomic_LIBS CXXCPP CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX LT_AGE LT_REVISION LT_CURRENT am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_coverage enable_werror enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_libgcrypt_prefix with_crypto_library with_bundled_catch with_bundled_pegtl with_gui_qt with_dbus with_polkit enable_asan enable_tsan enable_full_test_suite enable_debug_build enable_systemd ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH CPP CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR qb_CFLAGS qb_LIBS sodium_CFLAGS sodium_LIBS audit_CFLAGS audit_LIBS seccomp_CFLAGS seccomp_LIBS libcapng_CFLAGS libcapng_LIBS protobuf_CFLAGS protobuf_LIBS qt5_CFLAGS qt5_LIBS qt4_CFLAGS qt4_LIBS dbus_CFLAGS dbus_LIBS polkit_CFLAGS polkit_LIBS BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures usbguard 0.7.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/usbguard] --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 usbguard 0.7.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-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-coverage enable instrumented compilation for code coverage testing (default=no) --enable-werror treat compiler warnings as errors (default=no) --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-asan Enable Address Sanitizer --enable-tsan Enable Thread Sanitizer --enable-full-test-suite Run the full test suite (default=no) --enable-debug-build enable debugging flags (default=no) --enable-systemd install the systemd service unit file (default=no) 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-libgcrypt-prefix=PFX prefix where LIBGCRYPT is installed (optional) --with-crypto-library Select crypto backend library. Supported values: sodium, gcrypt. --with-bundled-catch Build using the bundled Catch library --with-bundled-pegtl Build using the bundled PEGTL library --with-gui-qt Build the Qt GUI components --with-dbus Build the DBus Bridge service --with-polkit Install the PolicyKit configuration if D-Bus support is also enabled 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 CXX C++ compiler command CXXFLAGS C++ compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path qb_CFLAGS C compiler flags for qb, overriding pkg-config qb_LIBS linker flags for qb, overriding pkg-config sodium_CFLAGS C compiler flags for sodium, overriding pkg-config sodium_LIBS linker flags for sodium, overriding pkg-config audit_CFLAGS C compiler flags for audit, overriding pkg-config audit_LIBS linker flags for audit, overriding pkg-config seccomp_CFLAGS C compiler flags for seccomp, overriding pkg-config seccomp_LIBS linker flags for seccomp, overriding pkg-config libcapng_CFLAGS C compiler flags for libcapng, overriding pkg-config libcapng_LIBS linker flags for libcapng, overriding pkg-config protobuf_CFLAGS C compiler flags for protobuf, overriding pkg-config protobuf_LIBS linker flags for protobuf, overriding pkg-config qt5_CFLAGS C compiler flags for qt5, overriding pkg-config qt5_LIBS linker flags for qt5, overriding pkg-config qt4_CFLAGS C compiler flags for qt4, overriding pkg-config qt4_LIBS linker flags for qt4, overriding pkg-config dbus_CFLAGS C compiler flags for dbus, overriding pkg-config dbus_LIBS linker flags for dbus, overriding pkg-config polkit_CFLAGS C compiler flags for polkit, overriding pkg-config polkit_LIBS linker flags for polkit, overriding pkg-config BASH_COMPLETION_CFLAGS C compiler flags for BASH_COMPLETION, overriding pkg-config BASH_COMPLETION_LIBS linker flags for BASH_COMPLETION, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF usbguard configure 0.7.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------ ## ## Report this to usbguard@usbguard.org ## ## ------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { 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_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { 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_cxx_try_compile "$LINENO"; then : else 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t 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 usbguard $as_me 0.7.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/build-config.h.in" ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='usbguard' VERSION='0.7.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 $as_echo_n "checking how to create a pax tar archive... " >&6; } # 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_pax-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' am__tar_="$_am_tar --format=posix -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 pax -w "$$tardir"' am__tar_='pax -L -x pax -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H pax -L' am__tar_='find "$tardir" -print | cpio -o -H pax -L' am__untar='cpio -i -H pax -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_pax}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_pax+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_pax=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 $as_echo "$am_cv_prog_tar_pax" >&6; } # 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 # If automake supports "silent rules", enable them by default # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # # Compiler flags # EXTERNAL_CXXFLAGS="$CXXFLAGS" EXTERNAL_CFLAGS="$CFLAGS" EXTERNAL_CPPFLAGS="$CPPFLAGS" COMMON_WARNING_FLAGS=" -pedantic" COMMON_WARNING_FLAGS+=" -Wno-unknown-pragmas" COMMON_WARNING_FLAGS+=" -Wall" COMMON_WARNING_FLAGS+=" -Wextra" COMMON_WARNING_FLAGS+=" -Wformat=2" COMMON_WARNING_FLAGS+=" -Wredundant-decls" COMMON_WARNING_FLAGS+=" -Wcast-align" COMMON_WARNING_FLAGS+=" -Wmissing-declarations" COMMON_WARNING_FLAGS+=" -Wmissing-include-dirs" COMMON_WARNING_FLAGS+=" -Wmissing-format-attribute" COMMON_WARNING_FLAGS+=" -Wswitch-enum" COMMON_WARNING_FLAGS+=" -Wswitch-default" COMMON_WARNING_FLAGS+=" -Winvalid-pch" COMMON_WARNING_FLAGS+=" -Wformat-nonliteral" #COMMON_WARNING_FLAGS+=" -flto -Wodr" # # Workaround for older compilers warning about { } # not initializing all struct fields. # COMMON_WARNING_FLAGS+=" -Wno-missing-field-initializers" # # Don't warn about implicit fallthrough # # TODO: Use [[fallthrough]] C++ attribute specifier with # newer compiler versions. # DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-implicit-fallthrough" >&5 $as_echo_n "checking whether C compiler accepts -Wno-implicit-fallthrough... " >&6; } if ${ax_cv_check_cflags___Wno_implicit_fallthrough+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Wno-implicit-fallthrough" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags___Wno_implicit_fallthrough=yes else ax_cv_check_cflags___Wno_implicit_fallthrough=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_implicit_fallthrough" >&5 $as_echo "$ax_cv_check_cflags___Wno_implicit_fallthrough" >&6; } if test "x$ax_cv_check_cflags___Wno_implicit_fallthrough" = xyes; then : COMMON_WARNING_FLAGS+=" -Wno-implicit-fallthrough" else : fi # # Final project CXXFLAGS are set after configure checks. # CXXFLAGS="-std=c++11 $EXTERNAL_CXXFLAGS" CFLAGS="-std=c99 $EXTERNAL_CFLAGS" CPPFLAGS="-DHAVE_BUILD_CONFIG_H $EXTERNAL_CPPFLAGS" # # Additional CXXFLAGS used when --enable-debug-build is used # CXXFLAGS_DEBUG_ENABLED="-g -O0" # # Additional CXXFLAGS used when --disable-debug-build is used # and when --enable-debug-build is # # Don't add -DNDEBUG here. It's added to the generated config.h # header file. # CXXFLAGS_DEBUG_DISABLED="" # Libtool Versioning # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details ## increment if the interface has additions, changes, removals. LT_CURRENT=0 ## increment any time the source changes; set 0 to if you increment CURRENT LT_REVISION=0 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has ## precedence over adding, so set to 0 if both happened. LT_AGE=0 # Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; case "${enableval}" in yes) coverage=yes ;; no) coverage=no ;; *) as_fn_error $? "bad value ${enableval} for --enable-coverage" "$LINENO" 5 ;; esac else coverage=no fi if test "x$coverage" = xyes; then CXXFLAGS="$CXXFLAGS --coverage" CFLAGS="$CFLAGS --coverage" fi # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in yes) werror=yes ;; no) werror=no ;; *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; esac else werror=no fi if test "x$werror" = xyes; then COMMON_WARNING_FLAGS=" -Werror $COMMON_WARNING_FLAGS" 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 do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __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 your preprocessor is broken; #endif #if BIG_OK #else 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 void 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; float fnumber; 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); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. 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[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 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 test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi 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 ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check if libatomic is available, might be required for emulating # atomic intrinsics on some platforms. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_add_fetch_8 in -latomic" >&5 $as_echo_n "checking for __atomic_add_fetch_8 in -latomic... " >&6; } if ${ac_cv_lib_atomic___atomic_add_fetch_8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-latomic $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __atomic_add_fetch_8 (); int main () { return __atomic_add_fetch_8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_atomic___atomic_add_fetch_8=yes else ac_cv_lib_atomic___atomic_add_fetch_8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atomic___atomic_add_fetch_8" >&5 $as_echo "$ac_cv_lib_atomic___atomic_add_fetch_8" >&6; } if test "x$ac_cv_lib_atomic___atomic_add_fetch_8" = xyes; then : __saved_LIBS="$LIBS" LIBS="$LIBS -Wl,--push-state,--as-needed,-latomic,--pop-state" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : atomic_LIBS="-Wl,--push-state,--as-needed,-latomic,--pop-state" else atomic_LIBS="-latomic" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$__saved_LIBS" else atomic_LIBS="" fi # # Checks for required libraries. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETLINK_KOBJECT_UEVENT definition" >&5 $as_echo_n "checking for NETLINK_KOBJECT_UEVENT definition... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(void) { return NETLINK_KOBJECT_UEVENT; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_uevent=yes else have_uevent=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$have_uevent" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_UEVENT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # # qb library # if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for qb" >&5 $as_echo_n "checking for qb... " >&6; } if test -n "$qb_CFLAGS"; then pkg_cv_qb_CFLAGS="$qb_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libqb >= 0.16.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libqb >= 0.16.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qb_CFLAGS=`$PKG_CONFIG --cflags "libqb >= 0.16.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$qb_LIBS"; then pkg_cv_qb_LIBS="$qb_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libqb >= 0.16.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libqb >= 0.16.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qb_LIBS=`$PKG_CONFIG --libs "libqb >= 0.16.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then qb_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libqb >= 0.16.0" 2>&1` else qb_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libqb >= 0.16.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$qb_PKG_ERRORS" >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "libqb development files not found! See \`config.log' for more details" "$LINENO" 5; } elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "libqb development files not found! See \`config.log' for more details" "$LINENO" 5; } else qb_CFLAGS=$pkg_cv_qb_CFLAGS qb_LIBS=$pkg_cv_qb_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBQB 1" >>confdefs.h libqb_summary="system-wide; $qb_CFLAGS $qb_LIBS" fi # # sodium library # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sodium" >&5 $as_echo_n "checking for sodium... " >&6; } if test -n "$sodium_CFLAGS"; then pkg_cv_sodium_CFLAGS="$sodium_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium >= 0.4.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsodium >= 0.4.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_sodium_CFLAGS=`$PKG_CONFIG --cflags "libsodium >= 0.4.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$sodium_LIBS"; then pkg_cv_sodium_LIBS="$sodium_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium >= 0.4.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsodium >= 0.4.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_sodium_LIBS=`$PKG_CONFIG --libs "libsodium >= 0.4.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then sodium_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsodium >= 0.4.5" 2>&1` else sodium_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsodium >= 0.4.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$sodium_PKG_ERRORS" >&5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else sodium_CFLAGS=$pkg_cv_sodium_CFLAGS sodium_LIBS=$pkg_cv_sodium_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBSODIUM 1" >>confdefs.h libsodium_summary="system-wide; $sodium_CFLAGS $sodium_LIBS" libsodium_available=yes fi # # gcrypt library # # Check whether --with-libgcrypt-prefix was given. if test "${with_libgcrypt_prefix+set}" = set; then : withval=$with_libgcrypt_prefix; libgcrypt_config_prefix="$withval" else libgcrypt_config_prefix="" fi if test x$libgcrypt_config_prefix != x ; then if test x${LIBGCRYPT_CONFIG+set} != xset ; then LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}libgcrypt-config", so it can be a program name with args. set dummy ${ac_tool_prefix}libgcrypt-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBGCRYPT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBGCRYPT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG if test -n "$LIBGCRYPT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 $as_echo "$LIBGCRYPT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_LIBGCRYPT_CONFIG"; then ac_pt_LIBGCRYPT_CONFIG=$LIBGCRYPT_CONFIG # Extract the first word of "libgcrypt-config", so it can be a program name with args. set dummy libgcrypt-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_LIBGCRYPT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_LIBGCRYPT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_LIBGCRYPT_CONFIG="$ac_pt_LIBGCRYPT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_LIBGCRYPT_CONFIG=$ac_cv_path_ac_pt_LIBGCRYPT_CONFIG if test -n "$ac_pt_LIBGCRYPT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LIBGCRYPT_CONFIG" >&5 $as_echo "$ac_pt_LIBGCRYPT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_LIBGCRYPT_CONFIG" = x; then LIBGCRYPT_CONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIBGCRYPT_CONFIG=$ac_pt_LIBGCRYPT_CONFIG fi else LIBGCRYPT_CONFIG="$ac_cv_path_LIBGCRYPT_CONFIG" fi tmp=1.5.0 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_libgcrypt_api=0 min_libgcrypt_version="$tmp" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGCRYPT - version >= $min_libgcrypt_version" >&5 $as_echo_n "checking for LIBGCRYPT - version >= $min_libgcrypt_version... " >&6; } ok=no if test "$LIBGCRYPT_CONFIG" != "no" ; then req_major=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` major=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` micro=`echo $libgcrypt_config_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libgcrypt_config_version)" >&5 $as_echo "yes ($libgcrypt_config_version)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test $ok = yes; then # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGCRYPT API version" >&5 $as_echo_n "checking LIBGCRYPT API version... " >&6; } if test "$req_libgcrypt_api" -eq "$tmp" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: okay" >&5 $as_echo "okay" >&6; } else ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: does not match. want=$req_libgcrypt_api got=$tmp" >&5 $as_echo "does not match. want=$req_libgcrypt_api got=$tmp" >&6; } fi fi fi fi if test $ok = yes; then LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` $as_echo "#define HAVE_LIBGCRYPT 1" >>confdefs.h gcrypt_CFLAGS="$LIBGCRYPT_CFLAGS" gcrypt_LIBS="$LIBGCRYPT_LIBS" libgcrypt_summary="system-wide; $gcrypt_CFLAGS $gcrypt_LIBS" libgcrypt_available=yes libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** *** The config script $LIBGCRYPT_CONFIG was *** built for $libgcrypt_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgcrypt-prefix *** to specify a matching config script. ***" >&5 $as_echo "$as_me: WARNING: *** *** The config script $LIBGCRYPT_CONFIG was *** built for $libgcrypt_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgcrypt-prefix *** to specify a matching config script. ***" >&2;} fi fi else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" fi # # --with-crypto-library= # # Supported selectors: # # sodium ... libsodium # gcrypt ... libgcrypt # # Check whether --with-crypto-library was given. if test "${with_crypto_library+set}" = set; then : withval=$with_crypto_library; with_crypto_library=$withval else with_crypto_library=sodium fi case "$with_crypto_library" in sodium) if test "x$libsodium_available" = xyes; then crypto_CFLAGS="$sodium_CFLAGS" crypto_LIBS="$sodium_LIBS" crypto_summary="$libsodium_summary" $as_echo "#define USBGUARD_USE_LIBSODIUM 1" >>confdefs.h else as_fn_error $? "The selected crypto backend library is not available." "$LINENO" 5 fi ;; gcrypt) if test "x$libgcrypt_available" = xyes; then crypto_CFLAGS="$gcrypt_CFLAGS" crypto_LIBS="$gcrypt_LIBS" crypto_summary="$libgcrypt_summary" $as_echo "#define USBGUARD_USE_LIBGCRYPT 1" >>confdefs.h else as_fn_error $? "The selected crypto backend library is not available." "$LINENO" 5 fi ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Invalid crypto library selector. Supported selectors: sodium, gcrypt See \`config.log' for more details" "$LINENO" 5; } esac # # Check for optional libraries # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for audit" >&5 $as_echo_n "checking for audit... " >&6; } if test -n "$audit_CFLAGS"; then pkg_cv_audit_CFLAGS="$audit_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audit >= 2.7.7\""; } >&5 ($PKG_CONFIG --exists --print-errors "audit >= 2.7.7") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_audit_CFLAGS=`$PKG_CONFIG --cflags "audit >= 2.7.7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$audit_LIBS"; then pkg_cv_audit_LIBS="$audit_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audit >= 2.7.7\""; } >&5 ($PKG_CONFIG --exists --print-errors "audit >= 2.7.7") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_audit_LIBS=`$PKG_CONFIG --libs "audit >= 2.7.7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then audit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "audit >= 2.7.7" 2>&1` else audit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "audit >= 2.7.7" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$audit_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: libaudit development files not found! Linux Audit support wille be turned OFF" >&5 $as_echo "$as_me: libaudit development files not found! Linux Audit support wille be turned OFF" >&6;} libaudit_summary="not found" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: libaudit development files not found! Linux Audit support wille be turned OFF" >&5 $as_echo "$as_me: libaudit development files not found! Linux Audit support wille be turned OFF" >&6;} libaudit_summary="not found" else audit_CFLAGS=$pkg_cv_audit_CFLAGS audit_LIBS=$pkg_cv_audit_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LINUX_AUDIT 1" >>confdefs.h ac_fn_c_check_decl "$LINENO" "audit_encode_nv_string" "ac_cv_have_decl_audit_encode_nv_string" "#include " if test "x$ac_cv_have_decl_audit_encode_nv_string" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_AUDIT_ENCODE_NV_STRING $ac_have_decl _ACEOF libaudit_summary="system-wide; $audit_LIBS" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for seccomp" >&5 $as_echo_n "checking for seccomp... " >&6; } if test -n "$seccomp_CFLAGS"; then pkg_cv_seccomp_CFLAGS="$seccomp_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libseccomp >= 2.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libseccomp >= 2.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_seccomp_CFLAGS=`$PKG_CONFIG --cflags "libseccomp >= 2.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$seccomp_LIBS"; then pkg_cv_seccomp_LIBS="$seccomp_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libseccomp >= 2.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libseccomp >= 2.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_seccomp_LIBS=`$PKG_CONFIG --libs "libseccomp >= 2.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then seccomp_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libseccomp >= 2.0.0" 2>&1` else seccomp_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libseccomp >= 2.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$seccomp_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: libseccomp development files not found! Seccomp support will be turned OFF" >&5 $as_echo "$as_me: libseccomp development files not found! Seccomp support will be turned OFF" >&6;} libseccomp_summary="not found" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: libseccomp development files not found! Seccomp support will be turned OFF" >&5 $as_echo "$as_me: libseccomp development files not found! Seccomp support will be turned OFF" >&6;} libseccomp_summary="not found" else seccomp_CFLAGS=$pkg_cv_seccomp_CFLAGS seccomp_LIBS=$pkg_cv_seccomp_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SECCOMP 1" >>confdefs.h libseccomp_summary="system-wide; $seccomp_LIBS" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcapng" >&5 $as_echo_n "checking for libcapng... " >&6; } if test -n "$libcapng_CFLAGS"; then pkg_cv_libcapng_CFLAGS="$libcapng_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcap-ng >= 0.7.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcap-ng >= 0.7.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcapng_CFLAGS=`$PKG_CONFIG --cflags "libcap-ng >= 0.7.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcapng_LIBS"; then pkg_cv_libcapng_LIBS="$libcapng_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcap-ng >= 0.7.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcap-ng >= 0.7.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcapng_LIBS=`$PKG_CONFIG --libs "libcap-ng >= 0.7.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcapng_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcap-ng >= 0.7.0" 2>&1` else libcapng_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcap-ng >= 0.7.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcapng_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: libseccomp development files not found! Seccomp support will be turned OFF" >&5 $as_echo "$as_me: libseccomp development files not found! Seccomp support will be turned OFF" >&6;} libcap_ng_summary="not found" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: libseccomp development files not found! Seccomp support will be turned OFF" >&5 $as_echo "$as_me: libseccomp development files not found! Seccomp support will be turned OFF" >&6;} libcap_ng_summary="not found" else libcapng_CFLAGS=$pkg_cv_libcapng_CFLAGS libcapng_LIBS=$pkg_cv_libcapng_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBCAPNG 1" >>confdefs.h libcap_ng_summary="system-wide; $libcapng_LIBS" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for protobuf" >&5 $as_echo_n "checking for protobuf... " >&6; } if test -n "$protobuf_CFLAGS"; then pkg_cv_protobuf_CFLAGS="$protobuf_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"protobuf >= 2.5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "protobuf >= 2.5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_protobuf_CFLAGS=`$PKG_CONFIG --cflags "protobuf >= 2.5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$protobuf_LIBS"; then pkg_cv_protobuf_LIBS="$protobuf_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"protobuf >= 2.5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "protobuf >= 2.5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_protobuf_LIBS=`$PKG_CONFIG --libs "protobuf >= 2.5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then protobuf_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "protobuf >= 2.5.0" 2>&1` else protobuf_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "protobuf >= 2.5.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$protobuf_PKG_ERRORS" >&5 as_fn_error $? "Required protobuf development files not found!" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Required protobuf development files not found!" "$LINENO" 5 else protobuf_CFLAGS=$pkg_cv_protobuf_CFLAGS protobuf_LIBS=$pkg_cv_protobuf_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } protobuf_summary="system-wide; $protobuf_CFLAGS $protobuf_LIBS" fi for ac_prog in protoc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PROTOC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PROTOC"; then ac_cv_prog_PROTOC="$PROTOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PROTOC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PROTOC=$ac_cv_prog_PROTOC if test -n "$PROTOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROTOC" >&5 $as_echo "$PROTOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PROTOC" && break done if test -z "$PROTOC"; then as_fn_error $? "\"Required protobuf compiler not found!\"" "$LINENO" 5 fi # # Catch C++ library # # Check whether --with-bundled-catch was given. if test "${with_bundled_catch+set}" = set; then : withval=$with_bundled_catch; with_bundled_catch=$withval else with_bundled_catch=no fi if test "x$with_bundled_catch" = xyes; then catch_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/Catch/include" catch_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: Using bundled Catch library" >&5 $as_echo "$as_me: Using bundled Catch library" >&6;} catch_summary="bundled; $catch_CFLAGS $catch_LIBS" else SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $CPPFLAGS -I/usr/include/catch" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "catch.hpp" "ac_cv_header_catch_hpp" "$ac_includes_default" if test "x$ac_cv_header_catch_hpp" = xyes; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "catch.hpp not found or not usable. Re-run with --with-bundled-catch to use the bundled library. 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 catch_CFLAGS="-I/usr/include/catch" catch_LIBS="" CPPFLAGS=$SAVE_CPPFLAGS catch_summary="system-wide; $catch_CFLAGS $catch_LIBS" fi # # PEGTL C++ library # # Check whether --with-bundled-pegtl was given. if test "${with_bundled_pegtl+set}" = set; then : withval=$with_bundled_pegtl; with_bundled_pegtl=$withval else with_bundled_pegtl=no fi if test "x$with_bundled_pegtl" = xyes; then pegtl_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/PEGTL" pegtl_AC_CFLAGS="-I$srcdir/src/ThirdParty/PEGTL" pegtl_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: Using bundled PEGTL library" >&5 $as_echo "$as_me: Using bundled PEGTL library" >&6;} pegtl_summary="bundled; $pegtl_CFLAGS $pegtl_LIBS" else SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $CPPFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "pegtl.hh" "ac_cv_header_pegtl_hh" "$ac_includes_default" if test "x$ac_cv_header_pegtl_hh" = xyes; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "pegtl.hh not found or not usable. Re-run with --with-bundled-pegtl to use the bundled library. 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 pegtl_CFLAGS="" pegtl_AC_CFLAGS="" pegtl_LIBS="" CPPFLAGS=$SAVE_CPPFLAGS pegtl_summary="system-wide; $pegtl_CFLAGS $pegtl_LIBS" fi # # Check whether the available PEGTL library is compatible # with version 1.3.1 or older. # SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $pegtl_AC_CFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(void) { struct grammar : pegtl::one<'g'> {}; try { pegtl::parse_string(std::string(), std::string()); } catch(const pegtl::parse_error& ex) { auto b = ex.positions[0].byte_in_line; } return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : have_pegtl_lte_131=no else have_pegtl_lte_131=yes fi rm -f core conftest.err conftest.$ac_objext 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 if test "x$have_pegtl_lte_131" = xyes; then $as_echo "#define HAVE_PEGTL_LTE_1_3_1 1" >>confdefs.h fi CPPFLAGS=$SAVE_CPPFLAGS # # Qt GUI # # Check whether --with-gui-qt was given. if test "${with_gui_qt+set}" = set; then : withval=$with_gui_qt; with_gui_qt=$withval else with_gui_qt=no fi # # Check for Qt 5.x # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for qt5" >&5 $as_echo_n "checking for qt5... " >&6; } if test -n "$qt5_CFLAGS"; then pkg_cv_qt5_CFLAGS="$qt5_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qt5_CFLAGS=`$PKG_CONFIG --cflags "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$qt5_LIBS"; then pkg_cv_qt5_LIBS="$qt5_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qt5_LIBS=`$PKG_CONFIG --libs "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then qt5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0" 2>&1` else qt5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$qt5_PKG_ERRORS" >&5 qt5_available=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } qt5_available=no else qt5_CFLAGS=$pkg_cv_qt5_CFLAGS qt5_LIBS=$pkg_cv_qt5_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } export QT_SELECT=5 for ac_prog in moc-qt5 moc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT5MOC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT5MOC"; then ac_cv_prog_QT5MOC="$QT5MOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT5MOC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT5MOC=$ac_cv_prog_QT5MOC if test -n "$QT5MOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT5MOC" >&5 $as_echo "$QT5MOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT5MOC" && break done for ac_prog in uic-qt5 uic do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT5UIC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT5UIC"; then ac_cv_prog_QT5UIC="$QT5UIC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT5UIC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT5UIC=$ac_cv_prog_QT5UIC if test -n "$QT5UIC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT5UIC" >&5 $as_echo "$QT5UIC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT5UIC" && break done for ac_prog in rcc-qt5 rcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT5RCC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT5RCC"; then ac_cv_prog_QT5RCC="$QT5RCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT5RCC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT5RCC=$ac_cv_prog_QT5RCC if test -n "$QT5RCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT5RCC" >&5 $as_echo "$QT5RCC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT5RCC" && break done for ac_prog in lrelease-qt5 lrelease do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT5LRELEASE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT5LRELEASE"; then ac_cv_prog_QT5LRELEASE="$QT5LRELEASE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT5LRELEASE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT5LRELEASE=$ac_cv_prog_QT5LRELEASE if test -n "$QT5LRELEASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT5LRELEASE" >&5 $as_echo "$QT5LRELEASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT5LRELEASE" && break done if test -z "$QT5MOC" || test -z "$QT5UIC" || test -z "$QT5RCC" || test -z "$QT5LRELEASE"; then qt5_available=no else qt5_available=yes fi fi # # Check for Qt 4.x # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for qt4" >&5 $as_echo_n "checking for qt4... " >&6; } if test -n "$qt4_CFLAGS"; then pkg_cv_qt4_CFLAGS="$qt4_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtGui >= 4.0 QtSvg >= 4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "QtGui >= 4.0 QtSvg >= 4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qt4_CFLAGS=`$PKG_CONFIG --cflags "QtGui >= 4.0 QtSvg >= 4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$qt4_LIBS"; then pkg_cv_qt4_LIBS="$qt4_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtGui >= 4.0 QtSvg >= 4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "QtGui >= 4.0 QtSvg >= 4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_qt4_LIBS=`$PKG_CONFIG --libs "QtGui >= 4.0 QtSvg >= 4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then qt4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "QtGui >= 4.0 QtSvg >= 4.0" 2>&1` else qt4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "QtGui >= 4.0 QtSvg >= 4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$qt4_PKG_ERRORS" >&5 qt4_available=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } qt4_available=no else qt4_CFLAGS=$pkg_cv_qt4_CFLAGS qt4_LIBS=$pkg_cv_qt4_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } export QT_SELECT=4 for ac_prog in moc-qt4 moc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT4MOC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT4MOC"; then ac_cv_prog_QT4MOC="$QT4MOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT4MOC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT4MOC=$ac_cv_prog_QT4MOC if test -n "$QT4MOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT4MOC" >&5 $as_echo "$QT4MOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT4MOC" && break done for ac_prog in uic-qt4 uic do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT4UIC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT4UIC"; then ac_cv_prog_QT4UIC="$QT4UIC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT4UIC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT4UIC=$ac_cv_prog_QT4UIC if test -n "$QT4UIC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT4UIC" >&5 $as_echo "$QT4UIC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT4UIC" && break done for ac_prog in rcc-qt4 rcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT4RCC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT4RCC"; then ac_cv_prog_QT4RCC="$QT4RCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT4RCC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT4RCC=$ac_cv_prog_QT4RCC if test -n "$QT4RCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT4RCC" >&5 $as_echo "$QT4RCC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT4RCC" && break done for ac_prog in lrelease-qt4 lrelease do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QT4LRELEASE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$QT4LRELEASE"; then ac_cv_prog_QT4LRELEASE="$QT4LRELEASE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_QT4LRELEASE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi QT4LRELEASE=$ac_cv_prog_QT4LRELEASE if test -n "$QT4LRELEASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT4LRELEASE" >&5 $as_echo "$QT4LRELEASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$QT4LRELEASE" && break done if test -z "$QT4MOC" || test -z "$QT4UIC" || test -z "$QT4RCC" || test -z "$QT4LRELEASE"; then qt4_available=no else qt4_available=yes fi fi case "$with_gui_qt" in qt5) if test "x$qt5_available" = xno; then as_fn_error $? "Requested to use Qt 5.x to build Qt GUI components but Qt 5.x development files are not available!" "$LINENO" 5; fi $as_echo "#define HAVE_QT5 1" >>confdefs.h QTMOC=$QT5MOC QTUIC=$QT5UIC QTRCC=$QT5RCC QTLRELEASE=$QT5LRELEASE qt_CFLAGS=$qt5_CFLAGS qt_LIBS=$qt5_LIBS qt_summary="Qt 5.x; system-wide; $qt_CFLAGS $qt_LIBS" build_gui_qt=yes ;; qt4) if test "x$qt4_available" = xno; then as_fn_error $? "Requested to use Qt 5.x to build Qt GUI components but Qt 5.x development files are not available!" "$LINENO" 5; fi $as_echo "#define HAVE_QT4 1" >>confdefs.h QTMOC=$QT4MOC QTUIC=$QT4UIC QTRCC=$QT4RCC QTLRELEASE=$QT4LRELEASE qt_CFLAGS=$qt4_CFLAGS qt_LIBS=$qt4_LIBS qt_summary="Qt 4.x; system-wide; $qt_CFLAGS $qt_LIBS" build_gui_qt=yes ;; no) qt_summary="Building without Qt GUI" build_gui_qt=no ;; *) as_fn_error $? "Unknown --with-gui-qt selector value: $with_gui_qt; recognized selectors are: qt4, qt5, no" "$LINENO" 5 esac # # GLib D-Bus # # Check whether --with-dbus was given. if test "${with_dbus+set}" = set; then : withval=$with_dbus; else with_dbus=yes fi if test "x$with_dbus" = xyes; then # # Check for required D-Bus modules # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus" >&5 $as_echo_n "checking for dbus... " >&6; } if test -n "$dbus_CFLAGS"; then pkg_cv_dbus_CFLAGS="$dbus_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 dbus-glib-1 >= 0.100 gio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 dbus-glib-1 >= 0.100 gio-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_dbus_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 dbus-glib-1 >= 0.100 gio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$dbus_LIBS"; then pkg_cv_dbus_LIBS="$dbus_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 dbus-glib-1 >= 0.100 gio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 dbus-glib-1 >= 0.100 gio-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_dbus_LIBS=`$PKG_CONFIG --libs "dbus-1 dbus-glib-1 >= 0.100 gio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then dbus_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 dbus-glib-1 >= 0.100 gio-2.0" 2>&1` else dbus_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 dbus-glib-1 >= 0.100 gio-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$dbus_PKG_ERRORS" >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Required D-Bus modules (dbus-1, dbus-glib-1, gio-2.0) not found! See \`config.log' for more details" "$LINENO" 5; } elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Required D-Bus modules (dbus-1, dbus-glib-1, gio-2.0) not found! See \`config.log' for more details" "$LINENO" 5; } else dbus_CFLAGS=$pkg_cv_dbus_CFLAGS dbus_LIBS=$pkg_cv_dbus_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_DBUS 1" >>confdefs.h dbus_summary="system-wide; $dbus_CFLAGS $dbus_LIBS" fi # # Check for xmllint tool # for ac_prog in xmllint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XMLLINT"; then ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XMLLINT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XMLLINT=$ac_cv_prog_XMLLINT if test -n "$XMLLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 $as_echo "$XMLLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XMLLINT" && break done if test -z "$XMLLINT" ; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The required xmllint tool is missing on your system. Make sure that xmllint is installed. See \`config.log' for more details" "$LINENO" 5; } fi # # Check for xsltproc tool # for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XSLTPROC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done if test -z "$XSLTPROC"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The required xsltproc tool is missing on your system. Make sure that xsltproc is installed. See \`config.log' for more details" "$LINENO" 5; } fi # # Check for gdbus-codegen tool # for ac_prog in gdbus-codegen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GDBUS_CODEGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GDBUS_CODEGEN"; then ac_cv_prog_GDBUS_CODEGEN="$GDBUS_CODEGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GDBUS_CODEGEN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GDBUS_CODEGEN=$ac_cv_prog_GDBUS_CODEGEN if test -n "$GDBUS_CODEGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDBUS_CODEGEN" >&5 $as_echo "$GDBUS_CODEGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GDBUS_CODEGEN" && break done if test -z "$GDBUS_CODEGEN"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The required gdbus-codegen tool is missing on your system. Make sure that gdbus-codegen is installed. See \`config.log' for more details" "$LINENO" 5; } fi dbus_services_dir=`$PKG_CONFIG dbus-1 --define-variable=datadir='${datadir}' --define-variable=prefix='${prefix}' --variable=system_bus_services_dir` if test "x$dbus_services_dir" = x; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Cannot autodetect the D-Bus system services directory See \`config.log' for more details" "$LINENO" 5; } else # # Hack around expanded paths in system_bus_services_dir. Without this distcheck won't # work, because it uses ./configure --prefix=$somedir. The expanded path ignores this # prefix (and DESTDIR won't help here either) # case "$dbus_services_dir" in /usr/share/*|/usr/local/share/*) dbus_services_dir=$(sed -r 's,^(/usr/share|/usr/local/share),${datadir},'<<<$dbus_services_dir) ;; /usr/*|/usr/local/*) dbus_services_dir=$(sed -r 's,^(/usr|/usr/local),${prefix},'<<<$dbus_services_dir) ;; /*) dbus_services_dir='${prefix}'"$dbus_services_dir" ;; esac DBUS_SERVICES_DIR=$dbus_services_dir fi dbus_data_dir=`$PKG_CONFIG dbus-1 --define-variable=datadir='${datadir}' --define-variable=prefix='${prefix}' --variable=datadir` if test "x$dbus_data_dir" = x; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Cannot autodetect the D-Bus data directory See \`config.log' for more details" "$LINENO" 5; } else dbus_busconfig_dir="$dbus_data_dir/dbus-1/system.d" DBUS_BUSCONFIG_DIR=$dbus_busconfig_dir fi else dbus_summary="None; building without DBus support" dbus_services_dir="-" dbus_busconfig_dir="-" fi # # PolicyKit # # Check whether --with-polkit was given. if test "${with_polkit+set}" = set; then : withval=$with_polkit; else with_polkit=yes fi if test "x$with_polkit" = xyes; then # # Check for required PolicyKit modules # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for polkit" >&5 $as_echo_n "checking for polkit... " >&6; } if test -n "$polkit_CFLAGS"; then pkg_cv_polkit_CFLAGS="$polkit_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"polkit-gobject-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_polkit_CFLAGS=`$PKG_CONFIG --cflags "polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$polkit_LIBS"; then pkg_cv_polkit_LIBS="$polkit_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"polkit-gobject-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_polkit_LIBS=`$PKG_CONFIG --libs "polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then polkit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "polkit-gobject-1" 2>&1` else polkit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "polkit-gobject-1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$polkit_PKG_ERRORS" >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Required PolicyKit modules (polkit-gobject-1) not found! See \`config.log' for more details" "$LINENO" 5; } elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Required PolicyKit modules (polkit-gobject-1) not found! See \`config.log' for more details" "$LINENO" 5; } else polkit_CFLAGS=$pkg_cv_polkit_CFLAGS polkit_LIBS=$pkg_cv_polkit_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_POLKIT 1" >>confdefs.h polkit_summary="system-wide; `$PKG_CONFIG polkit-gobject-1 --define-variable=prefix='${prefix}' --define-variable=datadir='${datadir}' --variable=policydir`" fi polkit_policy_dir="`$PKG_CONFIG polkit-gobject-1 --define-variable=prefix='${prefix}' --define-variable=datadir='${datadir}' --variable=policydir`" if test "x$polkit_policy_dir" = x; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Cannot autodetect the PolicyKit policy directory See \`config.log' for more details" "$LINENO" 5; } else POLKIT_POLICY_DIR=$polkit_policy_dir fi else polkit_summary="None; building without PolicyKit support" polkit_policy_dir="-" fi # # AddressSanitizer # # Based on: https://github.com/machinezone/tcpkali/blob/15903a7692abecbd28899d44e822a6f894caa23c/configure.aci#L73 # # Enable Address Sanitizer, if supported by gcc (4.8+) or clang. # http://clang.llvm.org/docs/AddressSanitizer.html # https://code.google.com/p/address-sanitizer/wiki/HowToBuild # # Check whether --enable-asan was given. if test "${enable_asan+set}" = set; then : enableval=$enable_asan; enable_asan=$enableval else enable_asan=no fi if test "x$enable_asan" = xyes; 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 ASAN_FLAGS="$ASAN_FLAGS -static-libasan" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -faddress-sanitizer" >&5 $as_echo_n "checking whether C++ compiler accepts -faddress-sanitizer... " >&6; } if ${ax_cv_check_cxxflags___faddress_sanitizer+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -faddress-sanitizer" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___faddress_sanitizer=yes else ax_cv_check_cxxflags___faddress_sanitizer=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___faddress_sanitizer" >&5 $as_echo "$ax_cv_check_cxxflags___faddress_sanitizer" >&6; } if test "x$ax_cv_check_cxxflags___faddress_sanitizer" = xyes; then : ASAN_FLAGS="$ASAN_FLAGS -faddress-sanitizer" else enable_asan=no fi if test "x$enable_asan" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -fsanitize=address" >&5 $as_echo_n "checking whether C++ compiler accepts -fsanitize=address... " >&6; } if ${ax_cv_check_cxxflags___fsanitize_address+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -fsanitize=address" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___fsanitize_address=yes else ax_cv_check_cxxflags___fsanitize_address=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___fsanitize_address" >&5 $as_echo "$ax_cv_check_cxxflags___fsanitize_address" >&6; } if test "x$ax_cv_check_cxxflags___fsanitize_address" = xyes; then : ASAN_FLAGS="$ASAN_FLAGS -fsanitize=address" enable_asan=yes else enable_asan=no fi if test "x$enable_asan" = xno; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-asan is given, but not supported on this platform. Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild See \`config.log' for more details" "$LINENO" 5; } fi fi # Keep error messages nice. Also consider: # export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer # export ASAN_OPTIONS=symbolize=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -fno-omit-frame-pointer" >&5 $as_echo_n "checking whether C++ compiler accepts -fno-omit-frame-pointer... " >&6; } if ${ax_cv_check_cxxflags___fno_omit_frame_pointer+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___fno_omit_frame_pointer=yes else ax_cv_check_cxxflags___fno_omit_frame_pointer=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___fno_omit_frame_pointer" >&5 $as_echo "$ax_cv_check_cxxflags___fno_omit_frame_pointer" >&6; } if test "x$ax_cv_check_cxxflags___fno_omit_frame_pointer" = xyes; then : ASAN_FLAGS="$ASAN_FLAGS -fno-omit-frame-pointer" else : 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 fi # # Enable Thread Sanitizer, if supported by clang. # http://clang.llvm.org/docs/ThreadSanitizer.html # https://code.google.com/p/address-sanitizer/wiki/HowToBuild # # Check whether --enable-tsan was given. if test "${enable_tsan+set}" = set; then : enableval=$enable_tsan; enable_tsan=$enableval else enable_tsan=no fi if test "x$enable_tsan" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fsanitize=thread" >&5 $as_echo_n "checking whether C compiler accepts -fsanitize=thread... " >&6; } if ${ax_cv_check_cflags___fsanitize_thread+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fsanitize=thread" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags___fsanitize_thread=yes else ax_cv_check_cflags___fsanitize_thread=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fsanitize_thread" >&5 $as_echo "$ax_cv_check_cflags___fsanitize_thread" >&6; } if test "x$ax_cv_check_cflags___fsanitize_thread" = xyes; then : TSAN_FLAGS="$TSAN_FLAGS -fsanitize=thread" else enable_tsan=no fi if test "x$enable_tsan" = xno; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-tsan is given, but not supported on this platform. Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild See \`config.log' for more details" "$LINENO" 5; } fi # Keep error messages nice. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-omit-frame-pointer" >&5 $as_echo_n "checking whether C compiler accepts -fno-omit-frame-pointer... " >&6; } if ${ax_cv_check_cflags___fno_omit_frame_pointer+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-omit-frame-pointer" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags___fno_omit_frame_pointer=yes else ax_cv_check_cflags___fno_omit_frame_pointer=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_omit_frame_pointer" >&5 $as_echo "$ax_cv_check_cflags___fno_omit_frame_pointer" >&6; } if test "x$ax_cv_check_cflags___fno_omit_frame_pointer" = xyes; then : TSAN_FLAGS="$TSAN_FLAGS -fno-omit-frame-pointer" else : fi # -fsanitize=thread linking must be done with -pie or -shared # We can't do anything about this message in GCC; use clang. fi # # Require asciidoctor. # for ac_prog in asciidoctor do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ASCIIDOCTOR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ASCIIDOCTOR"; then ac_cv_prog_ASCIIDOCTOR="$ASCIIDOCTOR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ASCIIDOCTOR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ASCIIDOCTOR=$ac_cv_prog_ASCIIDOCTOR if test -n "$ASCIIDOCTOR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASCIIDOCTOR" >&5 $as_echo "$ASCIIDOCTOR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ASCIIDOCTOR" && break done if test -z "$ASCIIDOCTOR"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Unable to find documentation generator (asciidoctor) See \`config.log' for more details" "$LINENO" 5; } fi # # Check whether the aspell utility is present. # # If aspell is not present, the test suite will skip spell # checking of documentation related files. # for ac_prog in aspell do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ASPELL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ASPELL"; then ac_cv_prog_ASPELL="$ASPELL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ASPELL="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ASPELL=$ac_cv_prog_ASPELL if test -n "$ASPELL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASPELL" >&5 $as_echo "$ASPELL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ASPELL" && break done if test -z "$ASPELL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find the Aspell spell checker. The test suite will skip spell checking of documentation related files." >&5 $as_echo "$as_me: WARNING: Unable to find the Aspell spell checker. The test suite will skip spell checking of documentation related files." >&2;} fi # # Full test suite mode. # # Runs all available test when enabled. Some tests make assumption about # the environment they run in, so they might fail when these assumptions # are not met. # # Check whether --enable-full-test-suite was given. if test "${enable_full_test_suite+set}" = set; then : enableval=$enable_full_test_suite; full_test_suite=$enableval else full_test_suite=no fi # Checks for header files. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in arpa/inet.h fcntl.h inttypes.h limits.hi locale.h netdb.h stdint.h stdlib.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in string.h sys/time.h syslog.h unistd.h wchar.h ext/stdio_filebuf.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } 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" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else 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 ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_header in vfork.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, 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_cxx_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_func in dup2 gettimeofday localtime_r memset mkdir regcomp setlocale strerror strstr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done 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 # ./configure script options # Check whether --enable-debug-build was given. if test "${enable_debug_build+set}" = set; then : enableval=$enable_debug_build; case "${enableval}" in yes) debug=yes ;; no) debug=no ;; *) as_fn_error $? "bad value ${enableval} for --enable-debug-build" "$LINENO" 5 ;; esac else debug=no fi # Check whether --enable-systemd was given. if test "${enable_systemd+set}" = set; then : enableval=$enable_systemd; case "${enableval}" in yes) systemd=yes ;; no) systemd=no ;; *) as_fn_error $? "bad value ${enableval} for --enable-systemd" "$LINENO" 5 ;; esac else systemd=no fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASH_COMPLETION" >&5 $as_echo_n "checking for BASH_COMPLETION... " >&6; } if test -n "$BASH_COMPLETION_CFLAGS"; then pkg_cv_BASH_COMPLETION_CFLAGS="$BASH_COMPLETION_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_CFLAGS=`$PKG_CONFIG --cflags "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$BASH_COMPLETION_LIBS"; then pkg_cv_BASH_COMPLETION_LIBS="$BASH_COMPLETION_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_LIBS=`$PKG_CONFIG --libs "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` else BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BASH_COMPLETION_PKG_ERRORS" >&5 bash_completion=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } bash_completion=no else BASH_COMPLETION_CFLAGS=$pkg_cv_BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS=$pkg_cv_BASH_COMPLETION_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } bash_completion_dir="`$PKG_CONFIG --variable=completionsdir bash-completion`" bash_completion=yes fi if test "x$debug" = xyes; then CXXFLAGS="$CXXFLAGS $CXXFLAGS_DEBUG_ENABLED" CFLAGS="$CFLAGS $CFLAGS_DEBUG_ENABLED" else CXXFLAGS="$CXXFLAGS $CXXFLAGS_DEBUG_DISABLED" CFLAGS="$CFLAGS $CFLAGS_DEBUG_DISABLED" $as_echo "#define NDEBUG 1" >>confdefs.h $as_echo "#define QUEX_OPTION_ASSERTS_DISABLED 1" >>confdefs.h fi if test "x$enable_asan" = xyes; then CXXFLAGS="$CXXFLAGS $ASAN_FLAGS" CFLAGS="$CFLAGS $ASAN_FLAGS" LDFLAGS="$LDFLAGS $ASAN_FLAGS" $as_echo "#define ASAN_ENABLED 1" >>confdefs.h fi if test "x$enable_tsan" = xyes; then CXXFLAGS="$CXXFLAGS $TSAN_FLAGS" CFLAGS="$CFLAGS $TSAN_FLAGS" LDFLAGS="$LDFLAGS $TSAN_FLAGS" $as_echo "#define TSAN_ENABLED 1" >>confdefs.h fi if test "x$systemd" = xyes; then systemd_unit_dir="`$PKG_CONFIG systemd --variable=systemdsystemunitdir`" if test "x$systemd_unit_dir" = x; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Cannot detect the systemd system unit dir See \`config.log' for more details" "$LINENO" 5; } fi SYSTEMD_UNIT_DIR=$systemd_unit_dir $as_echo "#define SYSTEMD_SUPPORT_ENABLED 1" >>confdefs.h else systemd_unit_dir="-" fi ANALYZE_CONFIGURE_ARGS=$ac_configure_args case "$bash_completion_dir" in /usr/share/*|/usr/local/share/*) bash_completion_dir=$(sed -r 's,^(/usr/share|/usr/local/share),${datadir},'<<<$bash_completion_dir) ;; /usr/*|/usr/local/*) bash_completion_dir=$(sed -r 's,^(/usr|/usr/local),${prefix},'<<<$bash_completion_dir) ;; /*) bash_completion_dir='${prefix}'"$bash_completion_dir" ;; esac BASH_COMPLETION_DIR=$bash_completion_dir if test "x$systemd" = xyes ; then SYSTEMD_SUPPORT_ENABLED_TRUE= SYSTEMD_SUPPORT_ENABLED_FALSE='#' else SYSTEMD_SUPPORT_ENABLED_TRUE='#' SYSTEMD_SUPPORT_ENABLED_FALSE= fi if test "x$build_gui_qt" = xyes ; then GUI_QT_ENABLED_TRUE= GUI_QT_ENABLED_FALSE='#' else GUI_QT_ENABLED_TRUE='#' GUI_QT_ENABLED_FALSE= fi if test "x$with_dbus" = xyes ; then DBUS_ENABLED_TRUE= DBUS_ENABLED_FALSE='#' else DBUS_ENABLED_TRUE='#' DBUS_ENABLED_FALSE= fi if test "x$with_polkit" = xyes; then POLICYKIT_ENABLED_TRUE= POLICYKIT_ENABLED_FALSE='#' else POLICYKIT_ENABLED_TRUE='#' POLICYKIT_ENABLED_FALSE= fi if test "x$full_test_suite" = xyes; then FULL_TEST_SUITE_ENABLED_TRUE= FULL_TEST_SUITE_ENABLED_FALSE='#' else FULL_TEST_SUITE_ENABLED_TRUE='#' FULL_TEST_SUITE_ENABLED_FALSE= fi if test "x$bash_completion" != xno; then BASH_COMPLETION_ENABLED_TRUE= BASH_COMPLETION_ENABLED_FALSE='#' else BASH_COMPLETION_ENABLED_TRUE='#' BASH_COMPLETION_ENABLED_FALSE= fi CXXFLAGS="$CXXFLAGS -fvisibility=hidden $COMMON_WARNING_FLAGS $WARNING_CXXFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden $COMMON_WARNING_FLAGS $WARNING_CFLAGS" cat >>confdefs.h <<_ACEOF #define BINDIR "$bindir" _ACEOF cat >>confdefs.h <<_ACEOF #define DATADIR "$datadir" _ACEOF cat >>confdefs.h <<_ACEOF #define DATAROOTDIR "$datarootdir" _ACEOF cat >>confdefs.h <<_ACEOF #define DOCDIR "$docdir" _ACEOF cat >>confdefs.h <<_ACEOF #define EXEC_PREFIX "$exec_prefix" _ACEOF cat >>confdefs.h <<_ACEOF #define INCLUDEDIR "$includedir" _ACEOF cat >>confdefs.h <<_ACEOF #define LIBEXECDIR "$libexecdir" _ACEOF cat >>confdefs.h <<_ACEOF #define LOCALSTATEDIR "$localstatedir" _ACEOF cat >>confdefs.h <<_ACEOF #define PREFIX "$prefix" _ACEOF cat >>confdefs.h <<_ACEOF #define SBINDIR "$sbindir" _ACEOF cat >>confdefs.h <<_ACEOF #define SHAREDSTATEDIR "$sharedstatedir" _ACEOF cat >>confdefs.h <<_ACEOF #define SYSCONFDIR "$sysconfdir" _ACEOF cat >>confdefs.h <<_ACEOF #define USBGUARD_DAEMON_CONF_PATH "$sysconfdir/usbguard/usbguard-daemon.conf" _ACEOF ac_config_files="$ac_config_files Makefile libusbguard.pc src/Tests/Makefile src/GUI.Qt/usbguard-applet-qt.desktop" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__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 "${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 "${SYSTEMD_SUPPORT_ENABLED_TRUE}" && test -z "${SYSTEMD_SUPPORT_ENABLED_FALSE}"; then as_fn_error $? "conditional \"SYSTEMD_SUPPORT_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GUI_QT_ENABLED_TRUE}" && test -z "${GUI_QT_ENABLED_FALSE}"; then as_fn_error $? "conditional \"GUI_QT_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DBUS_ENABLED_TRUE}" && test -z "${DBUS_ENABLED_FALSE}"; then as_fn_error $? "conditional \"DBUS_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${POLICYKIT_ENABLED_TRUE}" && test -z "${POLICYKIT_ENABLED_FALSE}"; then as_fn_error $? "conditional \"POLICYKIT_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FULL_TEST_SUITE_ENABLED_TRUE}" && test -z "${FULL_TEST_SUITE_ENABLED_FALSE}"; then as_fn_error $? "conditional \"FULL_TEST_SUITE_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BASH_COMPLETION_ENABLED_TRUE}" && test -z "${BASH_COMPLETION_ENABLED_FALSE}"; then as_fn_error $? "conditional \"BASH_COMPLETION_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" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by usbguard $as_me 0.7.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ usbguard config.status 0.7.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/build-config.h.in") CONFIG_HEADERS="$CONFIG_HEADERS src/build-config.h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libusbguard.pc") CONFIG_FILES="$CONFIG_FILES libusbguard.pc" ;; "src/Tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/Tests/Makefile" ;; "src/GUI.Qt/usbguard-applet-qt.desktop") CONFIG_FILES="$CONFIG_FILES src/GUI.Qt/usbguard-applet-qt.desktop" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options 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 # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo echo " Build Configuration Summary " echo "===================================" echo echo " Run full test suite: $full_test_suite" echo echo "## Libraries" echo echo " libqb: $libqb_summary" echo " crypto: $crypto_summary" echo " libaudit: $libaudit_summary" echo " libseccomp: $libseccomp_summary" echo " libcap-ng: $libcap_ng_summary" echo " protobuf: $protobuf_summary" echo " Catch: $catch_summary" echo " PEGTL: $pegtl_summary; version <= 1.3.1: $have_pegtl_lte_131" echo " Qt: $qt_summary" echo " GLib D-Bus: $dbus_summary" echo echo "## Directories" echo echo " D-Bus System Services: $dbus_services_dir" echo " D-Bus Busconfig: $dbus_busconfig_dir" echo " PolicyKit Policies: $polkit_policy_dir" echo " systemd unit dir: $systemd_unit_dir" echo " Bash completion dir: $BASH_COMPLETION_DIR" echo echo "## Compilation Flags" echo echo "Debug Build: $debug" echo " DEFS: $DEFS" echo " CXXFLAGS: $CXXFLAGS" echo " CFLAGS: $CFLAGS" echo " CPPFLAGS: $CPPFLAGS" echo " LDFLAGS: $LDFLAGS" echo " ASAN_FLAGS: $ASAN_FLAGS" echo " TSAN_FLAGS: $TSAN_FLAGS" echo usbguard-0.7.2+ds/configure.ac000066400000000000000000000621161325273707200162420ustar00rootroot00000000000000AC_PREREQ([2.69]) AC_INIT([usbguard], m4_esyscmd_s([cat VERSION]), [usbguard@usbguard.org]) AC_CONFIG_SRCDIR([src/]) AC_CONFIG_HEADERS([src/build-config.h.in]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([subdir-objects foreign tar-pax]) # If automake supports "silent rules", enable them by default m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) # # Compiler flags # EXTERNAL_CXXFLAGS="$CXXFLAGS" EXTERNAL_CFLAGS="$CFLAGS" EXTERNAL_CPPFLAGS="$CPPFLAGS" COMMON_WARNING_FLAGS=" -pedantic" COMMON_WARNING_FLAGS+=" -Wno-unknown-pragmas" COMMON_WARNING_FLAGS+=" -Wall" COMMON_WARNING_FLAGS+=" -Wextra" COMMON_WARNING_FLAGS+=" -Wformat=2" COMMON_WARNING_FLAGS+=" -Wredundant-decls" COMMON_WARNING_FLAGS+=" -Wcast-align" COMMON_WARNING_FLAGS+=" -Wmissing-declarations" COMMON_WARNING_FLAGS+=" -Wmissing-include-dirs" COMMON_WARNING_FLAGS+=" -Wmissing-format-attribute" COMMON_WARNING_FLAGS+=" -Wswitch-enum" COMMON_WARNING_FLAGS+=" -Wswitch-default" COMMON_WARNING_FLAGS+=" -Winvalid-pch" COMMON_WARNING_FLAGS+=" -Wformat-nonliteral" #COMMON_WARNING_FLAGS+=" -flto -Wodr" # # Workaround for older compilers warning about { } # not initializing all struct fields. # COMMON_WARNING_FLAGS+=" -Wno-missing-field-initializers" # # Don't warn about implicit fallthrough # # TODO: Use [[fallthrough]] C++ attribute specifier with # newer compiler versions. # AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [COMMON_WARNING_FLAGS+=" -Wno-implicit-fallthrough"], [], []) # # Final project CXXFLAGS are set after configure checks. # CXXFLAGS="-std=c++11 $EXTERNAL_CXXFLAGS" CFLAGS="-std=c99 $EXTERNAL_CFLAGS" CPPFLAGS="-DHAVE_BUILD_CONFIG_H $EXTERNAL_CPPFLAGS" # # Additional CXXFLAGS used when --enable-debug-build is used # CXXFLAGS_DEBUG_ENABLED="-g -O0" # # Additional CXXFLAGS used when --disable-debug-build is used # and when --enable-debug-build is # # Don't add -DNDEBUG here. It's added to the generated config.h # header file. # CXXFLAGS_DEBUG_DISABLED="" # Libtool Versioning # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details ## increment if the interface has additions, changes, removals. LT_CURRENT=0 ## increment any time the source changes; set 0 to if you increment CURRENT LT_REVISION=0 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has ## precedence over adding, so set to 0 if both happened. LT_AGE=0 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) AC_ARG_ENABLE([coverage], [AC_HELP_STRING([--enable-coverage], [enable instrumented compilation for code coverage testing (default=no)])], [case "${enableval}" in yes) coverage=yes ;; no) coverage=no ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;; esac], [coverage=no]) if test "x$coverage" = xyes; then CXXFLAGS="$CXXFLAGS --coverage" CFLAGS="$CFLAGS --coverage" fi AC_ARG_ENABLE([werror], [AC_HELP_STRING([--enable-werror], [treat compiler warnings as errors (default=no)])], [case "${enableval}" in yes) werror=yes ;; no) werror=no ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-werror]) ;; esac], [werror=no]) if test "x$werror" = xyes; then COMMON_WARNING_FLAGS=" -Werror $COMMON_WARNING_FLAGS" fi # # Checks for programs. # AC_PROG_CXX AC_PROG_CC_C99 AC_PROG_INSTALL AC_PROG_MAKE_SET AM_PROG_LIBTOOL AC_PROG_LIBTOOL # Check if libatomic is available, might be required for emulating # atomic intrinsics on some platforms. # AC_CHECK_LIB([atomic], [__atomic_add_fetch_8], [ __saved_LIBS="$LIBS" LIBS="$LIBS -Wl,--push-state,--as-needed,-latomic,--pop-state" AC_LINK_IFELSE([AC_LANG_PROGRAM()], [atomic_LIBS="-Wl,--push-state,--as-needed,-latomic,--pop-state"], [atomic_LIBS="-latomic"] ) LIBS="$__saved_LIBS" ], [atomic_LIBS=""]) AC_SUBST([atomic_LIBS]) # # Checks for required libraries. # AC_MSG_CHECKING([for NETLINK_KOBJECT_UEVENT definition]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include int main(void) { return NETLINK_KOBJECT_UEVENT; } ]])], [have_uevent=yes], [have_uevent=no]) if test "x$have_uevent" = xyes; then AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_UEVENT], [1], [UEVENT netlink socket support]) else AC_MSG_RESULT([no]) fi # # qb library # PKG_CHECK_MODULES([qb], [libqb >= 0.16.0], [AC_DEFINE([HAVE_LIBQB], [1], [libqb API available]) libqb_summary="system-wide; $qb_CFLAGS $qb_LIBS"], [AC_MSG_FAILURE([libqb development files not found!])] ) # # sodium library # PKG_CHECK_MODULES([sodium], [libsodium >= 0.4.5], [AC_DEFINE([HAVE_LIBSODIUM], [1], [libsodium API available]) libsodium_summary="system-wide; $sodium_CFLAGS $sodium_LIBS"] libsodium_available=yes, [] ) # # gcrypt library # AM_PATH_LIBGCRYPT([1.5.0], [AC_DEFINE([HAVE_LIBGCRYPT], [1], [libgcrypt API available]) gcrypt_CFLAGS="$LIBGCRYPT_CFLAGS" gcrypt_LIBS="$LIBGCRYPT_LIBS" libgcrypt_summary="system-wide; $gcrypt_CFLAGS $gcrypt_LIBS" libgcrypt_available=yes], [] ) # # --with-crypto-library= # # Supported selectors: # # sodium ... libsodium # gcrypt ... libgcrypt # AC_ARG_WITH([crypto-library], AS_HELP_STRING([--with-crypto-library], [Select crypto backend library. Supported values: sodium, gcrypt.]), [with_crypto_library=$withval], [with_crypto_library=sodium]) case "$with_crypto_library" in sodium) if test "x$libsodium_available" = xyes; then crypto_CFLAGS="$sodium_CFLAGS" crypto_LIBS="$sodium_LIBS" crypto_summary="$libsodium_summary" AC_DEFINE([USBGUARD_USE_LIBSODIUM], [1], [Use libsodium as crypto backend]) else AC_MSG_ERROR([The selected crypto backend library is not available.]) fi ;; gcrypt) if test "x$libgcrypt_available" = xyes; then crypto_CFLAGS="$gcrypt_CFLAGS" crypto_LIBS="$gcrypt_LIBS" crypto_summary="$libgcrypt_summary" AC_DEFINE([USBGUARD_USE_LIBGCRYPT], [1], [Use libsodium as crypto backend]) else AC_MSG_ERROR([The selected crypto backend library is not available.]) fi ;; *) AC_MSG_FAILURE([Invalid crypto library selector. Supported selectors: sodium, gcrypt]) esac AC_SUBST([crypto_CFLAGS]) AC_SUBST([crypto_LIBS]) # # Check for optional libraries # PKG_CHECK_MODULES([audit], [audit >= 2.7.7], [AC_DEFINE([HAVE_LINUX_AUDIT], [1], [Linux Audit API available]) AC_CHECK_DECLS([audit_encode_nv_string], [], [], [[#include]]) libaudit_summary="system-wide; $audit_LIBS"], [AC_MSG_NOTICE([libaudit development files not found! Linux Audit support wille be turned OFF]) libaudit_summary="not found"] ) PKG_CHECK_MODULES([seccomp], [libseccomp >= 2.0.0], [AC_DEFINE([HAVE_SECCOMP], [1], [seccomp API usable]) libseccomp_summary="system-wide; $seccomp_LIBS"], [AC_MSG_NOTICE([libseccomp development files not found! Seccomp support will be turned OFF]) libseccomp_summary="not found"] ) PKG_CHECK_MODULES([libcapng], [libcap-ng >= 0.7.0], [AC_DEFINE([HAVE_LIBCAPNG], [1], [cap-ng API usable]) libcap_ng_summary="system-wide; $libcapng_LIBS"], [AC_MSG_NOTICE([libseccomp development files not found! Seccomp support will be turned OFF]) libcap_ng_summary="not found"] ) PKG_CHECK_MODULES([protobuf], [protobuf >= 2.5.0], [protobuf_summary="system-wide; $protobuf_CFLAGS $protobuf_LIBS"], [AC_MSG_ERROR([Required protobuf development files not found!])] ) AC_CHECK_PROGS(PROTOC, [protoc]) if test -z "$PROTOC"; then AC_MSG_ERROR(["Required protobuf compiler not found!"]) fi # # Catch C++ library # AC_ARG_WITH([bundled-catch], AS_HELP_STRING([--with-bundled-catch], [Build using the bundled Catch library]), [with_bundled_catch=$withval], [with_bundled_catch=no]) if test "x$with_bundled_catch" = xyes; then catch_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/Catch/include" catch_LIBS="" AC_MSG_NOTICE([Using bundled Catch library]) catch_summary="bundled; $catch_CFLAGS $catch_LIBS" else SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $CPPFLAGS -I/usr/include/catch" AC_LANG_PUSH([C++]) AC_CHECK_HEADER([catch.hpp], [], [AC_MSG_FAILURE(catch.hpp not found or not usable. Re-run with --with-bundled-catch to use the bundled library.)]) AC_LANG_POP catch_CFLAGS="-I/usr/include/catch" catch_LIBS="" CPPFLAGS=$SAVE_CPPFLAGS catch_summary="system-wide; $catch_CFLAGS $catch_LIBS" fi AC_SUBST([catch_CFLAGS]) AC_SUBST([catch_LIBS]) # # PEGTL C++ library # AC_ARG_WITH([bundled-pegtl], AS_HELP_STRING([--with-bundled-pegtl], [Build using the bundled PEGTL library]), [with_bundled_pegtl=$withval], [with_bundled_pegtl=no]) if test "x$with_bundled_pegtl" = xyes; then pegtl_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/PEGTL" pegtl_AC_CFLAGS="-I$srcdir/src/ThirdParty/PEGTL" pegtl_LIBS="" AC_MSG_NOTICE([Using bundled PEGTL library]) pegtl_summary="bundled; $pegtl_CFLAGS $pegtl_LIBS" else SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $CPPFLAGS" AC_LANG_PUSH([C++]) AC_CHECK_HEADER([pegtl.hh], [], [AC_MSG_FAILURE(pegtl.hh not found or not usable. Re-run with --with-bundled-pegtl to use the bundled library.)]) AC_LANG_POP pegtl_CFLAGS="" pegtl_AC_CFLAGS="" pegtl_LIBS="" CPPFLAGS=$SAVE_CPPFLAGS pegtl_summary="system-wide; $pegtl_CFLAGS $pegtl_LIBS" fi AC_SUBST([pegtl_CFLAGS]) AC_SUBST([pegtl_AC_CFLAGS]) AC_SUBST([pegtl_LIBS]) # # Check whether the available PEGTL library is compatible # with version 1.3.1 or older. # SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS="-std=c++11 $pegtl_AC_CFLAGS" AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include #include int main(void) { struct grammar : pegtl::one<'g'> {}; try { pegtl::parse_string(std::string(), std::string()); } catch(const pegtl::parse_error& ex) { auto b = ex.positions[0].byte_in_line; } return 0; } ]])], [have_pegtl_lte_131=no], [have_pegtl_lte_131=yes]) AC_LANG_POP if test "x$have_pegtl_lte_131" = xyes; then AC_DEFINE([HAVE_PEGTL_LTE_1_3_1], [1], [PEGTL version less than or equal to 1.3.1]) fi CPPFLAGS=$SAVE_CPPFLAGS # # Qt GUI # AC_ARG_WITH([gui-qt], AS_HELP_STRING([--with-gui-qt], [Build the Qt GUI components]), [with_gui_qt=$withval], [with_gui_qt=no]) # # Check for Qt 5.x # PKG_CHECK_MODULES([qt5], [Qt5Gui >= 5.0 Qt5Widgets >= 5.0 Qt5Svg >= 5.0], [ export QT_SELECT=5 AC_CHECK_PROGS(QT5MOC, [moc-qt5 moc]) AC_CHECK_PROGS(QT5UIC, [uic-qt5 uic]) AC_CHECK_PROGS(QT5RCC, [rcc-qt5 rcc]) AC_CHECK_PROGS(QT5LRELEASE, [lrelease-qt5 lrelease]) if test -z "$QT5MOC" || test -z "$QT5UIC" || test -z "$QT5RCC" || test -z "$QT5LRELEASE"; then qt5_available=no else qt5_available=yes fi ], [ qt5_available=no ]) # # Check for Qt 4.x # PKG_CHECK_MODULES([qt4], [QtGui >= 4.0 QtSvg >= 4.0], [ export QT_SELECT=4 AC_CHECK_PROGS(QT4MOC, [moc-qt4 moc]) AC_CHECK_PROGS(QT4UIC, [uic-qt4 uic]) AC_CHECK_PROGS(QT4RCC, [rcc-qt4 rcc]) AC_CHECK_PROGS(QT4LRELEASE, [lrelease-qt4 lrelease]) if test -z "$QT4MOC" || test -z "$QT4UIC" || test -z "$QT4RCC" || test -z "$QT4LRELEASE"; then qt4_available=no else qt4_available=yes fi ], [ qt4_available=no ]) case "$with_gui_qt" in qt5) if test "x$qt5_available" = xno; then AC_MSG_ERROR([Requested to use Qt 5.x to build Qt GUI components but Qt 5.x development files are not available!]); fi AC_DEFINE([HAVE_QT5], [1], [Qt 5.x development files available]) AC_SUBST(QTMOC, $QT5MOC) AC_SUBST(QTUIC, $QT5UIC) AC_SUBST(QTRCC, $QT5RCC) AC_SUBST(QTLRELEASE, $QT5LRELEASE) AC_SUBST(qt_CFLAGS, $qt5_CFLAGS) AC_SUBST(qt_LIBS, $qt5_LIBS) qt_summary="Qt 5.x; system-wide; $qt_CFLAGS $qt_LIBS" build_gui_qt=yes ;; qt4) if test "x$qt4_available" = xno; then AC_MSG_ERROR([Requested to use Qt 5.x to build Qt GUI components but Qt 5.x development files are not available!]); fi AC_DEFINE([HAVE_QT4], [1], [Qt 4.x development files available]) AC_SUBST(QTMOC, $QT4MOC) AC_SUBST(QTUIC, $QT4UIC) AC_SUBST(QTRCC, $QT4RCC) AC_SUBST(QTLRELEASE, $QT4LRELEASE) AC_SUBST(qt_CFLAGS, $qt4_CFLAGS) AC_SUBST(qt_LIBS, $qt4_LIBS) qt_summary="Qt 4.x; system-wide; $qt_CFLAGS $qt_LIBS" build_gui_qt=yes ;; no) qt_summary="Building without Qt GUI" build_gui_qt=no ;; *) AC_MSG_ERROR([Unknown --with-gui-qt selector value: $with_gui_qt; recognized selectors are: qt4, qt5, no]) esac # # GLib D-Bus # AC_ARG_WITH([dbus], AC_HELP_STRING([--with-dbus], [Build the DBus Bridge service]), [], [with_dbus=yes]) if test "x$with_dbus" = xyes; then # # Check for required D-Bus modules # PKG_CHECK_MODULES([dbus], [dbus-1 dbus-glib-1 >= 0.100 gio-2.0], [AC_DEFINE([HAVE_DBUS], [1], [Required GLib DBus API available]) dbus_summary="system-wide; $dbus_CFLAGS $dbus_LIBS"], [AC_MSG_FAILURE([Required D-Bus modules (dbus-1, dbus-glib-1, gio-2.0) not found!])] ) # # Check for xmllint tool # AC_CHECK_PROGS(XMLLINT, [xmllint]) if test -z "$XMLLINT" ; then AC_MSG_FAILURE([The required xmllint tool is missing on your system. Make sure that xmllint is installed.]) fi # # Check for xsltproc tool # AC_CHECK_PROGS(XSLTPROC, [xsltproc]) if test -z "$XSLTPROC"; then AC_MSG_FAILURE([The required xsltproc tool is missing on your system. Make sure that xsltproc is installed.]) fi # # Check for gdbus-codegen tool # AC_CHECK_PROGS(GDBUS_CODEGEN, [gdbus-codegen]) if test -z "$GDBUS_CODEGEN"; then AC_MSG_FAILURE([The required gdbus-codegen tool is missing on your system. Make sure that gdbus-codegen is installed.]) fi dbus_services_dir=`$PKG_CONFIG dbus-1 --define-variable=datadir='${datadir}' --define-variable=prefix='${prefix}' --variable=system_bus_services_dir` if test "x$dbus_services_dir" = x; then AC_MSG_FAILURE([Cannot autodetect the D-Bus system services directory]) else # # Hack around expanded paths in system_bus_services_dir. Without this distcheck won't # work, because it uses ./configure --prefix=$somedir. The expanded path ignores this # prefix (and DESTDIR won't help here either) # case "$dbus_services_dir" in /usr/share/*|/usr/local/share/*) dbus_services_dir=$(sed -r 's,^(/usr/share|/usr/local/share),${datadir},'<<<$dbus_services_dir) ;; /usr/*|/usr/local/*) dbus_services_dir=$(sed -r 's,^(/usr|/usr/local),${prefix},'<<<$dbus_services_dir) ;; /*) dbus_services_dir='${prefix}'"$dbus_services_dir" ;; esac AC_SUBST(DBUS_SERVICES_DIR, $dbus_services_dir) fi dbus_data_dir=`$PKG_CONFIG dbus-1 --define-variable=datadir='${datadir}' --define-variable=prefix='${prefix}' --variable=datadir` if test "x$dbus_data_dir" = x; then AC_MSG_FAILURE([Cannot autodetect the D-Bus data directory]) else dbus_busconfig_dir="$dbus_data_dir/dbus-1/system.d" AC_SUBST(DBUS_BUSCONFIG_DIR, $dbus_busconfig_dir) fi else dbus_summary="None; building without DBus support" dbus_services_dir="-" dbus_busconfig_dir="-" fi # # PolicyKit # AC_ARG_WITH([polkit], AC_HELP_STRING([--with-polkit], [Install the PolicyKit configuration if D-Bus support is also enabled]), [], [with_polkit=yes]) if test "x$with_polkit" = xyes; then # # Check for required PolicyKit modules # PKG_CHECK_MODULES([polkit], [polkit-gobject-1], [AC_DEFINE([HAVE_POLKIT], [1], [Required PolicyKit modules available]) polkit_summary="system-wide; `$PKG_CONFIG polkit-gobject-1 --define-variable=prefix='${prefix}' --define-variable=datadir='${datadir}' --variable=policydir`"], [AC_MSG_FAILURE([Required PolicyKit modules (polkit-gobject-1) not found!])] ) polkit_policy_dir="`$PKG_CONFIG polkit-gobject-1 --define-variable=prefix='${prefix}' --define-variable=datadir='${datadir}' --variable=policydir`" if test "x$polkit_policy_dir" = x; then AC_MSG_FAILURE([Cannot autodetect the PolicyKit policy directory]) else AC_SUBST(POLKIT_POLICY_DIR, $polkit_policy_dir) fi else polkit_summary="None; building without PolicyKit support" polkit_policy_dir="-" fi # # AddressSanitizer # # Based on: https://github.com/machinezone/tcpkali/blob/15903a7692abecbd28899d44e822a6f894caa23c/configure.aci#L73 # # Enable Address Sanitizer, if supported by gcc (4.8+) or clang. # http://clang.llvm.org/docs/AddressSanitizer.html # https://code.google.com/p/address-sanitizer/wiki/HowToBuild # AC_ARG_ENABLE([asan], [AS_HELP_STRING([--enable-asan], [Enable Address Sanitizer])], [enable_asan=$enableval], [enable_asan=no]) if test "x$enable_asan" = xyes; then AC_LANG_PUSH([C++]) ASAN_FLAGS="$ASAN_FLAGS -static-libasan" AX_CHECK_COMPILE_FLAG([-faddress-sanitizer], [ASAN_FLAGS="$ASAN_FLAGS -faddress-sanitizer"], [enable_asan=no], []) if test "x$enable_asan" = xno; then AX_CHECK_COMPILE_FLAG([-fsanitize=address], [ASAN_FLAGS="$ASAN_FLAGS -fsanitize=address" enable_asan=yes], [enable_asan=no], []) if test "x$enable_asan" = xno; then AC_MSG_FAILURE([--enable-asan is given, but not supported on this platform. Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild]) fi fi # Keep error messages nice. Also consider: # export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer # export ASAN_OPTIONS=symbolize=1 AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [ASAN_FLAGS="$ASAN_FLAGS -fno-omit-frame-pointer"], [], []) AC_LANG_POP fi # # Enable Thread Sanitizer, if supported by clang. # http://clang.llvm.org/docs/ThreadSanitizer.html # https://code.google.com/p/address-sanitizer/wiki/HowToBuild # AC_ARG_ENABLE([tsan], [AS_HELP_STRING([--enable-tsan], [Enable Thread Sanitizer])], [enable_tsan=$enableval], [enable_tsan=no]) if test "x$enable_tsan" = xyes; then AX_CHECK_COMPILE_FLAG([-fsanitize=thread], [TSAN_FLAGS="$TSAN_FLAGS -fsanitize=thread"], [enable_tsan=no], []) if test "x$enable_tsan" = xno; then AC_MSG_FAILURE([--enable-tsan is given, but not supported on this platform. Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild]) fi # Keep error messages nice. AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [TSAN_FLAGS="$TSAN_FLAGS -fno-omit-frame-pointer"], [], []) # -fsanitize=thread linking must be done with -pie or -shared # We can't do anything about this message in GCC; use clang. fi # # Require asciidoctor. # AC_CHECK_PROGS(ASCIIDOCTOR, [asciidoctor]) if test -z "$ASCIIDOCTOR"; then AC_MSG_FAILURE([Unable to find documentation generator (asciidoctor)]) fi # # Check whether the aspell utility is present. # # If aspell is not present, the test suite will skip spell # checking of documentation related files. # AC_CHECK_PROGS(ASPELL, [aspell]) if test -z "$ASPELL"; then AC_MSG_WARN([Unable to find the Aspell spell checker. The test suite will skip spell checking of documentation related files.]) fi # # Full test suite mode. # # Runs all available test when enabled. Some tests make assumption about # the environment they run in, so they might fail when these assumptions # are not met. # AC_ARG_ENABLE([full-test-suite], [AS_HELP_STRING([--enable-full-test-suite], [Run the full test suite (default=no)])], [full_test_suite=$enableval], [full_test_suite=no]) # Checks for header files. AC_LANG_PUSH([C++]) AC_FUNC_ALLOCA AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.hi locale.h netdb.h stdint.h stdlib.h]) AC_CHECK_HEADERS([string.h sys/time.h syslog.h unistd.h wchar.h ext/stdio_filebuf.h]) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER_STDBOOL AC_C_INLINE AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_INT8_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UID_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([dup2 gettimeofday localtime_r memset mkdir regcomp setlocale strerror strstr]) AC_LANG_POP # ./configure script options AC_ARG_ENABLE([debug-build], [AC_HELP_STRING([--enable-debug-build], [enable debugging flags (default=no)])], [case "${enableval}" in yes) debug=yes ;; no) debug=no ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug-build]) ;; esac], [debug=no]) AC_ARG_ENABLE([systemd], [AC_HELP_STRING([--enable-systemd], [install the systemd service unit file (default=no)])], [case "${enableval}" in yes) systemd=yes ;; no) systemd=no ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-systemd]) ;; esac], [systemd=no]) PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [bash_completion_dir="`$PKG_CONFIG --variable=completionsdir bash-completion`" bash_completion=yes], [bash_completion=no]) if test "x$debug" = xyes; then CXXFLAGS="$CXXFLAGS $CXXFLAGS_DEBUG_ENABLED" CFLAGS="$CFLAGS $CFLAGS_DEBUG_ENABLED" else CXXFLAGS="$CXXFLAGS $CXXFLAGS_DEBUG_DISABLED" CFLAGS="$CFLAGS $CFLAGS_DEBUG_DISABLED" AC_DEFINE([NDEBUG], [1], [Debug build disabled]) AC_DEFINE([QUEX_OPTION_ASSERTS_DISABLED], [1], [Disable asserts in the Quex generated lexer]) fi if test "x$enable_asan" = xyes; then CXXFLAGS="$CXXFLAGS $ASAN_FLAGS" CFLAGS="$CFLAGS $ASAN_FLAGS" LDFLAGS="$LDFLAGS $ASAN_FLAGS" AC_DEFINE([ASAN_ENABLED], [1], [Address Sanitizer is enabled]) fi if test "x$enable_tsan" = xyes; then CXXFLAGS="$CXXFLAGS $TSAN_FLAGS" CFLAGS="$CFLAGS $TSAN_FLAGS" LDFLAGS="$LDFLAGS $TSAN_FLAGS" AC_DEFINE([TSAN_ENABLED], [1], [Thread Sanitizer is enabled]) fi if test "x$systemd" = xyes; then systemd_unit_dir="`$PKG_CONFIG systemd --variable=systemdsystemunitdir`" if test "x$systemd_unit_dir" = x; then AC_MSG_FAILURE([Cannot detect the systemd system unit dir]) fi AC_SUBST(SYSTEMD_UNIT_DIR, $systemd_unit_dir) AC_DEFINE([SYSTEMD_SUPPORT_ENABLED], [1], [Enable systemd support int the project]) else systemd_unit_dir="-" fi AC_SUBST([ANALYZE_CONFIGURE_ARGS], $ac_configure_args) case "$bash_completion_dir" in /usr/share/*|/usr/local/share/*) bash_completion_dir=$(sed -r 's,^(/usr/share|/usr/local/share),${datadir},'<<<$bash_completion_dir) ;; /usr/*|/usr/local/*) bash_completion_dir=$(sed -r 's,^(/usr|/usr/local),${prefix},'<<<$bash_completion_dir) ;; /*) bash_completion_dir='${prefix}'"$bash_completion_dir" ;; esac AC_SUBST([BASH_COMPLETION_DIR], $bash_completion_dir) AM_CONDITIONAL([SYSTEMD_SUPPORT_ENABLED], [test "x$systemd" = xyes ]) AM_CONDITIONAL([GUI_QT_ENABLED], [test "x$build_gui_qt" = xyes ]) AM_CONDITIONAL([DBUS_ENABLED], [test "x$with_dbus" = xyes ]) AM_CONDITIONAL([POLICYKIT_ENABLED], [test "x$with_polkit" = xyes]) AM_CONDITIONAL([FULL_TEST_SUITE_ENABLED], [test "x$full_test_suite" = xyes]) AM_CONDITIONAL([BASH_COMPLETION_ENABLED], [test "x$bash_completion" != xno]) CXXFLAGS="$CXXFLAGS -fvisibility=hidden $COMMON_WARNING_FLAGS $WARNING_CXXFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden $COMMON_WARNING_FLAGS $WARNING_CFLAGS" AC_DEFINE_UNQUOTED([BINDIR], ["$bindir"], [Binaries root directory]) AC_DEFINE_UNQUOTED([DATADIR], ["$datadir"], [Data directory]) AC_DEFINE_UNQUOTED([DATAROOTDIR], ["$datarootdir"], [Data root directory]) AC_DEFINE_UNQUOTED([DOCDIR], ["$docdir"], [Documentation directory]) AC_DEFINE_UNQUOTED([EXEC_PREFIX], ["$exec_prefix"], [Exec Prefix]) AC_DEFINE_UNQUOTED([INCLUDEDIR], ["$includedir"], [Include directory]) AC_DEFINE_UNQUOTED([LIBEXECDIR], ["$libexecdir"], [Libexec directory]) AC_DEFINE_UNQUOTED([LOCALSTATEDIR], ["$localstatedir"], [Local state directory]) AC_DEFINE_UNQUOTED([PREFIX], ["$prefix"], [Prefix]) AC_DEFINE_UNQUOTED([SBINDIR], ["$sbindir"], [System binaries root directory]) AC_DEFINE_UNQUOTED([SHAREDSTATEDIR], ["$sharedstatedir"], [Shared state directory]) AC_DEFINE_UNQUOTED([SYSCONFDIR], ["$sysconfdir"], [System config root directory]) AC_DEFINE_UNQUOTED([USBGUARD_DAEMON_CONF_PATH], ["$sysconfdir/usbguard/usbguard-daemon.conf"], [Default USBGuard daemon config path]) AC_CONFIG_FILES([Makefile libusbguard.pc src/Tests/Makefile src/GUI.Qt/usbguard-applet-qt.desktop]) AC_OUTPUT echo echo " Build Configuration Summary " echo "===================================" echo echo " Run full test suite: $full_test_suite" echo echo "## Libraries" echo echo " libqb: $libqb_summary" echo " crypto: $crypto_summary" echo " libaudit: $libaudit_summary" echo " libseccomp: $libseccomp_summary" echo " libcap-ng: $libcap_ng_summary" echo " protobuf: $protobuf_summary" echo " Catch: $catch_summary" echo " PEGTL: $pegtl_summary; version <= 1.3.1: $have_pegtl_lte_131" echo " Qt: $qt_summary" echo " GLib D-Bus: $dbus_summary" echo echo "## Directories" echo echo " D-Bus System Services: $dbus_services_dir" echo " D-Bus Busconfig: $dbus_busconfig_dir" echo " PolicyKit Policies: $polkit_policy_dir" echo " systemd unit dir: $systemd_unit_dir" echo " Bash completion dir: $BASH_COMPLETION_DIR" echo echo "## Compilation Flags" echo echo "Debug Build: $debug" echo " DEFS: $DEFS" echo " CXXFLAGS: $CXXFLAGS" echo " CFLAGS: $CFLAGS" echo " CPPFLAGS: $CPPFLAGS" echo " LDFLAGS: $LDFLAGS" echo " ASAN_FLAGS: $ASAN_FLAGS" echo " TSAN_FLAGS: $TSAN_FLAGS" echo usbguard-0.7.2+ds/doc/000077500000000000000000000000001325273707200145135ustar00rootroot00000000000000usbguard-0.7.2+ds/doc/man/000077500000000000000000000000001325273707200152665ustar00rootroot00000000000000usbguard-0.7.2+ds/doc/man/usbguard-applet-qt.1.adoc000066400000000000000000000021121325273707200217720ustar00rootroot00000000000000usbguard-applet-qt(1) ===================== :doctype: manpage == NAME usbguard-applet-qt - USBGuard Qt Applet [[synopsis]] == SYNOPSIS *usbguard-applet-qt* [[description]] == DESCRIPTION USBGuard Qt Applet for interacting with USBGuard daemon. [[options]] == OPTIONS There are currently no command-line options recognized by usbguard-applet-qt. [[security-considerations]] == SECURITY CONSIDERATIONS The applet uses the USBGuard public IPC interface to talk to the daemon component. Depending on your distribution defaults, the access to this interface is limited to a certain group or a specific user only. Please refer to the *usbguard-daemon.conf*(5) man page for more information on how to configure the ACL correctly. Do not leave the ACL unconfigured as that will expose the IPC interface to all local users. That will allow them to manipulate the authorization state of USB devices and modify the USBGuard policy. [[see-also]] == SEE ALSO <>, <> include::footer.adoc[] usbguard-0.7.2+ds/doc/man/usbguard-daemon.8.adoc000066400000000000000000000036411325273707200213450ustar00rootroot00000000000000usbguard-daemon(8) ================== :doctype: manpage == NAME usbguard-daemon - USBGuard daemon [[synopsis]] == SYNOPSIS *usbguard-daemon* ['OPTIONS'] [[description]] == DESCRIPTION The *usbguard-daemon* is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in *usbguard-rules.conf*(5). The policy and the authorization state of USB devices can be modified during runtime using the *usbguard*(1) tool. [[options]] == OPTIONS *-d*:: Enable debugging messages in the log. *-f*:: Enable classical daemon behavior (fork at start, sysV compliant). *-s*:: Log to syslog. *-k*:: Log to console. (default) *-K*:: Disable Logging to console. *-l* 'path':: Log to a file at 'path'. *-p* 'path':: Write PID to a file at 'path' (default: '/var/run/usbguard.pid'). *-c* 'path':: Load configuration from a file at 'path' (default: '/etc/usbguard/usbguard-daemon.conf'). *-h*:: Show the help/usage screen. [[security-considerations]] == SECURITY CONSIDERATIONS The daemon provides the USBGuard public IPC interface. Depending on your distribution defaults, the access to this interface is limited to a certain group or a specific user only. Please refer to the usbguard-daemon.conf(5) man page for more information on how to configure the ACL correctly. *Do not leave the ACL unconfigured as that will expose the IPC interface to all local users. That will allow them to manipulate the authorization state of USB devices and modify the USBGuard policy*. [[see-also]] == SEE ALSO <>, <>, <>, <> include::footer.adoc[] usbguard-0.7.2+ds/doc/man/usbguard-daemon.conf.5.adoc000066400000000000000000000147041325273707200222700ustar00rootroot00000000000000usbguard-daemon.conf(5) ======================= :doctype: manpage == NAME usbguard-daemon.conf - USBGuard daemon configuration file [[description]] == DESCRIPTION The *usbguard-daemon.conf* file is loaded by the USBGuard daemon after it parses its command-line options. It is used to configure runtime parameters of the daemon. The default search path is '/etc/usbguard/usbguard-daemon.conf'. It may be overridden using the *-c* command-line option, see *usbguard-daemon*(8) for further details. [[options]] == OPTIONS *RuleFile*='path':: The USBGuard daemon will use this file to load the policy rule set from it and to write new rules received via the IPC interface. *ImplicitPolicyTarget*='target':: How to treat USB devices that don't match any rule in the policy. Target should be one of `allow`, `block` or `reject` (logically remove the device node from the system). *PresentDevicePolicy*='policy':: How to treat USB devices that are already connected when the daemon starts. Policy should be one of `allow`, `block`, `reject`, `keep` (keep whatever state the device is currently in) or `apply-policy` (evaluate the rule set for every present device). *PresentControllerPolicy*='policy':: How to treat USB *controller* devices that are already connected when the daemon starts. One of `allow`, `block`, `reject`, `keep` or `apply-policy`. *InsertedDevicePolicy*='policy':: How to treat USB devices that are already connected _after_ the daemon starts. One of `block`, `reject`, `apply-policy`. *RestoreControllerDeviceState*='boolean':: The USBGuard daemon modifies some attributes of controller devices like the default authorization state of new child device instances. Using this setting, you can control whether the daemon will try to restore the attribute values to the state before modification on shutdown. *DeviceManagerBackend*='backend':: Which device manager backend implementation to use. Backend should be one of `uevent` (default) or `dummy`. *IPCAllowedUsers**='username' ['username' ...]:: A space delimited list of usernames that the daemon will accept IPC connections from. *IPCAllowedGroups*='groupname' ['groupname' ...]:: A space delimited list of groupnames that the daemon will accept IPC connections from. *IPCAccessControlFiles*='path':: The files at this location will be interpreted by the daemon as IPC access control definition files. See the <> section for more details. *DeviceRulesWithPort*='boolean':: Generate device specific rules including the "via-port" attribute. *AuditBackend*='backend':: USBGuard audit events log backend. The 'backend' value should be one of `FileAudit` or `LinuxAudit`. *AuditFilePath*='filepath':: USBGuard audit events log file path. Required if AuditBackend is set to `FileAudit`. [[security-considerations]] == SECURITY CONSIDERATIONS [[ipc]] === IPC The daemon provides the USBGuard public IPC interface. Depending on your distribution defaults, access to this interface is limited to a certain group or a specific user only. Please set either the *IPCAllowedUsers*, *IPCAllowedGroups* or *IPCAccessControlFiles* options to limit access to the IPC interface. *Do not leave the ACL unconfigured as that will expose the IPC interface to all local users and will allow them to manipulate the authorization state of USB devices and modify the USBGuard policy*. [[restorecontrollerdevicestate-configuration-option]] === RestoreControllerDeviceState configuration option If set to true, the USB authorization policy could be bypassed by performing some sort of attack on the daemon (via a local exploit or via a USB device) to make it shutdown and restore to the operating-system default state (known to be permissive). [[ipc-access-control]] == IPC ACCESS CONTROL Access to the USBGuard IPC interface can be limited per user or group. Furthermore, by using the IPC Access Control files, it is possible to limit the access down to the level of Sections and Privileges as explained below. [[recommended-ipcaccesscontrolfiles]] === *Recommended*: *IPCAccessControlFiles* When you set *IPCAccessControlFiles* option, the daemon will look for IPC access control files in the directory specified by the setting value. Each file in the directory is processed as follows: 1. The basename of the file is interpreted as an username, UID, groupname or GID. If the names starts with `:` (colon), it is assumed that the rest of the name represents a group identifier (groupname or GID in case of a numeric-only string). Otherwise, it is interpreted as an user identifier (username or UID in case of numeric-only string). 2. The contents of the file are parsed as `Section=privilege [privilege ...]` formatted lines which specify the section privileges. If a section is omitted, it is assumed that no privileges are given for that section. Available sections and privileges: * *Devices* ** modify: Change authorization state of devices including permanent changes (i.e. modification of device specific rules in the policy). ** list: Ability to get a list of recognized devices and their attributes. ** listen: Listen to device presence and device policy changes. * *Policy* ** modify: Append rules to or remove any rules from the policy. ** list: Ability to view the currently enforced policy. * *Exceptions* ** listen: Receive exception messages. * *Parameters* ** modify: Set values of run-time parameters. ** list: Get values of run-time parameters. The following is a generally usable and reasonably safe example of an access control file. It allows to modify USB device authorization state (`Devices=modify`), list USB devices (`Devices=list`), listen to USB device related events (`Devices=listen`), list USB authorization policy rules (`Policy=list`) and listen to exception events (`Exceptions=listen`): .... Devices=modify list listen Policy=list Exceptions=listen .... Instead of creating the access control files by yourself, you can use the `usbguard add-user` or `usbguard remove-user` CLI commands. See usbguard(1) for more details. [[legacy-ipcallowedusers-and-ipcallowedgroups]] === Legacy: *IPCAllowedUsers* and *IPCAllowedGroups* Example configuration allowing full IPC access to users 'root', 'joe' and members of the group 'wheel': .... IPCAllowedUsers=root joe IPCAllowedGroups=wheel .... [[see-also]] == SEE ALSO <>, <> include::footer.adoc[] usbguard-0.7.2+ds/doc/man/usbguard-dbus.8.adoc000066400000000000000000000011531325273707200210330ustar00rootroot00000000000000usbguard-dbus(8) ================ :doctype: manpage == NAME usbguard-dbus - USBGuard D-Bus interface service [[synopsis]] == SYNOPSIS *usbguard-dbus* ['OPTIONS'] [[description]] == DESCRIPTION The usbguard-dbus component exposes a D-Bus interface to a running instance of *usbguard-daemon(8)*. [[options]] == OPTIONS *-s, --system*:: Listen on the system bus. *-S, --session*:: Listen on the session bus. *-h, --help*:: Show the help/usage screen. [[see-also]] == SEE ALSO <>, <> include::footer.adoc[] usbguard-0.7.2+ds/doc/man/usbguard-rules.conf.5.adoc000066400000000000000000000306751325273707200221640ustar00rootroot00000000000000usbguard-rules.conf(5) ====================== :doctype: manpage == NAME usbguard-rules.conf - USBGuard rule set file. [[description]] == DESCRIPTION The *usbguard-rules.conf* file is loaded by the USBGuard daemon after it parses the main configuration file, usbguard-daemon.conf(5). The daemon expects the file to contain rules written in a language which is described in the <> section below. [[rule-language]] == Rule Language The USBGuard daemon decides which USB device to authorize based on a policy defined by a set of rules. When a USB device is inserted into the system, the daemon scans the existing rules sequentially. If a matching rule is found, it either authorizes (*allows*), deauthorizes (*blocks*) or removes (*rejects*) the device, based on the rule target. If no matching rule is found, the decision is based on an implicit default target. This implicit default is to block the device until a decision is made by the user. The rule language grammar, expressed in a BNF-like syntax, is the following: .... rule ::= target attributes. target ::= "allow" | "block" | "reject". attributes ::= attributes | attribute. attributes ::= . .... Rule attributes specify which devices to match or what condition have to be met for the rule to be applicable. See the <> section for the list of available attributes and <> for the list of supported rule rule conditions. [[targets]] === Targets The target of a rule specifies whether the device will be authorized for use or not. Three types of target are recognized: * *allow* - Authorize the device. The device and its interfaces will be allowed to communicate with the system. * *block* - Deauthorize the device. The device will remain in a blocked state until it is authorized. * *reject* - Deauthorize and Remove the device from the system. The device will have to be re-inserted to become visible to the system again. [[device-specification]] === Device Specification Except the target, all the other fields of a rule are optional. A rule where only the `target` is specified will match any device. That allows the policy administator to write an explicit default target. If no rule from the policy is applicable to the device, an implicit target configured in usbguard-daemon.conf(5) will be used. However, if one wants to narrow the applicability of a rule to a set of devices or one device only, it's possible to do so with device attributes and rule conditions. [[device-attributes]] ==== Device Attributes Device attributes are specific values read from the USB device after it's inserted to the system. Which attributes are available is defined below. Some of the attributes are derived and some are based on attributes read directly from the device. All attributes support two forms: * *single-valued* with a syntax: + .... name value .... * *multi-valued* with a syntax: + .... name [operator] { value1 value2 ... } .... where the optional 'operator' is one of: *all-of*:: The device attribute set must contain all of the specified values for the rule to match. *one-of*:: The device attribute set must contain at least one of the specified values for the rule to match. *none-of*:: The device attribute set must not contain any of the specified values for the rule to match. *equals*:: The device attribute set must contain exactly the same set of values for the rule to match. *equals-ordered*:: The device attribute set must contain exactly the same set of values in the same order for the rule to match. If the operator is not specified it is set to *equals*. [.underline]#List of attributes:# *id* usb-device-id:: Match a USB device ID. *id* [operator] { usb-device-id ... }:: Match a set of USB device IDs. *hash* "value":: Match a hash computed from the device attribute values and the USB descriptor data. The hash is computed for every device by USBGuard. *hash* [operator] { "value" ... }:: Match a set of device hashes. *parent-hash* "value":: Match a hash of the parent device. *parent-hash* [operator] { "value" ... }:: Match a set of parent device hashes. *name* "device-name":: Match the USB device name attribute. *name* [operator] { "device-name" ... }:: Match a set of USB device names. *serial* "serial-number":: Match the USB iSerial device attribute. *serial* [operator] { "serial-number" ... }:: Match a set of USB iSerial device attributes. *via-port* "port-id":: Match the USB port through which the device is connected. Note that some systems have unstable port numbering. The port might change after the system reboots or when certain kernel modules are reloaded. Use the *parent-hash* attribute if you want to ensure that a device is connected via a specific parent device. *via-port* [operator] { "port-id" ... }:: Match a set of USB ports. *with-interface* interface-type:: Match an interface type that the USB device provides. *with-interface* [operator] { interface-type ... }:: Match a set of interface types against the set of interfaces that the USB device provides. The 'usb-device-id' is a colon delimited pair in the form 'vendor_id:product_id'. All USB devices have this ID assigned by the manufacturer and it should uniquely identify a USB product type. Both 'vendor_id' and 'product_id' are 16-bit numbers represented in hexadecimal base. It's possible to use an asterisk character to match either any device ID `*:*` or any product ID from a specific vendor, e.g. `1234:*`. The 'port-id' value is a platform specific USB port identification. On Linux it's in the form of "usbN" in case of a USB controller (more accurately a "root hub") or "bus-port[.port[.port ...]]" (e.g. `1-2`, `1-2.1`, ...) in case of a USB device. The 'interface-type' represents a USB interface and should be formatted as three 8-bit numbers in hexadecimal base delimited by a colon character, i.e. 'cc:ss:pp'. The numbers represent the interface class ('cc'), subclass ('ss') and protocol ('pp') as assigned by the http://www.usb.org/about[USB-IF]. See the http://www.usb.org/developers/defined_class[list of assigned classes, subclasses and protocols] for details. Instead of the subclass and protocol number, you may write an asterisk character (`*`) to match all subclasses or protocols. Matching a specific class and a specific protocol is not allowed, i.e. if you use an asterisk as the subclass number, you have to use an asterisk for the protocol too. [[conditions]] === Conditions Whether a rule that matches a device will be applied or not can be further restricted using rule conditions. If the condition expression is met at the rule evaluation time, then the rule target is applied for the device. A condition expression is met if it evaluates to true. Otherwise, the rule evaluation continues with the next rule. A rule conditions has the following syntax: .... if [!]condition if [operator] { [!]conditionA [!]conditionB ... } .... Optionally, an exclamation mark (`!`) can be used to negate the result of a condition. Interpretation of the set operator: *all-of*:: Evaluate to true if all of the specified conditions evaluated to true. *one-of*:: Evaluate to true if one of the specified conditions evaluated to true. *none-of*:: Evaluate to true if none of the specified conditions evaluated to true. *equals*:: Same as *all-of*. *equals-ordered*:: Same as *all-of*. List of conditions: *localtime(time_range)*:: Evaluates to true if the local time is in the specified time range. 'time_range' can be written either as `HH:MM[:SS]` or `HH:MM[:SS]-HH:MM[:SS]`. *allowed-matches(query)*:: Evaluates to true if an allowed device matches the specified 'query'. The query uses the rule syntax. *Conditions in the query are not evaluated*. *rule-applied*:: Evaluates to true if the rule currently being evaluated ever matched a device. *rule-applied(past_duration)*:: Evaluates to true if the rule currently being evaluated matched a device in the past duration of time specified by the parameter. 'past_duration' can be written as `HH:MM:SS`, `HH:MM`, or `SS`. *rule-evaluated*:: Evaluates to true if the rule currently being evaluated was ever evaluated before. *rule-evaluated(past_duration)*:: Evaluates to true if the rule currently being evaluated was evaluated in the pas duration of time specified by the parameter. 'past_duration' can be written as `HH:MM:SS`, `HH:MM`, or `SS`. *random*:: Evaluates to true/false with a probability of `p(true)=0.5`. *random(p_true)*:: Evaluates to true with the specified probability `p(true)=p_true`. *true*:: Evaluates always to true. *false*:: Evaluates always to false. [[initial-policy]] == Initial policy Using the *usbguard* CLI tool and its *generate-policy* subcommand, you can generate an initial policy for your system instead of writing one from scratch. The tool generates an *allow* policy for all devices connected to the system at the time of execution. It has several options to tweak the resulting policy, see usbguard(1) for further details. The policy will be printed out on the standard output. It's a good idea to review the generated rules before using them on a system. The typical workflow for generating an initial policy could look like this: // tag::example-initial-policy[] .... $ sudo usbguard generate-policy > rules.conf $ vi rules.conf (review/modify the rule set) $ sudo install -m 0600 -o root -g root rules.conf /etc/usbguard/rules.conf $ sudo systemctl restart usbguard .... // end::example-initial-policy[] [[example-policies]] == Example Policies The following examples show what to put into the *rules.conf* file in order to implement the given policy. 1. *Allow USB mass storage devices (USB flash disks) and block everything else* + This policy will block any device that isn't just a mass storage device. Devices with a hidden keyboard interface in a USB flash disk will be blocked. Only devices with a single mass storage interface will be allowed to interact with the operating system. The policy consists of a single rule: + .... allow with-interface equals { 08:*:* } .... + The blocking is implicit in this case because we didn't write a `block` rule. Implicit blocking is useful to desktop users. A desktop applet listening to USBGuard events can ask the user for a decision if an implicit target was applied. 2. *Allow a specific Yubikey device to be connected via a specific port (and reject everything else on that port)* + .... allow 1050:0011 name "Yubico Yubikey II" serial "0001234567" via-port "1-2" hash "044b5e168d40ee0245478416caf3d998" reject via-port "1-2" .... + We could use just the hash to match the device. However, using the `name` and `serial` attributes provide an useful hint for later inspection of the policy. On the other hand, the hash is the most specific value we can use to identify a device. It's the best attribute to use if you want a rule to match just one device. 3. *Reject devices with suspicious combination of interfaces* + A USB flash disk which implements a keyboard or a network interface is very suspicious. The following set of rules forms a policy that allows USB flash disks and explicitly rejects devices with an additional and suspicious (as defined before) interface. + .... allow with-interface equals { 08:*:* } reject with-interface all-of { 08:*:* 03:00:* } reject with-interface all-of { 08:*:* 03:01:* } reject with-interface all-of { 08:*:* e0:*:* } reject with-interface all-of { 08:*:* 02:*:* } .... + The policy rejects all USB flash disk devices with an interface from the HID/Keyboard, Communications and Wireless classes. Note that blacklisting is the wrong approach and you shouldn't just blacklist a set of devices and allow the rest. The policy above assumes that blocking is the default. Rejecting a set of devices considered as "bad" is a good approach how to limit the exposure of the OS to such devices as much as possible. 4. *Allow a keyboard-only USB device only if there isn't already a USB device with a keyboard interface allowed* + .... allow with-interface one-of { 03:00:01 03:01:01 } if !allowed-matches(with-interface one-of { 03:00:01 03:01:01 }) .... 5. *Play "Russian roulette" with USB devices* + .... allow if random(0.1666) reject .... [[see-also]] == SEE ALSO <>, <> include::footer.adoc[] usbguard-0.7.2+ds/doc/man/usbguard.1.adoc000066400000000000000000000134261325273707200200770ustar00rootroot00000000000000usbguard(1) =========== :doctype: manpage == NAME usbguard - USBGuard command-line interface [[synopsis]] == SYNOPSIS *usbguard* 'OPTIONS' 'command' ['COMMAND-OPTIONS'] ... *usbguard list-devices* *usbguard allow-device* 'id' *usbguard block-device* 'id' *usbguard reject-device* 'id' *usbguard list-rules* *usbguard append-rule* 'rule' *usbguard remove-rule* 'id' *usbguard generate-policy* *usbguard watch* *usbguard read-descriptor* 'file' *usbguard add-user* 'name' *usbguard remove-user* 'name' [[description]] == DESCRIPTION The usbguard command provides a command-line interface (CLI) to a running usbguard-daemon(8) instance. It also provides a tool for generating initial USBGuard policies based on USB devices connected to the system. [[subcommands]] == SUBCOMMANDS === *list-devices* List all USB devices recognized by the USBGuard daemon. Available options: *-a, --allowed*:: List allowed devices. *-b, --blocked*:: List blocked devices. *-h, --help*:: Show help. === *allow-device* ['OPTIONS'] 'id' Authorize a device identified by the device 'id' to interact with the system. Available options: *-p, --permanent*:: Make the decision permanent. A device specific allow rule will be appended to the current policy. *-h, --help*:: Show help. === *block-device* ['OPTIONS'] 'id' Deauthorize a device identified by the device 'id'. Available options: *-p, --permanent*:: Make the decision permanent. A device specific block rule will be appended to the current policy. *-h, --help*:: Show help. === *reject-device* ['OPTIONS'] 'id' Deauthorize and remove a device identified by the device 'id'. Available options: *-p, --permanent*:: Make the decision permanent. A device specific reject rule will be appended to the current policy. *-h, --help*:: Show help. === *list-rules* ['OPTIONS'] List the rule set (policy) used by the USBGuard daemon. Available options: *-d, --show-devices*:: Show all devices which are affected by the specific rule. *-h, --help*:: Show help. === *append-rule* ['OPTIONS'] 'rule' Append the 'rule' to the current rule set. Available options: *-a, --after* 'id':: Append the new rule after a rule with the specified rule 'id'. *-h, --help*:: Show help. === *remove-rule* ['OPTIONS'] 'id' Remove a rule identified by the rule 'id' from the rule set. Available options: *-h, --help*:: Show help. === *generate-policy* ['OPTIONS'] Generate a rule set (policy) which authorizes the currently connected USB devices. Available options: *-p, --with-ports*:: Generate port specific rules for all devices. By default, port specific rules are generated only for devices which do not export an iSerial value. *-P, --no-ports-sn*:: Don't generate port specific rules for devices without an iSerial value. Without this option, the tool will add a via-port attribute to any device that doesn't provide a serial number. This is a security measure to limit devices that cannot be uniquely identified to connect only via a specific port. This makes it harder to bypass the policy since the real device will occupy the allowed USB port most of the time. *-t, --target* 'target':: Generate an explicit "catch all" rule with the specified target. The target can be one of the following values: *allow*, *block*, *reject* *-X, --no-hashes*:: Don't generate a hash attribute for each device. *-H, --hash-only*:: Generate a hash-only policy. *-h, --help*:: Show help. === *watch* ['OPTIONS'] Watch the IPC interface events and print them to stdout. Available options: *-w, --wait*:: Wait for IPC connection to become available. *-o, --once*:: Wait only when starting, if needed. Exit when the connection is lost. *-e, --exec* 'path':: Run an executable file located at 'path' for every event. Pass event data to the process via environment variables. *-h, --help*:: Show help. === *read-descriptor* ['OPTIONS'] 'file' Read a USB descriptor from a file and print it in human-readable form. Available options: *-h, --help*:: Show help. === *add-user* 'name' ['OPTIONS'] Create an IPC access control file allowing the user/group identified by 'name' to use the USBGuard IPC bus. The change takes effect only after restarting the usbguard-daemon(8) instance. Available options: *-u, --user*:: The specified 'name' represents a username or UID (default). *-g, --group*:: The specified 'name' represents a groupname or GID. *-p, --policy* 'privileges':: Policy related privileges. *-d, --devices* 'privileges':: Device related privileges. *-e, --exceptions* 'privileges':: Exceptions related privileges. *-P, --parameters* 'privileges':: Run-time parameter related privileges. *-h, --help*:: Show help. Privileges: The 'privileges' are expected to be in the form of a list separated by a colon: .... $ sudo usbguard add-user joe --devices=listen,modify .... Consult the usbguard-daemon.conf(5) man-page for a detailed list of available privileges in each section. === *remove-user* 'name' ['OPTIONS'] Remove an IPC access control file associated with the user/group identified by 'name'. The change takes effect only after restarting the usbguard-daemon(8) instance. Available options: *-u, --user*:: The specified 'name' represents a username or UID (default). *-g, --group*:: The specified 'name' represents a groupname or GID. *-h, --help*:: Show help. [[examples]] == EXAMPLES Generating an initial policy: include::usbguard-rules.conf.5.adoc[tags=example-initial-policy] [[see-also]] == SEE ALSO <>, <>, <> include::footer.adoc[] usbguard-0.7.2+ds/libusbguard.pc.in000066400000000000000000000004221325273707200172000ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/usbguard Name: libusbguard Description: USBGuard API library URL: https://github.com/USBGuard/usbguard Version: @VERSION@ Requires: libqb Libs: -L${libdir} -lusbguard Cflags: -I${includedir} usbguard-0.7.2+ds/m4/000077500000000000000000000000001325273707200142665ustar00rootroot00000000000000usbguard-0.7.2+ds/m4/ax_check_compile_flag.m4000066400000000000000000000064021325273707200210000ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 4 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS usbguard-0.7.2+ds/m4/libgcrypt.m4000066400000000000000000000111551325273707200165320ustar00rootroot00000000000000dnl Autoconf macros for libgcrypt dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc. dnl dnl This file is free software; as a special exception the author gives dnl unlimited permission to copy and/or distribute it, with or without dnl modifications, as long as this notice is preserved. dnl dnl This file is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed dnl with the API version to also check the API compatibility. Example: dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using dnl this features allows to prevent build against newer versions of libgcrypt dnl with a changed API. dnl AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_WITH(libgcrypt-prefix, AC_HELP_STRING([--with-libgcrypt-prefix=PFX], [prefix where LIBGCRYPT is installed (optional)]), libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") if test x$libgcrypt_config_prefix != x ; then if test x${LIBGCRYPT_CONFIG+set} != xset ; then LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config fi fi AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) tmp=ifelse([$1], ,1:1.2.0,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_libgcrypt_api=0 min_libgcrypt_version="$tmp" fi AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version) ok=no if test "$LIBGCRYPT_CONFIG" != "no" ; then req_major=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` micro=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then AC_MSG_RESULT([yes ($libgcrypt_config_version)]) else AC_MSG_RESULT(no) fi if test $ok = yes; then # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then AC_MSG_RESULT([okay]) else ok=no AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp]) fi fi fi fi if test $ok = yes; then LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then AC_MSG_WARN([[ *** *** The config script $LIBGCRYPT_CONFIG was *** built for $libgcrypt_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgcrypt-prefix *** to specify a matching config script. ***]]) fi fi else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) ]) usbguard-0.7.2+ds/m4/libtool.m4000066400000000000000000011253061325273707200162040ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 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 58 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_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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$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 cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _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], [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 `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" 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 `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 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* | 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 -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_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*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _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='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) 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++, # 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*) # 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 == "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*) _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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; 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 ;; 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 == "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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-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 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*) _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 ;; 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*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-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 ;; 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*) # 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_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 usbguard-0.7.2+ds/m4/ltoptions.m4000066400000000000000000000342621325273707200165720ustar00rootroot00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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])]) usbguard-0.7.2+ds/m4/ltsugar.m4000066400000000000000000000104401325273707200162100ustar00rootroot00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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 ]) usbguard-0.7.2+ds/m4/ltversion.m4000066400000000000000000000012731325273707200165600ustar00rootroot00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) usbguard-0.7.2+ds/m4/lt~obsolete.m4000066400000000000000000000137741325273707200171160ustar00rootroot00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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])]) usbguard-0.7.2+ds/scripts/000077500000000000000000000000001325273707200154355ustar00rootroot00000000000000usbguard-0.7.2+ds/scripts/astyle.sh000077500000000000000000000015311325273707200172750ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2017 Red Hat, 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 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 . # # Authors: Daniel Kopecek # PROJECT_ROOT="$(dirname "$0")/../" ASTYLERC_PATH="${PROJECT_ROOT}/src/astylerc" exec astyle $(< "${ASTYLERC_PATH}") $@ usbguard-0.7.2+ds/scripts/bash_completion/000077500000000000000000000000001325273707200206035ustar00rootroot00000000000000usbguard-0.7.2+ds/scripts/bash_completion/usbguard000077500000000000000000000032001325273707200223400ustar00rootroot00000000000000# Completion for usbguard get_ids() { local id_column=4 usbguard list-devices 2>/dev/null | cut -d " " -f "${id_column}" } get_rules() { local id_column=1 usbguard list-rules 2>/dev/null | cut -d ":" -f "${id_column}" } _usbguard() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="list-devices allow-device block-device reject-device list-rules append-rule remove-rule generate-policy watch read-descriptor" case "${prev}" in allow-device|block-device|reject-device) local ids ids=$( get_ids) # Maybe user running this is not allowed to list devices if [ $? -ne 0 ]; then COMPREPLY="" return 0 fi COMPREPLY=( $(compgen -W "${ids}" "${cur}") ) return 0 ;; remove-rule) local rules rules=$( get_rules ) # Maybe user running this is not allowed to list rules if [ $? -ne 0 ]; then COMPREPLY="" return 0 fi COMPREPLY=( $(compgen -W "${rules}" "${cur}") ) return 0 ;; generate-policy) opts=" --with-ports --no-ports-sn --target --no-hashes --hash-only --help" COMPREPLY=( $(compgen -W "${opts}" "${cur}") ) return 0 ;; list-device) opts=" --allowed --blocked --help" COMPREPLY=( $(compgen -W "${opts}" "${cur}") ) return 0 ;; *) ;; esac COMPREPLY=( $(compgen -W "${opts}" "${cur}") ) return 0 } complete -F _usbguard usbguard usbguard-0.7.2+ds/scripts/modeline.vim000066400000000000000000000000211325273707200177370ustar00rootroot00000000000000set ts=2 sw=2 et usbguard-0.7.2+ds/scripts/reformat-sources.sh000077500000000000000000000023321325273707200212740ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2017 Red Hat, 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 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 . # # Authors: Daniel Kopecek # PROJECT_ROOT="$(dirname "$0")/../" ASTYLE="${PROJECT_ROOT}/scripts/astyle.sh" echo echo " PLEASE READ:" echo " ============" echo " This script requires AStyle version 3 and above." echo " Older versions won't work correctly (or not at all)." echo " ============" echo set -ex find "${PROJECT_ROOT}/src" \ -type f -not -path '*ThirdParty/*' \ \( -name '*.cpp' -or -name '*.hpp' -or -name '*.c' -or -name '*.h' \) \ -exec "${ASTYLE}" --preserve-date --suffix=none --lineend=linux --formatted "{}" \; usbguard-0.7.2+ds/scripts/usb-descriptor-collect.sh000077500000000000000000000052041325273707200223650ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # set -e -o pipefail SED=$(which sed) FIND=$(which find) LSUSB=$(which lsusb) SHA1SUM=$(which sha1sum) TAR=$(which tar) MKTEMP=$(which mktemp) CP=$(which cp) WC=$(which wc) RM=$(which rm) TEMPDIR=$($MKTEMP -d --tmpdir usb-descriptor-collect.XXXXXX || (echo "Failed to create temporary directory"; exit 1)) ROOTDIR="$TEMPDIR/usb-descriptor-data" mkdir $ROOTDIR || (echo "Failed to create data root directory: $ROOTDIR"; exit 1) for dev_syspath in $($FIND /sys/bus/usb/devices/ -regex '.*/[0-9]+-[0-9]+\(\.[0-9]+\)*$' -o -regex '.*/usb[0-9]+$'); do echo "Collecting data from $dev_syspath" pushd "$dev_syspath" dev_bus=$(< busnum) dev_num=$(< devnum) echo " busnum: $dev_bus" echo " devnum: $dev_num" count_c=$($LSUSB -s $dev_bus:$dev_num -v 2> /dev/null | $SED -n 's|Configuration Descriptor|&|p' | $WC -l) count_i=$($LSUSB -s $dev_bus:$dev_num -v 2> /dev/null | $SED -n 's|Interface Descriptor|&|p' | $WC -l) count_e=$($LSUSB -s $dev_bus:$dev_num -v 2> /dev/null | $SED -n 's|Endpoint Descriptor|&|p' | $WC -l) echo " count_c: $count_c" echo " count_i: $count_i" echo " count_e: $count_e" descriptor_hash=$($SHA1SUM descriptors | $SED -n 's|^\([a-fA-F0-9]\{40\}\).*$|\1|p') echo " hash: $descriptor_hash" echo "count_c: $count_c" > "$ROOTDIR/$descriptor_hash.log" echo "count_i: $count_i" >> "$ROOTDIR/$descriptor_hash.log" echo "count_e: $count_e" >> "$ROOTDIR/$descriptor_hash.log" $CP -f descriptors "$ROOTDIR/$descriptor_hash.bin" popd done ARCHIVE_PATH="$TEMPDIR/usb-descriptor-data.tar.gz" echo "Creating data archive: $ARCHIVE_PATH" pushd "$TEMPDIR" $TAR zcvf $ARCHIVE_PATH usb-descriptor-data popd $RM -rf "$TEMPDIR/usb-descriptor-data" echo "=========================================" echo echo " Data collection complete!" echo " Please send the data archive to dnk.usbdev@gmail.com" echo echo " Archive path: $ARCHIVE_PATH" echo echo " Thanks!" echo echo "=========================================" usbguard-0.7.2+ds/scripts/usbguard-zsh-completion000066400000000000000000000140421325273707200221460ustar00rootroot00000000000000#compdef usbguard #autoload # usbguard completion, based on cli help text local curcontext="$curcontext" state line ret=1 local -a _command_args local -a _global_args local -a _subcommands local IFS=$'\n' _global_args=($(usbguard advanced | grep '^\s*--' | sed -r 's/^[\t ]*(--[^\t ,]+)( [^\t ,]*)?,? ?(--?[^\t ]+)?[\t ]*(.*)$/(\3)\1[\4]/')) _arguments -C -A "-v" -A "--version"\ '(- 1 *)'{-v,--version}'[display version information]' \ '1: :->cmds' \ $_global_args \ '*:: :->args' && ret=0 case $state in cmds) _subcommands=( "get-parameter:Get the value of a runtime parameter." "set-parameter:Set the value of a runtime parameter." "list-devices:List all USB devices recognized by the USBGuard daemon." "allow-device:Authorize a device to interact with the system." "block-device:Deauthorize a device." "reject-device:Deauthorize and remove a device from the system." "list-rules:List the rule set (policy) used by the USBGuard daemon." "append-rule:Append a rule to the rule set." "remove-rule:Remove a rule from the rule set." "generate-policy:Generate a rule set (policy) based on the connected USB devices." "watch:Watch for IPC interface events and print them to stdout." "read-descriptor:Read a USB descriptor from a file and print it in human-readable form." "add-user:Add USBGuard IPC user/group (requires root privilges)" "remove-user:Remove USBGuard IPC user/group (requires root privileges)" ) _describe -t subcommands 'usbguard subcommands' _subcommands && ret=0 ;; args) case $line[1] in help) _values 'commands' \ 'get-parameter' \ 'set-parameter' \ 'list-devices' \ 'allow-device' \ 'block-device' \ 'reject-device' \ 'list-rules' \ 'append-rule' \ 'remove-rule' \ 'generate-policy' \ 'watch' \ 'read-descriptor' \ 'add-user' \ 'remove-user' && ret=0 ;; get-parameter) _values "command" \ '[name]' _command_args=( \ '(--help)--help[Show help]' ) ;; set-parameter) _values "command" \ '[name]' \ '[value]' _command_args=( \ '(--verbose)--verbose[Print the previous and new attribute value]' \ '(--help)--help[Show help]' ) ;; list-devices) _command_args=( \ '(--allowed)--allowed[List allowed devices]' \ '(--blocked)--blocked[List blocked devices]' \ '(--help)--help[Show help]' ) ;; allow-device) _values "command" \ '[device-id]' _command_args=( \ '(--permanent)--permanent[Make the decision permanent]' \ '(--help)--help[Show help]' ) ;; block-device) _values "command" \ '[device-id]' _command_args=( \ '(--permanent)--permanent[Make the decision permanent]' \ '(--help)--help[Show help]' ) ;; reject-device) _values "command" \ '[device-id]' _command_args=( \ '(--permanent)--permanent[Make the decision permanent]' \ '(--help)--help[Show help]' ) ;; list-rules) _command_args=( \ '(--help)--help[Show help]' ) ;; append-rule) _values "command" \ '[rule]' _command_args=( \ '(--after)--after [Append the new rule after a rule with the specified id instead of appending it]' \ '(--help)--help[Show help]' ) ;; remove-rule) _values "command" \ '[device-id]' _command_args=( \ '(--help)--help[Show help]' ) ;; generate-policy) _command_args=( \ '(--with-ports-sn)--with-ports-sn[Generate port specific rules for all devices]' \ '(--no-ports-sn)--no-ports-sn[Do not generate port specific rule for devices without an iSerial value]' \ '(--target)--target [Generate an explicit "catch all" rule with the specified target (allow, block, reject)]' \ '(--no-hashes)--no-hashes[Do not generate a hash attribute for each device]' \ '(--hash-only)--hash-only[Generate a hash-only policy]' \ '(--help)--help[Show help]' ) ;; get-parameter) _command_args=( \ '(--wait)--wait[Wait for IPC connection to become available]' \ '(--once)--once[Wait only when starting, if needed. Exit when the connection is lost]' \ '(--help)--help[Show help]' ) ;; read-descriptor) _values "command" \ '[name]' _command_args=( \ '(--help)--help[Show help]' ) ;; add-user) _values "command" \ '[name]' _command_args=( \ '(--user)--user[The specified name represents a username or UID (default)]' \ '(--group)--group[The specified name represents a groupname or GID]' \ '(--policy)--policy [Policy related privileges]' \ '(--devices)--devices [Device related privileges]' \ '(--exceptions)--exceptions [Exceptions related privileges]' \ '(--parameters)--parameters [Run-time parameter related privileges]' \ '(--no-root-check)--no-root-check[Disable root privileges checking]' \ '(--help)--help[Show help]' ) ;; remove-user) _values "command" \ '[name]' _command_args=( \ '(--user)--user[The specified name represents a username or UID (default)]' \ '(--group)--group[The specified name represents a groupname or GID]' \ '(--no-root-check)--no-root-check[Disable root privileges checking]' \ '(--help)--help[Show help]' ) ;; esac ;; esac _arguments \ $_command_args \ && ret=0 return ret usbguard-0.7.2+ds/src/000077500000000000000000000000001325273707200145355ustar00rootroot00000000000000usbguard-0.7.2+ds/src/CLI/000077500000000000000000000000001325273707200151445ustar00rootroot00000000000000usbguard-0.7.2+ds/src/CLI/IPCSignalWatcher.cpp000066400000000000000000000200341325273707200207360ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCSignalWatcher.hpp" #include "usbguard/Exception.hpp" #include #include #include #include #include #include namespace usbguard { IPCSignalWatcher::~IPCSignalWatcher() { if (hasOpenExecutable()) { closeExecutable(); } } void IPCSignalWatcher::setExecutable(const std::string& path) { if (hasOpenExecutable()) { closeExecutable(); } openExecutable(path); } void IPCSignalWatcher::IPCConnected() { std::cout << "[IPC] Connected" << std::endl; if (hasOpenExecutable()) { const std::map env = { { "USBGUARD_IPC_SIGNAL", "IPC.Connected" } }; runExecutable(env); } } void IPCSignalWatcher::IPCDisconnected(bool exception_initiated, const IPCException& exception) { std::cout << "[IPC] Disconnected: exception_initiated=" << exception_initiated; if (exception_initiated) { std::cout << " message=" << exception.message(); } std::cout << std::endl; if (hasOpenExecutable()) { const std::map env = { { "USBGUARD_IPC_SIGNAL", "IPC.Disconnected" }, { "USBGUARD_MESSAGE", exception_initiated ? exception.message() : "" } }; runExecutable(env); } } void IPCSignalWatcher::DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) { std::cout << "[device] PresenceChanged: id=" << id << std::endl; std::cout << " event=" << DeviceManager::eventTypeToString(event) << std::endl; std::cout << " target=" << Rule::targetToString(target) << std::endl; std::cout << " device_rule=" << device_rule << std::endl; if (hasOpenExecutable()) { const std::map env = { { "USBGUARD_IPC_SIGNAL", "Device.PresenceChanged" }, { "USBGUARD_DEVICE_ID", std::to_string(id) }, { "USBGUARD_DEVICE_EVENT", DeviceManager::eventTypeToString(event) }, { "USBGUARD_DEVICE_TARGET", Rule::targetToString(target) }, { "USBGUARD_DEVICE_RULE", device_rule } }; runExecutable(env); } } void IPCSignalWatcher::DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) { std::cout << "[device] PolicyChanged: id=" << id << std::endl; std::cout << " target_old=" << Rule::targetToString(target_old) << std::endl; std::cout << " target_new=" << Rule::targetToString(target_new) << std::endl; std::cout << " device_rule=" << device_rule << std::endl; std::cout << " rule_id=" << rule_id << std::endl; if (hasOpenExecutable()) { const std::map env = { { "USBGUARD_IPC_SIGNAL", "Device.PolicyChanged" }, { "USBGUARD_DEVICE_ID", std::to_string(id) }, { "USBGUARD_DEVICE_TARGET_OLD", Rule::targetToString(target_old) }, { "USBGUARD_DEVICE_TARGET_NEW", Rule::targetToString(target_new) }, { "USBGUARD_DEVICE_RULE", device_rule }, { "USBGUARD_DEVICE_RULE_ID", std::to_string(rule_id) } }; runExecutable(env); } } void IPCSignalWatcher::openExecutable(const std::string& path) { const int fd = ::open(path.c_str(), O_RDONLY); if (fd < 0) { throw ErrnoException("openExecutable", path, errno); } struct ::stat st = { }; if (::fstat(fd, &st) != 0) { ::close(fd); throw ErrnoException("openExecutable", path, errno); } if (!S_ISREG(st.st_mode) || !(st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) { ::close(fd); throw Exception("openExecutable", path, "not an executable file"); } _exec_path = path; _exec_path_fd = fd; } void IPCSignalWatcher::closeExecutable() { _exec_path.clear(); (void)::close(_exec_path_fd); } bool IPCSignalWatcher::hasOpenExecutable() const { return (_exec_path_fd >= 0); } void IPCSignalWatcher::runExecutable(const std::map& environment) { /* * Fork child process, that will fork again and exec. */ const ::pid_t pid_fork1 = fork(); if (pid_fork1 == -1) { std::cerr << "ERROR: runExecutable: " << strerror(errno) << std::endl; return; } if (pid_fork1 > 0) { /* * Wait for the intermediary process to fork and exit. In case something * fails in the intermediary process, we can retrieve the error code from * the return status. */ int fork1_status = -1; const ::pid_t pid_waited = ::waitpid(pid_fork1, &fork1_status, 0); if (pid_waited == -1) { std::cerr << "ERROR: runExecutable: " << strerror(errno) << std::endl; } else if (WIFEXITED(fork1_status)) { const int fork1_errno = WEXITSTATUS(fork1_status); if (fork1_errno != 0) { std::cerr << "ERROR: runExecutable: " << strerror(errno) << std::endl; } } else if (WIFSIGNALED(fork1_status)) { const int fork1_signal = WTERMSIG(fork1_status); std::cerr << "ERROR: runExecutable: terminated by signal " << fork1_signal << std::endl; } return; } /* * Intermediary process. */ const ::pid_t sid = ::setsid(); if (sid == (::pid_t)-1) { ::_exit(errno); } const ::pid_t pid_fork2 = fork(); if (pid_fork2 == (::pid_t)-1) { ::_exit(errno); } if (pid_fork2 > 0) { ::_exit(0); } char* const exec_argv[] = { &_exec_path[0], nullptr }; char** const exec_envp = createExecutableEnvironment(environment); (void)::fexecve(_exec_path_fd, exec_argv, exec_envp); const int saved_errno = errno; destroyExecutableEnvironment(exec_envp); _exit(saved_errno); } char** IPCSignalWatcher::createExecutableEnvironment(const std::map& environment) { size_t environ_size = 0; if (environ != nullptr) { for (char** global_envp = environ; global_envp[0] != nullptr; ++global_envp) { ++environ_size; } } char** envp = new char* [environ_size + environment.size() + 1]; size_t i = 0; for (; i < environ_size; ++i) { envp[i] = cstrCopy(environ[i]); } for (const auto& map_entry : environment) { std::string environ_value; environ_value.append(map_entry.first); environ_value.append("="); environ_value.append(map_entry.second); envp[i++] = cstrCopy(environ_value.c_str()); } envp[i] = nullptr; return envp; } void IPCSignalWatcher::destroyExecutableEnvironment(char** const envp) { if (envp != nullptr) { char** envp_current = envp; while (envp_current[0] != nullptr) { delete [] envp_current[0]; ++envp_current; } delete [] envp; } } char* IPCSignalWatcher::cstrCopy(const char* c_str) { if (c_str == nullptr) { return nullptr; } const auto c_str_len = ::strlen(c_str); char* c_str_copy = new char [c_str_len + 1]; /* * new throws std::bad_alloc on failure, no need * to check the pointer. */ ::memcpy(c_str_copy, c_str, c_str_len); c_str_copy[c_str_len] = '\0'; return c_str_copy; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/IPCSignalWatcher.hpp000066400000000000000000000037261325273707200207540ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/IPCClient.hpp" namespace usbguard { class IPCSignalWatcher : public IPCClient { public: ~IPCSignalWatcher(); void setExecutable(const std::string& path); void IPCConnected() override; void IPCDisconnected(bool exception_initiated, const IPCException& exception) override; void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) override; void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) override; private: void openExecutable(const std::string& path); void closeExecutable(); bool hasOpenExecutable() const; void runExecutable(const std::map& environment); static char** createExecutableEnvironment(const std::map& environment); static void destroyExecutableEnvironment(char** const envp); static char* cstrCopy(const char* c_str); std::string _exec_path; int _exec_path_fd {-1}; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/PolicyGenerator.cpp000066400000000000000000000071101325273707200207550ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "PolicyGenerator.hpp" namespace usbguard { PolicyGenerator::PolicyGenerator() : _ruleset(nullptr) { _with_hash = true; _hash_only = false; _port_specific = false; _port_specific_noserial = true; _with_catchall = false; _catchall_target = Rule::Target::Block; _dm = DeviceManager::create(*this, "uevent"); _dm->setEnumerationOnlyMode(true); _dm->start(); } void PolicyGenerator::setWithHashAttribute(bool state) { _with_hash = state; } void PolicyGenerator::setHashOnly(bool state) { _hash_only = state; } void PolicyGenerator::setPortSpecificRules(bool state) { _port_specific = state; } void PolicyGenerator::setPortSpecificNoSerialRules(bool state) { _port_specific_noserial = state; } void PolicyGenerator::generate() { _dm->scan(); if (_with_catchall) { Rule catchall_rule; catchall_rule.setTarget(_catchall_target); _ruleset.appendRule(catchall_rule); } } const RuleSet& PolicyGenerator::refRuleSet() const { return _ruleset; } void PolicyGenerator::setExplicitCatchAllRule(bool state, Rule::Target target) { _with_catchall = state; _catchall_target = target; } void PolicyGenerator::dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device) { if (event != DeviceManager::EventType::Present) { /* * Ignore run-time device events */ return; } bool port_specific = _port_specific; /* * If the the global "port specific" flag isn't * set, check the "no iSerial port specific" flag * applicability. */ if (!port_specific && _port_specific_noserial) { port_specific = device->getSerial().empty(); } std::shared_ptr rule = device->getDeviceRule(/*include_port=*/port_specific); /* Remove everything but the hash value for hash-only rules */ if (_hash_only) { std::shared_ptr rule_hashonly(new Rule()); rule_hashonly->setRuleID(rule->getRuleID()); rule_hashonly->setHash(rule->getHash()); rule_hashonly->setParentHash(rule->getParentHash()); if (port_specific) { rule_hashonly->attributeViaPort().set(rule->attributeViaPort().values(), Rule::SetOperator::Equals); } rule = rule_hashonly; } /* Remove the hash attributes if set to do so */ else if (!_with_hash) { rule->attributeHash().clear(); rule->attributeParentHash().clear(); } rule->setTarget(Rule::Target::Allow); _ruleset.appendRule(*rule); } uint32_t PolicyGenerator::dmHookAssignID() { return _ruleset.assignID(); } void PolicyGenerator::dmHookDeviceException(const std::string& message) { USBGUARD_LOG(Error) << message; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/PolicyGenerator.hpp000066400000000000000000000035411325273707200207660ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Rule.hpp" #include "usbguard/RuleSet.hpp" #include "usbguard/DeviceManager.hpp" #include "usbguard/DeviceManagerHooks.hpp" namespace usbguard { class PolicyGenerator : public DeviceManagerHooks { public: PolicyGenerator(); void setWithHashAttribute(bool state); void setHashOnly(bool state); void setPortSpecificRules(bool state); void setPortSpecificNoSerialRules(bool state); void setExplicitCatchAllRule(bool state, Rule::Target target = Rule::Target::Block); void generate(); const RuleSet& refRuleSet() const; void dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device) override; uint32_t dmHookAssignID() override; void dmHookDeviceException(const std::string& message) override; private: RuleSet _ruleset; std::shared_ptr _dm; bool _with_hash; bool _hash_only; bool _port_specific; bool _port_specific_noserial; bool _with_catchall; Rule::Target _catchall_target; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-add-user.cpp000066400000000000000000000116201325273707200211660ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-add-user.hpp" #include "usbguard/USBGuard.hpp" #include "usbguard/IPCServer.hpp" #include #include #include namespace usbguard { static const char* options_short = "hugp:d:e:P:N"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "user", no_argument, nullptr, 'u' }, { "group", no_argument, nullptr, 'g' }, { "policy", required_argument, nullptr, 'p' }, { "devices", required_argument, nullptr, 'd' }, { "exceptions", required_argument, nullptr, 'e' }, { "parameters", required_argument, nullptr, 'P' }, { "no-root-check", no_argument, nullptr, 'N' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " add-user [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -u, --user The specified name represents a username or UID (default)." << std::endl; stream << " -g, --group The specified name represents a groupname or GID." << std::endl; stream << " -p, --policy Policy related privileges." << std::endl; stream << " -d, --devices Device related privileges." << std::endl; stream << " -e, --exceptions Exceptions related privileges." << std::endl; stream << " -P, --parameters Run-time parameter related privileges." << std::endl; stream << " -N, --no-root-check Disable root privileges checking." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } static void createIPCAccessControlFile(const std::string& path, const std::string& name, bool is_group, const IPCServer::AccessControl& access_control) { IPCServer::checkAccessControlName(name); const std::string basename = getIPCAccessControlFileBasename(name, is_group); const std::string separator = (path.at(path.size() - 1) == '/' ? "" : "/"); const std::string filepath = path + separator + basename; /* * Ensure that only the owner can read/write the file. */ umask(0177); std::ofstream access_control_stream(filepath); if (!access_control_stream.good()) { throw ErrnoException("createIPCAccessControlFile", filepath, errno); } access_control.save(access_control_stream); return; } int usbguard_add_user(int argc, char* argv[]) { int opt = 0; bool opt_is_group = false; bool opt_no_root_check = false; IPCServer::AccessControl access_control; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'u': opt_is_group = false; break; case 'g': opt_is_group = true; break; case 'p': access_control.merge(std::string("Policy=").append(optarg)); break; case 'd': access_control.merge(std::string("Devices=").append(optarg)); break; case 'e': access_control.merge(std::string("Exceptions=").append(optarg)); break; case 'P': access_control.merge(std::string("Parameters=").append(optarg)); break; case 'N': opt_no_root_check = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argv += optind; argc -= optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } if (!opt_no_root_check) { if (!(getuid() == 0 && geteuid() == 0)) { USBGUARD_LOG(Error) << "This subcommand requires root privileges. Please retry as root."; return EXIT_FAILURE; } } const std::string name(argv[0]); const std::string path(getIPCAccessControlFilesPath()); createIPCAccessControlFile(path, name, opt_is_group, access_control); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-add-user.hpp000066400000000000000000000016601325273707200211760ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_add_user(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-allow-device.cpp000066400000000000000000000047111325273707200220400ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-allow-device.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hp"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "permanent", no_argument, nullptr, 'p' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " allow-device [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -p, --permanent Make the decision permanent. A device specific allow" << std::endl; stream << " rule will be appended to or updated in the current policy." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_allow_device(int argc, char* argv[]) { uint32_t id = 0; bool permanent = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'p': permanent = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } id = std::stoul(argv[0]); usbguard::IPCClient ipc(/*connected=*/true); ipc.applyDevicePolicy(id, Rule::Target::Allow, permanent); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-allow-device.hpp000066400000000000000000000016641325273707200220510ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_allow_device(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-append-rule.cpp000066400000000000000000000047761325273707200217140ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-append-rule.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "ha:"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "after", required_argument, nullptr, 'a' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " append-rule [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -a, --after Append the new rule after a rule with the specified id" << std::endl; stream << " instead of appending it at the end of the rule set." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_append_rule(int argc, char* argv[]) { uint32_t parent_id = usbguard::Rule::LastID; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'a': parent_id = std::stoul(optarg); break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } usbguard::IPCClient ipc(/*connected=*/true); const std::string rule_spec = argv[0]; const uint32_t id = ipc.appendRule(rule_spec, parent_id); std::cout << id << std::endl; return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-append-rule.hpp000066400000000000000000000016631325273707200217110ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_append_rule(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-block-device.cpp000066400000000000000000000047111325273707200220140ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-block-device.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hp"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "permanent", no_argument, nullptr, 'p' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " block-device [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -p, --permanent Make the decision permanent. A device specific block" << std::endl; stream << " rule will be appended to or updated in the current policy." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_block_device(int argc, char* argv[]) { uint32_t id = 0; bool permanent = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'p': permanent = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } id = std::stoul(argv[0]); usbguard::IPCClient ipc(/*connected=*/true); ipc.applyDevicePolicy(id, Rule::Target::Block, permanent); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-block-device.hpp000066400000000000000000000016641325273707200220250ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_block_device(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-generate-policy.cpp000066400000000000000000000074421325273707200225600ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-generate-policy.hpp" #include "PolicyGenerator.hpp" #include "Common/Utility.hpp" #include "usbguard/DeviceManager.hpp" #include #include namespace usbguard { static const char* options_short = "hpPt:HX"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "with-ports", no_argument, nullptr, 'p' }, { "no-ports-sn", no_argument, nullptr, 'P' }, { "target", required_argument, nullptr, 't' }, { "hash-only", no_argument, nullptr, 'H' }, { "no-hashes", no_argument, nullptr, 'X' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " generate-policy [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -p, --with-ports Generate port specific rules for all devices." << std::endl; stream << " -P, --no-ports-sn Don't generate port specific rule for devices" << std::endl; stream << " without an iSerial value." << std::endl; stream << " -t, --target Generate an explicit \"catch all\" rule with the" << std::endl; stream << " specified target. Possible targets: allow, block, reject." << std::endl; stream << " -X, --no-hashes Don't generate a hash attribute for each device." << std::endl; stream << " -H, --hash-only Generate a hash-only policy." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_generate_policy(int argc, char** argv) { bool port_specific = false; bool port_specific_noserial = true; bool with_catchall = false; std::string catchall_target = "block"; bool with_hashes = true; bool only_hashes = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'p': port_specific = true; break; case 'P': port_specific_noserial = false; break; case 't': with_catchall = true; catchall_target = optarg; break; case 'H': only_hashes = true; break; case 'X': with_hashes = false; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } PolicyGenerator generator; generator.setWithHashAttribute(with_hashes); generator.setHashOnly(only_hashes); generator.setPortSpecificRules(port_specific); generator.setPortSpecificNoSerialRules(port_specific_noserial); generator.setExplicitCatchAllRule(with_catchall, Rule::targetFromString(catchall_target)); generator.generate(); const RuleSet& ruleset = generator.refRuleSet(); ruleset.save(std::cout); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-generate-policy.hpp000066400000000000000000000016671325273707200225700ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_generate_policy(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-get-parameter.cpp000066400000000000000000000041731325273707200222240ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-get-parameter.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "h"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " get-parameter [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_get_parameter(int argc, char* argv[]) { int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argv += optind; argc -= optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } const std::string name = argv[0]; usbguard::IPCClient ipc(/*connected=*/true); const std::string value = ipc.getParameter(name); std::cout << value << std::endl; return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-get-parameter.hpp000066400000000000000000000016651325273707200222340ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_get_parameter(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-list-devices.cpp000066400000000000000000000052351325273707200220620ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-list-devices.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hab"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "blocked", no_argument, nullptr, 'b' }, { "allowed", no_argument, nullptr, 'a' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " list-devices [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -a, --allowed List allowed devices." << std::endl; stream << " -b, --blocked List blocked devices." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_list_devices(int argc, char* argv[]) { bool list_blocked = false; bool list_allowed = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'a': list_allowed = true; break; case 'b': list_blocked = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } const bool list_everything = (list_blocked == list_allowed); std::string query = "match"; if (!list_everything) { if (list_allowed) { query = "allow"; } else { query = "block"; } } usbguard::IPCClient ipc(/*connected=*/true); for (auto device_rule : ipc.listDevices(query)) { std::cout << device_rule.getRuleID() << ": " << device_rule.toString() << std::endl; } return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-list-devices.hpp000066400000000000000000000016641325273707200220710ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_list_devices(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-list-rules.cpp000066400000000000000000000053261325273707200215730ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-list-rules.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hd"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "show-devices", no_argument, nullptr, 'd'}, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " list-rules [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -d, --show-devices Show all devices which are affected by the specific rule." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_list_rules(int argc, char* argv[]) { bool show_devices = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'd': show_devices = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } usbguard::IPCClient ipc(/*connected=*/true); RuleSet ruleset = ipc.listRules(); // if true, devices which are affected by rule are printed on stdout. if (!show_devices) { for (auto rule : ruleset.getRules()) { std::cout << rule->getRuleID() << ": " << rule->toString() << std::endl; } } else { for (auto rule : ruleset.getRules()) { std::cout << rule->getRuleID() << ": " << rule->toString() << std::endl; for (auto device_rule : ipc.listDevices(rule->toString())) { std::cout << "\t"<< device_rule.getRuleID() << ": " << device_rule.toString() << std::endl; } } } return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-list-rules.hpp000066400000000000000000000016621325273707200215770ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_list_rules(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-read-descriptor.cpp000066400000000000000000000201041325273707200225460ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-read-descriptor.hpp" #include "usbguard/USB.hpp" #include "usbguard/Exception.hpp" #include #include #include #include namespace usbguard { static const char* options_short = "h"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " read-descriptor [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } static void printDeviceDescriptor(const USBDescriptor*); static void printConfigurationDescriptor(const USBDescriptor*); static void printInterfaceDescriptor(const USBDescriptor*); static void printEndpointDescriptor(const USBDescriptor*); static void printAudioEndpointDescriptor(const USBDescriptor*); static void printUnknownDescriptor(const USBDescriptor*); class USBDescriptorPrinter : public USBDescriptorParserHooks { public: void loadUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor) override { (void)parser; switch (static_cast(descriptor->bHeader.bDescriptorType)) { case USBDescriptorType::Device: printDeviceDescriptor(descriptor); break; case USBDescriptorType::Configuration: printConfigurationDescriptor(descriptor); break; case USBDescriptorType::Interface: printInterfaceDescriptor(descriptor); break; case USBDescriptorType::Endpoint: switch (descriptor->bHeader.bLength) { case sizeof(USBEndpointDescriptor): printEndpointDescriptor(descriptor); break; case sizeof(USBAudioEndpointDescriptor): printAudioEndpointDescriptor(descriptor); break; default: printUnknownDescriptor(descriptor); } break; case USBDescriptorType::String: case USBDescriptorType::AssociationInterface: case USBDescriptorType::Unknown: default: printUnknownDescriptor(descriptor); break; } } }; int usbguard_read_descriptor(int argc, char* argv[]) { int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } std::ifstream descriptor_stream(argv[0], std::ifstream::binary); if (!descriptor_stream.good()) { throw ErrnoException("read-descriptor", argv[0], errno); } else { USBDescriptorPrinter printer; USBDescriptorParser parser(printer); const size_t size_parsed = parser.parse(descriptor_stream); printf("Bytes parsed: %zu\n", size_parsed); for (auto const& count : parser.getDescriptorCounts()) { printf("Descriptor type 0x%02" PRIx8 " count: %zu\n", count.first, count.second); } } return EXIT_SUCCESS; } #define PRINTF_LEVEL(level) for (int l = level; l > 0; --l) printf("\t") #define PRINTF_HEADER(sp, label, level) \ do { \ PRINTF_LEVEL(level); \ printf("%s: type=%02" PRIx8 " length=%" PRIu8 "\n", label, \ (sp)->bHeader.bDescriptorType, (sp)->bHeader.bLength); \ } while(0) #define PRINTF_MEMBER(sp, m, fmt, level) \ do { \ PRINTF_LEVEL(level); \ printf("%20s: " fmt "\n", #m, sp->m); \ } while(0) void printDeviceDescriptor(const USBDescriptor* descriptor_base) { const USBDeviceDescriptor* descriptor = reinterpret_cast(descriptor_base); PRINTF_HEADER(descriptor, "Device Descriptor", 0); PRINTF_MEMBER(descriptor, bcdUSB, "0x%04" PRIx16, 0); PRINTF_MEMBER(descriptor, bDeviceClass, "0x%02" PRIx8, 0); PRINTF_MEMBER(descriptor, bDeviceSubClass, "0x%02" PRIx8, 0); PRINTF_MEMBER(descriptor, bDeviceProtocol, "0x%02" PRIx8, 0); PRINTF_MEMBER(descriptor, bMaxPacketSize, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, idVendor, "0x%04" PRIx16, 0); PRINTF_MEMBER(descriptor, idProduct, "0x%04" PRIx16, 0); PRINTF_MEMBER(descriptor, bcdDevice, "0x%04" PRIx16, 0); PRINTF_MEMBER(descriptor, iManufacturer, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, iSerialNumber, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bNumConfigurations, "%" PRIu8, 0); printf("\n"); } void printConfigurationDescriptor(const USBDescriptor* descriptor_base) { const USBConfigurationDescriptor* descriptor = reinterpret_cast(descriptor_base); PRINTF_HEADER(descriptor, "Configuration Descriptor", 0); PRINTF_MEMBER(descriptor, wTotalLength, "%" PRIu16, 0); PRINTF_MEMBER(descriptor, bNumInterfaces, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bConfigurationValue, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, iConfiguration, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bmAttributes, "%02" PRIx8, 0); PRINTF_MEMBER(descriptor, bMaxPower, "%" PRIu8, 0); printf("\n"); } void printInterfaceDescriptor(const USBDescriptor* descriptor_base) { const USBInterfaceDescriptor* descriptor = reinterpret_cast(descriptor_base); PRINTF_HEADER(descriptor, "Interface Descriptor", 0); PRINTF_MEMBER(descriptor, bInterfaceNumber, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bAlternateSetting, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bNumEndpoints, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bInterfaceClass, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bInterfaceSubClass, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bInterfaceProtocol, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, iInterface, "%" PRIu8, 0); printf("\n"); } void printEndpointDescriptor(const USBDescriptor* descriptor_base) { const USBEndpointDescriptor* descriptor = reinterpret_cast(descriptor_base); PRINTF_HEADER(descriptor, "Endpoint Descriptor", 0); PRINTF_MEMBER(descriptor, bEndpointAddress, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bmAttributes, "0x%02" PRIx8, 0); PRINTF_MEMBER(descriptor, wMaxPacketSize, "%" PRIu16, 0); PRINTF_MEMBER(descriptor, bInterval, "%" PRIu8, 0); printf("\n"); } void printAudioEndpointDescriptor(const USBDescriptor* descriptor_base) { const USBAudioEndpointDescriptor* descriptor = reinterpret_cast(descriptor_base); PRINTF_HEADER(descriptor, "Endpoint Descriptor (Audio)", 0); PRINTF_MEMBER(descriptor, bEndpointAddress, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bmAttributes, "0x%02" PRIx8, 0); PRINTF_MEMBER(descriptor, wMaxPacketSize, "%" PRIu16, 0); PRINTF_MEMBER(descriptor, bInterval, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bRefresh, "%" PRIu8, 0); PRINTF_MEMBER(descriptor, bSynchAddress, "%" PRIu8, 0); printf("\n"); } void printUnknownDescriptor(const USBDescriptor* descriptor) { PRINTF_HEADER(descriptor, "UNKNOWN Descriptor", 0); printf("\n"); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-read-descriptor.hpp000066400000000000000000000016671325273707200225700ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_read_descriptor(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-reject-device.cpp000066400000000000000000000047161325273707200222030ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-reject-device.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hp"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "permanent", no_argument, nullptr, 'p' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " reject-device [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -p, --permanent Make the decision permanent. A device specific reject" << std::endl; stream << " rule will be appended to or updated in the current policy." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_reject_device(int argc, char* argv[]) { uint32_t id = 0; bool permanent = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'p': permanent = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } id = std::stoul(argv[0]); usbguard::IPCClient ipc(/*connected=*/true); ipc.applyDevicePolicy(id, Rule::Target::Reject, permanent); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-reject-device.hpp000066400000000000000000000016651325273707200222100ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_reject_device(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-remove-rule.cpp000066400000000000000000000040641325273707200217300ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-remove-rule.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "h"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " remove-rule [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_remove_rule(int argc, char* argv[]) { int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } const uint32_t id = std::stoul(argv[0]); usbguard::IPCClient ipc(/*connected=*/true); ipc.removeRule(id); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-remove-rule.hpp000066400000000000000000000016631325273707200217370ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_remove_rule(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-remove-user.cpp000066400000000000000000000070471325273707200217430ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-remove-user.hpp" #include "usbguard/USBGuard.hpp" #include "usbguard/IPCServer.hpp" #include #include namespace usbguard { static const char* options_short = "hugN"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "user", no_argument, nullptr, 'u' }, { "group", no_argument, nullptr, 'g' }, { "no-root-check", no_argument, nullptr, 'N' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " remove-user [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -u, --user The specified name represents a username or UID (default)." << std::endl; stream << " -g, --group The specified name represents a groupname or GID." << std::endl; stream << " -N, --no-root-check Disable root privileges checking." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } static void removeIPCAccessControlFile(const std::string& path, const std::string& name, bool is_group) { IPCServer::checkAccessControlName(name); const std::string basename = getIPCAccessControlFileBasename(name, is_group); const std::string separator = (path.at(path.size() - 1) == '/' ? "" : "/"); const std::string filepath = path + separator + basename; if (unlink(filepath.c_str()) != 0) { throw ErrnoException("removeIPCAccessControlFile", filepath, errno); } } int usbguard_remove_user(int argc, char* argv[]) { int opt = 0; bool opt_is_group = false; bool opt_no_root_check = false; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'u': opt_is_group = false; break; case 'g': opt_is_group = true; break; case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'N': opt_no_root_check = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argv += optind; argc -= optind; if (argc != 1) { showHelp(std::cerr); return EXIT_FAILURE; } if (!opt_no_root_check) { if (!(getuid() == 0 && geteuid() == 0)) { USBGUARD_LOG(Error) << "This subcommand requires root privileges. Please retry as root."; return EXIT_FAILURE; } } const std::string name(argv[0]); const std::string path(getIPCAccessControlFilesPath()); removeIPCAccessControlFile(path, name, opt_is_group); return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-remove-user.hpp000066400000000000000000000016631325273707200217460ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_remove_user(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-rule-parser.cpp000066400000000000000000000075221325273707200217310ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Rule.hpp" #include "usbguard/RuleParser.hpp" #include #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include static const char* options_short = "hft"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "file", no_argument, nullptr, 'f' }, { "trace", no_argument, nullptr, 't' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream, const char* usbguard_arg0) { stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS] " << std::endl; stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS] -f " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -f, --file Interpret the argument as a path to a file that should be parsed." << std::endl; stream << " -t, --trace Enable parser tracing." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int main(int argc, char** argv) { const char* usbguard_arg0 = argv[0]; bool trace = false; bool from_file = false; int opt = 0; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout, usbguard_arg0); return EXIT_SUCCESS; case 'f': from_file = true; break; case 't': trace = true; break; case '?': default: showHelp(std::cout, usbguard_arg0); return EXIT_FAILURE; } } argc -= optind; argv += optind; if (argc != 1) { showHelp(std::cerr, usbguard_arg0); return EXIT_FAILURE; } std::string rule_spec; try { if (from_file) { const std::string rule_file(argv[0]); std::ifstream stream(rule_file); size_t line = 0; while (stream.good()) { rule_spec.clear(); std::getline(stream, rule_spec); if (rule_spec.empty()) { break; } ++line; std::cout << "INPUT: " << rule_spec << std::endl; const usbguard::Rule rule = usbguard::parseRuleFromString(rule_spec, rule_file, line, trace); std::cout << "OUTPUT: " << rule.toString() << std::endl; } return EXIT_SUCCESS; } else { rule_spec = argv[0]; std::cout << "INPUT: " << rule_spec << std::endl; const usbguard::Rule rule = usbguard::parseRuleFromString(rule_spec, "", 0, trace); std::cout << "OUTPUT: " << rule.toString() << std::endl; return EXIT_SUCCESS; } } catch (const usbguard::RuleParserError& ex) { std::cerr << "! ERROR: " << ex.what() << std::endl; std::cerr << "!! " << rule_spec << std::endl; std::cerr << "!! "; std::cerr.width(4 + ex.offset()); std::cerr << "^-- " << ex.hint() << std::endl; std::cerr.width(1); } catch (const std::exception& ex) { std::cerr << "! EXCEPTION: " << ex.what() << std::endl; } catch (...) { std::cerr << "! EXCEPTION: Unknown" << std::endl; } return EXIT_FAILURE; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-set-parameter.cpp000066400000000000000000000047171325273707200222440ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-set-parameter.hpp" #include "usbguard/IPCClient.hpp" #include namespace usbguard { static const char* options_short = "hv"; static const struct ::option options_long[] = { { "help", no_argument, nullptr, 'h' }, { "verbose", no_argument, nullptr, 'v' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " set-parameter [OPTIONS] " << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -v, --verbose Print the previous and new attribute value." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_set_parameter(int argc, char* argv[]) { int opt = 0; bool verbose = false; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'v': verbose = true; break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } argv += optind; argc -= optind; if (argc != 2) { showHelp(std::cerr); return EXIT_FAILURE; } const std::string name = argv[0]; const std::string value = argv[1]; usbguard::IPCClient ipc(/*connected=*/true); const std::string previous_value = ipc.setParameter(name, value); if (verbose) { std::cout << previous_value << " => " << value << std::endl; } return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-set-parameter.hpp000066400000000000000000000016651325273707200222500ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_set_parameter(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-watch.cpp000066400000000000000000000076571325273707200206070ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard.hpp" #include "usbguard-watch.hpp" #include #include #include namespace usbguard { static const char* options_short = "wohe:"; static const struct ::option options_long[] = { { "wait", no_argument, nullptr, 'w' }, { "once", no_argument, nullptr, 'o' }, { "help", no_argument, nullptr, 'h' }, { "exec", required_argument, nullptr, 'e' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << usbguard_arg0 << " watch [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -w, --wait Wait for IPC connection to become available." << std::endl; stream << " -o, --once Wait only when starting, if needed. Exit when the connection is lost." << std::endl; stream << " -e, --exec Run an executable file located at for every event. Pass event" << std::endl; stream << " data to the process via environment variables." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int usbguard_watch(int argc, char* argv[]) { int opt = 0; bool do_wait = false; bool wait_once = false; std::string exec_path; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 'w': do_wait = true; break; case 'o': wait_once = do_wait = true; break; case 'h': showHelp(std::cout); return EXIT_SUCCESS; case 'e': exec_path = std::string(optarg); break; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } IPCSignalWatcher watcher; if (!exec_path.empty()) { watcher.setExecutable(exec_path); } bool connect_waiting = false; std::string connect_last_exception; while (true) { try { watcher.connect(); connect_waiting = false; if (wait_once) { do_wait = false; } watcher.wait(); } catch (const Exception& ex) { /* * Re-throw if we won't be waiting for the connection * to become available. */ if (!do_wait) { throw; } /* * Save the exception message. If the message changes, we'll * write an updated waiting message to the output. */ const std::string connect_exception = ex.message(); /* * When transitioning to waiting state or on exception message * updates, write a waiting status message to the output. */ if (!connect_waiting || connect_last_exception != connect_exception) { std::cerr << "Waiting. IPC not available: " << connect_exception << std::endl; connect_waiting = true; connect_last_exception = connect_exception; } /* * Wait for some time... */ sleep(1); } } return EXIT_SUCCESS; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard-watch.hpp000066400000000000000000000016551325273707200206040ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif namespace usbguard { int usbguard_watch(int argc, char** argv); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard.cpp000066400000000000000000000125521325273707200174710ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include #include #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include /* GNU version of basename(3) */ #include "usbguard.hpp" #include "usbguard-get-parameter.hpp" #include "usbguard-set-parameter.hpp" #include "usbguard-list-devices.hpp" #include "usbguard-list-rules.hpp" #include "usbguard-generate-policy.hpp" #include "usbguard-allow-device.hpp" #include "usbguard-block-device.hpp" #include "usbguard-reject-device.hpp" #include "usbguard-append-rule.hpp" #include "usbguard-remove-rule.hpp" #include "usbguard-watch.hpp" #include "usbguard-read-descriptor.hpp" #include "usbguard-add-user.hpp" #include "usbguard-remove-user.hpp" namespace usbguard { const char* usbguard_arg0 = nullptr; static const std::map cmd_handler_map = { { "get-parameter", &usbguard_get_parameter }, { "set-parameter", &usbguard_set_parameter }, { "list-devices", &usbguard_list_devices }, { "allow-device", &usbguard_allow_device }, { "block-device", &usbguard_block_device }, { "reject-device", &usbguard_reject_device }, { "list-rules", &usbguard_list_rules }, { "append-rule", &usbguard_append_rule }, { "remove-rule", &usbguard_remove_rule }, { "generate-policy", &usbguard_generate_policy }, { "watch", &usbguard_watch }, { "read-descriptor", &usbguard_read_descriptor }, { "add-user", &usbguard_add_user }, { "remove-user", &usbguard_remove_user } }; static void showTopLevelHelp(std::ostream& stream = std::cout) { stream << " Usage: " << usbguard_arg0 << " [OPTIONS] [COMMAND OPTIONS] ..." << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << "" << std::endl; stream << " Commands:" << std::endl; stream << " get-parameter Get the value of a runtime parameter." << std::endl; stream << " set-parameter Set the value of a runtime parameter." << std::endl; stream << " list-devices List all USB devices recognized by the USBGuard daemon." << std::endl; stream << " allow-device Authorize a device to interact with the system." << std::endl; stream << " block-device Deauthorize a device." << std::endl; stream << " reject-device Deauthorize and remove a device from the system." << std::endl; stream << std::endl; stream << " list-rules List the rule set (policy) used by the USBGuard daemon." << std::endl; stream << " append-rule Append a rule to the rule set." << std::endl; stream << " remove-rule Remove a rule from the rule set." << std::endl; stream << std::endl; stream << " generate-policy Generate a rule set (policy) based on the connected USB devices." << std::endl; stream << " watch Watch for IPC interface events and print them to stdout." << std::endl; stream << " read-descriptor Read a USB descriptor from a file and print it in human-readable form." << std::endl; stream << std::endl; stream << " add-user Add USBGuard IPC user/group (requires root privilges)" << std::endl; stream << " remove-user Remove USBGuard IPC user/group (requires root privileges)" << std::endl; stream << std::endl; } static int usbguard_cli(int argc, char* argv[]) { usbguard_arg0 = ::basename(argv[0]); if (argc == 1) { showTopLevelHelp(); return EXIT_SUCCESS; } const char* subcommand_key = argv[1]; const auto iterator = cmd_handler_map.find(subcommand_key); /* Not such key in the map, show list of commands */ if (iterator == cmd_handler_map.cend()) { showTopLevelHelp(); return EXIT_FAILURE; } auto subcommand = iterator->second; return subcommand(argc - 1, argv + 1); } } /* namespace usbguard */ int main(int argc, char* argv[]) { try { return usbguard::usbguard_cli(argc, argv); } catch (const usbguard::IPCException& ex) { std::cerr << "IPC ERROR: request id=" << ex.messageID() << ": " << ex.message() << std::endl; } catch (const usbguard::Exception& ex) { std::cerr << "ERROR: " << ex.message() << std::endl; } catch (const std::exception& ex) { std::cerr << "EXCEPTION: " << ex.what() << std::endl; } catch (...) { std::cerr << "BUG: Unknown exception" << std::endl; } return EXIT_FAILURE; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/CLI/usbguard.hpp000066400000000000000000000017771325273707200175050ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Logger.hpp" #include #include #include namespace usbguard { extern const char* usbguard_arg0; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Common/000077500000000000000000000000001325273707200157655ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Common/ByteOrder.hpp000066400000000000000000000020161325273707200203740ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include namespace usbguard { static inline uint16_t busEndianToHost(uint16_t bus_value) { return le16toh(bus_value); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Common/FDInputStream.hpp000066400000000000000000000030211325273707200211570ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include #include namespace usbguard { #if HAVE_EXT_STDIO_FILEBUF_H class FDInputStream : public std::ifstream { public: FDInputStream(int fd) : _filebuf_ptr(new __gnu_cxx::stdio_filebuf(fd, std::ios::in)) { std::ios::rdbuf(_filebuf_ptr.get()); } FDInputStream(FDInputStream&& stream) : _filebuf_ptr(std::move(stream._filebuf_ptr)) { std::ios::rdbuf(_filebuf_ptr.get()); } private: std::unique_ptr<__gnu_cxx::stdio_filebuf> _filebuf_ptr; }; #else #error "Required header file ext/stdio_filebuf.h not available." #endif /* !HAVE_EXT_STDIO_FILEBUF_H */ } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Common/Thread.hpp000066400000000000000000000050031325273707200177030ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Logger.hpp" #include #include #include namespace usbguard { template class Thread { public: Thread(C* method_class_ptr, void(C::*method)()) { _method_class_ptr = method_class_ptr; _method = method; _stop_request = false; } Thread(Thread& thread) { _method_class_ptr = thread._method_class_ptr; _method = thread._method; std::swap(_thread, thread._thread); _stop_request = thread._stop_request; } Thread& operator=(Thread& thread) { _method_class_ptr = thread._method_class_ptr; _method = thread._method; std::swap(_thread, thread._thread); _stop_request = thread._stop_request; return *this; } ~Thread() { } void start() { _stop_request = false; _thread = std::thread(_method, _method_class_ptr); } /** * Set the termination flag and wait for the thread * to exit. */ void stop(bool do_wait = true) { _stop_request = true; if (do_wait) { wait(); } } void wait() { if (_thread.joinable()) { try { _thread.join(); } catch (const std::system_error& ex) { USBGUARD_LOG(Error) << ex.what(); throw; } } _stop_request = false; } bool running() const { return (_thread.get_id() != std::thread::id()); } bool stopRequested() const { return _stop_request; } private: C* _method_class_ptr; void(C::*_method)(); std::thread _thread; std::atomic_bool _stop_request; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Common/Utility.cpp000066400000000000000000000272201325273707200201370ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Logger.hpp" #include "Common/Utility.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include namespace usbguard { static void runCommandExecChild(const std::string& path, const std::vector& args) { struct rlimit rlim; // Find out what the maxfd value could be if (::getrlimit(RLIMIT_NOFILE, &rlim) == -1) { return; } const int maxfd = (rlim.rlim_max == RLIM_INFINITY ? 4096 : rlim.rlim_max); const int nullfd = ::open("/dev/null", O_RDWR); if (nullfd < 0) { return; } for (int fd = 0; fd < maxfd; ++fd) { if (fd == nullfd) { // Don't close our /dev/null fd continue; } switch (fd) { case STDERR_FILENO: case STDOUT_FILENO: case STDIN_FILENO: // Redirect the standard descriptors to /dev/null ::dup2(nullfd, fd); break; default: // Close everything else (void)::close(fd); } } (void)::close(nullfd); if (args.size() > 1024) { // Looks suspicious... return; } // // Allocate space for the argv array on stack // +1 ... for argv[0] // +1 ... for nullptr termination of the array // char** const args_cstr = (char**)(::alloca(sizeof(const char*) * (args.size() + 2))); unsigned int i; args_cstr[0] = const_cast(path.c_str()); for (i = 0; i < args.size(); ++i) { args_cstr[1+i] = const_cast(args[i].c_str()); } args_cstr[1+i] = nullptr; // TODO: Reset environment? (void)::execv(path.c_str(), args_cstr); } int runCommand(const char* const path, const char* const arg1, const int timeout_secs) { std::vector args; args.push_back(arg1); return runCommand(path, args, timeout_secs); } int runCommand(const char* const path, const char* const arg1, const char* const arg2, const int timeout_secs) { std::vector args; args.push_back(arg1); args.push_back(arg2); return runCommand(path, args, timeout_secs); } int runCommand(const std::string& path, const std::vector& args, const int timeout_secs) { int retval = 0, status = 0; bool timedout = false; const pid_t child_pid = ::fork(); switch (child_pid) { case 0: // Child runCommandExecChild(path, args); ::_exit(EXIT_FAILURE); case -1: default: break; } // Parent - wait for the child to exit (up to timeout seconds) int waitpid_time_usec = timeout_secs * 1000 * 1000; while (waitpid_time_usec > 0) { const pid_t waitpid_retval = ::waitpid(child_pid, &status, WNOHANG); timedout = false; switch (waitpid_retval) { case 0: // Not exited yet; Sleep & retry timedout = true; waitpid_time_usec -= 500; ::usleep(500); continue; case -1: // Error retval = -1; break; default: if (waitpid_retval == child_pid) { // Child exited retval = WEXITSTATUS(status); waitpid_time_usec = 0; continue; } else { // Unexpected error } } } if (timedout) { // Try to be nice first ::kill(child_pid, SIGTERM); ::usleep(1000*500); // Send SIGKILL if the process is still running if (::waitpid(child_pid, &status, WNOHANG) != child_pid) { ::kill(child_pid, SIGKILL); } retval = -1; } return retval; } std::string filenameFromPath(const std::string& filepath, const bool include_extension) { const std::string directory_separator = "/"; std::vector path_tokens; tokenizeString(filepath, path_tokens, directory_separator); if (path_tokens.size() == 0) { return std::string(); } const std::string& filename = path_tokens.back(); if (include_extension) { return filename; } const size_t substr_to = filename.find_last_of('.'); return filename.substr(0, substr_to); } std::string parentPath(const std::string& path) { const std::string directory_separator = "/"; std::string parent_path(path); // find first not '/' (from end) // find first '/' (from end) // find first not '/' (from end) auto reverse_start_pos = \ parent_path.find_last_not_of(directory_separator); /* * Whole path consists only of '/'. */ if (reverse_start_pos == std::string::npos) { return std::string(); } reverse_start_pos = \ parent_path.find_last_of(directory_separator, reverse_start_pos); /* * No directory separator in the rest of the path. */ if (reverse_start_pos == std::string::npos) { return std::string(); } reverse_start_pos = \ parent_path.find_last_not_of(directory_separator, reverse_start_pos); /* * * /foo/bar => /foo * /foo/bar/ => /foo * /foo/bar// => /foo * /foo => std::string() * /foo/ => std::string() * / => std::string() * //foo => std::string() * */ if (reverse_start_pos == std::string::npos) { return std::string(); } return path.substr(0, reverse_start_pos + 1); } std::string trimRight(const std::string& s, const std::string& delimiters) { const size_t substr_to = s.find_last_not_of(delimiters); if (substr_to != std::string::npos) { return s.substr(0, substr_to + 1); } else { return std::string(); } } std::string trimLeft(const std::string& s, const std::string& delimiters) { const size_t substr_from = s.find_first_not_of(delimiters); if (substr_from == std::string::npos) { return s; } else { return s.substr(substr_from); } } std::string trim(const std::string& s, const std::string& delimiters) { return trimRight(trimLeft(s, delimiters), delimiters); } /* * The ostringstream class used for the implementation of numberToString * treats (u)int8_t as a char. We want to treat it as a number, so this * explicit specialization handles the uint8_t case by recasting it to * an unsigned int. */ template<> std::string numberToString(const uint8_t number, const std::string& prefix, const int base, const int align, const char align_char) { const uint16_t n = static_cast(number); return numberToString(n, prefix, base, align, align_char); } template<> uint8_t stringToNumber(const std::string& s, const int base) { const unsigned int num = stringToNumber(s, base); return (uint8_t)num; } bool isNumericString(const std::string& s) { for (int c : s) { if (!isdigit(c)) { return false; } } return true; } int loadFiles(const std::string& directory, std::function filter, std::function loader, std::function&, const std::pair&)> sorter) { DIR* dirobj = opendir(directory.c_str()); int retval = 0; if (dirobj == nullptr) { throw ErrnoException("loadFiles", directory, errno); } try { std::vector> loadpaths; struct dirent* entry_ptr = nullptr; /* * readdir usage note: We rely on the fact that readdir should be thread-safe * when used on a different directory stream. Since we create our own stream, * we should be fine with readdir here. The thread-safe version of readdir, * readdir_r, is deprecated in newer versions of glibc. */ while ((entry_ptr = readdir(dirobj)) != nullptr) { const std::string filename(entry_ptr->d_name); if (filename == "." || filename == "..") { continue; } std::string fullpath = directory + "/" + filename; std::string loadpath = filter(fullpath, entry_ptr); if (!loadpath.empty()) { loadpaths.emplace_back(std::make_pair(std::move(loadpath), std::move(fullpath))); } } std::stable_sort(loadpaths.begin(), loadpaths.end(), sorter); for (const auto& loadpath : loadpaths) { USBGUARD_LOG(Trace) << "L: " << loadpath.first << " : " << loadpath.second; } for (const auto& loadpath : loadpaths) { retval += loader(loadpath.first, loadpath.second); } } catch (...) { closedir(dirobj); throw; } closedir(dirobj); return retval; } std::string removePrefix(const std::string& prefix, const std::string& value) { if (value.compare(0, prefix.size(), prefix) == 0) { return value.substr(prefix.size()); } else { return value; } } bool hasSuffix(const std::string& value, const std::string& suffix) { if (suffix.size() > value.size()) { return false; } const auto pos = value.size() - suffix.size(); const auto cmp = value.compare(pos, suffix.size(), suffix); return cmp == 0; } bool hasPrefix(const std::string& value, const std::string& prefix) { if (prefix.size() > value.size()) { return false; } const auto cmp = value.compare(0, prefix.size(), prefix); return cmp == 0; } std::string symlinkPath(const std::string& linkpath, struct stat* st_user) { struct stat st = { }; struct stat* st_ptr = nullptr; if (st_user == nullptr) { USBGUARD_SYSCALL_THROW("symlinkPath", lstat(linkpath.c_str(), &st) != 0); st_ptr = &st; } else { st_ptr = st_user; } if (!S_ISLNK(st_ptr->st_mode)) { throw Exception("symlinkPath", linkpath, "not a symlink"); } if (st_ptr->st_size < 1) { st_ptr->st_size = 4096; } /* * Check sanity of st_size. min: 1 byte, max: 1 MiB (because 1 MiB should be enough :) */ if (st_ptr->st_size < 1 || st_ptr->st_size > (1024 * 1024)) { USBGUARD_LOG(Debug) << "st_size=" << st_ptr->st_size; throw Exception("symlinkPath", linkpath, "symlink value size out of range"); } std::string buffer(st_ptr->st_size, 0); const ssize_t link_size = readlink(linkpath.c_str(), &buffer[0], buffer.capacity()); if (link_size <= 0 || link_size > st_ptr->st_size) { USBGUARD_LOG(Debug) << "link_size=" << link_size << " st_size=" << st_ptr->st_size; throw Exception("symlinkPath", linkpath, "symlink value size changed before read"); } buffer.resize(link_size); if (buffer[0] == '/') { /* Absolute path */ return buffer; } else { /* Relative path */ return parentPath(linkpath) + "/" + buffer; } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Common/Utility.hpp000066400000000000000000000170071325273707200201460ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Exception.hpp" #include "usbguard/Typedefs.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include namespace usbguard { /** * Wrappers for the __builtin_expect function. */ #if defined(__GNUC__) #define likely(expr) __builtin_expect(!!(expr), 1) #define unlikely(expr) __builtin_expect(!!(expr), 0) #else #define likely(expr) (expr) #define unlikely(expr) (expr) #endif int runCommand(const char* path, const char* arg1, int timeout_secs = 10); int runCommand(const char* path, const char* arg1, const char* arg2, int timeout_secs = 10); int runCommand(const std::string& path, const std::vector& args = std::vector(), int timeout_secs = 10); /** * Tokenize a std::string compatible type using delimiters specified in a string. * * Splits the given string using delimiters found in the delimiter string (each * character in the delimiter string is considered as a delimiter) and stores the * token in a vector. If trim_empty is set to true, empty tokens won't be included * in the vector. */ template void tokenizeString(const StringType& str, std::vector& tokens, const typename std::vector::value_type delimiters, const bool trim_empty = false) { typename StringType::size_type pos, last_pos = 0; while (true) { pos = str.find_first_of(delimiters, last_pos); if (pos == StringType::npos) { pos = str.length(); if (pos != last_pos || !trim_empty) { tokens.push_back(StringType(str.data() + last_pos, pos - last_pos)); } break; } else { if (pos != last_pos || !trim_empty) { tokens.push_back(StringType(str.data() + last_pos, pos - last_pos)); } } last_pos = pos + 1; } } /** * Convert a number of type T to its string * representation. */ template std::string numberToString(const T number, const std::string& prefix = std::string(), const int base = 10, const int align = -1, const char align_char = ' ') { std::ostringstream ss; ss << std::setbase(base); ss << number; const std::string number_string = ss.str(); std::string result; result.append(prefix); if (align > 0 && number_string.size() < (size_t)align) { size_t chars_to_add = (size_t)align - number_string.size(); for (; chars_to_add > 0; --chars_to_add) { result += align_char; } } result.append(number_string); return result; } template<> std::string numberToString(const uint8_t number, const std::string& prefix, const int base, const int align, const char align_char); /** * Convert a string representation of a number * to a number of type T. */ template T stringToNumber(const std::string& s, const int base = 10) { std::istringstream ss(s); T num; ss >> std::setbase(base) >> num; return num; } template<> uint8_t stringToNumber(const std::string& s, const int base); bool isNumericString(const std::string& s); /** * Return the filename part of a path. If include_extension is set to * false, then any characters after the last dot character '.' will be * removed including the dot. * * Examples: "/foo/bar/baz" => "baz" * "/foo/bar/baz.txt" (include_extension=false) => "baz" * "/foo/bar/baz.txt" (include_extension=true) => "baz.txt" * "/foo/bar/baz.woo.txt" (include_extension=false) => "baz.woo" * "foo.txt" (include_extension=true) => "foo.txt" */ std::string filenameFromPath(const std::string& filepath, bool include_extension = false); /** * Return the parent path part of a path. */ std::string parentPath(const std::string& path); /** * Remove whitespace characters from the right side of a string. */ std::string trimRight(const std::string& s, const std::string& delimiters = " \f\n\r\t\v"); /** * Remove whitespace characters from the left side of a string. */ std::string trimLeft(const std::string& s, const std::string& delimiters = " \f\n\r\t\v"); /** * Remove whitespace characters from the left & right side of a string. */ std::string trim(const std::string& s, const std::string& delimiters = " \f\n\r\t\v"); /** * Call a void(*)(const std::string&) compatible method for every file in a directory * matching a regular expression. The function does not recursively descent into * subdirectories. */ int loadFiles(const std::string& directory, std::function filter, std::function loader, std::function&, const std::pair&)> sorter = \ [](const std::pair& a, const std::pair& b) { return a.first < b.first; }); /** * Remove prefix from string. */ std::string removePrefix(const std::string& prefix, const std::string& value); /** * Test whether a string value has a prefix/suffix. */ bool hasSuffix(const std::string& value, const std::string& suffix); bool hasPrefix(const std::string& value, const std::string& prefix); /** * Read symlink destination. */ std::string symlinkPath(const std::string& linkpath, struct stat* st_user = nullptr); /* * Restorer class */ template class Restorer { public: Restorer(Tvar& var, Tval transient, Tval restored) : _ref(var), _val(restored) { _ref = transient; } ~Restorer() { _ref = _val; } private: Tvar& _ref; Tval _val; }; struct FreeDeleter { void operator()(void* p) { free(p); } }; template std::unique_ptr make_unique(Params&& ... params) { return std::unique_ptr(new T(std::forward(params)...)); } /* * Scoped File Descriptor */ class ScopedFD { public: ScopedFD(int fd) : _fd(fd) {} ScopedFD(const ScopedFD&) = delete; ~ScopedFD() { if (_fd >= 0) { ::close(_fd); _fd = -1; } } operator int() const noexcept { return _fd; } bool operator<(int rhs) const noexcept { return _fd < rhs; } bool operator==(int rhs) const noexcept { return _fd == rhs; } private: int _fd{-1}; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/DBus/000077500000000000000000000000001325273707200153725ustar00rootroot00000000000000usbguard-0.7.2+ds/src/DBus/DBusBridge.cpp000066400000000000000000000247401325273707200200570ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DBusBridge.hpp" namespace usbguard { DBusBridge::DBusBridge(GDBusConnection* const gdbus_connection, void(*ipc_callback)(bool)) : p_gdbus_connection(gdbus_connection), p_ipc_callback(ipc_callback) { } DBusBridge::~DBusBridge() { } void DBusBridge::handleMethodCall(const std::string interface, const std::string method_name, GVariant* parameters, GDBusMethodInvocation* invocation) { if (!isConnected()) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_NO_SERVER, "USBGuard DBus service is not connected to the daemon."); return; } try { if (interface == "org.usbguard.Policy") { handlePolicyMethodCall(method_name, parameters, invocation); } else if (interface == "org.usbguard.Devices") { handleDevicesMethodCall(method_name, parameters, invocation); } else if (interface == "org.usbguard") { handleRootMethodCall(method_name, parameters, invocation); } else { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Unknown method interface"); } } catch (const Exception& ex) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "%s", ex.message().c_str()); } catch (const std::exception& ex) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "%s", ex.what()); } catch (...) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "BUG: Unknown exception"); } return; } void DBusBridge::handleRootMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation) { if (method_name == "getParameter") { const char* name_cstr = nullptr; g_variant_get(parameters, "(&s)", &name_cstr); std::string name(name_cstr); auto value = getParameter(name); g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", value.c_str())); return; } if (method_name == "setParameter") { const char* name_cstr = nullptr; const char* value_cstr = nullptr; g_variant_get(parameters, "(&s&s)", &name_cstr, &value_cstr); const std::string name(name_cstr); const std::string value(value_cstr); auto previous_value = setParameter(name, value); g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", previous_value.c_str())); return; } g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Unknown method interface"); return; } void DBusBridge::handlePolicyMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation) { if (method_name == "listRules") { const char* query_cstr = nullptr; g_variant_get(parameters, "(&s)", &query_cstr); std::string query(query_cstr); auto rule_set = listRules(query); auto rules = rule_set.getRules(); if (rules.size() > 0) { auto gvbuilder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY); try { for (auto rule : rules) { g_variant_builder_add(gvbuilder, "(us)", rule->getRuleID(), rule->toString().c_str()); } g_dbus_method_invocation_return_value(invocation, g_variant_new("(a(us))", gvbuilder)); } catch (...) { g_variant_builder_unref(gvbuilder); throw; } g_variant_builder_unref(gvbuilder); } else { g_dbus_method_invocation_return_value(invocation, g_variant_new("(a(us))", nullptr)); } return; } if (method_name == "appendRule") { const char* rule_spec_cstr = nullptr; uint32_t parent_id = 0; g_variant_get(parameters, "(&su)", &rule_spec_cstr, &parent_id); std::string rule_spec(rule_spec_cstr); const uint32_t rule_id = appendRule(rule_spec, parent_id); g_dbus_method_invocation_return_value(invocation, g_variant_new("(u)", rule_id)); return; } if (method_name == "removeRule") { uint32_t rule_id = 0; g_variant_get(parameters, "(u)", &rule_id); removeRule(rule_id); g_dbus_method_invocation_return_value(invocation, nullptr); return; } g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Unknown method interface"); return; } void DBusBridge::handleDevicesMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation) { if (method_name == "listDevices") { const char* query_cstr = nullptr; g_variant_get(parameters, "(&s)", &query_cstr); std::string query(query_cstr); auto devices = listDevices(query); if (devices.size() > 0) { auto gvbuilder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY); try { for (auto device_rule : devices) { g_variant_builder_add(gvbuilder, "(us)", device_rule.getRuleID(), device_rule.toString().c_str()); } g_dbus_method_invocation_return_value(invocation, g_variant_new("(a(us))", gvbuilder)); } catch (...) { g_variant_builder_unref(gvbuilder); throw; } g_variant_builder_unref(gvbuilder); } else { g_dbus_method_invocation_return_value(invocation, g_variant_new("(a(us))", nullptr)); } return; } if (method_name == "applyDevicePolicy") { uint32_t device_id = 0; uint32_t target_integer = 0; gboolean permanent = false; g_variant_get(parameters, "(uub)", &device_id, &target_integer, &permanent); const Rule::Target target = Rule::targetFromInteger(target_integer); const uint32_t rule_id = applyDevicePolicy(device_id, target, permanent); g_dbus_method_invocation_return_value(invocation, g_variant_new("(u)", rule_id)); return; } g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Unknown method "); } void DBusBridge::IPCConnected() { if (p_ipc_callback != nullptr) { p_ipc_callback(/*connected=*/true); } } void DBusBridge::IPCDisconnected(bool exception_initiated, const IPCException& exception) { (void)exception_initiated; (void)exception; if (p_ipc_callback != nullptr) { p_ipc_callback(/*connected=*/false); } } void DBusBridge::DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) { GVariantBuilder* gv_builder_attributes = deviceRuleToAttributes(device_rule); g_dbus_connection_emit_signal(p_gdbus_connection, nullptr, "/org/usbguard/Devices", "org.usbguard.Devices", "DevicePresenceChanged", g_variant_new("(uuusa{ss})", id, DeviceManager::eventTypeToInteger(event), Rule::targetToInteger(target), device_rule.c_str(), gv_builder_attributes), nullptr); if (gv_builder_attributes != nullptr) { g_variant_builder_unref(gv_builder_attributes); } } void DBusBridge::DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) { GVariantBuilder* gv_builder_attributes = deviceRuleToAttributes(device_rule); g_dbus_connection_emit_signal(p_gdbus_connection, nullptr, "/org/usbguard/Devices", "org.usbguard.Devices", "DevicePolicyChanged", g_variant_new("(uuusua{ss})", id, Rule::targetToInteger(target_old), Rule::targetToInteger(target_new), device_rule.c_str(), rule_id, gv_builder_attributes), nullptr); if (gv_builder_attributes != nullptr) { g_variant_builder_unref(gv_builder_attributes); } } void DBusBridge::ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason) { g_dbus_connection_emit_signal(p_gdbus_connection, nullptr, "/org/usbguard", "org.usbguard", "ExceptionMessage", g_variant_new("(sss)", context.c_str(), object.c_str(), reason.c_str()), nullptr); } GVariantBuilder* DBusBridge::deviceRuleToAttributes(const std::string& device_spec) { Rule device_rule = Rule::fromString(device_spec); GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE_DICTIONARY); if (builder == nullptr) { return nullptr; } g_variant_builder_add(builder, "{ss}", "hash", device_rule.getHash().c_str()); g_variant_builder_add(builder, "{ss}", "id", device_rule.getDeviceID().toString().c_str()); g_variant_builder_add(builder, "{ss}", "name", device_rule.getName().c_str()); g_variant_builder_add(builder, "{ss}", "parent-hash", device_rule.getParentHash().c_str()); g_variant_builder_add(builder, "{ss}", "serial", device_rule.getSerial().c_str()); g_variant_builder_add(builder, "{ss}", "via-port", device_rule.getViaPort().c_str()); std::string with_interface_string; auto const& with_interface_vector = device_rule.attributeWithInterface().values(); for (size_t i = 0; i < with_interface_vector.size(); ++i) { with_interface_string.append(with_interface_vector[i].toRuleString()); if (i < (with_interface_vector.size() - 1)) { with_interface_string.append(" "); } } g_variant_builder_add(builder, "{ss}", "with-interface", with_interface_string.c_str()); return builder; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/DBus/DBusBridge.hpp000066400000000000000000000052421325273707200200600ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/IPCClient.hpp" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-register" #include #pragma clang diagnostic pop namespace usbguard { class DBusBridge : public IPCClient { public: DBusBridge(GDBusConnection* const gdbus_connection, void(*ipc_callback)(bool) = nullptr); ~DBusBridge(); void handleMethodCall(const std::string interface, const std::string method_name, GVariant* parameters, GDBusMethodInvocation* invocation); private: void IPCConnected() override; void IPCDisconnected(bool exception_initiated, const IPCException& exception) override; void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) override; void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) override; void ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason) override; static GVariantBuilder* deviceRuleToAttributes(const std::string& device_spec); void handleRootMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation); void handlePolicyMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation); void handleDevicesMethodCall(const std::string& method_name, GVariant* parameters, GDBusMethodInvocation* invocation); void emitDevicePolicyDecision(const char* policy_signal, uint32_t id, const std::map& attributes, bool rule_match, uint32_t rule_id); GDBusConnection* const p_gdbus_connection; void(*p_ipc_callback)(bool); }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/DBus/DBusInterface.xml000066400000000000000000000175541325273707200206060ustar00rootroot00000000000000 usbguard-0.7.2+ds/src/DBus/gdbus-server.cpp000066400000000000000000000202601325273707200205060ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include #include #include "DBusBridge.hpp" static usbguard::DBusBridge* dbus_bridge = nullptr; static GMainLoop* main_loop = nullptr; static GDBusNodeInfo* introspection_data = NULL; static const gchar introspection_xml[] = #include "DBusInterface.xml.cstr" ; static const unsigned int expected_interface_count = 3; static int global_ret = EXIT_SUCCESS; static void handle_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { (void)connection; (void)sender; (void)object_path; (void)user_data; try { dbus_bridge->handleMethodCall(interface_name, method_name, parameters, invocation); } catch (std::exception& ex) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Exception: %s", ex.what()); } catch (...) { g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "BUG: Unknown exception; method call failed for unknown reasons."); } } static gboolean usbguard_ipc_try_connect(gpointer user_data) { (void)user_data; if (dbus_bridge == nullptr) { g_main_loop_quit(main_loop); global_ret = EXIT_FAILURE; return FALSE; } else if (dbus_bridge->isConnected()) { /* returning FALSE removes the function call from the main loop */ return FALSE; } else { try { dbus_bridge->connect(); } catch (...) { /* ignore exception */ } return TRUE; } } static void handle_usbguard_ipc_state(bool state) { if (state == false) { if (g_timeout_add_seconds(1, &usbguard_ipc_try_connect, nullptr) <= 0) { std::cerr << "Unable to setup the IPC reconnection timer." << std::endl; g_main_loop_quit(main_loop); global_ret = EXIT_FAILURE; return; } } } static const GDBusInterfaceVTable devices_interface_vtable = { handle_method_call, nullptr, nullptr, {} }; static const GDBusInterfaceVTable policy_interface_vtable = { handle_method_call, nullptr, nullptr, {} }; static const GDBusInterfaceVTable usbguard_interface_vtable = { handle_method_call, nullptr, nullptr, {} }; static void on_bus_acquired (GDBusConnection* connection, const gchar* name, gpointer user_data) { (void)name; (void)user_data; auto policy_rid = g_dbus_connection_register_object(connection, "/org/usbguard/Policy", introspection_data->interfaces[0], &policy_interface_vtable, /*user_data=*/dbus_bridge, /*user_data_free_func=*/nullptr, /*GError=*/nullptr); auto devices_rid = g_dbus_connection_register_object(connection, "/org/usbguard/Devices", introspection_data->interfaces[1], &devices_interface_vtable, /*user_data=*/dbus_bridge, /*user_data_free_func=*/nullptr, /*GError=*/nullptr); auto usbguard_rid = g_dbus_connection_register_object(connection, "/org/usbguard", introspection_data->interfaces[2], &usbguard_interface_vtable, /*user_data=*/dbus_bridge, /*user_data_free_func=*/nullptr, /*GError=*/nullptr); if (policy_rid <= 0 || devices_rid <= 0 || usbguard_rid <= 0) { std::cerr << "Unable to register required objects on the bus." << std::endl; g_main_loop_quit(main_loop); global_ret = EXIT_FAILURE; } } static void on_name_acquired (GDBusConnection* connection, const gchar* name, gpointer user_data) { (void)name; (void)user_data; /* We got the name, reset the global return value */ global_ret = EXIT_SUCCESS; try { dbus_bridge = new usbguard::DBusBridge(connection); handle_usbguard_ipc_state(/*state=*/false); } catch (...) { dbus_bridge = nullptr; std::cerr << "Unable to create the USBGuard DBus Bridge." << std::endl; g_main_loop_quit(main_loop); global_ret = EXIT_FAILURE; } } static void on_name_lost (GDBusConnection* connection, const gchar* name, gpointer user_data) { (void)connection; (void)name; (void)user_data; g_main_loop_quit(main_loop); auto dbus_bridge_local = dbus_bridge; dbus_bridge = nullptr; delete dbus_bridge_local; } static const char* options_short = "sSh"; static const char* usbguard_arg0 = nullptr; static const struct ::option options_long[] = { { "system", no_argument, nullptr, 's' }, { "session", no_argument, nullptr, 'S' }, { "help", no_argument, nullptr, 'h' }, { nullptr, 0, nullptr, 0 } }; static void showHelp(std::ostream& stream) { stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS]" << std::endl; stream << std::endl; stream << " Options:" << std::endl; stream << " -s, --system Listen on the system bus." << std::endl; stream << " -S, --session Listen on the session bus." << std::endl; stream << " -h, --help Show this help." << std::endl; stream << std::endl; } int main (int argc, char* argv[]) { usbguard_arg0 = argv[0]; int opt = 0; bool use_system_bus = true; while ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) { switch (opt) { case 's': use_system_bus = true; break; case 'S': use_system_bus = false; break; case 'h': showHelp(std::cout); return EXIT_SUCCESS; case '?': showHelp(std::cerr); default: return EXIT_FAILURE; } } /* Parse the XML DBus interface definition */ if ((introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, nullptr)) == nullptr) { std::cerr << "Failed to parse the introspection data." << std::endl; return EXIT_FAILURE; } /* Ensure that the expected number of interfaces is defined */ unsigned int interface_count = 0; if (introspection_data->interfaces != nullptr) { while (introspection_data->interfaces[interface_count] != nullptr) { ++interface_count; } } if (interface_count != expected_interface_count) { std::cerr << "The introspection data contains an unexpected" << " number of interfaces: " << interface_count << ", expected: " << expected_interface_count << std::endl; return EXIT_FAILURE; } /* * Set the global return value to FAILURE before we start the mainloop. * When we succesfully own the bus name, this flag will be reset by the * DBus callbacks back to SUCCESS. Otherwise, the on_name_lost callback * will be called which will stop the main loop and we'll return the * FAILURE return code. */ global_ret = EXIT_FAILURE; /* Try to take ownership of the bus */ auto owner_id = g_bus_own_name (use_system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION, "org.usbguard", G_BUS_NAME_OWNER_FLAGS_NONE, on_bus_acquired, on_name_acquired, on_name_lost, /*user_data=*/nullptr, /*user_data_free_func=*/nullptr); int ret; /* Start the main loop */ if (owner_id > 0) { if ((main_loop = g_main_loop_new (NULL, FALSE)) != nullptr) { g_main_loop_run (main_loop); } g_bus_unown_name (owner_id); ret = global_ret; } else { std::cerr << "Failed to take ownership of the org.usbguard bus name." << std::endl; ret = EXIT_FAILURE; } /* Release allocated resources */ g_dbus_node_info_unref (introspection_data); return ret; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/DBus/org.usbguard.conf000066400000000000000000000011501325273707200206400ustar00rootroot00000000000000 usbguard-0.7.2+ds/src/DBus/org.usbguard.policy000066400000000000000000000053011325273707200212140ustar00rootroot00000000000000 The USBGuard Project https://github.org/USBGuard/usbguard List the rule set (policy) used by the USBGuard daemon Prevents from listing the USBGuard policy no auth_self_keep_session Append a new rule to the policy Prevents from appending rules to the USBGuard policy no auth_admin Remove a rule from the policy Prevents removing rules from the USBGuard policy no auth_admin List all USB devices recognized by the USBGuard deaemon Prevents from listing USB devices recognized by the USBGuard daemon no auth_self_keep_session Authorize a USB device via the USBGuard daemon to interact with the system Prevents from authorizing USB devices via the USBGuard daemon no auth_admin Deauthorize a USB device via the USBGuard daemon Prevents from deauthorizing USB devices via the USBGuard daemon no auth_admin Remove a USB device via the USBGuard daemon Prevents from removing USB devices via the USBGuard daemon no auth_admin usbguard-0.7.2+ds/src/DBus/org.usbguard.service.in000066400000000000000000000001641325273707200217640ustar00rootroot00000000000000[D-BUS Service] Name=org.usbguard Exec=%{sbindir}%/usbguard-dbus --system SystemdService=dbus-org.usbguard.service usbguard-0.7.2+ds/src/DBus/usbguard-dbus.service.in000066400000000000000000000004301325273707200221250ustar00rootroot00000000000000[Unit] Description=USBGuard D-Bus Service Requires=usbguard.service Documentation=man:usbguard-dbus(8) [Service] Type=dbus BusName=org.usbguard ExecStart=%{sbindir}%/usbguard-dbus --system Restart=on-failure [Install] WantedBy=multi-user.target Alias=dbus-org.usbguard.service usbguard-0.7.2+ds/src/Daemon/000077500000000000000000000000001325273707200157405ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Daemon/Daemon.cpp000066400000000000000000000763711325273707200176650ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // Jiri Vymazal // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Daemon.hpp" #include "FileAuditBackend.hpp" #include "LinuxAuditBackend.hpp" #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include "usbguard/RuleParser.hpp" #include "usbguard/Audit.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include namespace usbguard { /* * Recognized configuration option names. If an * unknown setting is found in the config file, * a warning message will be displayed. */ static const std::vector G_config_known_names = { "RuleFile", "ImplicitPolicyTarget", "PresentDevicePolicy", "PresentControllerPolicy", "IPCAllowedUsers", "IPCAllowedGroups", "DeviceRulesWithPort", "InsertedDevicePolicy", "RestoreControllerDeviceState", "DeviceManagerBackend", "IPCAccessControlFiles", "AuditFilePath", "AuditBackend" }; static const std::vector> device_policy_method_strings = { { "allow", Daemon::DevicePolicyMethod::Allow }, { "block", Daemon::DevicePolicyMethod::Block }, { "reject", Daemon::DevicePolicyMethod::Reject }, { "keep", Daemon::DevicePolicyMethod::Keep }, { "apply-policy", Daemon::DevicePolicyMethod::ApplyPolicy } }; Daemon::DevicePolicyMethod Daemon::devicePolicyMethodFromString(const std::string& policy_string) { for (auto device_policy_method_string : device_policy_method_strings) { if (device_policy_method_string.first == policy_string) { return device_policy_method_string.second; } } throw Exception("DevicePolicyMethod", policy_string, "invalid policy method string"); } const std::string Daemon::devicePolicyMethodToString(DevicePolicyMethod policy) { for (auto device_policy_method_string : device_policy_method_strings) { if (device_policy_method_string.second == policy) { return device_policy_method_string.first; } } throw USBGUARD_BUG("Invalid device policy method value"); } Daemon::Daemon() : _config(G_config_known_names), _ruleset(this), _audit(_audit_identity) { sigset_t signal_set; sigfillset(&signal_set); for (int del_signum : { SIGSEGV, SIGABRT, SIGKILL, SIGILL }) { sigdelset(&signal_set, del_signum); } USBGUARD_SYSCALL_THROW("Daemon initialization", (errno = pthread_sigmask(SIG_BLOCK, &signal_set, nullptr)) != 0); _device_manager_backend = "udev"; _implicit_policy_target = Rule::Target::Block; _present_device_policy_method = DevicePolicyMethod::ApplyPolicy; _present_controller_policy_method = DevicePolicyMethod::Keep; _inserted_device_policy_method = DevicePolicyMethod::ApplyPolicy; _device_rules_with_port = false; _restore_controller_device_state = false; pid_fd = -1; } Daemon::~Daemon() { _config.close(); } int Daemon::checkPermissions(const std::string& path, const mode_t permissions) { struct stat file_stat; // from all enabled permissions we subtract the permissions we want to check // after this operation variable permission_bad contains the complement of // permissions we want to check. mode_t permission_bad { ( S_IRWXU | S_IRWXG | S_IRWXO ) - permissions }; if (!stat(path.c_str(), &file_stat)) { if (S_ISREG(file_stat.st_mode)) { // this comparison inspect if file has the wanted permissions and if // the file does not contain the unwanted permissions. if ( !( file_stat.st_mode & permissions ) || ( file_stat.st_mode & permission_bad) ) { USBGUARD_LOG(Error) << "Policy leaks are possible with this permissions!"; throw Exception("Check permissions", path, "Policy leaks possible"); } else { USBGUARD_LOG(Info) << "File has correct permissions."; } } else { USBGUARD_LOG(Error) << "ERROR: File is not a regular file."; throw Exception("Check permissions", path, "File not exists"); } } else { USBGUARD_LOG(Error) << "ERROR: obtaining file permissions! Errno: " << errno; throw ErrnoException("Check permissions", path, errno); } return 0; } void Daemon::loadConfiguration(const std::string& path, const bool check_permissions) { USBGUARD_LOG(Info) << "Loading configuration from " << path; if (check_permissions) { checkPermissions(path, (S_IRUSR | S_IWUSR)); } _config.open(path, /*readonly=*/true); /* RuleFile */ if (_config.hasSettingValue("RuleFile")) { const std::string& rule_file = _config.getSettingValue("RuleFile"); try { loadRules(rule_file, check_permissions); } catch (const RuleParserError& ex) { throw Exception("Configuration", rule_file, ex.hint()); } catch (const std::exception& ex) { throw Exception("Configuration", rule_file, ex.what()); } catch (...) { throw Exception("Configuration", rule_file, "unknown exception"); } } else { USBGUARD_LOG(Warning) << "RuleFile not set; Modification of the permanent policy won't be possible."; } /* ImplicitPolicyTarget */ if (_config.hasSettingValue("ImplicitPolicyTarget")) { const std::string& target_string = _config.getSettingValue("ImplicitPolicyTarget"); Rule::Target target = Rule::targetFromString(target_string); setImplicitPolicyTarget(target); } /* PresentDevicePolicy */ if (_config.hasSettingValue("PresentDevicePolicy")) { const std::string& policy_string = _config.getSettingValue("PresentDevicePolicy"); DevicePolicyMethod policy = Daemon::devicePolicyMethodFromString(policy_string); setPresentDevicePolicyMethod(policy); } /* PresentControllerPolicy */ if (_config.hasSettingValue("PresentControllerPolicy")) { const std::string& policy_string = _config.getSettingValue("PresentControllerPolicy"); DevicePolicyMethod policy = Daemon::devicePolicyMethodFromString(policy_string); setPresentControllerPolicyMethod(policy); } /* InsertedDevicePolicy */ if (_config.hasSettingValue("InsertedDevicePolicy")) { const std::string& policy_string = _config.getSettingValue("InsertedDevicePolicy"); DevicePolicyMethod policy = Daemon::devicePolicyMethodFromString(policy_string); setInsertedDevicePolicyMethod(policy); } /* IPCAllowedUsers */ if (_config.hasSettingValue("IPCAllowedUsers")) { const std::string users_value = _config.getSettingValue("IPCAllowedUsers"); std::vector users; tokenizeString(users_value, users, " ", /*trim_empty=*/true); USBGUARD_LOG(Debug) << "Setting IPCAllowedUsers to { " << users_value << " }"; for (auto const& user : users) { addIPCAllowedUser(user); } } /* IPCAllowedGroups */ if (_config.hasSettingValue("IPCAllowedGroups")) { const std::string groups_value =_config.getSettingValue("IPCAllowedGroups"); std::vector groups; tokenizeString(groups_value, groups, " ", /*trim_empty=*/true); USBGUARD_LOG(Debug) << "Setting IPCAllowedGroups to { " << groups_value << " }"; for (auto const& group : groups) { addIPCAllowedGroup(group); } } /* DeviceRulesWithPort */ if (_config.hasSettingValue("DeviceRulesWithPort")) { const std::string value = _config.getSettingValue("DeviceRulesWithPort"); USBGUARD_LOG(Debug) << "Setting DeviceRulesWithPort to " << value; if (value == "true") { _device_rules_with_port = true; } else if (value == "false") { _device_rules_with_port = false; } else { throw Exception("Configuration", "DeviceRulesWithPort", "Invalid value"); } } /* DeviceManagerBackend */ if (_config.hasSettingValue("DeviceManagerBackend")) { _device_manager_backend = _config.getSettingValue("DeviceManagerBackend"); } _dm = DeviceManager::create(*this, _device_manager_backend); /* RestoreControllerDeviceState */ if (_config.hasSettingValue("RestoreControllerDeviceState")) { const std::string value = _config.getSettingValue("RestoreControllerDeviceState"); if (value == "true") { _restore_controller_device_state = true; } else if (value == "false") { _restore_controller_device_state = false; } else { throw Exception("Configuration", "RestoreControllerDeviceState", "Invalid value"); } _dm->setRestoreControllerDeviceState(_restore_controller_device_state); } /* IPCAccessControlFiles */ if (_config.hasSettingValue("IPCAccessControlFiles")) { const std::string value = _config.getSettingValue("IPCAccessControlFiles"); loadIPCAccessControlFiles(value); } /* AuditBackend */ if (_config.hasSettingValue("AuditBackend")) { const std::string value = _config.getSettingValue("AuditBackend"); USBGUARD_LOG(Debug) << "Setting AuditBackend to " << value; if (value == "LinuxAudit") { std::unique_ptr backend(new LinuxAuditBackend()); _audit.setBackend(std::move(backend)); } else if (value == "FileAudit") { if (_config.hasSettingValue("AuditFilePath")) { const std::string value = _config.getSettingValue("AuditFilePath"); USBGUARD_LOG(Debug) << "Setting AuditFilePath to " << value; USBGUARD_LOGGER.setAuditFile(true, value); } else { /* AuditFilePath value is required is AuditBackend is set to FileAudit */ throw Exception("Configuration", "AuditBackend", "AuditFilePath not set"); } std::unique_ptr backend(new FileAuditBackend()); _audit.setBackend(std::move(backend)); } else { throw Exception("Configuration", "AuditBackend", "Invalid value"); } } else { /* * Left for backwards compatibility. If AuditBackend is NOT set, but * AuditFilePath is, we set the backend to FileAudit automatically. */ /* AuditFilePath */ if (_config.hasSettingValue("AuditFilePath")) { const std::string value = _config.getSettingValue("AuditFilePath"); USBGUARD_LOG(Debug) << "Setting AuditFilePath to " << value; USBGUARD_LOGGER.setAuditFile(true, value); std::unique_ptr backend(new LinuxAuditBackend()); _audit.setBackend(std::move(backend)); } else { USBGUARD_LOG(Info) << "Audit logging disabled. Set AuditBackend and/or AuditFilePath to enable."; _audit.setBackend(nullptr); } } USBGUARD_LOG(Info) << "Configuration loaded successfully."; } void Daemon::loadRules(const std::string& path, const bool check_permissions) { USBGUARD_LOG(Info) << "Loading permanent policy file " << path; if (check_permissions) { checkPermissions(path, (S_IRUSR | S_IWUSR)); } _ruleset.load(path); } void Daemon::loadIPCAccessControlFiles(const std::string& path) { USBGUARD_LOG(Info) << "Loading IPC access control files at " << path; loadFiles(path, [](const std::string& path, const struct dirent * dir_entry) { (void)dir_entry; return filenameFromPath(path, /*include_extension=*/true); } , [this](const std::string& basename, const std::string& fullpath) { return loadIPCAccessControlFile(basename, fullpath); }); } void Daemon::checkIPCAccessControlName(const std::string& name) { IPCServer::checkAccessControlName(name); } void Daemon::parseIPCAccessControlFilename(const std::string& basename, std::string* const ptr_user, std::string* const ptr_group) { const auto ug_separator = basename.find_first_of(":"); const bool has_group = ug_separator != std::string::npos; const std::string user = basename.substr(0, ug_separator); const std::string group = has_group ? basename.substr(ug_separator + 1) : std::string(); checkIPCAccessControlName(user); checkIPCAccessControlName(group); *ptr_user = user; *ptr_group = group; } bool Daemon::loadIPCAccessControlFile(const std::string& basename, const std::string& fullpath) { USBGUARD_LOG(Info) << "Loading IPC access control file " << fullpath; std::string user; std::string group; IPCServer::AccessControl ac; try { parseIPCAccessControlFilename(basename, &user, &group); } catch (...) { USBGUARD_LOG(Warning) << "Ignoring access control file because of malformed name: " << basename; return false; } try { std::ifstream ac_stream(fullpath); ac.load(ac_stream); } catch (...) { USBGUARD_LOG(Warning) << "Failed to load IPC access control file " << fullpath; return false; } if (!user.empty()) { addIPCAllowedUser(user, ac); } if (!group.empty()) { addIPCAllowedGroup(group, ac); } return true; } void Daemon::setImplicitPolicyTarget(Rule::Target target) { USBGUARD_LOG(Debug) << "Setting ImplicitPolicyTarget to " << Rule::targetToString(target); _implicit_policy_target = target; _ruleset.setDefaultTarget(target); } void Daemon::setPresentDevicePolicyMethod(DevicePolicyMethod policy) { USBGUARD_LOG(Debug) << "Setting PresentDevicePolicy to " << devicePolicyMethodToString(policy); _present_device_policy_method = policy; } void Daemon::setPresentControllerPolicyMethod(DevicePolicyMethod policy) { USBGUARD_LOG(Debug) << "Setting PresentControllerPolicy to " << devicePolicyMethodToString(policy); _present_controller_policy_method = policy; } void Daemon::setInsertedDevicePolicyMethod(DevicePolicyMethod policy) { USBGUARD_LOG(Debug) << "Setting InsertedDevicePolicy to " << devicePolicyMethodToString(policy); switch (policy) { case DevicePolicyMethod::ApplyPolicy: case DevicePolicyMethod::Block: case DevicePolicyMethod::Reject: _inserted_device_policy_method = policy; break; case DevicePolicyMethod::Keep: case DevicePolicyMethod::Allow: default: throw Exception("setInsertedDevicePolicyMethod", devicePolicyMethodToString(policy), "invalid policy method"); } } void Daemon::run() { USBGUARD_LOG(Trace) << "Entering main loop"; _dm->start(); _dm->scan(); IPCServer::start(); sigset_t signal_set; sigemptyset(&signal_set); sigaddset(&signal_set, SIGINT); sigaddset(&signal_set, SIGTERM); sigaddset(&signal_set, SIGSYS); bool exit_loop = false; do { siginfo_t signal_info = { }; const int signal_num = sigwaitinfo(&signal_set, &signal_info); if (signal_num <= 0) { USBGUARD_LOG(Error) << "sigwaitinfo failed: errno=" << errno << "; Shutting down."; break; } switch (signal_num) { case SIGTERM: case SIGINT: USBGUARD_LOG(Info) << "Received SIGTERM/SIGINT. Shutting down."; exit_loop = true; break; case SIGSYS: USBGUARD_LOG(Error) << "Received SIGSYS: Seccomp whitelist violation!"; exit_loop = false; break; default: USBGUARD_LOG(Warning) << "Received signal " << signal_num << ". Ignoring!"; } } while (!exit_loop); if (pid_fd != -1) { (void)lockf(pid_fd, F_ULOCK, 0); (void)close(pid_fd); } IPCServer::stop(); _dm->stop(); USBGUARD_LOG(Trace) << "Leaving main loop."; } void Daemon::quit() { } void Daemon::daemonize(const std::string& pid_file) { USBGUARD_LOG(Trace) << "Starting daemonization"; pid_t pid = 0; pid_t original_pid = getpid(); sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGUSR1); sigprocmask(SIG_BLOCK, &mask, nullptr); USBGUARD_SYSCALL_THROW("Daemonize", (pid = fork()) < 0); if (pid > 0) { constexpr int timeout_val = 5; struct timespec timeout { timeout_val, 0 }; const time_t start = time(nullptr); siginfo_t info; do { const int signum = sigtimedwait(&mask, &info, &timeout); if (signum == SIGUSR1 && info.si_signo == SIGUSR1 && info.si_pid == pid) { USBGUARD_LOG(Trace) << "Finished daemonization"; exit(EXIT_SUCCESS); } if (signum == -1 && errno == EAGAIN) { break; /* timed out */ } timeout.tv_sec = timeout_val - difftime(time(nullptr), start); /* avoid potentially endless loop */ } while (true); throw Exception("Deamonize", "signal", "Waiting on pid file write timeout!"); } /* Now we are forked */ USBGUARD_SYSCALL_THROW("Daemonize", setsid() < 0); signal(SIGCHLD, SIG_IGN); USBGUARD_SYSCALL_THROW("Daemonize", (pid_fd = open(pid_file.c_str(), O_RDWR|O_CREAT, 0640)) < 0); USBGUARD_SYSCALL_THROW("Daemonize", (lockf(pid_fd, F_TLOCK, 0)) < 0); USBGUARD_SYSCALL_THROW("Daemonize", (pid = fork()) < 0); if (pid > 0) { try { std::string pid_str = std::to_string(pid); USBGUARD_SYSCALL_THROW("Daemonize", write(pid_fd, pid_str.c_str(), pid_str.size()) != static_cast(pid_str.size())); kill(original_pid, SIGUSR1); exit(EXIT_SUCCESS); } catch (...) { kill(pid, SIGKILL); throw; } } /* Now we are forked 2nd time */ umask(0047); /* no need for world-accessible or executable files */ (void)chdir("/"); const std::array std_fds {{STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO}}; int fd_null; USBGUARD_SYSCALL_THROW("Daemonize", (fd_null = open("/dev/null", O_RDWR)) < 0); /* We do not need to close all fds because there is only logging open at this point */ for (auto fd : std_fds) { USBGUARD_SYSCALL_THROW("Daemonize", close(fd)); USBGUARD_SYSCALL_THROW("Daemonize", (dup2(fd_null, fd)) < 0); } close(fd_null); USBGUARD_SYSCALL_THROW("Daemonize", (lockf(pid_fd, F_LOCK, 0)) < 0); } uint32_t Daemon::assignID() { return _ruleset.assignID(); } /* * Search for a rule that matches `match_spec' rule and * update it with a rule specified by `rule_spec'. Fail * if multiple rules match. If there are no matching * rules, append the `rule_spec' rule. * * Return the id of the updated or new rule. */ uint32_t Daemon::upsertRule(const std::string& match_spec, const std::string& rule_spec, const bool parent_insensitive) { USBGUARD_LOG(Trace) << "entry:" << " match_spec=" << match_spec << " rule_spec=" << rule_spec << " parent_insensitive=" << parent_insensitive; const Rule match_rule = Rule::fromString(match_spec); const Rule new_rule = Rule::fromString(rule_spec); const uint32_t id = _ruleset.upsertRule(match_rule, new_rule, parent_insensitive); if (_config.hasSettingValue("RuleFile")) { _ruleset.save(_config.getSettingValue("RuleFile")); } USBGUARD_LOG(Trace) << "return: id=" << id; return id; } /* * IPC service methods */ std::string Daemon::setParameter(const std::string& name, const std::string& value) { if (name == "InsertedDevicePolicy") { const auto previous_value = devicePolicyMethodToString(_inserted_device_policy_method); setInsertedDevicePolicyMethod(devicePolicyMethodFromString(value)); return previous_value; } throw Exception("setParameter", name, "unknown parameter"); } std::string Daemon::getParameter(const std::string& name) { if (name == "InsertedDevicePolicy") { return devicePolicyMethodToString(_inserted_device_policy_method); } throw Exception("getParameter", name, "unknown parameter"); } uint32_t Daemon::appendRule(const std::string& rule_spec, uint32_t parent_id) { USBGUARD_LOG(Trace) << "entry:" << " rule_spec=" << rule_spec << " parent_id=" << parent_id; const Rule rule = Rule::fromString(rule_spec); /* TODO: reevaluate the firewall rules for all active devices */ const uint32_t id = _ruleset.appendRule(rule, parent_id); if (_config.hasSettingValue("RuleFile")) { _ruleset.save(_config.getSettingValue("RuleFile")); } USBGUARD_LOG(Trace) << "return: id=" << id; return id; } void Daemon::removeRule(uint32_t id) { USBGUARD_LOG(Trace) << "id=" << id; _ruleset.removeRule(id); if (_config.hasSettingValue("RuleFile")) { _ruleset.save(_config.getSettingValue("RuleFile")); } } const RuleSet Daemon::listRules(const std::string& query) { USBGUARD_LOG(Trace) << "entry: query=" << query; return _ruleset; } uint32_t Daemon::applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) { USBGUARD_LOG(Trace) << "entry:" << " id=" << id << " target=" << Rule::targetToString(target) << " permanent=" << permanent; std::shared_ptr device = _dm->getDevice(id); std::shared_ptr rule; if (permanent) { rule = upsertDeviceRule(id, target); } else { rule = std::make_shared(); rule->setTarget(target); } dmApplyDevicePolicy(device, rule); USBGUARD_LOG(Trace) << "return:" << " id=" << rule->getRuleID(); return rule->getRuleID(); } void Daemon::dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device) { USBGUARD_LOG(Trace) << "event=" << DeviceManager::eventTypeToString(event) << " device_ptr=" << device.get(); auto audit_event = _audit.deviceEvent(device, event); std::shared_ptr device_rule = \ device->getDeviceRule(/*with_port*/true, /*with_parent_hash=*/true); DevicePresenceChanged(device->getID(), event, device->getTarget(), device_rule->toString()); audit_event.success(); std::shared_ptr policy_rule = nullptr; switch (event) { case DeviceManager::EventType::Present: policy_rule = getPresentDevicePolicyRule(device); break; case DeviceManager::EventType::Insert: case DeviceManager::EventType::Update: policy_rule = getInsertedDevicePolicyRule(device); break; case DeviceManager::EventType::Remove: /* NOOP */ return; default: throw USBGUARD_BUG("Unknown DeviceManager event type"); } dmApplyDevicePolicy(device, policy_rule); } void Daemon::dmHookDeviceException(const std::string& message) { USBGUARD_LOG(Warning) << message; } void Daemon::dmApplyDevicePolicy(std::shared_ptr device, std::shared_ptr matched_rule) { USBGUARD_LOG(Trace) << "device_ptr=" << device.get() << " matched_rule_ptr=" << matched_rule.get(); auto audit_event = _audit.policyEvent(device, device->getTarget(), matched_rule->getTarget()); const Rule::Target target_old = device->getTarget(); std::shared_ptr device_post = \ _dm->applyDevicePolicy(device->getID(), matched_rule->getTarget()); const bool target_changed = target_old != device_post->getTarget(); if (target_changed || matched_rule->getRuleID() == Rule::ImplicitID) { if (target_changed) { USBGUARD_LOG(Debug) << "Device target changed:" << " old=" << Rule::targetToString(target_old) << " new=" << Rule::targetToString(device_post->getTarget()); } else { USBGUARD_LOG(Debug) << "Implicit rule matched"; } std::shared_ptr device_rule = \ device_post->getDeviceRule(/*with_port=*/true, /*with_parent_hash=*/true); DevicePolicyChanged(device->getID(), target_old, device_post->getTarget(), device_rule->toString(), matched_rule->getRuleID()); } matched_rule->updateMetaDataCounters(/*applied=*/true); audit_event.success(); } std::shared_ptr Daemon::getInsertedDevicePolicyRule(std::shared_ptr device) { USBGUARD_LOG(Trace) << "device_ptr=" << device.get(); std::shared_ptr device_rule = \ device->getDeviceRule(/*with_port=*/true, /*with_parent_hash=*/true, /*match_rule=*/true); Rule::Target target = Rule::Target::Invalid; std::shared_ptr policy_rule; const DevicePolicyMethod policy_method = _inserted_device_policy_method; switch (policy_method) { case DevicePolicyMethod::Block: target = Rule::Target::Block; break; case DevicePolicyMethod::Reject: target = Rule::Target::Reject; break; case DevicePolicyMethod::ApplyPolicy: policy_rule = _ruleset.getFirstMatchingRule(device_rule); break; case DevicePolicyMethod::Allow: case DevicePolicyMethod::Keep: default: throw USBGUARD_BUG("Invalid DevicePolicyMethod value"); } if (policy_rule == nullptr) { policy_rule = std::make_shared(); policy_rule->setTarget(target); policy_rule->setRuleID(Rule::RootID); } return policy_rule; } std::shared_ptr Daemon::getPresentDevicePolicyRule(std::shared_ptr device) { USBGUARD_LOG(Trace) << "entry: device_ptr=" << device.get(); std::shared_ptr device_rule = \ device->getDeviceRule(/*with_port=*/true, /*with_parent_hash=*/true, /*match_rule=*/true); USBGUARD_LOG(Debug) << "device_rule=" << device_rule->toString(); USBGUARD_LOG(Debug) << "isController=" << device->isController(); const DevicePolicyMethod policy_method = \ device->isController() ? _present_controller_policy_method : _present_device_policy_method; Rule::Target target = Rule::Target::Invalid; std::shared_ptr matched_rule = nullptr; switch (policy_method) { case DevicePolicyMethod::Allow: target = Rule::Target::Allow; break; case DevicePolicyMethod::Block: target = Rule::Target::Block; break; case DevicePolicyMethod::Reject: target = Rule::Target::Reject; break; case DevicePolicyMethod::Keep: target = device->getTarget(); break; case DevicePolicyMethod::ApplyPolicy: matched_rule = _ruleset.getFirstMatchingRule(device_rule); target = matched_rule->getTarget(); break; default: throw USBGUARD_BUG("Invalid DevicePolicyMethod value"); } if (matched_rule == nullptr) { matched_rule = std::make_shared(); matched_rule->setTarget(target); matched_rule->setRuleID(Rule::ImplicitID); } USBGUARD_LOG(Trace) << "return:" << " matched_rule=" << matched_rule->toString(); return matched_rule; } uint32_t Daemon::dmHookAssignID() { return assignID(); } const std::vector Daemon::listDevices(const std::string& query) { USBGUARD_LOG(Trace) << "entry:" << " query=" << query; std::vector device_rules; const Rule query_rule = Rule::fromString(query); for (auto const& device : _dm->getDeviceList(query_rule)) { device_rules.push_back(*device->getDeviceRule()); } USBGUARD_LOG(Trace) << "return:" << " count(device_rules)=" << device_rules.size(); return device_rules; } std::shared_ptr Daemon::upsertDeviceRule(uint32_t id, Rule::Target target) { USBGUARD_LOG(Trace) << "entry:" << "id=" << id << "target=" << Rule::targetToString(target); std::shared_ptr device = _dm->getDevice(id); bool with_port = true && _device_rules_with_port; bool with_parent_hash = true; /* * Generate a port specific or agnostic rule depending on the target */ switch (target) { case Rule::Target::Allow: with_port = true && with_port; with_parent_hash = true; break; case Rule::Target::Block: /* * Block the device using a port agnostic rule, so that the same device * inserted in a different port is still blocked. Note that allowDevice * generates a port specific rule and the same device won't be allowed * when inserted in a different port. */ with_port = false; with_parent_hash = false; break; case Rule::Target::Reject: /* * Reject the device using a port agnostic port. When we explicitly * reject a device, we don't want to reject it again when the same * device is inserted in a different port. */ with_port = false; with_parent_hash = false; break; case Rule::Target::Invalid: case Rule::Target::Unknown: case Rule::Target::Match: case Rule::Target::Device: default: throw Exception("upsertDeviceRule", "device rule", "Invalid target"); } /* Generate a match rule for upsert */ std::shared_ptr match_rule = device->getDeviceRule(false, false, /*match_rule=*/true); const std::string match_spec = match_rule->toString(); USBGUARD_LOG(Debug) << "match_spec=" << match_spec; /* Generate new device rule */ std::shared_ptr device_rule = device->getDeviceRule(with_port, with_parent_hash); device_rule->setTarget(target); const std::string rule_spec = device_rule->toString(); USBGUARD_LOG(Debug) << "rule_spec=" << rule_spec; /* Upsert */ const uint32_t rule_id = upsertRule(match_spec, rule_spec, /*parent_insensitive=*/true); auto upsert_rule = _ruleset.getRule(rule_id); USBGUARD_LOG(Trace) << "return:" << " upsert_rule=" << upsert_rule->toString(); return upsert_rule; } void Daemon::addIPCAllowedUID(uid_t uid, const IPCServer::AccessControl& ac) { USBGUARD_LOG(Trace) << "uid=" << uid; IPCServer::addAllowedUID(uid, ac); } void Daemon::addIPCAllowedUID(const std::string& uid_string, const IPCServer::AccessControl& ac) { addIPCAllowedUID(stringToNumber(uid_string), ac); } void Daemon::addIPCAllowedGID(gid_t gid, const IPCServer::AccessControl& ac) { USBGUARD_LOG(Trace) << "gid=" << gid; IPCServer::addAllowedGID(gid, ac); } void Daemon::addIPCAllowedGID(const std::string& gid_string, const IPCServer::AccessControl& ac) { addIPCAllowedGID(stringToNumber(gid_string), ac); } void Daemon::addIPCAllowedUser(const std::string& user, const IPCServer::AccessControl& ac) { USBGUARD_LOG(Trace) << "user=" << user; if (isNumericString(user)) { addIPCAllowedUID(user, ac); } else { IPCServer::addAllowedUsername(user, ac); } } void Daemon::addIPCAllowedGroup(const std::string& group, const IPCServer::AccessControl& ac) { USBGUARD_LOG(Trace) << "group=" << group; if (isNumericString(group)) { addIPCAllowedGID(group, ac); } else { IPCServer::addAllowedGroupname(group, ac); } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/Daemon.hpp000066400000000000000000000124731325273707200176630ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // Jiri Vymazal // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Common/Thread.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/ConfigFile.hpp" #include "usbguard/IPCServer.hpp" #include "usbguard/RuleSet.hpp" #include "usbguard/Rule.hpp" #include "usbguard/Device.hpp" #include "usbguard/DeviceManager.hpp" #include "usbguard/DeviceManagerHooks.hpp" #include "usbguard/Audit.hpp" #include #include #include namespace usbguard { class Daemon : public IPCServer, public DeviceManagerHooks { public: enum DevicePolicyMethod { Allow, Block, Reject, Keep, ApplyPolicy }; static DevicePolicyMethod devicePolicyMethodFromString(const std::string& policy_string); static const std::string devicePolicyMethodToString(DevicePolicyMethod policy); Daemon(); ~Daemon(); int checkPermissions(const std::string& path, const mode_t permissions); void loadConfiguration(const std::string& path, const bool check_permissions); void loadRules(const std::string& path, const bool check_permissions); void loadIPCAccessControlFiles(const std::string& path); bool loadIPCAccessControlFile(const std::string& basename, const std::string& fullpath); void checkIPCAccessControlName(const std::string& basename); void parseIPCAccessControlFilename(const std::string& basename, std::string* const ptr_user, std::string* const ptr_group); void setImplicitPolicyTarget(Rule::Target target); void setPresentDevicePolicyMethod(DevicePolicyMethod policy); void setPresentControllerPolicyMethod(DevicePolicyMethod policy); void setInsertedDevicePolicyMethod(DevicePolicyMethod policy); /* Start the daemon */ void run(); /* Stop the daemon */ void quit(); /* Handle process daemonization */ void daemonize(const std::string& pid_file); uint32_t assignID(); uint32_t upsertRule(const std::string& match_spec, const std::string& rule_spec, bool parent_insensitive = false); /* IPC methods */ std::string setParameter(const std::string& name, const std::string& value) override; std::string getParameter(const std::string& name) override; uint32_t appendRule(const std::string& rule_spec, uint32_t parent_id) override; void removeRule(uint32_t id) override; const RuleSet listRules(const std::string& query) override; uint32_t applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) override; const std::vector listDevices(const std::string& query) override; /* Device manager hooks */ void dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device) override; uint32_t dmHookAssignID() override; void dmHookDeviceException(const std::string& message) override; #define USBGUARD_IPCSERVER_DEFAULT_AC \ IPCServer::AccessControl(IPCServer::AccessControl::Section::ALL, IPCServer::AccessControl::Privilege::ALL) void addIPCAllowedUID(uid_t uid, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); void addIPCAllowedUID(const std::string& uid_string, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); void addIPCAllowedGID(gid_t gid, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); void addIPCAllowedGID(const std::string& gid_string, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); void addIPCAllowedUser(const std::string& user, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); void addIPCAllowedGroup(const std::string& group, const IPCServer::AccessControl& ac = USBGUARD_IPCSERVER_DEFAULT_AC); private: void dmApplyDevicePolicy(std::shared_ptr device, std::shared_ptr matched_rule); std::shared_ptr getInsertedDevicePolicyRule(std::shared_ptr device); std::shared_ptr getPresentDevicePolicyRule(std::shared_ptr device); std::shared_ptr upsertDeviceRule(uint32_t id, Rule::Target target); ConfigFile _config; RuleSet _ruleset; int pid_fd; std::string _device_manager_backend; std::shared_ptr _dm; std::atomic _implicit_policy_target; std::atomic _present_device_policy_method; std::atomic _present_controller_policy_method; std::atomic _inserted_device_policy_method; bool _device_rules_with_port; bool _restore_controller_device_state; AuditIdentity _audit_identity; Audit _audit; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/FileAuditBackend.cpp000066400000000000000000000026621325273707200215700ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "FileAuditBackend.hpp" #include namespace usbguard { void FileAuditBackend::write(const AuditEvent& event) { std::string message; message.append("uid="); message.append(numberToString(event.identity().uid())); message.append(" "); message.append("pid="); message.append(numberToString(event.identity().pid())); message.append(" "); for (const auto& kv_pair : event.keys()) { message.append(kv_pair.first); message.append("='"); message.append(kv_pair.second); message.append("' "); } USBGUARD_LOG(Audit) << message; } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/FileAuditBackend.hpp000066400000000000000000000017611325273707200215740ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include namespace usbguard { class FileAuditBackend : public AuditBackend { public: void write(const AuditEvent& event); }; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/LinuxAuditBackend.cpp000066400000000000000000000202401325273707200220000ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "LinuxAuditBackend.hpp" #include #include #include "Common/Utility.hpp" #include "Library/Utility.hpp" #include #if defined(HAVE_LINUX_AUDIT) #include #ifndef AUDIT_USER_DEVICE #define AUDIT_USER_DEVICE 1137 /* User space hotplug device changes */ #endif #if !defined(HAVE_DECL_AUDIT_ENCODE_NV_STRING) #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include #include #include /* * Audit message encoding functions based on: * https://github.com/linux-audit/audit-userspace/blob/f7cd4d6/lib/audit_logging.c#L125 */ /* * This function checks a string to see if it needs encoding. * It returns true if needed and false if not. */ static bool audit_value_needs_encoding(const char* str, unsigned int size) { if (str == NULL) { return false; } for (unsigned int i = 0; i < size; i++) { // we don't test for > 0x7f because str[] is signed. if (str[i] == '"' || str[i] < 0x21 || str[i] == 0x7F) { return true; } } return false; } /* * This function does encoding of "untrusted" names just like the kernel */ static char* audit_encode_value(char* final, const char* buf, unsigned int size) { char* ptr = final; const char* hex = "0123456789ABCDEF"; if (final == NULL) { return NULL; } if (buf == NULL) { *final = 0; return final; } for (unsigned int i = 0; i < size; i++) { *ptr++ = hex[(buf[i] & 0xF0)>>4]; /* Upper nibble */ *ptr++ = hex[buf[i] & 0x0F]; /* Lower nibble */ } *ptr = 0; return final; } static char* audit_encode_nv_string(const char* name, const char* value, unsigned int vlen) { char* str = nullptr; if (vlen == 0 && value) { vlen = ::strlen(value); } if (value && audit_value_needs_encoding(value, vlen)) { char* tmp = reinterpret_cast(::malloc(2*vlen + 1)); if (tmp) { audit_encode_value(tmp, value, vlen); if (::asprintf(&str, "%s=%s", name, tmp) < 0) { str = nullptr; } free(tmp); } else { str = nullptr; } } else { if (::asprintf(&str, "%s=\"%s\"", name, value ? value : "?") < 0) { str = nullptr; } } return str; } #endif /* HAVE_DECL_AUDIT_ENCODE_NV_STRING */ #endif /* HAVE_LINUX_AUDIT */ namespace usbguard { #if defined(HAVE_LINUX_AUDIT) static std::string encodeMessageNVPair(const std::string& key, const std::string& value) { std::unique_ptr encoded_cstr(audit_encode_nv_string(key.c_str(), value.c_str(), value.size())); std::string encoded(encoded_cstr.get()); return encoded; } static void appendToMessage(std::string& message, const std::string& key, const std::string& value) { if (message.size() > 0) { message.append(" "); } message.append(encodeMessageNVPair(key, value)); } static std::string translateTypeValue(const std::string& value) { if (hasPrefix(value, "Policy.Device.")) { /* device policy events */ if (hasSuffix(value, "Update")) { return "changed-authorization-state-for"; } throw std::runtime_error("LinuxAuditBackend: unexpected Policy.Device event"); } else if (hasPrefix(value, "Device.")) { /* device events */ if (hasSuffix(value, "Present")) { return "discovered-device"; } if (hasSuffix(value, "Insert")) { return "inserted-device"; } if (hasSuffix(value, "Update")) { return "updated-device"; } if (hasSuffix(value, "Remove")) { return "removed-device"; } throw std::runtime_error("LinuxAuditBackend: unexpected Device event"); } else if (hasPrefix(value, "Policy.")) { /* rule set modification events */ if (hasSuffix(value, "Insert")) { return "inserted-policy-rule"; } if (hasSuffix(value, "Update")) { return "updated-policy-rule"; } if (hasSuffix(value, "Remove")) { return "removed-policy-rule"; } throw std::runtime_error("LinuxAuditBackend: unexpected Policy event"); } throw std::runtime_error("LinuxAuditBackend: unexpected type= key value"); } #endif LinuxAuditBackend::LinuxAuditBackend() { #if defined(HAVE_LINUX_AUDIT) USBGUARD_LOG(Debug) << "Opening Linux Audit socket"; if ((_audit_fd = audit_open()) < 0) { throw ErrnoException("LinuxAuditBackend", "audit_open", errno); } #else (void)_audit_fd; throw std::runtime_error("LinuxAuditBackend: not supported"); #endif } LinuxAuditBackend::~LinuxAuditBackend() { #if defined(HAVE_LINUX_AUDIT) USBGUARD_LOG(Debug) << "Closing Linux Audit socket"; audit_close(_audit_fd); #endif } void LinuxAuditBackend::write(const AuditEvent& event) { #if defined(HAVE_LINUX_AUDIT) std::string message; /* * Linux Audit event result * 0 = failed * 1 = success */ int result = 0; auto kvals = event.keys(); std::string audit_key; std::string audit_value; if (kvals.count("type") > 0) { audit_key = "op"; audit_value = translateTypeValue(kvals["type"]); appendToMessage(message, audit_key, audit_value); kvals.erase("type"); } else { throw std::runtime_error("missing required type field in the audit event"); } if (kvals.count("result") > 0) { if (kvals["result"] == "SUCCESS") { result = 1; } kvals.erase("result"); } else { throw std::runtime_error("missing required result field in the audit event"); } if (kvals.count("device.system_name") > 0) { audit_key = "device"; audit_value = kvals["device.system_name"]; appendToMessage(message, audit_key, audit_value); kvals.erase("device.system_name"); } if (kvals.count("rule") > 0) { audit_key = "rule"; audit_value = kvals["rule"]; appendToMessage(message, audit_key, audit_value); kvals.erase("rule"); } for (const auto& kv_pair : kvals) { const std::string& key = kv_pair.first; const std::string& value = kv_pair.second; audit_key.clear(); audit_value.clear(); if (key == "device.rule") { audit_key = "device_rule"; audit_value = value; } else if (key == "device.rule.new") { audit_key = "device_rule"; audit_value = value; } else if (key == "target") { audit_key = "target"; audit_value = value; } else if (key == "target.new") { audit_key = "target"; audit_value = value; } else if (key == "rule.id") { audit_key = "rule_id"; audit_value = value; } else if (key == "rule.new") { audit_key = "rule"; audit_value = value; } /* * Skip appending the key=value pair to the message, if the * audit_key string is empty. This is used to skip key=value * pairs that we don't want to include in the Linux Audit trail. */ if (!audit_key.empty()) { appendToMessage(message, audit_key, audit_value); } } USBGUARD_LOG(Debug) << "Writing Linux Audit message: " << message; audit_log_user_message(_audit_fd, AUDIT_USER_DEVICE, message.c_str(), /*hostname=*/nullptr, /*addr=*/nullptr, /*tty=*/nullptr, result); #else (void)event; throw std::runtime_error("LinuxAuditBackend::write: not supported"); #endif } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/LinuxAuditBackend.hpp000066400000000000000000000021111325273707200220020ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include namespace usbguard { class LinuxAuditBackend : public AuditBackend { public: LinuxAuditBackend(); ~LinuxAuditBackend(); void write(const AuditEvent& event); private: int _audit_fd{-1}; }; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/Seccomp.c000066400000000000000000000150761325273707200175060ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Seccomp.h" #if defined(HAVE_SECCOMP) #include #include #include #include #include #include #if defined(HAVE_LIBCAPNG) #include #endif #endif #if defined(HAVE_SECCOMP) bool setupSeccompWhitelist(void) { /* TODO: Use SCMP_ACT_TRAP. Switch to EACCES for 1.x releases */ scmp_filter_ctx ctx = seccomp_init(/*SCMP_ACT_ERRNO(EACCES)*/SCMP_ACT_TRAP); if (!ctx) { return false; } int ret = 0; /* files, dirs */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(fstat), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(lstat), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(unlink), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(ftruncate), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(chown), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(chmod), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(lseek), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getdents), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(stat), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(readlink), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(access), 0); /* memory */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(brk), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mmap), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(munmap), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect), 1, SCMP_A2(SCMP_CMP_EQ, PROT_NONE)); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect), 1, SCMP_A2(SCMP_CMP_EQ, PROT_READ)); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect), 1, SCMP_A2(SCMP_CMP_EQ, PROT_WRITE)); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect), 1, SCMP_A2(SCMP_CMP_EQ, PROT_READ|PROT_WRITE)); /* clock */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(clock_gettime), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(clock_getres), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(gettid), 0); /* epoll */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(epoll_create1), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(epoll_wait), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(epoll_ctl), 0); /* signals */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigaction), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigprocmask), 0); /* process, thread */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(clone), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(futex), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(set_robust_list), 0); /* STRACE: * getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=4*1024}) = 0 */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getrlimit), 1, SCMP_A0(SCMP_CMP_EQ, RLIMIT_NOFILE)); /* pipes, eventfd */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(pipe), 0); /* STRACE: * eventfd2(0, 0) */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(eventfd2), 2, SCMP_A0(SCMP_CMP_EQ, 0), SCMP_A1(SCMP_CMP_EQ, 0)); /* socket */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), 1, SCMP_A0(SCMP_CMP_EQ, PF_LOCAL), SCMP_A1(SCMP_CMP_MASKED_EQ, SOCK_STREAM, SOCK_STREAM)); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), 1, SCMP_A0(SCMP_CMP_EQ, PF_NETLINK), SCMP_A2(SCMP_CMP_EQ, NETLINK_KOBJECT_UEVENT)); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(bind), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(accept), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(listen), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(shutdown), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(recvmsg), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(recvfrom), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(sendto), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(select), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(connect), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getsockname), 0); #if defined(HAVE_LIBCAPNG) /* capabilities */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(capget), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(capset), 0); /* allow to drop capabilities using prctl */ ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(prctl), 1, SCMP_A0(SCMP_CMP_EQ, PR_CAPBSET_DROP)); #endif /* HAVE_LIBCAPNG */ /* before main() only */ //seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(statfs), 0); //seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(arch_prctl), 0); //seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(set_tid_address), 0); //seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(execve), 0); if (ret != 0) { goto out; } if (seccomp_load(ctx) != 0) { ret = -1; goto out; } out: seccomp_release(ctx); return (ret == 0); } #else bool setupSeccompWhitelist(void) { return false; } #endif /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/Seccomp.h000066400000000000000000000017151325273707200175060ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #ifdef __cplusplus extern "C" { #endif bool setupSeccompWhitelist(void); #ifdef __cplusplus } #endif /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Daemon/main.cpp000066400000000000000000000132341325273707200173730ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // Jiri Vymazal // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Daemon.hpp" #include "Common/Utility.hpp" #include "Seccomp.h" #include "usbguard/Typedefs.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include #include #if defined(HAVE_LIBCAPNG) #include static void setupCapabilities(void); #endif #ifndef USBGUARD_PID_FILE #define USBGUARD_PID_FILE "/var/run/usbguard.pid" #endif using namespace usbguard; const char* const G_optstring = "dfskKl:p:c:hWCP"; static void printUsage(std::ostream& stream, const char* arg0) { stream << std::endl; stream << "Usage: " << filenameFromPath(std::string(arg0), true) << " [OPTIONS]" << std::endl; stream << std::endl; stream << " -d Enable debugging messages in the log." << std::endl; stream << " -f Enable classical daemon forking behavior." << std::endl; stream << " -s Log to syslog." << std::endl; stream << " -k Log to console." << std::endl; stream << " -K Disable Logging to console." << std::endl; stream << " -l Log to a file at `path'." << std::endl; stream << " -p Write PID to a file at `path'." << std::endl; stream << " -c Load configuration from a file at `path'." << std::endl; stream << " -P Disable permissions check on conf and policy files" << std::endl; stream << " (default: /etc/usbguard/usbguard-daemon.conf)" << std::endl; stream << " -C Drop capabilities to limit privileges of the process." << std::endl; stream << " -W Use a seccomp whitelist to limit available syscalls to the process." << std::endl; stream << " -h Show this usage screen." << std::endl; stream << std::endl; } int main(int argc, char* argv[]) { const char* const arg0 = argv[0]; bool debug_mode = false; bool log_syslog = false; bool log_console = true; bool log_file = false; bool use_seccomp_whitelist = false; bool drop_capabilities = false; bool check_permissions = true; bool daemonize = false; std::string log_file_path; std::string pid_file = USBGUARD_PID_FILE; std::string conf_file = "/etc/usbguard/usbguard-daemon.conf"; int opt; while ((opt = getopt(argc, argv, G_optstring)) != -1) { switch (opt) { case 'd': debug_mode = true; break; case 'f': daemonize = true; break; case 's': log_syslog = true; break; case 'k': log_console = true; break; case 'K': log_console = false; break; case 'l': log_file = true; log_file_path = std::string(optarg); break; case 'p': pid_file = std::string(optarg); break; case 'P': USBGUARD_LOG(Warning) << "PERMISSIONS CHECK ON POLICY FILE ARE TURNED OFF!"; check_permissions = false; break; case 'c': conf_file = std::string(optarg); break; case 'W': use_seccomp_whitelist = true; break; case 'C': drop_capabilities = true; break; case 'h': printUsage(std::cout, arg0); return EXIT_SUCCESS; case '?': printUsage(std::cerr, arg0); /* FALLTROUGH */ default: return EXIT_FAILURE; } } /* Initialize logging */ USBGUARD_LOGGER.setEnabled(true, (debug_mode ? LogStream::Level::Trace : LogStream::Level::Warning)); USBGUARD_LOGGER.setOutputConsole(log_console); USBGUARD_LOGGER.setOutputSyslog(log_syslog, "usbguard-daemon"); USBGUARD_LOGGER.setOutputFile(log_file, log_file_path); /* Setup seccomp whitelist & drop capabilities */ if (use_seccomp_whitelist) { if (!setupSeccompWhitelist()) { return EXIT_FAILURE; } } if (drop_capabilities) { #if defined(HAVE_LIBCAPNG) setupCapabilities(); #else return EXIT_FAILURE; #endif } /* Start the daemon */ int ret = EXIT_FAILURE; try { usbguard::Daemon daemon; if (!conf_file.empty()) { daemon.loadConfiguration(conf_file, check_permissions); } if (daemonize) { if (log_console && !log_syslog && !log_file) { USBGUARD_LOG(Warning) << "You have selected to fork and log only to \ console, nothing will be logged after forking!"; } daemon.daemonize(pid_file); } daemon.run(); ret = EXIT_SUCCESS; } catch (const usbguard::Exception& ex) { USBGUARD_LOG(Error) << "ERROR: " << ex.message(); } catch (const std::exception& ex) { USBGUARD_LOG(Error) << "EXCEPTION: " << ex.what(); } catch (...) { USBGUARD_LOG(Error) << "EXCEPTION: Unknown excepton caught while starting the process"; } return ret; } #if defined(HAVE_LIBCAPNG) static void setupCapabilities(void) { capng_clear(CAPNG_SELECT_BOTH); capng_updatev(CAPNG_ADD, (capng_type_t)(CAPNG_EFFECTIVE|CAPNG_PERMITTED), CAP_CHOWN, CAP_FOWNER, -1); capng_apply(CAPNG_SELECT_BOTH); return; } #endif /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/000077500000000000000000000000001325273707200155445ustar00rootroot00000000000000usbguard-0.7.2+ds/src/GUI.Qt/DeviceDialog.cpp000066400000000000000000000144301325273707200205710ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DeviceDialog.h" #include "DeviceDialog.ui.h" #include "usbguard/Logger.hpp" #include #include DeviceDialog::DeviceDialog(quint32 id, QWidget* parent) : QDialog(parent), ui(new Ui::DeviceDialog) { USBGUARD_LOG(Trace) << "Creating DeviceDialog for device_id=" << id; ui->setupUi(this); setWindowTitle(QString(tr("USB Device Inserted"))); setWindowIcon(QIcon(":/usbguard-icon.svg")); setWindowFlags(Qt::CustomizeWindowHint|Qt::WindowStaysOnTopHint); connect(&timer, SIGNAL(timeout()), this, SLOT(timerUpdate())); device_id = id; setDecisionMethod(DecisionMethod::Buttons); setDefaultDecisionTimeout(23); setRandomizePosition(false); setDefaultDecision(usbguard::Rule::Target::Block); updateDialog(); timer.start(1000); } void DeviceDialog::setName(const QString& name) { ui->name_label->setText(name); } void DeviceDialog::setDeviceID(const QString& vendor_id, const QString& product_id) { ui->deviceid_label->setText(QString("%1:%2").arg(vendor_id).arg(product_id)); } void DeviceDialog::setSerial(const QString& serial) { USBGUARD_LOG(Trace) << "Masking serial number value"; _serial = serial; if (_mask_serial_number) { for (auto i = _serial.size(), p = 1; i > 0; --i, ++p) { if ((p % 2) == 0) { _serial[i - 1] = '*'; } } } ui->serial_label->setText(_serial); } void DeviceDialog::setInterfaceTypes(const std::vector& interfaces) { ui->interface_list->clear(); for (auto const& type : interfaces) { ui->interface_list->addItem(QString::fromStdString(type.typeString())); } } void DeviceDialog::setDefaultDecision(usbguard::Rule::Target target) { switch (target) { case usbguard::Rule::Target::Allow: ui->allow_button->setFocus(); break; case usbguard::Rule::Target::Block: ui->block_button->setFocus(); break; case usbguard::Rule::Target::Reject: case usbguard::Rule::Target::Unknown: case usbguard::Rule::Target::Invalid: case usbguard::Rule::Target::Match: case usbguard::Rule::Target::Device: default: ui->reject_button->setFocus(); } _default_decision = target; } void DeviceDialog::setDefaultDecisionTimeout(quint32 seconds) { _default_decision_timeout = seconds; time_left = seconds; } void DeviceDialog::setDecisionMethod(DeviceDialog::DecisionMethod method) { _decision_method = method; } void DeviceDialog::setDecisionIsPermanent(bool state) { _decision_is_permanent = state; ui->permanent_checkbox->setChecked(state); } void DeviceDialog::setRejectVisible(bool state) { ui->reject_button->setHidden(!state); } static int randomInteger(int a, int b) { return (qrand() % (b > a ? b - a : a - b)) + std::min(a, b); } void DeviceDialog::setRandomizePosition(bool randomize) { QRect position_rect = \ QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, size(), qApp->desktop()->availableGeometry()); if (randomize) { const int h = ui->block_button->height(); const int w = ui->block_button->width(); const int dy = randomInteger(-2.618*h, 2.618*h); const int dx = randomInteger(-2.618*w, 2.618*w); position_rect.translate(dx, dy); } setGeometry(position_rect); } void DeviceDialog::setMaskSerialNumber(bool state) { _mask_serial_number = state; } void DeviceDialog::timerUpdate() { if (time_left > 0) { --time_left; updateDialog(); } else { timer.stop(); executeDefaultDecision(); } } void DeviceDialog::reject() { if (timer.isActive()) { timer.stop(); updateDialog(); } else { QDialog::reject(); } } void DeviceDialog::accept() { if (timer.isActive()) { timer.stop(); } QDialog::accept(); } void DeviceDialog::updateDialog() { QPushButton* button = nullptr; QString label; switch (_default_decision) { case usbguard::Rule::Target::Allow: button = ui->allow_button; label = QString(tr("Allow")); break; case usbguard::Rule::Target::Block: button = ui->block_button; label = QString(tr("Block")); break; case usbguard::Rule::Target::Reject: case usbguard::Rule::Target::Match: case usbguard::Rule::Target::Device: case usbguard::Rule::Target::Invalid: case usbguard::Rule::Target::Unknown: default: button = ui->reject_button; label = QString(tr("Reject")); } if (timer.isActive()) { button->setText(QString("%1 [%2]").arg(label).arg(time_left)); } else { button->setText(label); ui->hint_label->setText(tr("(Press Escape to close this window)")); } } void DeviceDialog::executeDefaultDecision() { USBGUARD_LOG(Debug) << "Executing default decision: " << usbguard::Rule::targetToString(_default_decision); switch (_default_decision) { case usbguard::Rule::Target::Allow: on_allow_button_clicked(); break; case usbguard::Rule::Target::Block: on_block_button_clicked(); break; case usbguard::Rule::Target::Reject: case usbguard::Rule::Target::Unknown: case usbguard::Rule::Target::Invalid: case usbguard::Rule::Target::Device: case usbguard::Rule::Target::Match: default: on_allow_button_clicked(); } } DeviceDialog::~DeviceDialog() { delete ui; } void DeviceDialog::on_allow_button_clicked() { emit allowed(device_id, ui->permanent_checkbox->isChecked()); accept(); } void DeviceDialog::on_block_button_clicked() { emit blocked(device_id, ui->permanent_checkbox->isChecked()); accept(); } void DeviceDialog::on_reject_button_clicked() { emit rejected(device_id, ui->permanent_checkbox->isChecked()); accept(); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/DeviceDialog.h000066400000000000000000000050061325273707200202350ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/USB.hpp" #include "usbguard/Rule.hpp" #include #include namespace Ui { class DeviceDialog; } class DeviceDialog : public QDialog { Q_OBJECT public: enum class DecisionMethod { Buttons, MathTest }; explicit DeviceDialog(quint32 id, QWidget* parent = 0); ~DeviceDialog(); void setName(const QString& name); void setSerial(const QString& serial); void setDeviceID(const QString& vendor_id, const QString& product_id); void setInterfaceTypes(const std::vector& interfaces); void setDefaultDecision(usbguard::Rule::Target target); void setDefaultDecisionTimeout(quint32 seconds); void setDecisionMethod(DecisionMethod method); void setDecisionIsPermanent(bool state); void setRejectVisible(bool state); void setRandomizePosition(bool randomize); void setMaskSerialNumber(bool state); signals: void allowed(quint32 id, bool permanent); void blocked(quint32 id, bool permanent); void rejected(quint32 id, bool permanent); protected slots: void timerUpdate(); protected: void reject(); void accept(); void updateDialog(); void executeDefaultDecision(); void setPosition(bool randomized); private slots: void on_allow_button_clicked(); void on_block_button_clicked(); void on_reject_button_clicked(); private: Ui::DeviceDialog* ui; usbguard::Rule::Target _default_decision; quint32 _default_decision_timeout; DecisionMethod _decision_method; bool _reject_enabled; bool _mask_serial_number; bool _decision_is_permanent; QTimer timer; int time_left; quint32 device_id; QString _name; QString _serial; QString _device_id; QStringList _interface_types; }; /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/DeviceDialog.ui000066400000000000000000000204621325273707200204260ustar00rootroot00000000000000 DeviceDialog 0 0 423 386 300 300 USBGuard Device Dialog 0 0 Monospace 12 QFrame::StyledPanel QFrame::Raised 10 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 75 true TextLabel 10 Device ID: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 Serial #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 75 true TextLabel 75 true TextLabel 0 0 16777215 128 10 QFrame::StyledPanel QAbstractItemView::DoubleClicked false true Make the decision permanent 0 0 0 0 14 75 true false background-color: rgb(255, 80, 0) Block 0 0 14 75 true background-color: rgb(0, 128, 0) Allow 0 0 14 75 true background-color: rgb(255, 0, 0) Reject 8 (Press Escape to stop the countdown) Qt::AlignCenter allow_button reject_button block_button hint_label usbguard-0.7.2+ds/src/GUI.Qt/DeviceModel.cpp000066400000000000000000000254271325273707200204420ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DeviceModel.h" #include "usbguard/Logger.hpp" #include #include #include DeviceModelItem::DeviceModelItem() { _parent = nullptr; _requested_target = usbguard::Rule::Target::Invalid; } DeviceModelItem::DeviceModelItem(const usbguard::Rule& device_rule, DeviceModelItem* parent) { _parent = parent; _device_rule = device_rule; _requested_target = device_rule.getTarget(); } DeviceModelItem::~DeviceModelItem() { _parent = nullptr; qDeleteAll(_children); } void DeviceModelItem::appendChild(DeviceModelItem* child) { _children.append(child); } void DeviceModelItem::removeChild(DeviceModelItem* child) { (void)_children.takeAt(_children.indexOf(child)); } DeviceModelItem* DeviceModelItem::child(int row) { return _children.value(row); } int DeviceModelItem::childCount() const { return _children.count(); } int DeviceModelItem::columnCount() const { return 8; } QVariant DeviceModelItem::data(int column) { switch (column) { case 0: return QVariant(_device_rule.getRuleID()); case 1: return QVariant(_requested_target != _device_rule.getTarget() ? QString('*') : QString()); case 2: return QVariant(QCoreApplication::translate("MainWindow", usbguard::Rule::targetToString(_requested_target).c_str())); case 3: return QVariant(QString::fromStdString(_device_rule.getDeviceID().toString())); case 4: return QVariant(QString::fromStdString(_device_rule.getName())); case 5: return QVariant(QString::fromStdString(_device_rule.getSerial())); case 6: return QVariant(QString::fromStdString(_device_rule.getViaPort())); case 7: { QString interface_string; for (auto interface : _device_rule.attributeWithInterface().values()) { interface_string.append(QString::fromStdString(interface.toRuleString())); interface_string.append(" "); } return QVariant(interface_string); } default: return QVariant(); } } int DeviceModelItem::row() const { if (_parent) { return _parent->_children.indexOf(const_cast(this)); } else { return 0; } } DeviceModelItem* DeviceModelItem::parent() { return _parent; } usbguard::Rule::Target DeviceModelItem::getRequestedTarget() const { return _requested_target; } usbguard::Rule::Target DeviceModelItem::getDeviceTarget() const { return _device_rule.getTarget(); } void DeviceModelItem::setRequestedTarget(usbguard::Rule::Target target) { _requested_target = target; } void DeviceModelItem::setDeviceTarget(usbguard::Rule::Target target) { _device_rule.setTarget(target); _requested_target = target; } QString DeviceModelItem::getDeviceHash() const { return QString::fromStdString(_device_rule.getHash()); } quint32 DeviceModelItem::getDeviceID() const { return _device_rule.getRuleID(); } DeviceModel::DeviceModel(QObject* parent) : QAbstractItemModel(parent) { _root_item = new DeviceModelItem(); } DeviceModel::~DeviceModel() { clear(); delete _root_item; } QVariant DeviceModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation != Qt::Horizontal) { return QVariant(); } if (role != Qt::DisplayRole && role != Qt::TextAlignmentRole) { return QVariant(); } switch (section) { case 0: if (role == Qt::DisplayRole) { return tr("ID"); } else { return Qt::AlignCenter; } break; case 1: if (role == Qt::DisplayRole) { return tr(" M "); /* Modified flag */ } if (role == Qt::TextAlignmentRole) { return Qt::AlignCenter; } break; case 2: if (role == Qt::DisplayRole) { return tr("Target"); } if (role == Qt::TextAlignmentRole) { return Qt::AlignCenter; } break; case 3: if (role == Qt::DisplayRole) { return tr("USB ID"); } if (role == Qt::TextAlignmentRole) { return Qt::AlignCenter; } break; case 4: if (role == Qt::DisplayRole) { return tr("Name"); } break; case 5: if (role == Qt::DisplayRole) { return tr("Serial"); } break; case 6: if (role == Qt::DisplayRole) { return tr("Port"); } break; case 7: if (role == Qt::DisplayRole) { return tr("Interfaces"); } break; default: break; } return QVariant(); } QModelIndex DeviceModel::index(int row, int column, const QModelIndex& parent) const { if (!hasIndex(row, column, parent)) { return QModelIndex(); } DeviceModelItem* parent_item = nullptr; if (!parent.isValid()) { parent_item = _root_item; } else { parent_item = static_cast(parent.internalPointer()); } DeviceModelItem* child_item = parent_item->child(row); if (child_item) { return createIndex(row, column, child_item); } else { return QModelIndex(); } } QModelIndex DeviceModel::parent(const QModelIndex& index) const { if (!index.isValid()) { return QModelIndex(); } DeviceModelItem* child_item = static_cast(index.internalPointer()); DeviceModelItem* parent_item = child_item->parent(); if (parent_item == _root_item) { return QModelIndex(); } else { return createIndex(parent_item->row(), 0, parent_item); } } int DeviceModel::rowCount(const QModelIndex& parent) const { if (parent.column() > 0) { return 0; } DeviceModelItem* parent_item = nullptr; if (!parent.isValid()) { parent_item = _root_item; } else { parent_item = static_cast(parent.internalPointer()); } return parent_item->childCount(); } int DeviceModel::columnCount(const QModelIndex& parent) const { if (!parent.isValid()) { return _root_item->columnCount(); } else { return static_cast(parent.internalPointer())->columnCount(); } } QVariant DeviceModel::data(const QModelIndex& index, int role) const { if (!index.isValid()) { return QVariant(); } if (role == Qt::TextAlignmentRole) { return headerData(index.column(), Qt::Horizontal, role); } if (role != Qt::DisplayRole) { return QVariant(); } DeviceModelItem* item = static_cast(index.internalPointer()); return item->data(index.column()); } Qt::ItemFlags DeviceModel::flags(const QModelIndex& index) const { if (!index.isValid()) { return Qt::NoItemFlags; } if (index.column() == 2) { return Qt::ItemIsEditable | QAbstractItemModel::flags(index); } else { return QAbstractItemModel::flags(index); } } void DeviceModel::insertDevice(const usbguard::Rule& device_rule) { USBGUARD_LOG(Trace) << "device_rule=" << device_rule.toString(); const uint32_t device_id = device_rule.getRuleID(); const QString device_hash = QString::fromStdString(device_rule.getHash()); const QString parent_hash = QString::fromStdString(device_rule.getParentHash()); DeviceModelItem* parent_item = _hash_map.value(parent_hash, _root_item); DeviceModelItem* child_item = new DeviceModelItem(device_rule, parent_item); layoutAboutToBeChanged(); beginInsertRows(createIndex(parent_item->row(), 0, parent_item), parent_item->childCount(), parent_item->childCount()); parent_item->appendChild(child_item); _hash_map.insert(device_hash, child_item); _id_map.insert(device_id, child_item); endInsertRows(); layoutChanged(); } void DeviceModel::updateDeviceTarget(quint32 device_id, usbguard::Rule::Target target) { USBGUARD_LOG(Trace) << "device_id=" << device_id << " target=" << usbguard::Rule::targetToString(target); DeviceModelItem* item = _id_map.value(device_id, nullptr); if (item == nullptr) { return; } if (item->getDeviceTarget() != target) { item->setDeviceTarget(target); emit dataChanged(createIndex(item->row(), 0, item), createIndex(item->row(), item->columnCount() - 1, item) #if defined(HAVE_QT5) , QVector() << Qt::DisplayRole); #else ); #endif } } void DeviceModel::updateRequestedTarget(DeviceModelItem* item, usbguard::Rule::Target target) { USBGUARD_LOG(Trace) << "item=" << item << " target=" << usbguard::Rule::targetToString(target); if (item->getRequestedTarget() != target) { item->setRequestedTarget(target); emit dataChanged(createIndex(item->row(), 0, item), createIndex(item->row(), item->columnCount() - 1, item) #if defined(HAVE_QT5) , QVector() << Qt::DisplayRole); #else ); #endif } } void DeviceModel::removeDevice(quint32 device_id) { USBGUARD_LOG(Trace) << "device_id=" << device_id; DeviceModelItem* item = _id_map.value(device_id, nullptr); if (item == nullptr) { return; } else { removeDevice(item); } } void DeviceModel::removeDevice(DeviceModelItem* item, bool notify) { USBGUARD_LOG(Trace) << "item=" << item << " notify=" << notify; DeviceModelItem* parent_item = item->parent(); if (parent_item == nullptr) { return; } if (notify) { layoutAboutToBeChanged(); beginRemoveRows(createIndex(parent_item->row(), 0, parent_item), item->row(), item->row()); } while (item->childCount() > 0) { removeDevice(item->child(0), notify); } _hash_map.remove(item->getDeviceHash()); _id_map.remove(item->getDeviceID()); if (notify) { endRemoveRows(); layoutChanged(); } parent_item->removeChild(item); delete item; } bool DeviceModel::containsDevice(quint32 device_id) const { return _id_map.count(device_id) > 0; } QModelIndex DeviceModel::createRowEditIndex(const QModelIndex& index) const { return createIndex(index.row(), 2, index.internalPointer()); } QMap DeviceModel::getModifiedDevices() const { QMap modified_map; for (auto item : _id_map) { if (item->getDeviceTarget() != item->getRequestedTarget()) { modified_map.insert(item->getDeviceID(), item->getRequestedTarget()); } } return modified_map; } void DeviceModel::clear() { USBGUARD_LOG(Trace); beginResetModel(); while (_root_item->childCount() > 0) { removeDevice(_root_item->child(0), /*notify=*/false); } endResetModel(); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/DeviceModel.h000066400000000000000000000061621325273707200201020ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Rule.hpp" #include #include #include #include class DeviceModelItem { public: DeviceModelItem(); explicit DeviceModelItem(const usbguard::Rule& device_rule, DeviceModelItem* parent); ~DeviceModelItem(); void appendChild(DeviceModelItem* child); void removeChild(DeviceModelItem* child); DeviceModelItem* child(int row); int childCount() const; int columnCount() const; QVariant data(int column); int row() const; DeviceModelItem* parent(); QString getDeviceHash() const; quint32 getDeviceID() const; usbguard::Rule::Target getRequestedTarget() const; usbguard::Rule::Target getDeviceTarget() const; void setRequestedTarget(usbguard::Rule::Target target); void setDeviceTarget(usbguard::Rule::Target target); private: QList _children; DeviceModelItem* _parent; usbguard::Rule _device_rule; usbguard::Rule::Target _requested_target; }; class DeviceModel : public QAbstractItemModel { Q_OBJECT public: explicit DeviceModel(QObject* parent = 0); ~DeviceModel(); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& index) const override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; void insertDevice(const usbguard::Rule& device_rule); void updateDeviceTarget(quint32 device_id, usbguard::Rule::Target target); void updateRequestedTarget(DeviceModelItem* item, usbguard::Rule::Target target); void removeDevice(quint32 device_id); void removeDevice(DeviceModelItem* item, bool notify = false); bool containsDevice(quint32 device_id) const; QModelIndex createRowEditIndex(const QModelIndex& index) const; QMap getModifiedDevices() const; void clear(); private: QMap _hash_map; QMap _id_map; DeviceModelItem* _root_item; }; /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/MainWindow.cpp000066400000000000000000000560241325273707200203330ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "MainWindow.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" #include "MainWindow.ui.h" #include "DeviceDialog.h" #include "usbguard/Logger.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #pragma GCC diagnostic pop MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow), _settings("USBGuard", "usbguard-applet-qt"), _device_model(this) { /* * Seed the pseudo-random generator. We use it for * randomizing the position of the DeviceDialog window. */ QTime time_rnd_seed = QTime::currentTime(); qsrand((uint)time_rnd_seed.msec()); ui->setupUi(this); ui->device_view->setModel(&_device_model); ui->device_view->setItemDelegateForColumn(2, &_target_delegate); ui->device_view->resizeColumnToContents(1); ui->device_view->setItemsExpandable(false); QObject::connect(ui->device_view->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(editDeviceListRow(QModelIndex))); QObject::connect(ui->device_view, SIGNAL(clicked(QModelIndex)), this, SLOT(editDeviceListRow(QModelIndex))); QObject::connect(ui->apply_button, SIGNAL(pressed()), this, SLOT(commitDeviceListChanges())); QObject::connect(ui->reset_button, SIGNAL(pressed()), this, SLOT(resetDeviceList())); setWindowTitle("USBGuard"); setWindowIcon(QIcon(":/usbguard-icon.svg")); setWindowState(Qt::WindowMinimized); setupSystemTray(); qRegisterMetaType("usbguard::DeviceManager::EventType"); qRegisterMetaType("usbguard::Rule::Target"); qRegisterMetaType("std::string"); QObject::connect(&_ipc_timer, SIGNAL(timeout()), this, SLOT(ipcTryConnect())); QObject::connect(this, SIGNAL(uiDevicePresenceChanged(quint32, usbguard::DeviceManager::EventType, usbguard::Rule::Target, const std::string&)), this, SLOT(handleDevicePresenceChange(quint32, usbguard::DeviceManager::EventType, usbguard::Rule::Target, const std::string&))); QObject::connect(this, SIGNAL(uiDevicePolicyChanged(quint32, usbguard::Rule::Target, usbguard::Rule::Target, const std::string&, quint32)), this, SLOT(handleDevicePolicyChange(quint32, usbguard::Rule::Target, usbguard::Rule::Target, const std::string&, quint32))); QObject::connect(this, SIGNAL(uiConnected()), this, SLOT(handleIPCConnect())); QObject::connect(this, SIGNAL(uiDisconnected()), this, SLOT(handleIPCDisconnect())); /* * loadSettings has to be called before setupSettingsWatcher! Otherwise it * will trigger the slots connected by the setupSettingsWatcher method. */ loadSettings(); setupSettingsWatcher(); _ipc_timer.setInterval(1000); _ipc_timer.start(); ui->statusBar->showMessage(tr("Inactive. No IPC connection.")); new QShortcut(QKeySequence(Qt::Key_Escape, Qt::Key_Escape), this, SLOT(showMinimized())); } void MainWindow::setupSystemTray() { systray = new QSystemTrayIcon(QIcon(":/usbguard-icon-inactive.svg"), this); systray->setToolTip("USBGuard"); auto menu = new QMenu(); auto quit_action = new QAction(tr("Quit"), systray); menu->addAction(quit_action); systray->setContextMenu(menu); QObject::connect(quit_action, SIGNAL(triggered()), qApp, SLOT(quit())); QObject::connect(systray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(switchVisibilityState(QSystemTrayIcon::ActivationReason))); QObject::connect(&_flash_timer, SIGNAL(timeout()), this, SLOT(flashStep())); systray->show(); } void MainWindow::setupSettingsWatcher() { for (QCheckBox* checkbox : ui->settings_tab->findChildren()) { QObject::connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(saveSettings())); } for (QComboBox* combobox : ui->settings_tab->findChildren()) { QObject::connect(combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(saveSettings())); } for (QSpinBox* spinbox : ui->settings_tab->findChildren()) { QObject::connect(spinbox, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); } } void MainWindow::switchVisibilityState(QSystemTrayIcon::ActivationReason reason) { USBGUARD_LOG(Trace) << "reason=" << reason; if (reason == QSystemTrayIcon::Context) { systray->contextMenu()->show(); } else { if (!isVisible() || (windowState() & Qt::WindowMinimized)) { USBGUARD_LOG(Trace) << "Showing main window"; showNormal(); stopFlashing(); } else { USBGUARD_LOG(Trace) << "Minimizing main window"; showMinimized(); } } } MainWindow::~MainWindow() { IPCClient::disconnect(); delete ui; } void MainWindow::showDeviceDialog(quint32 id, const usbguard::Rule& device_rule) { auto dialog = new DeviceDialog(id); dialog->setRejectVisible(ui->show_reject_button_checkbox->isChecked()); dialog->setDefaultDecisionTimeout(ui->decision_timeout->value()); dialog->setMaskSerialNumber(ui->mask_serial_checkbox->isChecked()); dialog->setDecisionIsPermanent(ui->decision_permanent_checkbox->isChecked()); usbguard::Rule::Target default_target = usbguard::Rule::Target::Block; switch (ui->default_decision_combobox->currentIndex()) { case 0: default_target = usbguard::Rule::Target::Allow; break; case 1: default_target = usbguard::Rule::Target::Block; break; case 2: default_target = usbguard::Rule::Target::Reject; break; default: default_target = usbguard::Rule::Target::Block; } dialog->setDefaultDecision(default_target); dialog->setName(QString::fromStdString(device_rule.getName())); dialog->setSerial(QString::fromStdString(device_rule.getSerial())); dialog->setDeviceID(QString::fromStdString(device_rule.getDeviceID().getVendorID()), QString::fromStdString(device_rule.getDeviceID().getProductID())); dialog->setInterfaceTypes(device_rule.attributeWithInterface().values()); dialog->setModal(false); dialog->setRandomizePosition(ui->randomize_position_checkbox->isChecked()); QObject::connect(dialog, SIGNAL(allowed(quint32, bool)), this, SLOT(allowDevice(quint32, bool))); QObject::connect(dialog, SIGNAL(rejected(quint32, bool)), this, SLOT(rejectDevice(quint32, bool))); QObject::connect(dialog, SIGNAL(blocked(quint32, bool)), this, SLOT(blockDevice(quint32, bool))); dialog->show(); dialog->raise(); dialog->activateWindow(); } void MainWindow::showMessage(const QString& message, bool alert, bool statusbar) { const QString mtemplate(alert ? "[%1] %2" : "[%1] %2"); const QString datetime = QDateTime::currentDateTime().toString(); const QString mmessage = QString(mtemplate).arg(datetime).arg(message); ui->messages_text->append(mmessage); if (statusbar) { const QString stemplate("[%1] %2"); const QString smessage = QString(stemplate).arg(datetime).arg(message); ui->statusBar->showMessage(smessage); } } void MainWindow::handleDevicePresenceChange(quint32 id, usbguard::DeviceManager::EventType event, usbguard::Rule::Target target, const std::string& device_rule_string) { (void)target; auto device_rule = usbguard::Rule::fromString(device_rule_string); switch (event) { case usbguard::DeviceManager::EventType::Insert: handleDeviceInsert(id, device_rule); break; case usbguard::DeviceManager::EventType::Remove: handleDeviceRemove(id, device_rule); break; case usbguard::DeviceManager::EventType::Present: case usbguard::DeviceManager::EventType::Update: default: /* NOOP */ break; } notifyDevicePresenceChanged(event, device_rule); } void MainWindow::handleDevicePolicyChange(quint32 id, usbguard::Rule::Target target_old, usbguard::Rule::Target target_new, const std::string& device_rule_string, quint32 rule_id) { (void)target_old; auto device_rule = usbguard::Rule::fromString(device_rule_string); _device_model.updateDeviceTarget(id, target_new); ui->device_view->expandAll(); notifyDevicePolicyChanged(device_rule, rule_id); if (target_new == usbguard::Rule::Target::Block && rule_id == usbguard::Rule::ImplicitID) { showDeviceDialog(id, device_rule); } } void MainWindow::notifyDevicePresenceChanged(usbguard::DeviceManager::EventType event, const usbguard::Rule& device_rule) { QString title; bool show_notification = true; QSystemTrayIcon::MessageIcon notification_icon = \ QSystemTrayIcon::Information; switch (event) { case usbguard::DeviceManager::EventType::Insert: title = tr("USB Device Inserted"); show_notification = ui->notify_inserted->isChecked(); break; case usbguard::DeviceManager::EventType::Update: title = tr("USB Device Updated"); break; case usbguard::DeviceManager::EventType::Remove: title = tr("USB Device Removed"); show_notification = ui->notify_removed->isChecked(); break; case usbguard::DeviceManager::EventType::Present: title = tr("USB Device Present"); show_notification = ui->notify_present->isChecked(); break; default: /* NOOP */ return; } notify(title, notification_icon, device_rule, show_notification); } void MainWindow::notifyDevicePolicyChanged(const usbguard::Rule& device_rule, quint32 rule_id) { (void)rule_id; QString title; bool show_notification = true; QSystemTrayIcon::MessageIcon notification_icon = \ QSystemTrayIcon::Information; switch (device_rule.getTarget()) { case usbguard::Rule::Target::Allow: title = tr("USB Device Allowed"); show_notification = ui->notify_allowed->isChecked(); break; case usbguard::Rule::Target::Block: title = tr("USB Device Blocked"); show_notification = ui->notify_blocked->isChecked(); notification_icon = QSystemTrayIcon::Warning; break; case usbguard::Rule::Target::Reject: title = tr("USB Device Rejected"); show_notification = ui->notify_rejected->isChecked(); notification_icon = QSystemTrayIcon::Warning; if (windowState() & Qt::WindowMinimized) { startFlashing(); } break; case usbguard::Rule::Target::Invalid: case usbguard::Rule::Target::Match: case usbguard::Rule::Target::Device: case usbguard::Rule::Target::Unknown: default: /* NOOP */ return; } notify(title, notification_icon, device_rule, show_notification); } void MainWindow::notify(const QString& title, QSystemTrayIcon::MessageIcon icon, const usbguard::Rule& device_rule, bool show_notification) { const QString usb_id = QString::fromStdString(device_rule.getDeviceID().toString()); const QString name = QString::fromStdString(device_rule.getName()); const QString port = QString::fromStdString(device_rule.getViaPort()); const QString message_body = QString("%1: USB ID=%2; Name=%3; Port=%4") .arg(title).arg(usb_id).arg(name).arg(port); showMessage(message_body); if (show_notification) { const QString notification_body = \ QString("USB ID: %1\n" "Name: %2\n" "Port: %3\n") .arg(usb_id).arg(name).arg(port); showNotification(icon, title, notification_body); } } void MainWindow::showNotification(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& message) { systray->showMessage(title, message, icon); } void MainWindow::notifyIPCConnected() { const QString title = tr("IPC Connection Established"); if (ui->notify_ipc->isChecked()) { showNotification(QSystemTrayIcon::Information, title, ""); } showMessage(title, /*alert=*/false, /*statusbar=*/true); } void MainWindow::notifyIPCDisconnected() { const QString title = tr("IPC Connection Lost"); if (ui->notify_ipc->isChecked()) { showNotification(QSystemTrayIcon::Warning, title, ""); } showMessage(title, /*alert=*/true, /*statusbar=*/true); } void MainWindow::startFlashing() { _flash_state = false; _flash_timer.setInterval(500); _flash_timer.start(); } void MainWindow::stopFlashing() { _flash_state = false; _flash_timer.stop(); if (IPCClient::isConnected()) { systray->setIcon(QIcon(":/usbguard-icon.svg")); } else { systray->setIcon(QIcon(":/usbguard-icon-inactive.svg")); } } void MainWindow::flashStep() { if (_flash_state) { systray->setIcon(QIcon(":/usbguard-icon-warning.svg")); systray->show(); _flash_timer.setInterval(250); _flash_state = false; } else { if (IPCClient::isConnected()) { systray->setIcon(QIcon(":/usbguard-icon.svg")); } else { systray->setIcon(QIcon(":/usbguard-icon-inactive.svg")); } systray->show(); _flash_timer.setInterval(500); _flash_state = true; } } void MainWindow::ipcTryConnect() { USBGUARD_LOG(Trace); try { IPCClient::connect(); } catch (const usbguard::Exception& ex) { showMessage(QString("Connection failed: %1") .arg(QString::fromStdString(ex.message())), /*alert=*/true); } catch (const std::exception& ex) { showMessage(QString("Connection failed: std::exception: %1") .arg(QString::fromStdString(ex.what())), /*alert=*/true); } } void MainWindow::allowDevice(quint32 id, bool permanent) { USBGUARD_LOG(Trace) << "id=" << id << " permanent=" << permanent; try { IPCClient::applyDevicePolicy(id, usbguard::Rule::Target::Allow, permanent); } catch (const usbguard::IPCException& ex) { showMessage(QString("IPC call failed: %1: %2") .arg("allowDevice") .arg(QString::fromStdString(ex.message())), /*alert=*/true); } catch (const std::exception& ex) { showMessage(QString("IPC call failed: %1: std::exception: %2") .arg("allowDevice") .arg(QString::fromStdString(ex.what())), /*alert=*/true); } } void MainWindow::blockDevice(quint32 id, bool permanent) { USBGUARD_LOG(Trace) << "id=" << id << " permanent=" << permanent; try { IPCClient::applyDevicePolicy(id, usbguard::Rule::Target::Block, permanent); } catch (const usbguard::IPCException& ex) { showMessage(QString("IPC call failed: %1: %2") .arg("blockDevice") .arg(QString::fromStdString(ex.message())), /*alert=*/true); } catch (const std::exception& ex) { showMessage(QString("IPC call failed: %1: std::exception: %2") .arg("blockDevice") .arg(QString::fromStdString(ex.what())), /*alert=*/true); } } void MainWindow::rejectDevice(quint32 id, bool permanent) { USBGUARD_LOG(Trace) << "id=" << id << " permanent=" << permanent; try { IPCClient::applyDevicePolicy(id, usbguard::Rule::Target::Reject, permanent); } catch (const usbguard::IPCException& ex) { showMessage(QString("IPC call failed: %1: %2") .arg("rejectDevice") .arg(QString::fromStdString(ex.message())), /*alert=*/true); } catch (const std::exception& ex) { showMessage(QString("IPC call failed: %1: std::exception: %2") .arg("rejectDevice") .arg(QString::fromStdString(ex.what())), /*alert=*/true); } } void MainWindow::handleIPCConnect() { USBGUARD_LOG(Trace); _ipc_timer.stop(); notifyIPCConnected(); systray->setIcon(QIcon(":/usbguard-icon.svg")); ui->device_view->setDisabled(false); loadDeviceList(); } void MainWindow::handleIPCDisconnect() { USBGUARD_LOG(Trace); IPCClient::wait(); _ipc_timer.start(); notifyIPCDisconnected(); systray->setIcon(QIcon(":/usbguard-icon-inactive.svg")); clearDeviceList(); ui->device_view->setDisabled(true); } void MainWindow::handleDeviceInsert(quint32 id, const usbguard::Rule& device_rule) { USBGUARD_LOG(Trace) << "id=" << id << " device_rule=" << device_rule.toString(); loadDeviceList(); } void MainWindow::handleDeviceRemove(quint32 id, const usbguard::Rule& device_rule) { USBGUARD_LOG(Trace) << "id=" << id << " device_rule=" << device_rule.toString(); ui->device_view->selectionModel()->clearSelection(); ui->device_view->reset(); _device_model.removeDevice(id); ui->device_view->expandAll(); } void MainWindow::loadSettings() { USBGUARD_LOG(Trace); _settings.sync(); _settings.beginGroup("Notifications"); ui->notify_inserted->setChecked(_settings.value("Inserted", true).toBool()); ui->notify_removed->setChecked(_settings.value("Removed", false).toBool()); ui->notify_allowed->setChecked(_settings.value("Allowed", true).toBool()); ui->notify_blocked->setChecked(_settings.value("Blocked", true).toBool()); ui->notify_rejected->setChecked(_settings.value("Rejected", true).toBool()); ui->notify_present->setChecked(_settings.value("Present", false).toBool()); ui->notify_ipc->setChecked(_settings.value("IPCStatus", false).toBool()); _settings.endGroup(); _settings.beginGroup("DeviceDialog"); const int default_decision_index = _settings.value("DefaultDecision", 1).toInt(); if (default_decision_index >= 0 && default_decision_index < ui->default_decision_combobox->count()) { ui->default_decision_combobox->setCurrentIndex(default_decision_index); } const int decision_method_index = _settings.value("DecisionMethod", 0).toInt(); if (decision_method_index >= 0 && decision_method_index < ui->decision_method_combobox->count()) { ui->decision_method_combobox->setCurrentIndex(decision_method_index); } ui->decision_timeout->setValue(_settings.value("DefaultDecisionTimeout", 23).toInt()); ui->decision_permanent_checkbox->setChecked(_settings.value("DecisionIsPermanent", false).toBool()); ui->show_reject_button_checkbox->setChecked(_settings.value("ShowRejectButton", false).toBool()); ui->randomize_position_checkbox->setChecked(_settings.value("RandomizeWindowPosition", true).toBool()); ui->mask_serial_checkbox->setChecked(_settings.value("MaskSerialNumber", true).toBool()); _settings.endGroup(); } void MainWindow::saveSettings() { USBGUARD_LOG(Trace); _settings.clear(); _settings.beginGroup("Notifications"); _settings.setValue("Inserted", ui->notify_inserted->isChecked()); _settings.setValue("Removed", ui->notify_removed->isChecked()); _settings.setValue("Allowed", ui->notify_allowed->isChecked()); _settings.setValue("Blocked", ui->notify_blocked->isChecked()); _settings.setValue("Rejected", ui->notify_rejected->isChecked()); _settings.setValue("Present", ui->notify_present->isChecked()); _settings.setValue("IPCStatus", ui->notify_ipc->isChecked()); _settings.endGroup(); _settings.beginGroup("DeviceDialog"); _settings.setValue("DefaultDecision", ui->default_decision_combobox->currentIndex()); _settings.setValue("DefaultDecisionTimeout", ui->decision_timeout->value()); _settings.setValue("DecisionMethod", ui->decision_method_combobox->currentIndex()); _settings.setValue("DecisionIsPermanent", ui->decision_permanent_checkbox->isChecked()); _settings.setValue("ShowRejectButton", ui->show_reject_button_checkbox->isChecked()); _settings.setValue("RandomizeWindowPosition", ui->randomize_position_checkbox->isChecked()); _settings.setValue("MaskSerialNumber", ui->mask_serial_checkbox->isChecked()); _settings.endGroup(); _settings.sync(); } void MainWindow::loadDeviceList() { USBGUARD_LOG(Trace); try { for (auto device_rule : IPCClient::listDevices()) { if (!_device_model.containsDevice(device_rule.getRuleID())) { _device_model.insertDevice(device_rule); } } ui->device_view->expandAll(); } catch (const usbguard::IPCException& ex) { showMessage(QString("IPC call failed: %1: %2") .arg("listDevices") .arg(QString::fromStdString(ex.message())), /*alert=*/true); } catch (const std::exception& ex) { showMessage(QString("IPC call failed: %1: std::exception: %2") .arg("listDevices") .arg(QString::fromStdString(ex.what())), /*alert=*/true); } } void MainWindow::editDeviceListRow(const QModelIndex& index) { ui->device_view->edit(_device_model.createRowEditIndex(index)); } void MainWindow::commitDeviceListChanges() { auto modified_map = _device_model.getModifiedDevices(); auto modified_it = modified_map.begin(); const bool permanent = ui->permanent_checkbox->isChecked(); while (modified_it != modified_map.end()) { auto id = modified_it.key(); auto target = modified_it.value(); switch (target) { case usbguard::Rule::Target::Allow: allowDevice(id, permanent); break; case usbguard::Rule::Target::Block: blockDevice(id, permanent); break; case usbguard::Rule::Target::Reject: rejectDevice(id, permanent); break; case usbguard::Rule::Target::Match: case usbguard::Rule::Target::Invalid: case usbguard::Rule::Target::Unknown: case usbguard::Rule::Target::Device: default: break; } ++modified_it; } } void MainWindow::clearDeviceList() { ui->device_view->clearSelection(); ui->device_view->reset(); _device_model.clear(); } void MainWindow::resetDeviceList() { clearDeviceList(); loadDeviceList(); ui->device_view->expandAll(); } void MainWindow::changeEvent(QEvent* e) { USBGUARD_LOG(Trace) << "e->type=" << e->type(); if (e->type() == QEvent::LanguageChange) { USBGUARD_LOG(Trace) << "QEvent::LanguageChange"; ui->retranslateUi(this); } else if (e->type() == QEvent::WindowStateChange) { USBGUARD_LOG(Trace) << "QEvent::WindowStateChange"; QWindowStateChangeEvent* event = \ static_cast(e); if (!(event->oldState() & Qt::WindowMinimized) && (windowState() & Qt::WindowMinimized)) { USBGUARD_LOG(Trace) << "Qt::WindowMinimized"; QTimer::singleShot(250, this, SLOT(hide())); } } QMainWindow::changeEvent(e); } void MainWindow::closeEvent(QCloseEvent* e) { USBGUARD_LOG(Trace) << "e=" << e; showMinimized(); e->accept(); } void MainWindow::DevicePresenceChanged(quint32 id, usbguard::DeviceManager::EventType event, usbguard::Rule::Target target, const std::string& device_rule) { emit uiDevicePresenceChanged(id, event, target, device_rule); } void MainWindow::DevicePolicyChanged(quint32 id, usbguard::Rule::Target target_old, usbguard::Rule::Target target_new, const std::string& device_rule, quint32 rule_id) { emit uiDevicePolicyChanged(id, target_old, target_new, device_rule, rule_id); } void MainWindow::IPCConnected() { emit uiConnected(); } void MainWindow::IPCDisconnected(bool exception_initiated, const usbguard::IPCException& exception) { (void)exception_initiated; (void)exception; emit uiDisconnected(); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/MainWindow.h000066400000000000000000000101561325273707200177740ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DeviceModel.h" #include "TargetDelegate.h" #include "usbguard/IPCClient.hpp" #include #include #include #include namespace Ui { class MainWindow; } class MainWindow : public QMainWindow, public usbguard::IPCClient { Q_OBJECT public: explicit MainWindow(QWidget* parent = 0); ~MainWindow(); signals: void uiDevicePresenceChanged(quint32 id, usbguard::DeviceManager::EventType event, usbguard::Rule::Target target, const std::string& device_rule); void uiDevicePolicyChanged(quint32 id, usbguard::Rule::Target target_old, usbguard::Rule::Target target_new, const std::string& device_rule, quint32 rule_id); void uiConnected(); void uiDisconnected(); protected slots: void switchVisibilityState(QSystemTrayIcon::ActivationReason reason); void flashStep(); void ipcTryConnect(); void showDeviceDialog(quint32 id, const usbguard::Rule& device_rule); void showMessage(const QString& message, bool alert = false, bool statusbar = false); void showNotification(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& message); void handleDevicePresenceChange(quint32 id, usbguard::DeviceManager::EventType event, usbguard::Rule::Target target, const std::string& device_rule); void handleDevicePolicyChange(quint32 id, usbguard::Rule::Target target_old, usbguard::Rule::Target target_new, const std::string& device_rule, quint32 rule_id); void notifyIPCConnected(); void notifyIPCDisconnected(); void notifyDevicePresenceChanged(usbguard::DeviceManager::EventType event, const usbguard::Rule& device_rule); void notifyDevicePolicyChanged(const usbguard::Rule& device_rule, quint32 rule_id); void notify(const QString& title, QSystemTrayIcon::MessageIcon icon, const usbguard::Rule& device_rule, bool show_notification); void allowDevice(quint32 id, bool permanent); void blockDevice(quint32 id, bool permanent); void rejectDevice(quint32 id, bool permanent); void handleIPCConnect(); void handleIPCDisconnect(); void handleDeviceInsert(quint32 id, const usbguard::Rule& device_rule); void handleDeviceRemove(quint32 id, const usbguard::Rule& device_rule); void loadSettings(); void saveSettings(); void loadDeviceList(); void editDeviceListRow(const QModelIndex& index); void commitDeviceListChanges(); void clearDeviceList(); void resetDeviceList(); void changeEvent(QEvent* e) override; void closeEvent(QCloseEvent* e) override; void setupSystemTray(); void setupSettingsWatcher(); void startFlashing(); void stopFlashing(); void DevicePresenceChanged(quint32 id, usbguard::DeviceManager::EventType event, usbguard::Rule::Target target, const std::string& device_rule) override; void DevicePolicyChanged(quint32 id, usbguard::Rule::Target target_old, usbguard::Rule::Target target_new, const std::string& device_rule, quint32 rule_id) override; void IPCConnected() override; void IPCDisconnected(bool exception_initiated, const usbguard::IPCException& exception) override; private: Ui::MainWindow* ui; QSystemTrayIcon* systray; QTimer _flash_timer; bool _flash_state; QTimer _ipc_timer; QSettings _settings; DeviceModel _device_model; TargetDelegate _target_delegate; }; /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/MainWindow.ui000066400000000000000000000314371325273707200201670ustar00rootroot00000000000000 MainWindow 0 0 527 391 MainWindow 0 true Devices Reset Qt::Horizontal 40 20 true Apply false false DejaVu Sans Mono QFrame::StyledPanel QFrame::Plain QAbstractItemView::CurrentChanged|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked true QAbstractItemView::SelectRows Qt::ElideMiddle 20 true true false false true Permanently Messages Monospace 8 Settings 1 0 0 198 126 Notifications Allowed Removed Rejected true Inserted true Qt::Vertical 20 40 Blocked true IPC status Present 0 0 487 246 Device Dialog Decision is permanent by default <html><head/><body><p>Reject causes the device to be logically removed from the operating system. The device might still get power from the from the bus, however, it has to be reinserted for it to get visible for the operating system again.</p></body></html> Show the Reject button Qt::Vertical 20 40 Default decision timeout (seconds) Decision method Default decision allow block reject 3600 23 Buttons Randomize position of the window true <html><head/><body><p>Starting from the end, mask every 2nd character in the displayed serial number value with an asterisk symbol.</p></body></html> Mask the serial number value true Quit usbguard-0.7.2+ds/src/GUI.Qt/SessionBlocker.cpp000066400000000000000000000024211325273707200211740ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Pino Toscano // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "SessionBlocker.h" SessionBlocker::SessionBlocker(QApplication& app) : QObject(&app) { connect(&app, SIGNAL(commitDataRequest(QSessionManager&)), SLOT(slotDisableSessionManagement(QSessionManager&))); connect(&app, SIGNAL(saveStateRequest(QSessionManager&)), SLOT(slotDisableSessionManagement(QSessionManager&))); } void SessionBlocker::slotDisableSessionManagement(QSessionManager& sm) { sm.setRestartHint(QSessionManager::RestartNever); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/SessionBlocker.h000066400000000000000000000021201325273707200206350ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Pino Toscano // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include #include class SessionBlocker : public QObject { Q_OBJECT public: explicit SessionBlocker(QApplication& app); private slots: void slotDisableSessionManagement(QSessionManager& sm); }; /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/TargetDelegate.cpp000066400000000000000000000050251325273707200211330ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "TargetDelegate.h" #include "DeviceModel.h" #include "usbguard/Rule.hpp" #include TargetDelegate::TargetDelegate(QObject* parent) : QStyledItemDelegate(parent) { } QWidget* TargetDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const { (void)option; (void)index; QComboBox* editor = new QComboBox(parent); editor->setFrame(false); editor->setAutoFillBackground(true); editor->addItem(tr("allow"), QString("allow")); editor->addItem(tr("block"), QString("block")); editor->addItem(tr("reject"), QString("reject")); return editor; } void TargetDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { QComboBox* combobox = static_cast(editor); DeviceModelItem* item = static_cast(index.internalPointer()); QString value = QString::fromStdString(usbguard::Rule::targetToString(item->getRequestedTarget())); const int value_index = combobox->findData(value); if (value_index != -1) { combobox->setCurrentIndex(value_index); } } void TargetDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { QComboBox* combobox = static_cast(editor); usbguard::Rule::Target target = usbguard::Rule::targetFromString(combobox->itemData( combobox->currentIndex()).toString().toStdString()); DeviceModelItem* item = static_cast(index.internalPointer()); static_cast(model)->updateRequestedTarget(item, target); } void TargetDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const { (void)index; editor->setGeometry(option.rect); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/TargetDelegate.h000066400000000000000000000026171325273707200206040ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include class TargetDelegate : public QStyledItemDelegate { Q_OBJECT public: TargetDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const override; }; /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/main.cpp000066400000000000000000000031171325273707200171760ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "MainWindow.h" #include "SessionBlocker.h" #include "usbguard/Logger.hpp" #include #include #include #include int main(int argc, char* argv[]) { QApplication a(argc, argv); QTranslator translator; USBGUARD_LOG(Debug) << "Loading translations for locale: " << QLocale::system().name().toStdString(); if (translator.load(QLocale::system(), /*filename=*/QString(), /*prefix=*/QString(), /*directory=*/":/translations", /*suffix=*/".qm")) { a.installTranslator(&translator); } else { USBGUARD_LOG(Debug) << "Translations not available for the current locale."; } const SessionBlocker block(a); MainWindow w; a.setQuitOnLastWindowClosed(false); return a.exec(); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/GUI.Qt/resources/000077500000000000000000000000001325273707200175565ustar00rootroot00000000000000usbguard-0.7.2+ds/src/GUI.Qt/resources/usbguard-icon-inactive.svg000066400000000000000000000151761325273707200246530ustar00rootroot00000000000000 USBGuard logo image/svg+xml USBGuard logo Daniel Kopeček USB Guard Logo Official USBGuard project logo. https://github.com/USBGuard/usbguard/ 2016 usbguard-0.7.2+ds/src/GUI.Qt/resources/usbguard-icon-warning.svg000066400000000000000000000151661325273707200245150ustar00rootroot00000000000000 USBGuard logo image/svg+xml USBGuard logo Daniel Kopeček USB Guard Logo Official USBGuard project logo. https://github.com/USBGuard/usbguard/ 2016 usbguard-0.7.2+ds/src/GUI.Qt/resources/usbguard-icon.svg000066400000000000000000000150701325273707200230440ustar00rootroot00000000000000 USBGuard logo image/svg+xml USBGuard logo Daniel Kopeček USB Guard Logo Official USBGuard project logo. https://github.com/USBGuard/usbguard/ 2016 usbguard-0.7.2+ds/src/GUI.Qt/translations/000077500000000000000000000000001325273707200202655ustar00rootroot00000000000000usbguard-0.7.2+ds/src/GUI.Qt/translations/cs_CZ.ts000066400000000000000000000314051325273707200216410ustar00rootroot00000000000000 DeviceDialog USBGuard Device Dialog USBGuard: Dialogové okno zařízení Name: Jméno: TextLabel Textový Popisek Device ID: ID zařízení: Serial #: Sériové Číslo: Make the decision permanent Zapamatovat rozhodnutí Block Blokovat Allow Povolit Reject Vysunout (Press Escape to stop the countdown) (Stistkněte Escape pro zastavení odpočtu) USB Device Inserted USB zařízení připojeno (Press Escape to close this window) (Stistkněte Escape pro zavření tohoto okna) DeviceModel ID ID M M Target Cíl USB ID USB ID Name Jméno Serial Sériové Č. Port Port Interfaces Rozhraní MainWindow MainWindow Hlavní okno Devices Zařízení Reset Resetovat Apply Aplikovat Permanently Zapamatovat Messages Zprávy Settings Nastavení Notifications Notifikace Allowed Povoleno Removed Odpojeno Rejected Odmítnuto Inserted Připojeno Blocked Blokováno IPC status Stav IPC spojení Present Přítomno Device Dialog Dialogové okno zařízení Decision is permanent by default Pamatovat rozhodnutí <html><head/><body><p>Reject causes the device to be logically removed from the operating system. The device might still get power from the from the bus, however, it has to be reinserted for it to get visible for the operating system again.</p></body></html> <html><head/><body><p></p>Volba "Odmítnout" způsobí, že zařízení bude logicky odpojeno od operačního systému. Zařízení může být stále napájeno ze sběrnice. Zařízení musí být odpojeno a znovu připojeno, pokud má být opět viditelné pro operační systém.</body></html> Show the Reject button Zobrazovat volbu "Odmítnout" Default decision timeout (seconds) Časovač implicitního rozhodnutí (sekundy) Decision method Metoda výběru rozhodnutí Default decision Implicitní rozhodnutí allow Povolit block Blokovat reject Odmítnout Buttons Tlačítka Randomize position of the window Náhodná pozice okna <html><head/><body><p>Starting from the end, mask every 2nd character in the displayed serial number value with an asterisk symbol.</p></body></html> <html><head/><body><p>Počínaje od konce, nahraď každý druhý znak sériového čísla znakem hvězdičky.</p></body></html> Mask the serial number value Maskovat sériové číslo zařízení Quit Konec Inactive. No IPC connection. Nektivní. IPC spojení nenavázáno. USB Device Inserted USB zařízení připojeno USB Device Updated USB zařízení změněno USB Device Removed USB zařízení odpojeno USB Device Present USB zařízení přítomno USB Device Allowed USB zařízení povoleno USB Device Blocked USB zařízení blokováno USB Device Rejected USB zařízení odmítnuto IPC Connection Established IPC spojení navázáno IPC Connection Lost IPC spojení ztraceno TargetDelegate allow Povolit block Blokovat reject Odmítnout usbguard-0.7.2+ds/src/GUI.Qt/translations/es_AR.ts000066400000000000000000000212371325273707200216330ustar00rootroot00000000000000 DeviceDialog USBGuard Device Dialog Dialogo con dispositivo de USBGuard Name: Nombre: TextLabel EtiquetaDeTexto Device ID: ID de dispositivo: Serial #: Nro de serie: Make the decision permanent Aplicar la decisión permanentemente Block Bloquear Allow Permitir Reject Rechazar (Press Escape to stop the countdown) (Presiona Escape para detener la cuenta regresiva) USB Device Inserted Dispositivo USB conectado (Press Escape to close this window) (Presiona Escape para cerrar esta ventana) DeviceModel ID ID M M Target Objetivo USB ID ID del USB Name Nombre Serial Serie Port Puerto Interfaces Interfaces MainWindow MainWindow VentanaPrincipal Devices Dispositivo Reset Reajustar Apply Aplicar Permanently Permanentemente Messages Mensajes Settings Configuraciones Notifications Notificaciones Allowed Permitido Removed Removido Rejected Rechazado Inserted Insertado Blocked Bloqueado IPC status Estado del IPC Present Presente Device Dialog Dialogo del dispositivo Decision is permanent by default La decisión es permanente por defecto <html><head/><body><p>Reject causes the device to be logically removed from the operating system. The device might still get power from the from the bus, however, it has to be reinserted for it to get visible for the operating system again.</p></body></html> <html><head/><body><p>Rechazar causa que el dispositivo sea removido lógicamente del sistema operativo. El dispositivo seguirá recibiendo energía del bus, igualmente, debe ser reinsertado para que vuelva a ser visible por el sistema operativo.</p></body></html> Show the Reject button Mostrar el botón de Rechazo Default decision timeout (seconds) Cuenta regresiva por defecto (segundos) Decision method Método de decisión Default decision Decisión por defecto allow permitir block bloquear reject rechazar Buttons Botones Randomize position of the window Aleatorizar la posición de la ventana <html><head/><body><p>Starting from the end, mask every 2nd character in the displayed serial number value with an asterisk symbol.</p></body></html> <html><head/><body><p>Comenzando desde el final, reemplazar cada segundo caracter del número de serie mostrado con un símbolo de asterisco.</p></body></html> Mask the serial number value Enmascarar el número de serie Quit Salir Inactive. No IPC connection. Inactivo. No hay conexiones IPC. USB Device Inserted Dispositivo USB conectado USB Device Updated Dispositivo USB actualizado USB Device Removed Dispositivo USB removido USB Device Present Dispositivo USB presente USB Device Allowed Dispositivo USB Permitido USB Device Blocked Dispositivo USB Bloqueado USB Device Rejected Dispositivo USB rechazado IPC Connection Established Conexión IPC establecida IPC Connection Lost Conexión IPC perdida TargetDelegate allow permitir block bloquear reject rechazar usbguard-0.7.2+ds/src/GUI.Qt/usbguard-applet-qt.desktop.in000066400000000000000000000004021325273707200232610ustar00rootroot00000000000000[Desktop Entry] Type=Application Name=USBGuard GenericName=USBGuard Comment=USBGuard Qt Applet TryExec=usbguard-applet-qt Exec=usbguard-applet-qt Icon=usbguard-icon Categories=System; Keywords=USB;USBGuard;Applet;Qt; X-Desktop-File-Install-Version=@VERSION@ usbguard-0.7.2+ds/src/Library/000077500000000000000000000000001325273707200161415ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Library/AllowedMatchesCondition.cpp000066400000000000000000000037271325273707200234210ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "AllowedMatchesCondition.hpp" #include "usbguard/Interface.hpp" #include "usbguard/Logger.hpp" #include "usbguard/RuleParser.hpp" namespace usbguard { AllowedMatchesCondition::AllowedMatchesCondition(const std::string& device_spec, bool negated) : RuleConditionBase("allowed-matches", device_spec, negated) { _device_match_rule = parseRuleFromString(std::string("allow ") + device_spec); _interface_ptr = nullptr; } AllowedMatchesCondition::AllowedMatchesCondition(const AllowedMatchesCondition& rhs) : RuleConditionBase(rhs) { _device_match_rule = rhs._device_match_rule; _interface_ptr = rhs._interface_ptr; } void AllowedMatchesCondition::init(Interface* const interface_ptr) { _interface_ptr = interface_ptr; } bool AllowedMatchesCondition::update(const Rule& rule) { (void)rule; if (_interface_ptr == nullptr) { return false; } auto devices = _interface_ptr->listDevices(_device_match_rule.toString()); return !devices.empty(); } RuleConditionBase* AllowedMatchesCondition::clone() const { return new AllowedMatchesCondition(*this); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/AllowedMatchesCondition.hpp000066400000000000000000000026321325273707200234200ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Rule.hpp" #include "usbguard/Typedefs.hpp" #include namespace usbguard { class AllowedMatchesCondition : public RuleConditionBase { public: AllowedMatchesCondition(const std::string& device_spec, bool negated = false); AllowedMatchesCondition(const AllowedMatchesCondition& rhs); void init(Interface* const interface_ptr); bool update(const Rule& rule); RuleConditionBase* clone() const; private: Rule _device_match_rule; Interface* _interface_ptr; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Base64.cpp000066400000000000000000000157641325273707200177060ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Base64.hpp" #include #include namespace usbguard { static const char BASE64_PADDING_CHAR = '='; static const char encode_map[64+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; static const char decode_map[80] = { /* + */ 62, /* , */ 0, /* - */ 0, /* . */ 0, /* / */ 63, /* 0 */ 52, /* 1 */ 53, /* 2 */ 54, /* 3 */ 55, /* 4 */ 56, /* 5 */ 57, /* 6 */ 58, /* 7 */ 59, /* 8 */ 60, /* 9 */ 61, /* : */ 0, /* ; */ 0, /* < */ 0, /* = */ 0, /* > */ 0, /* ? */ 0, /* @ */ 0, /* A */ 0, /* B */ 1, /* C */ 2, /* D */ 3, /* E */ 4, /* F */ 5, /* G */ 6, /* H */ 7, /* I */ 8, /* J */ 9, /* K */ 10, /* L */ 11, /* M */ 12, /* N */ 13, /* O */ 14, /* P */ 15, /* Q */ 16, /* R */ 17, /* S */ 18, /* T */ 19, /* U */ 20, /* V */ 21, /* W */ 22, /* X */ 23, /* Y */ 24, /* Z */ 25, /* [ */ 0, /* \ */ 0, /* ] */ 0, /* ^ */ 0, /* _ */ 0, /* ` */ 0, /* a */ 26, /* b */ 27, /* c */ 28, /* d */ 29, /* e */ 30, /* f */ 31, /* g */ 32, /* h */ 33, /* i */ 34, /* j */ 35, /* k */ 36, /* l */ 37, /* m */ 38, /* n */ 39, /* o */ 40, /* p */ 41, /* q */ 42, /* r */ 43, /* s */ 44, /* t */ 45, /* u */ 46, /* v */ 47, /* w */ 48, /* x */ 49, /* y */ 50, /* z */ 51 }; #define B(n) (*(in+(n))) static void __b64_enc3(const uint8_t in[3], char out[4]) { out[0] = encode_map[(B(0) & 0xfc) >> 2]; out[1] = encode_map[(B(0) & 0x03) << 4 | (B(1) & 0xf0) >> 4]; out[2] = encode_map[(B(1) & 0x0f) << 2 | (B(2) & 0xc0) >> 6]; out[3] = encode_map[(B(2) & 0x3f)]; } static void __b64_enc2 (const uint8_t in[2], char out[4]) { out[0] = encode_map[(B(0) & 0xfc) >> 2]; out[1] = encode_map[(B(0) & 0x03) << 4 | (B(1) & 0xf0) >> 4]; out[2] = encode_map[(B(1) & 0x0f) << 2]; out[3] = BASE64_PADDING_CHAR; } static void __b64_enc1 (const uint8_t in, char out[4]) { out[0] = encode_map[(in & 0xfc) >> 2]; out[1] = encode_map[(in & 0x03) << 4]; out[2] = BASE64_PADDING_CHAR; out[3] = BASE64_PADDING_CHAR; } #undef B static void __check_b64_input(const char* in, const size_t count) { bool valid = true; for (size_t i = 0; i < count; ++i) { char c = in[i]; if (c < '+' || c > 'z') { valid = false; break; } if (c > 'Z' && c < 'a') { valid = false; break; } if (c > '9' && c < 'A') { valid = false; break; } if (c > '+' && c < '/') { valid = false; break; } } if (!valid) { throw std::runtime_error("Invalid base64 input"); } } #define B(n) ((*(in+(n)) - '+') % (sizeof decode_map / sizeof(decode_map[0]))) static void __b64_dec4 (const char in[4], uint8_t out[3]) { __check_b64_input(in, 4); out[0] = decode_map[B(0)] << 2 | ((decode_map[B(1)] & 0x30) >> 4); out[1] = ((decode_map[B(1)] & 0x0f) << 4) | ((decode_map[B(2)] & 0x3c) >> 2); out[2] = ((decode_map[B(2)] & 0x03) << 6) | decode_map[B(3)]; } static void __b64_dec3 (const char in[3], uint8_t out[2]) { __check_b64_input(in, 3); out[0] = decode_map[B(0)] << 2 | ((decode_map[B(1)] & 0x30) >> 4); out[1] = ((decode_map[B(1)] & 0x0f) << 4) | ((decode_map[B(2)] & 0x3c) >> 2); } static void __b64_dec2 (const char in[2], uint8_t out[1]) { __check_b64_input(in, 2); out[0] = (decode_map[B(0)] << 2) | ((decode_map[B(1)] >> 4) & 0x03); } #undef B std::string base64Encode (const uint8_t* const data, const size_t size) { if (size == 0 || data == nullptr) { throw std::runtime_error("base64encode: invalid input"); } const size_t encoded_size = base64EncodedSize(size); const uint8_t remainder = size % 3; const size_t enc3_count = (size - remainder) / 3; std::string result(encoded_size, 0); char* const buffer = &result[0]; size_t i = 0; for (; i < enc3_count; ++i) { __b64_enc3 (data + (i * 3), buffer + (i * 4)); } switch (remainder) { case 2: __b64_enc2 (data + (i * 3), buffer + (i * 4)); break; case 1: __b64_enc1 (*(data + (i * 3)), buffer + (i * 4)); break; case 0: break; default: throw std::runtime_error("base64Encode: unexpected remainder value"); } return result; } std::string base64Decode(const char* const data, const size_t size) { if (size == 0 || (size % 4) != 0) { throw std::runtime_error("base64Decode: invalid input"); } const size_t decoded_size = base64DecodedSize(size); size_t dec4_count = size / 4; uint8_t padding = 0; if (data[size - 1] == BASE64_PADDING_CHAR) { if (data[size - 2] == BASE64_PADDING_CHAR) { padding = 2; } else { padding = 1; } --dec4_count; } std::string result(decoded_size, 0); uint8_t* const buffer = reinterpret_cast(&result[0]); size_t i = 0; for (; i < dec4_count; ++i) { __b64_dec4 (data + (i * 4), buffer + (i * 3)); } switch (padding) { case 2: __b64_dec2 (data + (i * 4), buffer + (i * 3)); result.resize(3 * i + 1); break; case 1: __b64_dec3 (data + (i * 4), buffer + (i * 3)); result.resize(3 * i + 2); break; case 0: result.resize(3 * i); break; default: throw std::runtime_error("base64Device: unexpected padding value"); } return result; } size_t base64EncodedSize(const size_t decoded_size) { return (decoded_size / 3 * 4) + ((decoded_size % 3) == 0 ? 0 : 4); } size_t base64DecodedSize(const size_t encoded_size) { return (encoded_size / 4 * 3) + (encoded_size % 4); } std::string base64Encode(const std::string& value) { return base64Encode(reinterpret_cast(value.c_str()), value.size()); } std::string base64Decode(const std::string& value) { return base64Decode(value.c_str(), value.size()); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Base64.hpp000066400000000000000000000025001325273707200176730ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include namespace usbguard { size_t base64EncodedSize(size_t decoded_size); size_t base64DecodedSize(size_t encoded_size); std::string base64Encode(const std::string& value); std::string base64Encode(const uint8_t* buffer, size_t buflen); std::string base64Decode(const std::string& value); size_t base64Decode(const std::string& value, void* buffer, size_t buflen); std::string base64Decode(const char* const data, const size_t size); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/ConfigFilePrivate.cpp000066400000000000000000000103751325273707200222130ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "ConfigFilePrivate.hpp" #include "KeyValueParser.hpp" #include "Common/Utility.hpp" #include "usbguard/Exception.hpp" #include "usbguard/Logger.hpp" #include #include #include #include namespace usbguard { ConfigFilePrivate::ConfigFilePrivate(ConfigFile& p_instance, const std::vector& known_names) : _p_instance(p_instance), _known_names(known_names) { (void)_p_instance; _dirty = false; _readonly = false; } ConfigFilePrivate::~ConfigFilePrivate() { close(); } void ConfigFilePrivate::open(const std::string& path, bool readonly) { _readonly = readonly; if (_readonly) { _stream.open(path, std::ios::in); } else { _stream.open(path, std::ios::in|std::ios::out); } if (!_stream.is_open()) { throw Exception("Configuration", path, "unable to open the configuration file"); } parse(); } void ConfigFilePrivate::write() { if (!_stream.is_open()) { throw USBGUARD_BUG("ConfigFilePrivate::write: write() before open()"); } if (_readonly) { throw USBGUARD_BUG("ConfigFilePrivate::write: not applicable in read-only mode"); } if (_dirty) { /* Update _lines */ for (auto const& map_entry : _settings) { const NVPair& setting = map_entry.second; _lines[setting.line_number - 1] = setting.name + "=" + setting.value; } } _stream.clear(); _stream.seekp(0); for (auto const& line : _lines) { _stream << line << std::endl; if (!_stream.good()) { throw Exception("Configuration", "write", "failed to write configuration to disk"); } } _stream.flush(); _dirty = false; } void ConfigFilePrivate::close() { if (_stream) { if (_dirty && !_readonly) { write(); } _stream.close(); } } const std::string& ConfigFilePrivate::getSettingValue(const std::string& name) const { const NVPair& setting = _settings.at(name); return setting.value; } void ConfigFilePrivate::setSettingValue(const std::string& name, std::string& value) { NVPair& setting = _settings.at(name); setting.value = value; _dirty = true; } bool ConfigFilePrivate::hasSettingValue(const std::string& name) const { return (_settings.count(name) != 0); } void ConfigFilePrivate::parse() { std::string config_line; size_t config_line_number = 0; KeyValueParser kvparser(_known_names, "=", /*case_sensitive?*/true); while (std::getline(_stream, config_line)) { ++config_line_number; _lines.push_back(config_line); if ((config_line.size() < 1) || (config_line[0] == '#')) { continue; } auto p = kvparser.parseLine(config_line); NVPair& setting = _settings[p.first]; setting.name = p.first; setting.value = p.second; setting.line_number = config_line_number; USBGUARD_LOG(Debug) << "Parsed: " << p.first << "=" << p.second; } } bool ConfigFilePrivate::checkNVPair(const std::string& name, const std::string& value) const { (void)value; /* TODO */ /* * If the known_names array is empty, then consider * any name-value pair as known. */ if (_known_names.empty()) { return true; } for (auto const& known_name : _known_names) { if (name == known_name) { return true; } } return false; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/ConfigFilePrivate.hpp000066400000000000000000000036661325273707200222250ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/ConfigFile.hpp" #include "KeyValueParser.hpp" #include #include #include #include #include namespace usbguard { class ConfigFilePrivate { public: ConfigFilePrivate(ConfigFile& p_instance, const std::vector& known_names); ~ConfigFilePrivate(); void open(const std::string& path, bool readonly); void write(); void close(); void setSettingValue(const std::string& name, std::string& value); bool hasSettingValue(const std::string& name) const; const std::string& getSettingValue(const std::string& name) const; protected: void parse(); bool checkNVPair(const std::string& name, const std::string& value) const; private: struct NVPair { std::string name; std::string value; size_t line_number; }; ConfigFile& _p_instance; std::string _path; std::fstream _stream; std::vector _lines; std::map _settings; bool _dirty; bool _readonly; std::vector _known_names; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/DeviceManagerPrivate.cpp000066400000000000000000000075641325273707200227060ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DeviceManagerPrivate.hpp" #include "usbguard/DeviceManagerHooks.hpp" #include "usbguard/Exception.hpp" #include "usbguard/Logger.hpp" namespace usbguard { DeviceManagerPrivate::DeviceManagerPrivate(DeviceManager& p_instance, DeviceManagerHooks& hooks) : _p_instance(p_instance), _hooks(hooks) { setRestoreControllerDeviceState(false); } DeviceManagerPrivate::DeviceManagerPrivate(DeviceManager& p_instance, const DeviceManagerPrivate& rhs) : _p_instance(p_instance), _hooks(rhs._hooks) { *this = rhs; } const DeviceManagerPrivate& DeviceManagerPrivate::operator=(const DeviceManagerPrivate& rhs) { std::unique_lock local_device_map_lock(_device_map_mutex); std::unique_lock remote_device_map_lock(rhs._device_map_mutex); _device_map = rhs._device_map; return *this; } void DeviceManagerPrivate::setRestoreControllerDeviceState(bool enabled) { _restore_controller_device_state = enabled; } bool DeviceManagerPrivate::getRestoreControllerDeviceState() const { return _restore_controller_device_state; } void DeviceManagerPrivate::insertDevice(std::shared_ptr device) { USBGUARD_LOG(Trace) << "device_ptr=" << device.get(); std::unique_lock device_map_lock(_device_map_mutex); const uint32_t id = _hooks.dmHookAssignID(); USBGUARD_LOG(Debug) << "id=" << id; device->setID(id); _device_map[id] = device; } std::shared_ptr DeviceManagerPrivate::removeDevice(uint32_t id) { USBGUARD_LOG(Trace) << "entry: id=" << id; std::unique_lock device_map_lock(_device_map_mutex); auto it = _device_map.find(id); if (it == _device_map.end()) { throw Exception("Device remove", "device id", "id doesn't exist"); } std::shared_ptr device = it->second; _device_map.erase(it); USBGUARD_LOG(Trace) << "return: device_ptr=" << device.get(); return device; } std::vector> DeviceManagerPrivate::getDeviceList() { std::unique_lock device_map_lock(_device_map_mutex); std::vector> devices; for (auto& map_entry : _device_map) { devices.push_back(map_entry.second); } return devices; } std::shared_ptr DeviceManagerPrivate::getDevice(uint32_t id) { USBGUARD_LOG(Trace) << "id=" << id; std::unique_lock device_map_lock(_device_map_mutex); try { return _device_map.at(id); } catch (...) { throw Exception("Device lookup", "device id", "id doesn't exist"); } } void DeviceManagerPrivate::DeviceEvent(DeviceManager::EventType event, std::shared_ptr device) { USBGUARD_LOG(Trace) << "event=" << DeviceManager::eventTypeToString(event) << "device_ptr=" << device.get(); _hooks.dmHookDeviceEvent(event, device); } void DeviceManagerPrivate::DeviceException(const std::string& message) { USBGUARD_LOG(Trace) << "message=" << message; _hooks.dmHookDeviceException(message); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/DeviceManagerPrivate.hpp000066400000000000000000000042621325273707200227030ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Device.hpp" #include "usbguard/DeviceManager.hpp" #include "usbguard/RuleSet.hpp" #include "usbguard/Typedefs.hpp" #include #include #include namespace usbguard { class DeviceManagerHooks; class DeviceManagerPrivate { public: DeviceManagerPrivate(DeviceManager& p_instance, DeviceManagerHooks& hooks); DeviceManagerPrivate(DeviceManager& p_instance, const DeviceManagerPrivate& rhs); const DeviceManagerPrivate& operator=(const DeviceManagerPrivate& rhs); void setRestoreControllerDeviceState(bool enabled); bool getRestoreControllerDeviceState() const; void insertDevice(std::shared_ptr device); std::shared_ptr removeDevice(uint32_t id); /* Returns a copy of the list of active USB devices */ std::vector> getDeviceList(); std::shared_ptr getDevice(uint32_t id); std::mutex& refDeviceMapMutex(); /* Call Daemon instance hooks */ void DeviceEvent(DeviceManager::EventType event, std::shared_ptr device); void DeviceException(const std::string& message); private: DeviceManager& _p_instance; DeviceManagerHooks& _hooks; mutable std::mutex _device_map_mutex; std::map> _device_map; bool _restore_controller_device_state; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/DevicePrivate.cpp000066400000000000000000000215551325273707200214070ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DevicePrivate.hpp" #include "Hash.hpp" #include "Common/Utility.hpp" #include "usbguard/DeviceManager.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include namespace usbguard { DevicePrivate::DevicePrivate(Device& p_instance, DeviceManager& manager) : //_p_instance(p_instance), _manager(manager) { (void)p_instance; _id = Rule::DefaultID; _parent_id = Rule::RootID; _target = Rule::Target::Unknown; } DevicePrivate::DevicePrivate(Device& p_instance, const DevicePrivate& rhs) : //_p_instance(p_instance), _manager(rhs._manager) { (void)p_instance; *this = rhs; } const DevicePrivate& DevicePrivate::operator=(const DevicePrivate& rhs) { _id = rhs._id; _parent_id = rhs._parent_id; _target = rhs._target; _name = rhs._name; _device_id = rhs._device_id; _serial_number = rhs._serial_number; _port = rhs._port; _interface_types = rhs._interface_types; _hash_base64 = rhs._hash_base64; return *this; } DeviceManager& DevicePrivate::manager() const { return _manager; } std::mutex& DevicePrivate::refDeviceMutex() { return _mutex; } std::shared_ptr DevicePrivate::getDeviceRule(const bool with_port, const bool with_parent_hash, const bool match_rule) { USBGUARD_LOG(Trace) << "entry: " << " with_port=" << with_port << " with_parent_hash=" << with_parent_hash << " match_rule=" << match_rule; std::shared_ptr device_rule = std::make_shared(); std::unique_lock device_lock(refDeviceMutex()); device_rule->setRuleID(_id); if (match_rule) { device_rule->setTarget(Rule::Target::Match); } else { device_rule->setTarget(_target); } device_rule->setDeviceID(_device_id); device_rule->setSerial(_serial_number); if (with_port) { device_rule->setViaPort(_port); } device_rule->attributeWithInterface().set(getInterfaceTypes(), Rule::SetOperator::Equals); device_rule->setName(_name); device_rule->setHash(getHash()); if (with_parent_hash) { if (!_parent_hash.empty()) { device_rule->setParentHash(_parent_hash); } else { if (_parent_id != Rule::RootID) { auto parent_device = manager().getDevice(_parent_id); device_rule->setParentHash(parent_device->getHash()); } else { throw std::runtime_error("Cannot generate device rule: parent hash value not available"); } } } USBGUARD_LOG(Trace) << "return:" << " device_rule=" << device_rule->toString(); return device_rule; } std::string DevicePrivate::hashString(const std::string& value) const { Hash hash; hash.update(value); return hash.getBase64(); } void DevicePrivate::initializeHash() { Hash hash; const std::string vendor_id = _device_id.getVendorID(); const std::string product_id = _device_id.getProductID(); if (vendor_id.empty() || product_id.empty()) { throw Exception("Device hash initialization", numberToString(getID()), "vendor and/or product id values not available"); } /* * Hash name, device id and serial number fields. */ for (const std::string& field : { _name, vendor_id, product_id, _serial_number }) { hash.update(field); } _hash = std::move(hash); } void DevicePrivate::updateHash(std::istream& descriptor_stream, const size_t expected_size) { Hash hash(_hash); if (hash.update(descriptor_stream) != expected_size) { throw Exception("Device hash update", numberToString(getID()), "descriptor stream returned less data than expected"); } _hash = std::move(hash); } void DevicePrivate::updateHash(const void* const ptr, size_t size) { Hash hash(_hash); if (hash.update(ptr, size) != size) { throw Exception("Device hash update", numberToString(getID()), "hashed less data than expected"); } _hash = std::move(hash); } std::string DevicePrivate::finalizeHash() { _hash_base64 = _hash.getBase64(); return _hash_base64; } const std::string& DevicePrivate::getHash() const { if (_hash_base64.empty()) { throw USBGUARD_BUG("Accessing unfinalized device hash value"); } return _hash_base64; } void DevicePrivate::setParentHash(const std::string& hash) { _parent_hash = hash; } void DevicePrivate::setID(uint32_t id) { _id = id; } uint32_t DevicePrivate::getID() const { return _id; } void DevicePrivate::setParentID(uint32_t id) { _parent_id = id; } uint32_t DevicePrivate::getParentID() const { return _parent_id; } void DevicePrivate::setTarget(Rule::Target target) { _target = target; } Rule::Target DevicePrivate::getTarget() const { return _target; } void DevicePrivate::setName(const std::string& name) { if (name.size() > USB_GENERIC_STRING_MAX_LENGTH) { throw Exception("DevicePrivate::setName", numberToString(getID()), "name string size out-of-range"); } _name = name; } const std::string& DevicePrivate::getName() const { return _name; } void DevicePrivate::setDeviceID(const USBDeviceID& device_id) { _device_id = device_id; } const USBDeviceID& DevicePrivate::getDeviceID() const { return _device_id; } void DevicePrivate::setPort(const std::string& port) { if (port.size() > USB_PORT_STRING_MAX_LENGTH) { throw std::runtime_error("device port string size out of range"); } _port = port; } const std::string& DevicePrivate::getPort() const { return _port; } void DevicePrivate::setSerial(const std::string& serial_number) { if (serial_number.size() > USB_GENERIC_STRING_MAX_LENGTH) { throw std::runtime_error("device serial number string size out of range"); } _serial_number = serial_number; } const std::string& DevicePrivate::getSerial() const { return _serial_number; } std::vector& DevicePrivate::refMutableInterfaceTypes() { return _interface_types; } const std::vector& DevicePrivate::getInterfaceTypes() const { return _interface_types; } void DevicePrivate::loadDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { (void)descriptor; if (parser->haveDescriptor(USB_DESCRIPTOR_TYPE_DEVICE)) { throw std::runtime_error("Invalid descriptor data: multiple device descriptors for one device"); } _interface_types.clear(); return; } void DevicePrivate::loadConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { (void)descriptor; if (!parser->haveDescriptor(USB_DESCRIPTOR_TYPE_DEVICE)) { throw std::runtime_error("Invalid descriptor data: missing parent device descriptor while loading configuration"); } /* * Clean the descriptor state. There shouldn't be any Interface or Endpoint * descriptors while loading. */ parser->delDescriptor(USB_DESCRIPTOR_TYPE_INTERFACE); parser->delDescriptor(USB_DESCRIPTOR_TYPE_ENDPOINT); return; } void DevicePrivate::loadInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { if (!parser->haveDescriptor(USB_DESCRIPTOR_TYPE_CONFIGURATION)) { throw std::runtime_error("Invalid descriptor data: missing parent configuration descriptor while loading interface"); } const USBInterfaceType interface_type(*reinterpret_cast(descriptor)); _interface_types.push_back(interface_type); return; } void DevicePrivate::loadEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { (void)descriptor; /* * WARNING: This method can receive USB descriptors of two sizes! (endpoint, audio endpoint) */ if (!parser->haveDescriptor(USB_DESCRIPTOR_TYPE_INTERFACE)) { throw std::runtime_error("Invalid descriptor data: missing parent interface descriptor while loading endpoint"); } return; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/DevicePrivate.hpp000066400000000000000000000064511325273707200214120ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Hash.hpp" #include "usbguard/Device.hpp" #include "usbguard/Rule.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/USB.hpp" #include #include #include #include #include namespace usbguard { class DevicePrivate { public: DevicePrivate(Device& p_instance, DeviceManager& manager); DevicePrivate(Device& p_instance, const DevicePrivate& rhs); const DevicePrivate& operator=(const DevicePrivate& rhs); DeviceManager& manager() const; std::mutex& refDeviceMutex(); std::shared_ptr getDeviceRule(bool with_port = true, bool with_parent_hash = true, bool match_rule = false); std::string hashString(const std::string& value) const; void initializeHash(); void updateHash(const void* const ptr, size_t size); void updateHash(std::istream& descriptor_stream, size_t expected_size); std::string finalizeHash(); const std::string& getHash() const; void setParentHash(const std::string& hash); void setID(uint32_t id); uint32_t getID() const; void setParentID(uint32_t id); uint32_t getParentID() const; void setTarget(Rule::Target target); Rule::Target getTarget() const; void setName(const std::string& name); const std::string& getName() const; void setDeviceID(const USBDeviceID& device_id); const USBDeviceID& getDeviceID() const; void setPort(const std::string& port); const std::string& getPort() const; void setSerial(const std::string& serial_number); const std::string& getSerial() const; std::vector& refMutableInterfaceTypes(); const std::vector& getInterfaceTypes() const; void loadDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadEndpointDescriptor(USBDescriptorParser*, const USBDescriptor* descriptor); private: //Device& _p_instance; DeviceManager& _manager; std::mutex _mutex; uint32_t _id; uint32_t _parent_id; std::string _parent_hash; Rule::Target _target; std::string _name; USBDeviceID _device_id; std::string _serial_number; std::string _port; std::vector _interface_types; std::string _hash_base64; Hash _hash; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/FixedStateCondition.cpp000066400000000000000000000026601325273707200225600ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "FixedStateCondition.hpp" #include "usbguard/RuleParser.hpp" namespace usbguard { FixedStateCondition::FixedStateCondition(bool state, bool negated) : RuleConditionBase(state ? "true" : "false", negated), _state(state) { } FixedStateCondition::FixedStateCondition(const FixedStateCondition& rhs) : RuleConditionBase(rhs), _state(rhs._state) { } bool FixedStateCondition::update(const Rule& rule) { (void)rule; return _state; } RuleConditionBase* FixedStateCondition::clone() const { return new FixedStateCondition(*this); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/FixedStateCondition.hpp000066400000000000000000000024171325273707200225650ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include "usbguard/Rule.hpp" #include "usbguard/RuleCondition.hpp" namespace usbguard { class FixedStateCondition : public RuleConditionBase { public: FixedStateCondition(bool state, bool negated = false); FixedStateCondition(const FixedStateCondition& rhs); bool update(const Rule& rule); RuleConditionBase* clone() const; private: const bool _state; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Hash.cpp000066400000000000000000000073411325273707200175350ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Hash.hpp" #include "Base64.hpp" #include "Common/Utility.hpp" #include "usbguard/Exception.hpp" namespace usbguard { Hash::Hash() { /* * Initialize the hash state. * * TODO: Use a hash salt from the configuration. */ #if defined(USBGUARD_USE_LIBSODIUM) crypto_hash_sha256_init(&_state); #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_open(&_state, GCRY_MD_SHA256, 0); #endif } Hash::Hash(const Hash& rhs) { release(); #if defined(USBGUARD_USE_LIBSODIUM) _state = rhs._state; #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_copy(&_state, rhs._state); #endif } Hash::Hash(Hash&& rhs) { release(); #if defined(USBGUARD_USE_LIBSODIUM) _state = rhs._state; memset(&rhs._state, 0, sizeof _state); #endif #if defined(USBGUARD_USE_LIBGCRYPT) _state = rhs._state; rhs._state = nullptr; #endif } Hash& Hash::operator=(Hash&& rhs) { release(); #if defined(USBGUARD_USE_LIBSODIUM) _state = rhs._state; memset(&rhs._state, 0, sizeof _state); #endif #if defined(USBGUARD_USE_LIBGCRYPT) _state = rhs._state; rhs._state = nullptr; #endif return *this; } Hash::~Hash() { release(); } void Hash::release() { #if defined(USBGUARD_USE_LIBSODIUM) memset(&_state, 0, sizeof _state); #endif #if defined(USBGUARD_USE_LIBGCRYPT) if (_state != nullptr) { gcry_md_close(_state); } #endif } size_t Hash::update(const std::string& value) { return update(value.c_str(), value.size()); } size_t Hash::update(const void* const ptr, const size_t size) { #if defined(USBGUARD_USE_LIBSODIUM) crypto_hash_sha256_update(&_state, reinterpret_cast(ptr), size); #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_write(_state, ptr, size); #endif return size; } size_t Hash::update(std::istream& stream) { size_t size_hashed = 0; while (stream.good()) { uint8_t buffer[4096]; size_t buflen = 0; stream.read(reinterpret_cast(buffer), sizeof buffer); buflen = stream.gcount(); if (buflen > 0) { #if defined(USBGUARD_USE_LIBSODIUM) crypto_hash_sha256_update(&_state, buffer, buflen); #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_write(_state, buffer, buflen); #endif size_hashed += buflen; } } return size_hashed; } std::string Hash::getBase64() { #if defined(USBGUARD_USE_LIBSODIUM) uint8_t hash_binary[crypto_hash_sha256_BYTES]; crypto_hash_sha256_final(&_state, hash_binary); const uint8_t* const hash_buffer = hash_binary; const size_t hash_buflen = sizeof hash_binary; #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_final(_state); const size_t hash_buflen = gcry_md_get_algo_dlen(GCRY_MD_SHA256); const uint8_t* const hash_buffer = gcry_md_read(_state, GCRY_MD_SHA256); #endif return base64Encode(hash_buffer, hash_buflen); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Hash.hpp000066400000000000000000000032001325273707200175300ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include #include #include #if defined(USBGUARD_USE_LIBSODIUM) #include #elif defined(USBGUARD_USE_LIBGCRYPT) #include #else #error "Don't know which crypto library to use." #endif namespace usbguard { class Hash { public: Hash(); Hash(const Hash& rhs); Hash(Hash&& rhs); Hash& operator=(Hash&& rhs); ~Hash(); size_t update(const std::string& value); size_t update(const void* ptr, size_t size); size_t update(std::istream& stream); std::string getBase64(); private: void release(); #if defined(USBGUARD_USE_LIBSODIUM) crypto_hash_sha256_state _state; #endif #if defined(USBGUARD_USE_LIBGCRYPT) gcry_md_hd_t _state {nullptr}; #endif }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPC/000077500000000000000000000000001325273707200165545ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Library/IPC/Devices.proto000066400000000000000000000020531325273707200212230ustar00rootroot00000000000000package usbguard.IPC; import "Message.proto"; import "Rule.proto"; message listDevicesRequest { required string query = 1; } message listDevicesResponse { repeated Rule devices = 1; } message listDevices { required MessageHeader header = 1; required listDevicesRequest request = 2; optional listDevicesResponse response = 3; } message applyDevicePolicyRequest { required uint32 id = 1; required uint32 target = 2; required bool permanent = 3; } message applyDevicePolicyResponse { required uint32 rule_id = 2; } message applyDevicePolicy { required MessageHeader header = 1; required applyDevicePolicyRequest request = 2; optional applyDevicePolicyResponse response = 3; } message DevicePresenceChangedSignal { required uint32 id = 1; required uint32 event = 2; required uint32 target = 3; required string device_rule = 4; } message DevicePolicyChangedSignal { required uint32 id = 1; required uint32 target_old = 2; required uint32 target_new = 3; required string device_rule = 4; required uint32 rule_id = 5; } usbguard-0.7.2+ds/src/Library/IPC/Exception.proto000066400000000000000000000002521325273707200215760ustar00rootroot00000000000000package usbguard.IPC; message Exception { required string context = 1; required string object = 2; required string reason = 3; optional uint32 request_id = 4; } usbguard-0.7.2+ds/src/Library/IPC/Message.proto000066400000000000000000000001131325273707200212200ustar00rootroot00000000000000package usbguard.IPC; message MessageHeader { required uint64 id = 1; } usbguard-0.7.2+ds/src/Library/IPC/Parameter.proto000066400000000000000000000011701325273707200215600ustar00rootroot00000000000000package usbguard.IPC; import "Message.proto"; message setParameterRequest { required string name = 1; required string value = 2; } message setParameterResponse { required string value = 1; } message setParameter { required MessageHeader header = 1; required setParameterRequest request = 2; optional setParameterResponse response = 3; } message getParameterRequest { required string name = 1; } message getParameterResponse { required string value = 1; } message getParameter { required MessageHeader header = 1; required getParameterRequest request = 2; optional getParameterResponse response = 3; } usbguard-0.7.2+ds/src/Library/IPC/Policy.proto000066400000000000000000000016421325273707200211030ustar00rootroot00000000000000package usbguard.IPC; import "Message.proto"; import "Rule.proto"; message listRulesRequest { required string query = 1; } message listRulesResponse { required uint32 default_target = 1; repeated Rule rules = 2; } message listRules { required MessageHeader header = 1; required listRulesRequest request = 2; optional listRulesResponse response = 3; } message appendRuleRequest { required string rule = 1; required uint32 parent_id = 2; } message appendRuleResponse { required uint32 id = 1; } message appendRule { required MessageHeader header = 1; required appendRuleRequest request = 2; optional appendRuleResponse response = 3; } message removeRuleRequest { required uint32 id = 1; } message removeRuleResponse { required uint32 id = 1; } message removeRule { required MessageHeader header = 1; required removeRuleRequest request = 2; optional removeRuleResponse response = 3; } usbguard-0.7.2+ds/src/Library/IPC/Rule.proto000066400000000000000000000001361325273707200205500ustar00rootroot00000000000000package usbguard.IPC; message Rule { required uint32 id = 1; required string rule = 2; } usbguard-0.7.2+ds/src/Library/IPCClientPrivate.cpp000066400000000000000000000374311325273707200217620ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCClientPrivate.hpp" #include "IPCPrivate.hpp" #include "usbguard/Logger.hpp" #include #include #include #include namespace usbguard { int32_t IPCClientPrivate::qbPollWakeupFn(int32_t fd, int32_t revents, void* data) { USBGUARD_LOG(Trace) << "fd=" << fd << " revents=" << revents << " data=" << data; uint64_t one = 0; if (read(fd, &one, sizeof one) != sizeof one) { USBGUARD_LOG(Warning) << "IPC client: " << "Failed to read wakeup event: " << "errno=" << errno; return -1; } else { return 0; } } int32_t IPCClientPrivate::qbIPCMessageProcessFn(int32_t fd, int32_t revents, void* data) { USBGUARD_LOG(Trace) << "fd=" << fd << " revents=" << revents << " data=" << data; IPCClientPrivate* client = static_cast(data); client->processReceiveEvent(); return 0; } IPCClientPrivate::IPCClientPrivate(IPCClient& p_instance, bool connected) : _p_instance(p_instance), _thread(this, &IPCClientPrivate::thread) { _qb_conn = nullptr; _qb_fd = -1; USBGUARD_SYSCALL_THROW("IPC client initialization", (_wakeup_fd = eventfd(0, 0)) < 0); _qb_loop = qb_loop_create(); qb_loop_poll_add(_qb_loop, QB_LOOP_HIGH, _wakeup_fd, POLLIN, NULL, qbPollWakeupFn); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleMethodResponse); registerHandler(&IPCClientPrivate::handleException); registerHandler(&IPCClientPrivate::handleDevicePresenceChangedSignal); registerHandler(&IPCClientPrivate::handleDevicePolicyChangedSignal); if (connected) { try { connect(); } catch (...) { destruct(); throw; } } } void IPCClientPrivate::destruct() { USBGUARD_LOG(Trace); qb_loop_poll_del(_qb_loop, _wakeup_fd); close(_wakeup_fd); qb_loop_destroy(_qb_loop); } IPCClientPrivate::~IPCClientPrivate() { disconnect(/*do_wait=*/_thread.running()); destruct(); } void IPCClientPrivate::connect() { USBGUARD_LOG(Trace); _qb_conn = qb_ipcc_connect("usbguard", 1<<20); if (_qb_conn == nullptr) { throw ErrnoException("IPC connect", "service=usbguard", errno); } qb_ipcc_fd_get(_qb_conn, &_qb_fd); if (_qb_fd < 0) { qb_ipcc_disconnect(_qb_conn); _qb_conn = nullptr; _qb_fd = -1; throw Exception("IPC connect", "qb connection", "Bad file descriptor"); } qb_loop_poll_add(_qb_loop, QB_LOOP_HIGH, _qb_fd, POLLIN, this, qbIPCMessageProcessFn); USBGUARD_LOG(Trace) << "Starting IPC client thread"; _thread.start(); _p_instance.IPCConnected(); } void IPCClientPrivate::disconnect(bool exception_initiated, const IPCException& exception, bool do_wait) { USBGUARD_LOG(Trace) << "exception_initiated=" << exception_initiated << " exception=" << exception.message() << " do_wait=" << do_wait; USBGUARD_LOG(Trace) << "_qb_conn=" << _qb_conn << " _qb_fd=" << _qb_fd; if (_qb_conn != nullptr && _qb_fd >= 0) { qb_loop_poll_del(_qb_loop, _qb_fd); qb_ipcc_disconnect(_qb_conn); _qb_conn = nullptr; _qb_fd = -1; stop(do_wait); USBGUARD_LOG(Trace) << "Signaling IPCDisconnected"; _p_instance.IPCDisconnected(/*exception_initiated=*/true, exception); } } void IPCClientPrivate::disconnect(bool do_wait) { USBGUARD_LOG(Trace) << "do_wait=" << do_wait; const IPCException empty_exception; disconnect(/*exception_initiated=*/false, empty_exception, do_wait); } bool IPCClientPrivate::isConnected() const { return _qb_fd != -1; } void IPCClientPrivate::wait() { USBGUARD_LOG(Trace); _thread.wait(); } void IPCClientPrivate::thread() { USBGUARD_LOG(Trace) << "Entering IPC client main loop"; qb_loop_run(_qb_loop); USBGUARD_LOG(Trace) << "Leaving IPC client main loop"; } void IPCClientPrivate::wakeup() { const uint64_t one = 1; USBGUARD_SYSCALL_THROW("IPC client", write(_wakeup_fd, &one, sizeof one) != sizeof one); } void IPCClientPrivate::stop(bool do_wait) { USBGUARD_LOG(Trace) << "do_wait=" << do_wait; _thread.stop(/*do_wait=*/false); qb_loop_stop(_qb_loop); wakeup(); if (do_wait) { wait(); } } uint64_t IPCClientPrivate::generateMessageID() { static std::atomic id(1); return id++; } IPC::MessagePointer IPCClientPrivate::qbIPCSendRecvMessage(IPC::MessageType& message) { USBGUARD_LOG(Trace) << "message=" << &message; if (!isConnected()) { throw Exception("IPC send/recv", "connection", "Not connected"); } const uint64_t id = generateMessageID(); IPC::setMessageHeaderID(message, id); std::string payload; message.SerializeToString(&payload); struct qb_ipc_request_header hdr; hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message.GetTypeName()); hdr.size = sizeof hdr + payload.size(); struct iovec iov[2]; iov[0].iov_base = &hdr; iov[0].iov_len = sizeof hdr; iov[1].iov_base = (void*)payload.data(); iov[1].iov_len = payload.size(); /* Lock the return value slot map */ std::unique_lock return_map_lock(_return_mutex); /* * Create the promise and future objects. * The promise will be fullfiled by the message * processing handlers after they process * a reply from the server. */ auto& promise = _return_map[id]; auto future = promise.get_future(); qb_ipcc_sendv(_qb_conn, iov, 2); /* * Unlock the return value map so that the message * processing handler aren't blocked. */ return_map_lock.unlock(); /* Wait for some time for the reply to be received */ const std::chrono::milliseconds timeout_ms(5*1000); /* TODO: make this configurable */ const bool timed_out = \ future.wait_for(timeout_ms) == std::future_status::timeout; IPC::MessagePointer response; if (!timed_out) { response = future.get(); } /* Remove the slot from the return value slot map */ return_map_lock.lock(); _return_map.erase(id); return_map_lock.unlock(); if (timed_out) { throw Exception("IPC send/recv", "connection", "Timed out while waiting for IPC reply"); } /* * We might have caused an exception. Check whether * that's the case and if true, throw it here. */ if (IPC::isExceptionMessage(response)) { throw IPC::IPCExceptionFromMessage(response); } return response; } void IPCClientPrivate::processReceiveEvent() { USBGUARD_LOG(Trace); try { const std::string buffer = receive(); process(buffer); } catch (const IPCException& exception) { disconnect(/*exception_initiated=*/true, exception); } catch (const Exception& exception) { const IPCException ipc_exception(exception); disconnect(/*exception_initiated=*/true, ipc_exception); } catch (const std::exception& exception) { const IPCException ipc_exception("IPC receive event", "", exception.what()); disconnect(/*exception_initiated=*/true, ipc_exception); } catch (...) { const IPCException ipc_exception("IPC receive event", "BUG", "Unknown exception"); disconnect(/*exception_initiated=*/true, ipc_exception); } } std::string IPCClientPrivate::receive() { USBGUARD_LOG(Trace); const size_t buffer_size_max = 1<<20; std::string buffer(buffer_size_max, 0); const ssize_t recv_size = \ qb_ipcc_event_recv(_qb_conn, &buffer[0], /*msg_len=*/buffer_size_max, /*ms_timeout=*/500); if (recv_size < 0) { disconnect(); throw Exception("IPC receive", "connection", "Receive error"); } if (recv_size < (ssize_t)sizeof(struct qb_ipc_response_header)) { disconnect(); throw Exception("IPC receive", "message", "Message too small"); } USBGUARD_LOG(Debug) << "Received " << recv_size << " bytes"; buffer.resize((size_t)recv_size); return buffer; } void IPCClientPrivate::process(const std::string& buffer) { USBGUARD_LOG(Trace) << "buffer=" << &buffer; const struct qb_ipc_response_header* hdr = \ reinterpret_cast(buffer.data()); if ((size_t)hdr->size != buffer.size()) { disconnect(); throw Exception("IPC receive", "message header", "Invalid size value"); } if (hdr->id < QB_IPC_MSG_USER_START) { disconnect(); throw Exception("IPC receive", "message header", "Invalid payload type value"); } const uint32_t payload_type = hdr->id - QB_IPC_MSG_USER_START; const std::string payload = buffer.substr(sizeof(struct qb_ipc_response_header)); handleIPCPayload(payload_type, payload); } void IPCClientPrivate::handleIPCPayload(const uint32_t payload_type, const std::string& payload) { USBGUARD_LOG(Trace) << "payload_type=" << payload_type << " payload=" << &payload; try { auto& handler = _handlers.at(payload_type); auto message = handler.payloadToMessage(payload); handler.run(message); } catch (const IPCException& exception) { throw; } catch (...) { throw Exception("IPC connection", "message", "Unknown payload type"); } } std::string IPCClientPrivate::setParameter(const std::string& name, const std::string& value) { IPC::setParameter message_out; message_out.mutable_request()->set_name(name); message_out.mutable_request()->set_value(value); auto message_in = qbIPCSendRecvMessage(message_out); return message_in->response().value(); } std::string IPCClientPrivate::getParameter(const std::string& name) { IPC::getParameter message_out; message_out.mutable_request()->set_name(name); auto message_in = qbIPCSendRecvMessage(message_out); return message_in->response().value(); } uint32_t IPCClientPrivate::appendRule(const std::string& rule_spec, uint32_t parent_id) { IPC::appendRule message_out; message_out.mutable_request()->set_rule(rule_spec); message_out.mutable_request()->set_parent_id(parent_id); auto message_in = qbIPCSendRecvMessage(message_out); return message_in->response().id(); } void IPCClientPrivate::removeRule(uint32_t id) { IPC::removeRule message_out; message_out.mutable_request()->set_id(id); auto message_in = qbIPCSendRecvMessage(message_out); } const RuleSet IPCClientPrivate::listRules(const std::string& query) { IPC::listRules message_out; message_out.mutable_request()->set_query(query); auto message_in = qbIPCSendRecvMessage(message_out); const Rule::Target default_target = \ Rule::targetFromInteger(message_in->response().default_target()); RuleSet rule_set(&_p_instance); rule_set.setDefaultTarget(default_target); for (auto rule_message : message_in->response().rules()) { Rule rule = Rule::fromString(rule_message.rule()); rule.setRuleID(rule_message.id()); rule_set.appendRule(rule); } return rule_set; } uint32_t IPCClientPrivate::applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) { IPC::applyDevicePolicy message_out; message_out.mutable_request()->set_id(id); message_out.mutable_request()->set_target(Rule::targetToInteger(target)); message_out.mutable_request()->set_permanent(permanent); auto message_in = qbIPCSendRecvMessage(message_out); return message_in->response().rule_id(); } const std::vector IPCClientPrivate::listDevices(const std::string& query) { IPC::listDevices message_out; message_out.mutable_request()->set_query(query); auto message_in = qbIPCSendRecvMessage(message_out); std::vector devices; for (auto rule_message : message_in->response().devices()) { Rule device_rule = Rule::fromString(rule_message.rule()); device_rule.setRuleID(rule_message.id()); devices.push_back(device_rule); } return devices; } void IPCClientPrivate::handleMethodResponse(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out) { (void)message_out; const auto response_field = message_in->GetDescriptor()->FindFieldByName("response"); const auto reflection = message_in->GetReflection(); const bool has_response = reflection->HasField(*message_in, response_field); const uint64_t id = IPC::getMessageHeaderID(*message_in); if (!has_response) { throw IPCException("IPC method response", "message", "Missing response field", id); } try { auto& return_promise = _return_map.at(id); return_promise.set_value(std::move(message_in)); } catch (...) { throw IPCException("IPC method response", "message", "Unexpected method call response", id); } } void IPCClientPrivate::handleException(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out) { (void)message_out; const IPC::Exception* const exception = \ reinterpret_cast(message_in.get()); if (exception->has_request_id()) { const uint64_t id = exception->request_id(); if (id > 0) { try { auto& return_promise = _return_map.at(id); return_promise.set_value(std::move(message_in)); } catch (...) { throw IPCException("IPC exception response", "message", "Unexpected method response exception", id); } } } _p_instance.ExceptionMessage(exception->context(), exception->object(), exception->reason()); } void IPCClientPrivate::handleDevicePresenceChangedSignal(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out) { (void)message_out; const IPC::DevicePresenceChangedSignal* const signal =\ reinterpret_cast(message_in.get()); _p_instance.DevicePresenceChanged(signal->id(), DeviceManager::eventTypeFromInteger(signal->event()), Rule::targetFromInteger(signal->target()), signal->device_rule()); } void IPCClientPrivate::handleDevicePolicyChangedSignal(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out) { (void)message_out; const IPC::DevicePolicyChangedSignal* const signal = \ reinterpret_cast(message_in.get()); _p_instance.DevicePolicyChanged(signal->id(), Rule::targetFromInteger(signal->target_old()), Rule::targetFromInteger(signal->target_new()), signal->device_rule(), signal->rule_id()); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPCClientPrivate.hpp000066400000000000000000000101201325273707200217510ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCPrivate.hpp" #include "Common/Thread.hpp" #include "Policy.pb.h" #include "Devices.pb.h" #include "Exception.pb.h" #include "Parameter.pb.h" #include "usbguard/Typedefs.hpp" #include "usbguard/IPCClient.hpp" #include #include #include #include #include namespace usbguard { class IPCClientPrivate { using MessageHandler = IPC::MessageHandler; public: IPCClientPrivate(IPCClient& p_instance, bool connected); ~IPCClientPrivate(); void connect(); void disconnect(bool exception_initiated, const IPCException& exception, bool do_wait = false); void disconnect(bool do_wait = false); bool isConnected() const; void wait(); std::string setParameter(const std::string& name, const std::string& value); std::string getParameter(const std::string& name); uint32_t appendRule(const std::string& rule_spec, uint32_t parent_id); void removeRule(uint32_t id); const RuleSet listRules(const std::string& query); uint32_t applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent); const std::vector listDevices(const std::string& query); void processReceiveEvent(); private: static int32_t qbPollWakeupFn(int32_t fd, int32_t revents, void* data); static int32_t qbIPCMessageProcessFn(int32_t fd, int32_t revents, void* data); void destruct(); void thread(); void wakeup(); void stop(bool do_wait = false); static uint64_t generateMessageID(void); template void registerHandler(MessageHandler::HandlerType method) { const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); _handlers.emplace(type_number, MessageHandler::create(*this, method)); } template std::unique_ptr qbIPCSendRecvMessage(ProtobufType& message_out) { IPC::MessagePointer message_in = qbIPCSendRecvMessage(reinterpret_cast(message_out)); if (message_in->GetTypeName() != ProtobufType::default_instance().GetTypeName()) { throw std::runtime_error("qbIPCSendRecvMessage: response type mismatch"); } return std::unique_ptr(static_cast(message_in.release())); } IPC::MessagePointer qbIPCSendRecvMessage(IPC::MessageType& message); std::string receive(); void process(const std::string& buffer); void handleIPCPayload(uint32_t payload_type, const std::string& payload); void handleMethodResponse(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out); void handleException(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out); void handleDevicePresenceChangedSignal(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out); void handleDevicePolicyChangedSignal(IPC::MessagePointer& message_in, IPC::MessagePointer& message_out); IPCClient& _p_instance; qb_loop_t* _qb_loop; qb_ipcc_connection_t* _qb_conn; int _qb_fd; int _wakeup_fd; std::mutex _return_mutex; std::map> _return_map; Thread _thread; std::map _handlers; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPCPrivate.cpp000066400000000000000000000101461325273707200206150ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCPrivate.hpp" #include "Devices.pb.h" #include "Exception.pb.h" #include "Policy.pb.h" #include "usbguard/Logger.hpp" #include #include namespace usbguard { static const std::vector> type_numbers = { { 0x01, "usbguard.IPC.listDevices" }, { 0x02, "usbguard.IPC.applyDevicePolicy" }, { 0x03, "usbguard.IPC.DevicePresenceChangedSignal" }, { 0x04, "usbguard.IPC.DevicePolicyChangedSignal" }, { 0x05, "usbguard.IPC.listRules" }, { 0x06, "usbguard.IPC.appendRule" }, { 0x07, "usbguard.IPC.removeRule" }, { 0x08, "usbguard.IPC.Exception" }, { 0x09, "usbguard.IPC.getParameter" }, { 0x0a, "usbguard.IPC.setParameter" } }; uint32_t IPC::messageTypeNameToNumber(const std::string& name) { for (auto const& type_number : type_numbers) { if (type_number.second == name) { return type_number.first; } } throw std::runtime_error("Unknown IPC message type name"); } const std::string& IPC::messageTypeNameFromNumber(const uint32_t number) { for (auto const& type_number : type_numbers) { if (type_number.first == number) { return type_number.second; } } throw std::runtime_error("Unknown IPC message type number"); } IPC::MessagePointer IPC::IPCExceptionToMessage(const IPCException& exception) { IPC::Exception* const message = new IPC::Exception(); IPC::MessagePointer pointer(message); message->set_context(exception.context()); message->set_object(exception.object()); message->set_reason(exception.reason()); message->set_request_id(exception.messageID()); return pointer; } IPCException IPC::IPCExceptionFromMessage(const MessagePointer& message) { const IPC::Exception* const exception_message = \ reinterpret_cast(message.get()); return IPCException(exception_message->context(), exception_message->object(), exception_message->reason(), exception_message->request_id()); } bool IPC::isExceptionMessage(const MessagePointer& message) { return message->GetTypeName() == IPC::Exception::default_instance().GetTypeName(); } uint64_t IPC::getMessageHeaderID(const MessageType& message) { const auto header_field = message.GetDescriptor()->FindFieldByName("header"); const auto reflection = message.GetReflection(); const auto& header_message = reflection->GetMessage(message, header_field); if (header_message.GetTypeName() != IPC::MessageHeader::default_instance().GetTypeName()) { throw std::runtime_error("unknown message header type"); } const auto header = reinterpret_cast(header_message); return header.id(); } void IPC::setMessageHeaderID(MessageType& message, const uint64_t id) { const auto header_field = message.GetDescriptor()->FindFieldByName("header"); auto reflection = message.GetReflection(); auto header_message = reflection->MutableMessage(&message, header_field); if (header_message->GetTypeName() != IPC::MessageHeader::default_instance().GetTypeName()) { throw std::runtime_error("unknown message header type"); } auto header = reinterpret_cast(header_message); header->set_id(id); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPCPrivate.hpp000066400000000000000000000075201325273707200206240ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Exception.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/IPCServer.hpp" #include #include namespace usbguard { namespace IPC { uint32_t messageTypeNameToNumber(const std::string& name); const std::string& messageTypeNameFromNumber(uint32_t number); using MessageType = google::protobuf::Message; using MessagePointer = std::unique_ptr; MessagePointer IPCExceptionToMessage(const IPCException& exception); IPCException IPCExceptionFromMessage(const MessagePointer& message); bool isExceptionMessage(const MessagePointer& message); uint64_t getMessageHeaderID(const MessageType& message); void setMessageHeaderID(MessageType& message, uint64_t id); template class MessageHandler { public: using HandlerType = void(C::*)(MessagePointer&, MessagePointer&); MessageHandler(C& c, HandlerType method, const MessageType& factory, IPCServer::AccessControl::Section section = IPCServer::AccessControl::Section::NONE, IPCServer::AccessControl::Privilege privilege = IPCServer::AccessControl::Privilege::NONE) : _instance(c), _method(method), _message_factory(factory), _section(section), _privilege(privilege) { } MessageHandler(const MessageHandler& rhs) : _instance(rhs._instance), _method(rhs._method), _message_factory(rhs._message_factory), _section(rhs._section), _privilege(rhs._privilege) { } MessagePointer payloadToMessage(const std::string& payload) { MessagePointer message(_message_factory.New()); message->ParseFromString(payload); return message; } void run(MessagePointer& message) { MessagePointer response; run(message, response); } void run(MessagePointer& message, MessagePointer& response) { if (message->GetTypeName() != _message_factory.GetTypeName()) { throw std::runtime_error("Incompatible message type passed to handler"); } (_instance.*_method)(message, response); } template static MessageHandler create(C& c, HandlerType method, IPCServer::AccessControl::Section section = IPCServer::AccessControl::Section::NONE, IPCServer::AccessControl::Privilege privilege = IPCServer::AccessControl::Privilege::NONE) { return MessageHandler(c, method, ProtobufType::default_instance(), section, privilege); } IPCServer::AccessControl::Section section() const { return _section; } IPCServer::AccessControl::Privilege privilege() const { return _privilege; } private: C& _instance; HandlerType _method; const MessageType& _message_factory; IPCServer::AccessControl::Section _section; IPCServer::AccessControl::Privilege _privilege; }; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPCServerPrivate.cpp000066400000000000000000001013721325273707200220060ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCServerPrivate.hpp" #include "IPCPrivate.hpp" #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include #include #include #include #include #include #include #include namespace usbguard { static qb_loop* G_qb_loop = nullptr; IPCServerPrivate::IPCServerPrivate(IPCServer& p_instance) : _p_instance(p_instance), _thread(this, &IPCServerPrivate::thread) { if (G_qb_loop != nullptr) { throw USBGUARD_BUG("Only one instance of IPCServer per process allowed"); } G_qb_loop = _qb_loop = qb_loop_create(); if (_qb_loop == nullptr) { throw Exception("IPC server initialization", "main loop", "Failed to create qb_loop object"); } _wakeup_fd = -1; try { initIPC(); USBGUARD_SYSCALL_THROW("IPC server initialization", (_wakeup_fd = eventfd(0, 0)) < 0); qb_loop_poll_add(_qb_loop, QB_LOOP_HIGH, _wakeup_fd, POLLIN, nullptr, &IPCServerPrivate::qbPollWakeupFn); } catch (...) { qb_loop_destroy(_qb_loop); G_qb_loop = nullptr; throw; } registerHandler(&IPCServerPrivate::handleAppendRule, IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::MODIFY); registerHandler(&IPCServerPrivate::handleRemoveRule, IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::MODIFY); registerHandler(&IPCServerPrivate::handleListRules, IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::LIST); registerHandler(&IPCServerPrivate::handleApplyDevicePolicy, IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::MODIFY); registerHandler(&IPCServerPrivate::handleListDevices, IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LIST); registerHandler(&IPCServerPrivate::handleSetParameter, IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Privilege::MODIFY); registerHandler(&IPCServerPrivate::handleGetParameter, IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Privilege::LIST); } void IPCServerPrivate::initIPC() { static struct qb_ipcs_service_handlers service_handlers = { IPCServerPrivate::qbIPCConnectionAcceptFn, IPCServerPrivate::qbIPCConnectionCreatedFn, IPCServerPrivate::qbIPCMessageProcessFn, IPCServerPrivate::qbIPCConnectionClosedFn, IPCServerPrivate::qbIPCConnectionDestroyedFn }; _qb_service = qb_ipcs_create("usbguard", 0, QB_IPC_NATIVE, &service_handlers); if (_qb_service == nullptr) { throw Exception("IPC server initialization", "service", "Failed to create qb_service object"); } qb_ipcs_service_context_set(_qb_service, this); static struct qb_ipcs_poll_handlers poll_handlers = { IPCServerPrivate::qbIPCJobAdd, IPCServerPrivate::qbIPCDispatchAdd, IPCServerPrivate::qbIPCDispatchMod, IPCServerPrivate::qbIPCDispatchDel }; qb_ipcs_poll_handlers_set(_qb_service, &poll_handlers); const auto rc = qb_ipcs_run(_qb_service); if (rc != 0) { throw ErrnoException("IPC server initialization", "service", (int)-rc); } } void IPCServerPrivate::finiIPC() { qb_ipcs_destroy(_qb_service); } IPCServerPrivate::~IPCServerPrivate() { destruct(); } void IPCServerPrivate::thread() { qb_loop_run(_qb_loop); } void IPCServerPrivate::wakeup() { const uint64_t one = 1; USBGUARD_SYSCALL_THROW("IPC server", write(_wakeup_fd, &one, sizeof one) != sizeof one); } void IPCServerPrivate::start() { if (!_thread.running()) { _thread.start(); } } void IPCServerPrivate::stop() { _thread.stop(/*do_wait=*/false); qb_loop_stop(_qb_loop); wakeup(); _thread.wait(); } void IPCServerPrivate::destruct() { if (_thread.running()) { stop(); } finiIPC(); qb_loop_poll_del(_qb_loop, _wakeup_fd); qb_loop_destroy(_qb_loop); USBGUARD_SYSCALL_THROW("IPC server", close(_wakeup_fd) != 0); } int32_t IPCServerPrivate::qbPollWakeupFn(int32_t fd, int32_t revents, void* data) { USBGUARD_LOG(Trace) << "fd=" << fd << " revents=" << revents << " data=" << data; uint64_t one = 0; if (read(fd, &one, sizeof one) != sizeof one) { USBGUARD_LOG(Warning) << "IPC server: " << "Failed to read wakeup event: " << "errno=" << errno; return -1; } else { return 0; } } void IPCServerPrivate::qbIPCConnectionCreatedFn(qb_ipcs_connection_t* conn) { USBGUARD_LOG(Trace) << "conn=" << conn; USBGUARD_LOG(Info) << "New IPC connection from PID " << qbIPCConnectionClientPID(conn); } void IPCServerPrivate::qbIPCConnectionDestroyedFn(qb_ipcs_connection_t* conn) { USBGUARD_LOG(Trace) << "conn=" << conn; IPCServer::AccessControl* const access_control = \ static_cast(qb_ipcs_context_get(conn)); if (access_control != nullptr) { delete access_control; } } int32_t IPCServerPrivate::qbIPCConnectionClosedFn(qb_ipcs_connection_t* conn) { USBGUARD_LOG(Trace) << "conn=" << conn; USBGUARD_LOG(Info) << "Closed IPC connection to PID " << qbIPCConnectionClientPID(conn); return 0; } int32_t IPCServerPrivate::qbIPCJobAdd(enum qb_loop_priority p, void* data, qb_loop_job_dispatch_fn fn) { return qb_loop_job_add(G_qb_loop, p, data, fn); } int32_t IPCServerPrivate::qbIPCDispatchAdd(enum qb_loop_priority p, int32_t fd, int32_t evts, void* data, qb_ipcs_dispatch_fn_t fn) { return qb_loop_poll_add(G_qb_loop, p, fd, evts, data, fn); } int32_t IPCServerPrivate::qbIPCDispatchMod(enum qb_loop_priority p, int32_t fd, int32_t evts, void* data, qb_ipcs_dispatch_fn_t fn) { return qb_loop_poll_mod(G_qb_loop, p, fd, evts, data, fn); } int32_t IPCServerPrivate::qbIPCDispatchDel(int32_t fd) { return qb_loop_poll_del(G_qb_loop, fd); } int32_t IPCServerPrivate::qbIPCConnectionClientPID(qb_ipcs_connection_t* connection) { std::unique_ptr \ stats(qb_ipcs_connection_stats_get_2(connection, /*clear_after_read=*/0)); if (stats == nullptr) { throw std::runtime_error("Cannot retrieve qb connection statistics"); } return stats->client_pid; } int32_t IPCServerPrivate::qbIPCConnectionAcceptFn(qb_ipcs_connection_t* conn, uid_t uid, gid_t gid) { try { IPCServerPrivate* server = \ static_cast(qb_ipcs_connection_service_context_get(conn)); std::unique_ptr access_control(new IPCServer::AccessControl()); const bool auth = server->qbIPCConnectionAllowed(uid, gid, access_control.get()); qb_ipcs_context_set(conn, access_control.release()); if (auth) { USBGUARD_LOG(Info) << "IPC connection accepted: uid=" << uid << " gid=" << gid << " pid=" << qbIPCConnectionClientPID(conn); USBGUARD_LOG(Debug) << "Setting SHM permissions to uid=" << uid << " gid=" << 0 << " mode=0660"; qb_ipcs_connection_auth_set(conn, uid, 0, 0660); return 0; } else { USBGUARD_LOG(Warning) << "IPC connection denied: uid=" << uid << " gid=" << gid << " pid=" << qbIPCConnectionClientPID(conn); return -1; } } catch (const std::exception& exception) { USBGUARD_LOG(Error) << "IPC connection denied: Exception: " << exception.what(); } catch (...) { USBGUARD_LOG(Error) << "IPC connection denied: BUG: unknown exception caught."; } return -1; } bool IPCServerPrivate::hasACLEntries() const { return (!_allowed_uids.empty() \ || !_allowed_gids.empty() \ || !_allowed_usernames.empty() \ || !_allowed_groupnames.empty()); } bool IPCServerPrivate::qbIPCConnectionAllowed(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr) const { if (hasACLEntries()) { return authenticateIPCConnectionDAC(uid, gid, ac_ptr); } else { USBGUARD_LOG(Debug) << "IPC ACL is empty." << " Allowing connection for uid=" << uid << " gid=" << gid; return true; } } void IPCServerPrivate::qbIPCSendMessage(qb_ipcs_connection_t* qb_conn, const IPC::MessagePointer& message) { if (qb_conn == nullptr || message == nullptr) { throw USBGUARD_BUG("NULL argument(s)"); } std::string payload; message->SerializeToString(&payload); struct qb_ipc_response_header hdr; struct iovec iov[2]; hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); hdr.size = sizeof hdr + payload.size(); hdr.error = 0; iov[0].iov_base = &hdr; iov[0].iov_len = sizeof hdr; iov[1].iov_base = (void*)payload.data(); iov[1].iov_len = payload.size(); const size_t total_size = hdr.size; const ssize_t rc = qb_ipcs_event_sendv(qb_conn, iov, 2); if (rc < 0 || (size_t)rc != total_size) { std::unique_ptr \ stats(qb_ipcs_connection_stats_get_2(qb_conn, /*clear_after_read=*/0)); if (stats == nullptr) { throw std::runtime_error("Cannot retrieve qb connection statistics"); } if (rc < 0) { USBGUARD_LOG(Error) << "An error ocured while sending IPC message to pid=" << qbIPCConnectionClientPID(qb_conn); /* FALLTHROUGH */ } else if ((size_t)rc != total_size) { USBGUARD_LOG(Error) << "Unable to sent complete IPC message to pid=" << qbIPCConnectionClientPID(qb_conn) << " sent=" << (size_t)rc << " expected=" << total_size; /* FALLTHROUGH */ } } iov[0].iov_base = nullptr; iov[1].iov_base = nullptr; } int32_t IPCServerPrivate::qbIPCMessageProcessFn(qb_ipcs_connection_t* conn, void* data, size_t size) { if (conn == nullptr) { return -1; } qb_ipcs_connection_ref(conn); if (size <= sizeof (struct qb_ipc_request_header)) { USBGUARD_LOG(Debug) << "IPC message too short"; qb_ipcs_disconnect(conn); return -1; } if (size > 1<<20) { USBGUARD_LOG(Debug) << "IPC message too large"; qb_ipcs_disconnect(conn); return -1; } const struct qb_ipc_request_header* const hdr = \ reinterpret_cast(data); if (size != (size_t)hdr->size) { USBGUARD_LOG(Debug) << "Invalid IPC header size"; qb_ipcs_disconnect(conn); return -1; } if (hdr->id < QB_IPC_MSG_USER_START) { USBGUARD_LOG(Debug) << "Invalid IPC header id"; qb_ipcs_disconnect(conn); return -1; } int32_t client_pid = -1; bool client_disconnect = false; try { client_pid = qbIPCConnectionClientPID(conn); } catch (...) { USBGUARD_LOG(Error) << "Unable to get client PID. Disconnecting client."; qb_ipcs_disconnect(conn); return -1; } try { IPCServerPrivate* const server = \ reinterpret_cast(qb_ipcs_connection_service_context_get(conn)); const uint32_t payload_type = hdr->id - QB_IPC_MSG_USER_START; const char* const payload_data = reinterpret_cast(data) + sizeof(struct qb_ipc_request_header); const size_t payload_size = size - sizeof(struct qb_ipc_request_header); const std::string payload(payload_data, payload_size); const IPCServer::AccessControl* const access_control = \ static_cast(qb_ipcs_context_get(conn)); if (access_control == nullptr) { throw USBGUARD_BUG("IPC access control not set"); } USBGUARD_LOG(Debug) << "Handling IPC payload of type=" << payload_type << " size=" << payload_size; auto response = server->handleIPCPayload(payload_type, payload, access_control); if (response) { USBGUARD_LOG(Debug) << "Sending response to client_pid=" << client_pid; qbIPCSendMessage(conn, response); } } catch (const IPCException& ex) { USBGUARD_LOG(Warning) << "IPC: client_pid=" << client_pid << ": IPC exception: " << ex.message(); qbIPCSendMessage(conn, IPC::IPCExceptionToMessage(ex)); /* FALLTHROUGH */ } catch (const Exception& ex) { USBGUARD_LOG(Warning) << "IPC: client_pid=" << client_pid << ": Exception: " << ex.message(); client_disconnect = true; /* FALLTHROUGH */ } catch (const std::exception& ex) { USBGUARD_LOG(Warning) << "IPC: client_pid=" << client_pid << ": Exception: " << ex.what(); client_disconnect = true; /* FALLTHROUGH */ } catch (...) { USBGUARD_LOG(Warning) << "IPC: client_pid=" << client_pid << ": Unknown exception."; client_disconnect = true; /* FALLTHROUGH */ } if (client_disconnect) { USBGUARD_LOG(Warning) << "IPC: client_pid=" << client_pid << ": Disconnecting client."; qb_ipcs_disconnect(conn); return -1; } else { qb_ipcs_connection_unref(conn); } return 0; } void IPCServerPrivate::qbIPCBroadcastData(const struct iovec* const iov, const size_t iov_len, IPCServer::AccessControl::Section section) { auto qb_conn = qb_ipcs_connection_first_get(_qb_service); size_t total_size = 0; for (size_t i = 0; i < iov_len; ++i) { total_size += iov[i].iov_len; } while (qb_conn != nullptr) { const IPCServer::AccessControl* const access_control = \ static_cast(qb_ipcs_context_get(qb_conn)); if (access_control == nullptr) { throw USBGUARD_BUG(""); } if (access_control->hasPrivilege(section, IPCServer::AccessControl::Privilege::LISTEN)) { /* Send the data */ const ssize_t rc = qb_ipcs_event_sendv(qb_conn, iov, iov_len); if (rc < 0 || (size_t)rc != total_size) { std::unique_ptr \ stats(qb_ipcs_connection_stats_get_2(qb_conn, /*clear_after_read=*/0)); if (stats == nullptr) { throw std::runtime_error("Cannot retrieve qb connection statistics"); } if (rc < 0) { USBGUARD_LOG(Error) << "An error ocured while sending IPC message to pid=" << qbIPCConnectionClientPID(qb_conn); } else if ((size_t)rc != total_size) { USBGUARD_LOG(Error) << "Unable to sent complete IPC message to pid=" << qbIPCConnectionClientPID(qb_conn) << " sent=" << (size_t)rc << " expected=" << total_size; } } } else { USBGUARD_LOG(Info) << "IPC message broadcast: Skipping client at pid=" << qbIPCConnectionClientPID(qb_conn) << ": Insufficient privileges to receive the message."; } /* Get the next connection */ auto qb_conn_next = qb_ipcs_connection_next_get(_qb_service, qb_conn); qb_ipcs_connection_unref(qb_conn); qb_conn = qb_conn_next; } } void IPCServerPrivate::qbIPCBroadcastMessage(const IPC::MessagePointer& message) { qbIPCBroadcastMessage(message.get()); } IPCServer::AccessControl::Section IPCServerPrivate::messageTypeNameToAccessControlSection(const std::string& name) { if (name == "usbguard.IPC.DevicePresenceChangedSignal") { return IPCServer::AccessControl::Section::DEVICES; } if (name == "usbguard.IPC.DevicePolicyChangedSignal") { return IPCServer::AccessControl::Section::DEVICES; } if (name == "usbguard.IPC.Exception") { return IPCServer::AccessControl::Section::EXCEPTIONS; } throw Exception("IPC Server", name, "Invalid IPC typename to Access Control section translation request"); } void IPCServerPrivate::qbIPCBroadcastMessage(const IPC::MessageType* const message) { std::string payload; message->SerializeToString(&payload); struct qb_ipc_response_header hdr = { }; hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); hdr.size = sizeof hdr + payload.size(); hdr.error = 0; struct iovec iov[2]; iov[0].iov_base = &hdr; iov[0].iov_len = sizeof hdr; iov[1].iov_base = (void*)payload.data(); iov[1].iov_len = payload.size(); qbIPCBroadcastData(iov, 2, messageTypeNameToAccessControlSection(message->GetTypeName())); iov[0].iov_base = nullptr; iov[1].iov_base = nullptr; } bool IPCServerPrivate::authenticateIPCConnectionDAC(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr) const { USBGUARD_LOG(Trace) << "uid=" << uid << " gid=" << gid << " ac_ptr=" << ac_ptr; return \ matchACLByUID(uid, ac_ptr) || \ matchACLByGID(gid, ac_ptr) || \ matchACLByName(uid, gid, ac_ptr); } bool IPCServerPrivate::matchACLByUID(uid_t uid, IPCServer::AccessControl* const ac_ptr) const { USBGUARD_LOG(Trace) << "uid=" << uid << " ac_ptr=" << ac_ptr; const auto& it = _allowed_uids.find(uid); if (it == _allowed_uids.cend()) { return false; } if (ac_ptr != nullptr) { ac_ptr->merge(it->second); } USBGUARD_LOG(Trace) << "matched"; return true; } bool IPCServerPrivate::matchACLByGID(gid_t gid, IPCServer::AccessControl* const ac_ptr) const { USBGUARD_LOG(Trace) << "gid=" << gid << " ac_ptr=" << ac_ptr; const auto& it = _allowed_gids.find(gid); if (it == _allowed_gids.cend()) { return false; } if (ac_ptr != nullptr) { ac_ptr->merge(it->second); } USBGUARD_LOG(Trace) << "matched"; return true; } bool IPCServerPrivate::matchACLByName(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr) const { USBGUARD_LOG(Trace) << "uid=" << uid << " gid=" << gid << " ac_ptr=" << ac_ptr; bool matched = false; const std::string uid_name = getNameFromUID(uid); const bool check_uid_group_membership = !uid_name.empty(); if (!uid_name.empty()) { const auto& it = _allowed_usernames.find(uid_name); if (it != _allowed_usernames.cend()) { if (ac_ptr != nullptr) { ac_ptr->merge(it->second); } USBGUARD_LOG(Trace) << "username matched: " << uid_name; matched = true; } } const std::string gid_name = getNameFromGID(gid); if (!gid_name.empty()) { const auto& it = _allowed_groupnames.find(gid_name); if (it != _allowed_groupnames.cend()) { if (ac_ptr != nullptr) { ac_ptr->merge(it->second); } USBGUARD_LOG(Trace) << "groupname matched: " << gid_name; matched = true; } } if (check_uid_group_membership) { USBGUARD_LOG(Trace) << "Checking UID group membership"; /* * Check against allowed GIDs */ for (auto const& allowed_gid_entry : _allowed_gids) { const auto& allowed_gid = allowed_gid_entry.first; const std::vector group_members = getGroupMemberNames(allowed_gid); for (const auto& group_member : group_members) { if (group_member == uid_name) { if (ac_ptr != nullptr) { ac_ptr->merge(allowed_gid_entry.second); } USBGUARD_LOG(Trace) << "matched member of group with GID: " << allowed_gid; matched = true; } } } /* * Check against allowed groupnames */ for (auto const& allowed_groupnames_entry : _allowed_groupnames) { const auto& allowed_groupname = allowed_groupnames_entry.first; const std::vector group_members = getGroupMemberNames(allowed_groupname); for (const auto& group_member : group_members) { if (group_member == uid_name) { if (ac_ptr != nullptr) { ac_ptr->merge(allowed_groupnames_entry.second); } USBGUARD_LOG(Trace) << "matched member of group with name: " << allowed_groupname; matched = true; } } } } /* check_uid_group_membership */ /* TODO: * Cache final result for some time to prevent DoS. * IPC ACL doesn't change during runtime. Implement * cache use limit/expiration to prevent cache time * stretching. */ return matched; } std::string IPCServerPrivate::getNameFromUID(uid_t uid) { std::string buffer(1024, 0); struct passwd pw = { }; struct passwd* pwptr = nullptr; if (getpwuid_r(uid, &pw, &buffer[0], buffer.capacity(), &pwptr) != 0) { USBGUARD_LOG(Warning) << "Unable to lookup username for uid=" << uid << ": errno=" << errno; return std::string(); } if (pwptr == nullptr || pw.pw_name == nullptr) { USBGUARD_LOG(Info) << "No username associated with uid=" << uid; return std::string(); } return std::string(pw.pw_name); } std::string IPCServerPrivate::getNameFromGID(gid_t gid) { std::string buffer(4096, 0); struct group gr = { }; struct group* grptr = nullptr; if (getgrgid_r(gid, &gr, &buffer[0], buffer.capacity(), &grptr) != 0) { USBGUARD_LOG(Warning) << "Unable to lookup groupname for gid=" << gid << ": errno=" << errno; return std::string(); } if (grptr == nullptr || gr.gr_name == nullptr) { USBGUARD_LOG(Info) << "No groupname associated with gid=" << gid; return std::string(); } return std::string(gr.gr_name); } std::vector IPCServerPrivate::getGroupMemberNames(gid_t gid) { std::vector names; std::string buffer(4096, 0); struct group gr = { }; struct group* grptr = nullptr; if (getgrgid_r(gid, &gr, &buffer[0], buffer.capacity(), &grptr) != 0) { USBGUARD_LOG(Warning) << "Unable to fetch group members for gid=" << gid << ": errno=" << errno; return std::vector(); } if (grptr == nullptr || gr.gr_name == nullptr) { USBGUARD_LOG(Info) << "No group associated with gid=" << gid; return std::vector(); } for (size_t i = 0; gr.gr_mem[i] != nullptr; ++i) { names.emplace_back(std::string(gr.gr_mem[i])); } return names; } std::vector IPCServerPrivate::getGroupMemberNames(const std::string& groupname) { std::vector names; std::string buffer(4096, 0); struct group gr = { }; struct group* grptr = nullptr; if (getgrnam_r(groupname.c_str(), &gr, &buffer[0], buffer.capacity(), &grptr) != 0) { USBGUARD_LOG(Warning) << "Unable to fetch group member names for groupname=" << groupname << ": errno=" << errno; return std::vector(); } if (grptr == nullptr || gr.gr_name == nullptr) { USBGUARD_LOG(Info) << "Can't find group with name=" << groupname; return std::vector(); } for (size_t i = 0; gr.gr_mem[i] != nullptr; ++i) { names.emplace_back(std::string(gr.gr_mem[i])); } return names; } IPC::MessagePointer IPCServerPrivate::handleIPCPayload(const uint32_t payload_type, const std::string& payload, const IPCServer::AccessControl* const access_control) { const auto& handler_it = _handlers.find(payload_type); if (handler_it == _handlers.end()) { throw Exception("IPC connection", "IPC payload data", "Unknown payload type"); } auto& handler = handler_it->second; /* * Try to parse the IPC payload as a message of the * specified type. If the parsing fails, the client will * be disconnected. */ IPC::MessagePointer message_in; uint64_t request_id = 0; try { message_in = handler.payloadToMessage(payload); request_id = IPC::getMessageHeaderID(*message_in); } catch (...) { throw Exception("IPC connection", "IPC payload data", "Payload data parsing failed"); } if (!access_control->hasPrivilege(handler.section(), handler.privilege())) { throw IPCException("IPC method", IPC::messageTypeNameFromNumber(payload_type), "Permission denied", request_id); } /* * Try to run the handler. Exception thrown from inside the handler * will be sent to the client. */ try { IPC::MessagePointer response; handler.run(message_in, response); return response; } catch (IPCException& exception) { exception.setMessageID(request_id); throw exception; } catch (const Exception& exception) { throw IPCException(exception, request_id); } catch (const std::exception& exception) { throw IPCException("IPC method", IPC::messageTypeNameFromNumber(payload_type), exception.what(), request_id); } catch (...) { throw IPCException("IPC method", IPC::messageTypeNameFromNumber(payload_type), "BUG: Unexpected exception", request_id); } } void IPCServerPrivate::handleAppendRule(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::appendRule* const message_in = static_cast(request.get()); const std::string rule = message_in->request().rule(); const uint32_t parent_id = message_in->request().parent_id(); /* * Execute the method. */ const uint32_t id = _p_instance.appendRule(rule, parent_id); /* * Construct the response. */ IPC::appendRule* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_id(id); response.reset(message_out); } void IPCServerPrivate::handleRemoveRule(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::removeRule* const message_in = static_cast(request.get()); const uint32_t id = message_in->request().id(); /* * Execute the method. */ _p_instance.removeRule(id); /* * Construct the response. */ IPC::removeRule* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_id(id); response.reset(message_out); } void IPCServerPrivate::handleListRules(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::listRules* const message_in = static_cast(request.get()); const std::string query = message_in->request().query(); /* * Execute the method. */ auto rule_set = _p_instance.listRules(query); const uint32_t default_target = Rule::targetToInteger(rule_set.getDefaultTarget()); /* * Construct the response. */ IPC::listRules* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_default_target(default_target); for (const auto& rule : rule_set.getRules()) { auto message_rule = message_out->mutable_response()->add_rules(); message_rule->set_id(rule->getRuleID()); message_rule->set_rule(rule->toString()); } response.reset(message_out); } void IPCServerPrivate::handleApplyDevicePolicy(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::applyDevicePolicy* const message_in = static_cast(request.get()); const uint32_t id = message_in->request().id(); const Rule::Target target = Rule::targetFromInteger(message_in->request().target()); const bool permanent = message_in->request().permanent(); /* * Execute the method. */ const uint32_t rule_id = _p_instance.applyDevicePolicy(id, target, permanent); /* * Construct the response. */ IPC::applyDevicePolicy* const message_out = message_in->New(); IPC::MessagePointer response_local(message_out); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_rule_id(rule_id); response = std::move(response_local); } void IPCServerPrivate::handleListDevices(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::listDevices* const message_in = static_cast(request.get()); const std::string query = message_in->request().query(); /* * Execute the method. */ auto device_rules = _p_instance.listDevices(query); /* * Construct the response. */ IPC::listDevices* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->Clear(); for (const auto& device_rule : device_rules) { auto message_rule = message_out->mutable_response()->add_devices(); message_rule->set_id(device_rule.getRuleID()); message_rule->set_rule(device_rule.toString()); } response.reset(message_out); } void IPCServerPrivate::handleSetParameter(IPC::MessagePointer& request, IPC::MessagePointer& response) { /* * Get request field values. */ const IPC::setParameter* const message_in = static_cast(request.get()); const std::string name = message_in->request().name(); const std::string value = message_in->request().value(); /* * Execute the method. */ auto previous_value = _p_instance.setParameter(name, value); /* * Construct the response. */ IPC::setParameter* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_value(previous_value); response.reset(message_out); } void IPCServerPrivate::handleGetParameter(IPC::MessagePointer& request, IPC::MessagePointer& response) { const IPC::getParameter* const message_in = static_cast(request.get()); const std::string name = message_in->request().name(); auto value = _p_instance.getParameter(name); IPC::getParameter* const message_out = message_in->New(); message_out->MergeFrom(*message_in); message_out->mutable_response()->set_value(value); response.reset(message_out); } void IPCServerPrivate::DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) { IPC::DevicePresenceChangedSignal signal; signal.set_id(id); signal.set_event(DeviceManager::eventTypeToInteger(event)); signal.set_target(Rule::targetToInteger(target)); signal.set_device_rule(device_rule); qbIPCBroadcastMessage(&signal); } void IPCServerPrivate::DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) { IPC::DevicePolicyChangedSignal signal; signal.set_id(id); signal.set_target_old(Rule::targetToInteger(target_old)); signal.set_target_new(Rule::targetToInteger(target_new)); signal.set_device_rule(device_rule); signal.set_rule_id(rule_id); qbIPCBroadcastMessage(&signal); } void IPCServerPrivate::ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason, uint64_t request_id) { IPC::Exception exception; exception.set_context(context); exception.set_object(object); exception.set_reason(reason); if (request_id > 0) { exception.set_request_id(request_id); } qbIPCBroadcastMessage(&exception); } void IPCServerPrivate::addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac) { _allowed_uids.emplace(uid, ac); } void IPCServerPrivate::addAllowedGID(gid_t gid, const IPCServer::AccessControl& ac) { _allowed_gids.emplace(gid, ac); } void IPCServerPrivate::addAllowedUsername(const std::string& username, const IPCServer::AccessControl& ac) { _allowed_usernames.emplace(username, ac); } void IPCServerPrivate::addAllowedGroupname(const std::string& groupname, const IPCServer::AccessControl& ac) { _allowed_groupnames.emplace(groupname, ac); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/IPCServerPrivate.hpp000066400000000000000000000140541325273707200220130ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCPrivate.hpp" #include "Common/Thread.hpp" #include "Devices.pb.h" #include "Policy.pb.h" #include "Exception.pb.h" #include "Parameter.pb.h" #include "usbguard/Typedefs.hpp" #include "usbguard/IPCServer.hpp" #include #include #include #include #include namespace usbguard { class IPCServerPrivate { using MessageHandler = IPC::MessageHandler; public: IPCServerPrivate(IPCServer& p_instance); ~IPCServerPrivate(); void start(); void stop(); void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule); void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id); void ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason, uint64_t request_id = 0); void addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac); void addAllowedGID(gid_t gid, const IPCServer::AccessControl& ac); void addAllowedUsername(const std::string& username, const IPCServer::AccessControl& ac); void addAllowedGroupname(const std::string& groupname, const IPCServer::AccessControl& ac); private: void initIPC(); void finiIPC(); void thread(); void wakeup(); void destruct(); static int32_t qbPollWakeupFn(int32_t fd, int32_t revents, void* data); static int32_t qbIPCConnectionAcceptFn(qb_ipcs_connection_t*, uid_t, gid_t); static void qbIPCConnectionCreatedFn(qb_ipcs_connection_t*); static void qbIPCConnectionDestroyedFn(qb_ipcs_connection_t*); static int32_t qbIPCConnectionClosedFn(qb_ipcs_connection_t*); static int32_t qbIPCMessageProcessFn(qb_ipcs_connection_t*, void*, size_t); static int32_t qbIPCJobAdd(enum qb_loop_priority p, void* data, qb_loop_job_dispatch_fn fn); static int32_t qbIPCDispatchAdd(enum qb_loop_priority p, int32_t fd, int32_t evts, void* data, qb_ipcs_dispatch_fn_t fn); static int32_t qbIPCDispatchMod(enum qb_loop_priority p, int32_t fd, int32_t evts, void* data, qb_ipcs_dispatch_fn_t fn); static int32_t qbIPCDispatchDel(int32_t fd); static int32_t qbIPCConnectionClientPID(qb_ipcs_connection_t* connection); bool hasACLEntries() const; bool qbIPCConnectionAllowed(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr) const; bool authenticateIPCConnectionDAC(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr = nullptr) const; bool matchACLByUID(uid_t uid, IPCServer::AccessControl* const ac_ptr) const; bool matchACLByGID(gid_t gid, IPCServer::AccessControl* const ac_ptr) const; bool matchACLByName(uid_t uid, gid_t gid, IPCServer::AccessControl* const ac_ptr) const; static std::string getNameFromUID(uid_t uid); static std::string getNameFromGID(gid_t gid); static std::vector getGroupMemberNames(gid_t gid); static std::vector getGroupMemberNames(const std::string& groupname); static void qbIPCSendMessage(qb_ipcs_connection_t* qb_conn, const IPC::MessagePointer& message); static IPCServer::AccessControl::Section messageTypeNameToAccessControlSection(const std::string& name); void qbIPCBroadcastData(const struct iovec* iov, size_t iov_len, IPCServer::AccessControl::Section section); void qbIPCBroadcastMessage(const IPC::MessagePointer& message); void qbIPCBroadcastMessage(const IPC::MessageType* message); IPC::MessagePointer handleIPCPayload(const uint32_t payload_type, const std::string& payload, const IPCServer::AccessControl* const access_control); template void registerHandler(MessageHandler::HandlerType method, IPCServer::AccessControl::Section section, IPCServer::AccessControl::Privilege privilege) { const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); _handlers.emplace(type_number, MessageHandler::create(*this, method, section, privilege)); } void handleAppendRule(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleRemoveRule(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleListRules(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleApplyDevicePolicy(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleListDevices(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleSetParameter(IPC::MessagePointer& request, IPC::MessagePointer& response); void handleGetParameter(IPC::MessagePointer& request, IPC::MessagePointer& response); IPCServer& _p_instance; qb_loop_t* _qb_loop; qb_ipcs_service_t* _qb_service; int _wakeup_fd; std::unordered_map _allowed_uids; std::unordered_map _allowed_gids; std::unordered_map _allowed_usernames; std::unordered_map _allowed_groupnames; Thread _thread; std::unordered_map _handlers; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Init.cpp000066400000000000000000000040601325273707200175500ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCServerPrivate.hpp" #include "IPCClientPrivate.hpp" #if defined(USBGUARD_USE_LIBSODIUM) #include #endif #if defined(USBGUARD_USE_LIBGCRYPT) #include #endif #include #include namespace usbguard { class LibraryInit { public: LibraryInit() { std::setlocale(LC_NUMERIC, "C"); /* * FIXME: Provide a mechanism to disable the crypto library * initialization as it might interfere with initialization * done by third-party applications. * * gcrypt: whether initialization was performed or not can * be queried using: * gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P, 0); */ #if defined(USBGUARD_USE_LIBSODIUM) if (sodium_init() == -1) { throw std::runtime_error("Cannot initialize the sodium library"); } #endif #if defined(USBGUARD_USE_LIBGCRYPT) if (!gcry_check_version(GCRYPT_VERSION)) { throw std::runtime_error("Cannot initialize the gcrypt library"); } gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); #endif } ~LibraryInit() { google::protobuf::ShutdownProtobufLibrary(); } }; static LibraryInit library_init; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/KeyValueParser.cpp000066400000000000000000000067211325273707200215550ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // Marek Tamaskovic // Radovan Sroka // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "KeyValueParser.hpp" #include "Common/Utility.hpp" #include "usbguard/Exception.hpp" #include "usbguard/Logger.hpp" #include namespace usbguard { /** * NOTE: * vector v should have strings UPPERCASE when case insensitive mode was enabled */ KeyValueParser::KeyValueParser(const std::vector& v, const std::string& sep, bool case_sensitive): _keys(v), _separator(sep), _case_sensitive(case_sensitive) { } KeyValueParser::KeyValueParser(const std::vector& v, bool case_sensitive): KeyValueParser(v, "=", case_sensitive) {} void KeyValueParser::viewConfig() { std::cout << "separator:\t" << this->_separator << std::endl; std::cout << "keys:\t"; for (auto item : this->_keys) { std::cout << item << ", "; } std::cout << "\b\b " << std::endl; } std::pair KeyValueParser::parseLine(std::string& str) { std::string::size_type sep_pos; std::string key_c, key, val; sep_pos = str.find(this->_separator); if (sep_pos == std::string::npos) { throw Exception("KeyValueParser", "Parser", "Separator not found: syntax error"); } else { key = str.substr(0, sep_pos); val = str.substr(sep_pos + 1); key = trim(key); val = trim(val); if (!this->_case_sensitive) { for (size_t i = 0 ; i < key.length() ; i++) { key[i] = std::toupper(key[i], this->_loc); } } if (this->checkKeyValidity(key)) { USBGUARD_LOG(Error) << "Error: parsed key is not in key set: '" << key << "'"; throw Exception("KeyValueParser", "Parser", "Invalid key"); } else { return std::make_pair(key, val); } } } void KeyValueParser::parseStream(std::istream& stream) { std::map m; std::map::iterator it; std::string line; while ( getline (stream, line) ) { if ((line.size() < 1) || (line[0] == '#')) { continue; } auto p = this->parseLine(line); it = m.find(p.first); if (it != m.end()) { m.emplace(p.first, p.second); } else { m[p.first] = p.second; } } this->_output_map = std::move(m); } bool KeyValueParser::checkKeyValidity(const std::string& key) { for (auto a: this->_keys) { if (!key.compare(a)) { return false; } } return true; } std::map KeyValueParser::getMap() { return this->_output_map; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/KeyValueParser.hpp000066400000000000000000000033411325273707200215550ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // Marek Tamaskovic // Radovan Sroka // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include #include #include #include #include #include #include namespace usbguard { class KeyValueParser { std::vector _keys; std::string _separator {""}; std::map _output_map; std::locale _loc; bool _case_sensitive; bool checkKeyValidity(const std::string& key); public: KeyValueParser(const std::vector& v, bool case_sensitive = true); KeyValueParser(const std::vector& v, const std::string& sep, bool case_sensitive = true); std::pair parseLine(std::string& str); void parseStream(std::istream& stream); std::map getMap(); void viewConfig(); }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/LocaltimeCondition.cpp000066400000000000000000000077031325273707200224340ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "LocaltimeCondition.hpp" #include "Common/Utility.hpp" #include "usbguard/RuleParser.hpp" #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #include #endif namespace usbguard { LocaltimeCondition::LocaltimeCondition(const std::string& time_range, bool negated) : RuleConditionBase("localtime", time_range, negated) { std::string time_begin; std::string time_end; const size_t dash_pos = time_range.find('-'); if (dash_pos == std::string::npos) { time_begin = time_range; } else { time_begin = time_range.substr(0, dash_pos); time_end = time_range.substr(dash_pos + 1); } _daytime_begin = stringToDaytime(time_begin); if (!time_end.empty()) { _daytime_end = stringToDaytime(time_end); } else { _daytime_end = _daytime_begin; } if (_daytime_begin > _daytime_end) { throw Exception("LocaltimeCondition", "Invalid time range (begin > end)", time_range); } } LocaltimeCondition::LocaltimeCondition(const LocaltimeCondition& rhs) : RuleConditionBase(rhs) { _daytime_begin = rhs._daytime_begin; _daytime_end = rhs._daytime_end; } bool LocaltimeCondition::update(const Rule& rule) { USBGUARD_LOG(Trace); (void)rule; const auto tp_now = std::chrono::system_clock::now(); const auto daytime = std::chrono::system_clock::to_time_t(tp_now) % 86400; USBGUARD_LOG(Trace) << "daytime=" << daytime << " daytime_begin=" << _daytime_begin << " daytime_end=" << _daytime_end; return (daytime >= _daytime_begin && daytime <= _daytime_end); } RuleConditionBase* LocaltimeCondition::clone() const { return new LocaltimeCondition(*this); } std::string LocaltimeCondition::tmToString(const struct tm* const tm) { std::string tm_string; tm_string.append("{ tm.tm_sec="); tm_string.append(numberToString(tm->tm_sec)); tm_string.append(" tm.tm_min="); tm_string.append(numberToString(tm->tm_min)); tm_string.append(" tm.tm_hour="); tm_string.append(numberToString(tm->tm_hour)); tm_string.append(" tm.tm_mday="); tm_string.append(numberToString(tm->tm_mday)); tm_string.append(" tm.tm_mon="); tm_string.append(numberToString(tm->tm_mon)); tm_string.append(" tm.tm_year="); tm_string.append(numberToString(tm->tm_year)); tm_string.append(" tm.tm_wday="); tm_string.append(numberToString(tm->tm_wday)); tm_string.append(" tm.tm_yday="); tm_string.append(numberToString(tm->tm_yday)); tm_string.append(" tm.tm_isdst="); tm_string.append(numberToString(tm->tm_isdst)); tm_string.append(" }"); return tm_string; } std::time_t LocaltimeCondition::stringToDaytime(const std::string& string) { USBGUARD_LOG(Trace) << "string=" << string; struct ::tm tm = { }; if (::strptime(string.c_str(), "%H:%M:%s", &tm) == nullptr) { if (::strptime(string.c_str(), "%H:%M", &tm) == nullptr) { throw Exception("LocaltimeCondition", "Invalid time or range format", string); } } USBGUARD_LOG(Trace) << "tm=" << tmToString(&tm); return tm.tm_sec + 60*tm.tm_min + 60*60*tm.tm_hour; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/LocaltimeCondition.hpp000066400000000000000000000027741325273707200224440ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/Rule.hpp" #include #include namespace usbguard { class LocaltimeCondition : public RuleConditionBase { public: LocaltimeCondition(const std::string& time_range, bool negated = false); LocaltimeCondition(const LocaltimeCondition& rhs); bool update(const Rule& rule); RuleConditionBase* clone() const; protected: static std::time_t stringToDaytime(const std::string& string); static std::string tmToString(const struct ::tm* const tm); private: std::time_t _daytime_begin; std::time_t _daytime_end; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RandomStateCondition.cpp000066400000000000000000000033221325273707200227350ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RandomStateCondition.hpp" #include "usbguard/RuleParser.hpp" #include namespace usbguard { RandomStateCondition::RandomStateCondition(const std::string& true_probability, bool negated) : RuleConditionBase("random", true_probability, negated), _rng_gen(_rng_device()), _true_probability(true_probability.empty() ? 0.5 : std::stod(true_probability)), _rng_dist(_true_probability) { } RandomStateCondition::RandomStateCondition(const RandomStateCondition& rhs) : RuleConditionBase(rhs), _rng_gen(_rng_device()), _true_probability(rhs._true_probability), _rng_dist(_true_probability) { } bool RandomStateCondition::update(const Rule& rule) { (void)rule; return _rng_dist(_rng_gen); } RuleConditionBase* RandomStateCondition::clone() const { return new RandomStateCondition(*this); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RandomStateCondition.hpp000066400000000000000000000026601325273707200227460ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include "usbguard/Rule.hpp" #include "usbguard/RuleCondition.hpp" #include namespace usbguard { class RandomStateCondition : public RuleConditionBase { public: RandomStateCondition(const std::string& true_probability, bool negated = false); RandomStateCondition(const RandomStateCondition& rhs); bool update(const Rule& rule); RuleConditionBase* clone() const; private: std::random_device _rng_device; std::mt19937 _rng_gen; double _true_probability; std::bernoulli_distribution _rng_dist; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleAppliedCondition.cpp000066400000000000000000000051201325273707200227200ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RuleAppliedCondition.hpp" #include "RulePrivate.hpp" #include "usbguard/RuleParser.hpp" #include #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #include #endif namespace usbguard { RuleAppliedCondition::RuleAppliedCondition(const std::string& elapsed_time, bool negated) : RuleConditionBase("rule-applied", elapsed_time, negated) { _elapsed_time = std::chrono::steady_clock::duration(stringToSeconds(elapsed_time)); } RuleAppliedCondition::RuleAppliedCondition(const RuleAppliedCondition& rhs) : RuleConditionBase(rhs), _elapsed_time(rhs._elapsed_time) { } bool RuleAppliedCondition::update(const Rule& rule) { if (rule.internal()->metadata().counter_applied > 0) { if (_elapsed_time == std::chrono::steady_clock::duration::zero()) { return true; } else { const auto last_applied_duration = std::chrono::steady_clock::now() \ - rule.internal()->metadata().tp_last_applied; if (last_applied_duration <= _elapsed_time) { return true; } } } return false; } RuleConditionBase* RuleAppliedCondition::clone() const { return new RuleAppliedCondition(*this); } uint64_t RuleAppliedCondition::stringToSeconds(const std::string& string) { struct ::tm tm = { }; if (string.empty() || string == "") { return 0; } if (::strptime(string.c_str(), "%H:%M:%s", &tm) == nullptr) { if (::strptime(string.c_str(), "%H:%M", &tm) == nullptr) { if (::strptime(string.c_str(), "%s", &tm) == nullptr) { throw std::runtime_error("Invalid time string. Expecing either HH:MM or HH:MM:SS format."); } } } return tm.tm_sec + 60*tm.tm_min + 60*60*tm.tm_hour; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleAppliedCondition.hpp000066400000000000000000000026501325273707200227320ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/Rule.hpp" #include namespace usbguard { class RuleAppliedCondition : public RuleConditionBase { public: RuleAppliedCondition(const std::string& elapsed_time, bool negated = false); RuleAppliedCondition(const RuleAppliedCondition& rhs); bool update(const Rule& rule); RuleConditionBase* clone() const; protected: static uint64_t stringToSeconds(const std::string& string); private: std::chrono::steady_clock::duration _elapsed_time; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleEvaluatedCondition.cpp000066400000000000000000000051611325273707200232610ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RuleEvaluatedCondition.hpp" #include "RulePrivate.hpp" #include "usbguard/RuleParser.hpp" #include #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #include #endif namespace usbguard { RuleEvaluatedCondition::RuleEvaluatedCondition(const std::string& elapsed_time, bool negated) : RuleConditionBase("rule-applied", elapsed_time, negated) { _elapsed_time = std::chrono::steady_clock::duration(stringToSeconds(elapsed_time)); } RuleEvaluatedCondition::RuleEvaluatedCondition(const RuleEvaluatedCondition& rhs) : RuleConditionBase(rhs), _elapsed_time(rhs._elapsed_time) { } bool RuleEvaluatedCondition::update(const Rule& rule) { if (rule.internal()->metadata().counter_evaluated > 0) { if (_elapsed_time == std::chrono::steady_clock::duration::zero()) { return true; } else { const auto last_evaluated_duration = std::chrono::steady_clock::now() \ - rule.internal()->metadata().tp_last_evaluated; if (last_evaluated_duration <= _elapsed_time) { return true; } } } return false; } RuleConditionBase* RuleEvaluatedCondition::clone() const { return new RuleEvaluatedCondition(*this); } uint64_t RuleEvaluatedCondition::stringToSeconds(const std::string& string) { struct ::tm tm = { }; if (string.empty() || string == "") { return 0; } if (::strptime(string.c_str(), "%H:%M:%s", &tm) == nullptr) { if (::strptime(string.c_str(), "%H:%M", &tm) == nullptr) { if (::strptime(string.c_str(), "%s", &tm) == nullptr) { throw std::runtime_error("Invalid time string. Expecing either HH:MM, HH:MM:SS or SS format."); } } } return tm.tm_sec + 60*tm.tm_min + 60*60*tm.tm_hour; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleEvaluatedCondition.hpp000066400000000000000000000026601325273707200232670ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/Rule.hpp" #include namespace usbguard { class RuleEvaluatedCondition : public RuleConditionBase { public: RuleEvaluatedCondition(const std::string& elapsed_time, bool negated = false); RuleEvaluatedCondition(const RuleEvaluatedCondition& rhs); bool update(const Rule& rule); RuleConditionBase* clone() const; protected: static uint64_t stringToSeconds(const std::string& string); private: std::chrono::steady_clock::duration _elapsed_time; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleParser/000077500000000000000000000000001325273707200202255ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Library/RuleParser/Actions.hpp000066400000000000000000000271371325273707200223500ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Utility.hpp" #include "Common/Utility.hpp" #include namespace usbguard { namespace RuleParser { struct target; struct device_id; struct device_id_value; struct string_value; struct multiset_operator; struct interface_value; struct condition; struct str_name; struct str_hash; struct str_parent_hash; struct str_serial; struct str_id; struct str_via_port; struct str_with_interface; struct str_if; template struct rule_parser_actions : pegtl::nothing {}; template<> struct rule_parser_actions { template static void apply(const Input& in, Rule& rule) { try { rule.setTarget(Rule::targetFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct rule_parser_actions { template static void apply(const Input& in, Rule& rule) { try { std::vector tokens; tokenizeString(in.string(), tokens, ":"); const USBDeviceID device_id(tokens[0], tokens[1]); rule.setDeviceID(device_id); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; static const std::string stringValueFromRule(const std::string& value) { const std::string string_raw(value.substr(1, value.size() - 2)); return Utility::unescapeString(string_raw); } template struct name_actions : pegtl::nothing {}; template<> struct name_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeName().empty()) { throw pegtl::parse_error("name attribute already defined", in); } } }; template<> struct name_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeName().append(stringValueFromRule(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct name_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeName().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct id_actions : pegtl::nothing {}; template<> struct id_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeDeviceID().empty()) { throw pegtl::parse_error("id attribute already defined", in); } } }; template<> struct id_actions { template static void apply(const Input& in, Rule& rule) { try { std::vector tokens; tokenizeString(in.string(), tokens, ":"); const USBDeviceID device_id(tokens[0], tokens[1]); rule.attributeDeviceID().append(device_id); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct id_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeDeviceID().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct hash_actions : pegtl::nothing {}; template<> struct hash_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeHash().empty()) { throw pegtl::parse_error("hash attribute already defined", in); } } }; template<> struct hash_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeHash().append(stringValueFromRule(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct hash_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeHash().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct parent_hash_actions : pegtl::nothing {}; template<> struct parent_hash_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeParentHash().empty()) { throw pegtl::parse_error("parent-hash attribute already defined", in); } } }; template<> struct parent_hash_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeParentHash().append(stringValueFromRule(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct parent_hash_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeParentHash().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct serial_actions : pegtl::nothing {}; template<> struct serial_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeSerial().empty()) { throw pegtl::parse_error("serial attribute already defined", in); } } }; template<> struct serial_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeSerial().append(stringValueFromRule(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct serial_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeSerial().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct via_port_actions : pegtl::nothing {}; template<> struct via_port_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeViaPort().empty()) { throw pegtl::parse_error("via-port attribute already defined", in); } } }; template<> struct via_port_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeViaPort().append(stringValueFromRule(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct via_port_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeViaPort().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct with_interface_actions : pegtl::nothing {}; template<> struct with_interface_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeWithInterface().empty()) { throw pegtl::parse_error("with-interface attribute already defined", in); } } }; template<> struct with_interface_actions { template static void apply(const Input& in, Rule& rule) { try { const USBInterfaceType interface_type(in.string()); rule.attributeWithInterface().append(interface_type); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct with_interface_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeWithInterface().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template struct condition_actions : pegtl::nothing {}; template<> struct condition_actions { template static void apply(const Input& in, Rule& rule) { if (!rule.attributeConditions().empty()) { throw pegtl::parse_error("conditions already defined", in); } } }; template<> struct condition_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeConditions().append(RuleCondition(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct condition_actions { template static void apply(const Input& in, Rule& rule) { try { rule.attributeConditions().setSetOperator(Rule::setOperatorFromString(in.string())); } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; } /* namespace RuleParser */ } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleParser/Grammar.hpp000066400000000000000000000140261325273707200223270ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Actions.hpp" #include using namespace pegtl; namespace usbguard { namespace RuleParser { /* * Rule language keywords */ struct str_allow : pegtl_string_t("allow") {}; struct str_block : pegtl_string_t("block") {}; struct str_reject : pegtl_string_t("reject") {}; struct str_match : pegtl_string_t("match") {}; struct str_device : pegtl_string_t("device") {}; struct str_name : pegtl_string_t("name") {}; struct str_hash : pegtl_string_t("hash") {}; struct str_parent_hash : pegtl_string_t("parent-hash") {}; struct str_via_port : pegtl_string_t("via-port") {}; struct str_with_interface : pegtl_string_t("with-interface") {}; struct str_serial : pegtl_string_t("serial") {}; struct str_if : pegtl_string_t("if") {}; struct str_id : pegtl_string_t("id") {}; struct str_all_of : pegtl_string_t("all-of") {}; struct str_one_of : pegtl_string_t("one-of") {}; struct str_none_of : pegtl_string_t("none-of") {}; struct str_equals : pegtl_string_t("equals") {}; struct str_equals_ordered : pegtl_string_t("equals-ordered") {}; /* * Generic rule attribute */ struct multiset_operator : sor {}; template struct attribute_value_multiset : seq>, one<'{'>, star, list>, star, one<'}'>> {}; template struct rule_attribute : seq, sor, attribute_value_rule>> {}; /* * Bounded string value */ struct escaped_single : one<'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '\'', '0', '\n'> {}; struct escaped_decbyte : if_must> {}; struct escaped_hexbyte : if_must, rep<2, ascii::xdigit>> {}; template struct character_escaped : if_must, sor>> {}; struct character_regular : not_one<'\r', '\n'> {}; template struct character : sor, character_regular> {}; template struct bounded_string : if_must, until, character>> {}; struct string_value : bounded_string<'"'> {}; /* * Rule conditions */ struct condition_argument : bounded_string<'(', ')'> {}; struct condition_identifier : seq, star>> {}; struct negation : one<'!'> {}; struct condition : seq, condition_identifier, opt> {}; /* * Device ID */ struct hex4 : rep<4, ascii::xdigit> {}; struct device_vid : sor> {}; struct device_pid : sor> {}; struct device_id_value : seq, device_pid> {}; struct device_id : device_id_value {}; /* * USB interface notation */ struct hex2 : rep<2, ascii::xdigit> {}; struct hex2orAsterisk : sor> {}; struct interface_value : seq, hex2orAsterisk, one<':'>, hex2orAsterisk> {}; /* * Device attributes */ struct id_attribute : action> {}; struct name_attribute : action> {}; struct hash_attribute : action> {}; struct parent_hash_attribute : action> {}; struct serial_attribute : action> {}; struct via_port_attribute : action> {}; struct with_interface_attribute : action> {}; struct condition_attribute : action> {}; struct rule_attributes : sor {}; /* * Rule target */ struct target : sor {}; /* * Rule */ struct rule : seq, device_id>, opt, list>>> {}; /* * Grammar entry point */ struct rule_grammar : until> {}; } /* namespace RuleParser */ } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RulePrivate.cpp000066400000000000000000000262231325273707200211140ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RulePrivate.hpp" #include "Common/Utility.hpp" #include "usbguard/RuleParser.hpp" #include "usbguard/Logger.hpp" namespace usbguard { RulePrivate::RulePrivate(Rule& p_instance) : //_p_instance(p_instance), _device_id("id"), _serial("serial"), _name("name"), _hash("hash"), _parent_hash("parent-hash"), _via_port("via-port"), _with_interface("with-interface"), _conditions("if") { (void)p_instance; _rule_id = Rule::DefaultID; _target = Rule::Target::Invalid; _conditions_state = 0; } RulePrivate::RulePrivate(Rule& p_instance, const RulePrivate& rhs) : //_p_instance(p_instance), _device_id("id"), _serial("serial"), _name("name"), _hash("hash"), _parent_hash("parent-hash"), _via_port("via-port"), _with_interface("with-interface"), _conditions("if") { (void)p_instance; *this = rhs; } const RulePrivate& RulePrivate::operator=(const RulePrivate& rhs) { _meta = rhs._meta; _rule_id = rhs._rule_id; _target = rhs._target; _device_id = rhs._device_id; _serial = rhs._serial; _name = rhs._name; _hash = rhs._hash; _parent_hash = rhs._parent_hash; _via_port = rhs._via_port; _with_interface = rhs._with_interface; _conditions = rhs._conditions; _conditions_state = rhs._conditions_state; return *this; #if 0 /* TODO */ try { for (auto const& condition : rhs._conditions) { _conditions.push_back(condition->clone()); } } catch (...) { for (auto const& condition : _conditions) { delete condition; } throw; } #endif } RulePrivate::~RulePrivate() { } bool RulePrivate::appliesTo(std::shared_ptr rhs, bool parent_insensitive) const { return appliesTo(*rhs, parent_insensitive); } bool RulePrivate::appliesTo(const Rule& rhs, bool parent_insensitive) const { /* * This method checks whether the rule referenced by rhs belongs to * a set defined by this rule. */ USBGUARD_LOG(Trace) << "entry:" << " rhs=" << rhs.toString() << " parent_insensitive=" << parent_insensitive; bool applies = false; if (!_device_id.appliesTo(rhs.internal()->_device_id) || !_serial.appliesTo(rhs.internal()->_serial) || !_name.appliesTo(rhs.internal()->_name) || !_hash.appliesTo(rhs.internal()->_hash) || !(parent_insensitive || _parent_hash.appliesTo(rhs.internal()->_parent_hash)) || !(parent_insensitive || _via_port.appliesTo(rhs.internal()->_via_port)) || !_with_interface.appliesTo(rhs.internal()->_with_interface)) { applies = false; } else { applies = true; } USBGUARD_LOG(Trace) << "return:" << " applies=" << applies; return applies; } bool RulePrivate::appliesToWithConditions(const Rule& rhs, bool with_update) { USBGUARD_LOG(Trace) << "entry:" << " rhs=" << rhs.toString() << " with_updates=" << with_update; bool applies = false; if (appliesTo(rhs)) { applies = meetsConditions(rhs, with_update); } else { applies = false; } USBGUARD_LOG(Trace) << "return:" << " applies=" << applies; return applies; } bool RulePrivate::meetsConditions(const Rule& rhs, bool with_update) { USBGUARD_LOG(Trace) << "entry:" << " conditions=" << _conditions.count() << " rhs=" << rhs.toString() << " with_update=" << with_update; if (with_update) { (void)updateConditionsState(rhs); } USBGUARD_LOG(Debug) << "set_operator=" << Rule::setOperatorToString(_conditions.setOperator()); bool meets_conditions = false; switch (_conditions.setOperator()) { case Rule::SetOperator::OneOf: meets_conditions = conditionsState() > 0; break; case Rule::SetOperator::NoneOf: meets_conditions = conditionsState() == 0; break; case Rule::SetOperator::AllOf: case Rule::SetOperator::Equals: case Rule::SetOperator::EqualsOrdered: meets_conditions = \ (conditionsState() == ((((uint64_t)1) << _conditions.count()) - 1)); break; case Rule::SetOperator::Match: default: throw std::runtime_error("BUG: meetsConditions: invalid conditions set operator"); } USBGUARD_LOG(Trace) << "return:" << " meets_conditions=" << meets_conditions; return meets_conditions; } void RulePrivate::initConditions(Interface* const interface) { for (auto& condition : _conditions.values()) { condition->init(interface); } /* FIXME: prevent leaks when init() throws an exception */ } void RulePrivate::finiConditions() { for (auto& condition : _conditions.values()) { condition->fini(); } } bool RulePrivate::updateConditionsState(const Rule& rhs) { uint64_t updated_state = 0; unsigned int i = 0; for (auto& condition : _conditions.values()) { if (i >= (sizeof updated_state * 8)) { throw std::runtime_error("BUG: updateConditionsState: too many conditions"); } updated_state |= uint64_t(condition->evaluate(rhs)) << i; ++i; } USBGUARD_LOG(Debug) << "current=" << conditionsState() << " updated=" << updated_state; bool retval = false; if (updated_state != conditionsState()) { setConditionsState(updated_state); retval = true; } else { retval = false; } USBGUARD_LOG(Trace) << "return:" << " retval=" << retval; return retval; } uint64_t RulePrivate::conditionsState() const { return _conditions_state; } void RulePrivate::setConditionsState(uint64_t state) { _conditions_state = state; } void RulePrivate::setRuleID(uint32_t rule_id) { _rule_id = rule_id; } uint32_t RulePrivate::getRuleID() const { return _rule_id; } void RulePrivate::setTarget(Rule::Target target) { _target = target; } Rule::Target RulePrivate::getTarget() const { return _target; } void RulePrivate::setDeviceID(const USBDeviceID& device_id) { _device_id.set(device_id); } const USBDeviceID& RulePrivate::getDeviceID() const { return _device_id.get(); } const Rule::Attribute& RulePrivate::attributeDeviceID() const { return _device_id; } Rule::Attribute& RulePrivate::attributeDeviceID() { return _device_id; } void RulePrivate::setSerial(const std::string& value) { _serial.set(value); } const std::string& RulePrivate::getSerial() const { return _serial.get(); } const Rule::Attribute& RulePrivate::attributeSerial() const { return _serial; } Rule::Attribute& RulePrivate::attributeSerial() { return _serial; } void RulePrivate::setName(const std::string& value) { _name.set(value); } const std::string& RulePrivate::getName() const { return _name.get(); } const Rule::Attribute& RulePrivate::attributeName() const { return _name; } Rule::Attribute& RulePrivate::attributeName() { return _name; } void RulePrivate::setHash(const std::string& value) { _hash.set(value); } const std::string& RulePrivate::getHash() const { return _hash.get(); } const Rule::Attribute& RulePrivate::attributeHash() const { return _hash; } Rule::Attribute& RulePrivate::attributeHash() { return _hash; } void RulePrivate::setParentHash(const std::string& value) { _parent_hash.set(value); } const std::string& RulePrivate::getParentHash() const { return _parent_hash.get(); } const Rule::Attribute& RulePrivate::attributeParentHash() const { return _parent_hash; } Rule::Attribute& RulePrivate::attributeParentHash() { return _parent_hash; } void RulePrivate::setViaPort(const std::string& value) { _via_port.set(value); } const std::string& RulePrivate::getViaPort() const { return _via_port.get(); } const Rule::Attribute& RulePrivate::attributeViaPort() const { return _via_port; } Rule::Attribute& RulePrivate::attributeViaPort() { return _via_port; } const Rule::Attribute& RulePrivate::attributeWithInterface() const { return _with_interface; } Rule::Attribute& RulePrivate::attributeWithInterface() { return _with_interface; } const Rule::Attribute& RulePrivate::attributeConditions() const { return _conditions; } Rule::Attribute& RulePrivate::attributeConditions() { return _conditions; } template static void toString_appendNonEmptyAttribute(std::string& rule_string, const Rule::Attribute& attribute) { if (attribute.empty()) { return; } rule_string.append(" "); rule_string.append(attribute.toRuleString()); return; } std::string RulePrivate::toString(bool invalid) const { std::string rule_string; try { rule_string.append(Rule::targetToString(_target)); } catch (...) { if (invalid) { rule_string.append(""); } else { throw; } } toString_appendNonEmptyAttribute(rule_string, _device_id); toString_appendNonEmptyAttribute(rule_string, _serial); toString_appendNonEmptyAttribute(rule_string, _name); toString_appendNonEmptyAttribute(rule_string, _hash); toString_appendNonEmptyAttribute(rule_string, _parent_hash); toString_appendNonEmptyAttribute(rule_string, _via_port); toString_appendNonEmptyAttribute(rule_string, _with_interface); toString_appendNonEmptyAttribute(rule_string, _conditions); return rule_string; } RulePrivate::MetaData& RulePrivate::metadata() { return _meta; } const RulePrivate::MetaData& RulePrivate::metadata() const { return _meta; } Rule RulePrivate::fromString(const std::string& rule_string) { return parseRuleFromString(rule_string); } void RulePrivate::updateMetaDataCounters(bool applied, bool evaluated) { if (evaluated) { ++_meta.counter_evaluated; _meta.tp_last_evaluated = std::chrono::steady_clock::now(); } if (applied) { ++_meta.counter_applied; _meta.tp_last_applied = std::chrono::steady_clock::now(); } return; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RulePrivate.hpp000066400000000000000000000117701325273707200211220ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Rule.hpp" #include namespace usbguard { class Interface; class RulePrivate { public: struct MetaData { MetaData() : tp_created(std::chrono::steady_clock::now()) { counter_evaluated = 0; counter_applied = 0; } MetaData(const MetaData& rhs) { counter_evaluated = rhs.counter_evaluated; counter_applied = rhs.counter_applied; tp_created = rhs.tp_created; tp_last_evaluated = rhs.tp_last_evaluated; tp_last_applied = rhs.tp_last_applied; } uint64_t counter_evaluated; uint64_t counter_applied; std::chrono::steady_clock::time_point tp_created; std::chrono::steady_clock::time_point tp_last_evaluated; std::chrono::steady_clock::time_point tp_last_applied; }; RulePrivate(Rule& p_instance); RulePrivate(Rule& p_instance, const RulePrivate& rhs); const RulePrivate& operator=(const RulePrivate& rhs); ~RulePrivate(); bool appliesTo(std::shared_ptr rhs, bool parent_insensitive = false) const; bool appliesTo(const Rule& rhs, bool parent_insensitive = false) const; bool appliesToWithConditions(const Rule& rhs, bool with_update = false); bool meetsConditions(const Rule& rhs, bool with_update = false); void initConditions(Interface* const interface); void finiConditions(); bool updateConditionsState(const Rule& rhs); uint64_t conditionsState() const; void setConditionsState(uint64_t state); void setRuleID(uint32_t rule_id); uint32_t getRuleID() const; void setTarget(Rule::Target target); Rule::Target getTarget() const; void setDeviceID(const USBDeviceID& value); const USBDeviceID& getDeviceID() const; const Rule::Attribute& attributeDeviceID() const; Rule::Attribute& attributeDeviceID(); void setSerial(const std::string& value); const std::string& getSerial() const; const Rule::Attribute& attributeSerial() const; Rule::Attribute& attributeSerial(); void setName(const std::string& value); const std::string& getName() const; const Rule::Attribute& attributeName() const; Rule::Attribute& attributeName(); void setHash(const std::string& value); const std::string& getHash() const; const Rule::Attribute& attributeHash() const; Rule::Attribute& attributeHash(); void setParentHash(const std::string& value); const std::string& getParentHash() const; const Rule::Attribute& attributeParentHash() const; Rule::Attribute& attributeParentHash(); void setViaPort(const std::string& value); const std::string& getViaPort() const; const Rule::Attribute& attributeViaPort() const; Rule::Attribute& attributeViaPort(); /* * Set/get for a single value isn't useful for the * with-interface attribute as it usualy contains * multiple values. Therefore, we provide only the * attribute accessors in this case. */ const Rule::Attribute& attributeWithInterface() const; Rule::Attribute& attributeWithInterface(); const Rule::Attribute& attributeConditions() const; Rule::Attribute& attributeConditions(); std::string toString(bool invalid = false) const; MetaData& metadata(); const MetaData& metadata() const; void updateMetaDataCounters(bool applied = true, bool evaluated = false); /*** Static methods ***/ static Rule fromString(const std::string& rule_string); private: //Rule& _p_instance; MetaData _meta; uint32_t _rule_id; Rule::Target _target; Rule::Attribute _device_id; Rule::Attribute _serial; Rule::Attribute _name; Rule::Attribute _hash; Rule::Attribute _parent_hash; Rule::Attribute _via_port; Rule::Attribute _with_interface; Rule::Attribute _conditions; uint64_t _conditions_state; }; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleSetPrivate.cpp000066400000000000000000000164031325273707200215670ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RuleSetPrivate.hpp" #include "RulePrivate.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/RuleParser.hpp" #include "usbguard/Exception.hpp" #include namespace usbguard { RuleSetPrivate::RuleSetPrivate(RuleSet& p_instance, Interface* const interface_ptr) : _p_instance(p_instance), _interface_ptr(interface_ptr) { (void)_p_instance; _default_target = Rule::Target::Block; _default_action = std::string(); _id_next = Rule::RootID + 1; } RuleSetPrivate::RuleSetPrivate(RuleSet& p_instance, const RuleSetPrivate& rhs) : _p_instance(p_instance), _interface_ptr(rhs._interface_ptr) { *this = rhs; } const RuleSetPrivate& RuleSetPrivate::operator=(const RuleSetPrivate& rhs) { _default_target = rhs._default_target; _default_action = rhs._default_action; _id_next = rhs._id_next.load(); _rules = rhs._rules; return *this; } RuleSetPrivate::~RuleSetPrivate() { } void RuleSetPrivate::load(const std::string& path) { std::ifstream stream(path); if (!stream.is_open()) { throw ErrnoException("RuleSet loading", path, errno); } load(stream); } void RuleSetPrivate::load(std::istream& stream) { std::unique_lock lock(_io_mutex); std::string line_string; size_t line_number = 0; do { ++line_number; std::getline(stream, line_string); const Rule rule = parseRuleFromString(line_string, "", line_number); if (rule) { appendRule(rule); } } while (stream.good()); } void RuleSetPrivate::save(const std::string& path) const { std::ofstream stream(path, std::fstream::trunc); if (!stream.is_open()) { throw ErrnoException("RuleSet saving", path, errno); } save(stream); } void RuleSetPrivate::save(std::ostream& stream) const { std::unique_lock io_lock(_io_mutex); std::unique_lock op_lock(_op_mutex); for (auto const& rule : _rules) { const std::string rule_string = rule->toString(); stream << rule_string << std::endl; } } void RuleSetPrivate::setDefaultTarget(Rule::Target target) { std::unique_lock op_lock(_op_mutex); _default_target = target; } Rule::Target RuleSetPrivate::getDefaultTarget() const { std::unique_lock op_lock(_op_mutex); return _default_target; } void RuleSetPrivate::setDefaultAction(const std::string& action) { std::unique_lock op_lock(_op_mutex); _default_action = action; } uint32_t RuleSetPrivate::appendRule(const Rule& rule, uint32_t parent_id, bool lock) { std::unique_lock op_lock(_op_mutex, std::defer_lock); if (lock) { op_lock.lock(); } auto rule_ptr = std::make_shared(rule); /* * If the rule doesn't already have a sequence number * assigned, do it now. Otherwise update the sequence * number counter so that we don't generate a duplicit * one if assignID() gets called in the future. */ if (rule_ptr->getRuleID() == Rule::DefaultID) { assignID(rule_ptr); } else { _id_next = std::max(_id_next.load(), rule_ptr->getRuleID() + 1); } /* Initialize conditions */ rule_ptr->internal()->initConditions(_interface_ptr); /* Append the rule to the main rule table */ if (parent_id == Rule::LastID) { _rules.push_back(rule_ptr); } else if (parent_id == 0) { _rules.insert(_rules.begin(), rule_ptr); } else { bool parent_found = false; for (auto it = _rules.begin(); it != _rules.end(); ++it) { const Rule& rule = **it; if (rule.getRuleID() == parent_id) { _rules.insert(it+1, rule_ptr); parent_found = true; break; } } if (!parent_found) { throw Exception("Rule set append", "rule", "Invalid parent ID"); } } return rule_ptr->getRuleID(); } uint32_t RuleSetPrivate::upsertRule(const Rule& match_rule, const Rule& new_rule, const bool parent_insensitive) { std::unique_lock op_lock(_op_mutex); std::shared_ptr matching_rule; for (auto& rule_ptr : _rules) { if (rule_ptr->internal()->appliesTo(match_rule, parent_insensitive)) { if (!matching_rule) { matching_rule = rule_ptr; } else { throw Exception("Rule set upsert", "rule", "Cannot upsert; multiple matching rules"); } } } if (matching_rule) { const uint32_t id = matching_rule->getRuleID(); *matching_rule = new_rule; matching_rule->setRuleID(id); return id; } else { return appendRule(new_rule, Rule::LastID, /*lock=*/false); } } std::shared_ptr RuleSetPrivate::getRule(uint32_t id) { std::unique_lock op_lock(_op_mutex); for (auto const& rule : _rules) { if (rule->getRuleID() == id) { return rule; } } throw Exception("Rule set lookup", "rule id", "id doesn't exist"); } bool RuleSetPrivate::removeRule(uint32_t id) { std::unique_lock op_lock(_op_mutex); for (auto it = _rules.begin(); it != _rules.end(); ++it) { auto const& rule_ptr = *it; if (rule_ptr->getRuleID() == id) { _rules.erase(it); return true; } } /* FIXME: Remove the rule from the priority queue too */ throw Exception("Rule set remove", "rule id", "id doesn't exist"); } std::shared_ptr RuleSetPrivate::getFirstMatchingRule(std::shared_ptr device_rule, uint32_t from_id) const { (void)from_id; /* TODO */ std::unique_lock op_lock(_op_mutex); for (auto& rule_ptr : _rules) { if (rule_ptr->internal()->appliesToWithConditions(*device_rule, /*with_update*/true)) { return rule_ptr; } } std::shared_ptr default_rule = std::make_shared(); default_rule->setRuleID(Rule::ImplicitID); default_rule->setTarget(_default_target); return default_rule; } std::vector> RuleSetPrivate::getRules() { std::vector> rules; for (auto const& rule : _rules) { rules.push_back(rule); } return rules; } uint32_t RuleSetPrivate::assignID(std::shared_ptr rule) { rule->setRuleID(assignID()); return rule->getRuleID(); } uint32_t RuleSetPrivate::assignID() { return _id_next++; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/RuleSetPrivate.hpp000066400000000000000000000046401325273707200215740ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include "usbguard/RuleSet.hpp" #include #include #include namespace usbguard { class RuleSetPrivate { public: RuleSetPrivate(RuleSet& p_instance, Interface* const interface_ptr); RuleSetPrivate(RuleSet& p_instance, const RuleSetPrivate& rhs); const RuleSetPrivate& operator=(const RuleSetPrivate& rhs); ~RuleSetPrivate(); void load(const std::string& path); void load(std::istream& stream); void save(const std::string& path) const; void save(std::ostream& stream) const; void setDefaultTarget(Rule::Target target); Rule::Target getDefaultTarget() const; void setDefaultAction(const std::string& action); uint32_t appendRule(const Rule& rule, uint32_t parent_id = Rule::LastID, bool lock = true); uint32_t upsertRule(const Rule& match_rule, const Rule& new_rule, bool parent_insensitive = false); std::shared_ptr getRule(uint32_t id); bool removeRule(uint32_t id); std::shared_ptr getFirstMatchingRule(std::shared_ptr device_rule, uint32_t from_id = 1) const; std::vector> getRules(); uint32_t assignID(std::shared_ptr rule); uint32_t assignID(); private: mutable std::mutex _io_mutex; /* mutex for load/save */ mutable std::mutex _op_mutex; /* mutex for operations on the rule set */ RuleSet& _p_instance; Interface* const _interface_ptr; Rule::Target _default_target; std::string _default_action; Atomic _id_next; std::vector> _rules; }; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/SysFSDevice.cpp000066400000000000000000000125241325273707200210000ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "SysFSDevice.hpp" #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE #endif #include #include #include #include namespace usbguard { SysFSDevice::SysFSDevice() : _sysfs_dirfd(-1) { } SysFSDevice::SysFSDevice(const std::string& sysfs_path, bool without_parent) : _sysfs_path(sysfs_path), _sysfs_name(filenameFromPath(_sysfs_path, /*include_extension=*/true)), _sysfs_dirfd(-1) { USBGUARD_LOG(Trace) << "sysfs_path=" << sysfs_path << " without_parent=" << without_parent; if (!without_parent) { _sysfs_parent_path = parentPath(sysfs_path); if (_sysfs_parent_path.empty()) { throw Exception("SysFSDevice", sysfs_path, "Cannot get parent path"); } USBGUARD_LOG(Debug) << "parent_path=" << _sysfs_parent_path; } USBGUARD_SYSCALL_THROW("SysFSDevice", (_sysfs_dirfd = open(_sysfs_path.c_str(), O_PATH|O_DIRECTORY)) < 0); try { reloadUEvent(); } catch (...) { close(_sysfs_dirfd); throw; } } SysFSDevice::SysFSDevice(SysFSDevice&& device) : _sysfs_path(std::move(device._sysfs_path)), _sysfs_name(std::move(device._sysfs_name)), _sysfs_parent_path(std::move(device._sysfs_parent_path)), _uevent(std::move(device._uevent)) { _sysfs_dirfd = device._sysfs_dirfd; device._sysfs_dirfd = -1; } SysFSDevice::~SysFSDevice() { if (_sysfs_dirfd != -1) { close(_sysfs_dirfd); } } SysFSDevice& SysFSDevice::operator=(SysFSDevice&& rhs_device) { _sysfs_path = std::move(rhs_device._sysfs_path); _sysfs_name = std::move(rhs_device._sysfs_name); _sysfs_parent_path = std::move(rhs_device._sysfs_parent_path); _sysfs_dirfd = std::move(rhs_device._sysfs_dirfd); rhs_device._sysfs_dirfd = -1; _uevent = std::move(rhs_device._uevent); return *this; } const std::string& SysFSDevice::getPath() const { return _sysfs_path; } const std::string& SysFSDevice::getName() const { return _sysfs_name; } const UEvent& SysFSDevice::getUEvent() const { return _uevent; } const std::string& SysFSDevice::getParentPath() const { return _sysfs_parent_path; } bool SysFSDevice::hasAttribute(const std::string& name) const { struct ::stat st; if (::fstatat(_sysfs_dirfd, name.c_str(), &st, AT_SYMLINK_NOFOLLOW) != 0) { if (errno == ENOENT) { return false; } throw ErrnoException("SysFSDevice::hasAttribute", name, errno); } return S_ISREG(st.st_mode); } int SysFSDevice::openAttribute(const std::string& name) const { USBGUARD_LOG(Trace) << "name=" << name; const int fd = openat(_sysfs_dirfd, name.c_str(), O_RDONLY); if (fd < 0) { throw ErrnoException("SysFSDevice", name, errno); } return fd; } std::string SysFSDevice::readAttribute(const std::string& name, bool strip_last_null, bool optional) const { USBGUARD_LOG(Trace) << "name=" << name; const ScopedFD fd(openat(_sysfs_dirfd, name.c_str(), O_RDONLY)); if (fd < 0) { if (optional && errno == ENOENT) { return std::string(); } else { throw ErrnoException("SysFSDevice", name, errno); } } std::string buffer(4096, 0); ssize_t rc = -1; USBGUARD_SYSCALL_THROW("SysFSDevice", (rc = read(fd, &buffer[0], buffer.capacity())) < 0); if (strip_last_null) { if (rc > 0) { buffer.resize(static_cast(rc) - 1); } else { return std::string(); } } else { buffer.resize(static_cast(rc)); } USBGUARD_LOG(Debug) << "value=" << buffer << " size=" << buffer.size(); return buffer; } void SysFSDevice::setAttribute(const std::string& name, const std::string& value) { USBGUARD_LOG(Trace) << "name=" << name << " value=" << value; USBGUARD_LOG(Trace) << "path=" << _sysfs_path; const ScopedFD fd(openat(_sysfs_dirfd, name.c_str(), O_WRONLY)); if (fd < 0) { throw ErrnoException("SysFSDevice", name, errno); } ssize_t rc = -1; USBGUARD_SYSCALL_THROW("SysFSDevice", (rc = write(fd, &value[0], value.size())) != (ssize_t)value.size()); } void SysFSDevice::reload() { reloadUEvent(); } void SysFSDevice::reloadUEvent() { const std::string uevent_string = readAttribute("uevent"); _uevent = UEvent::fromString(uevent_string, /*attributes_only=*/true); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/SysFSDevice.hpp000066400000000000000000000035221325273707200210030ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "UEvent.hpp" #include "usbguard/Typedefs.hpp" #include namespace usbguard { class SysFSDevice { public: SysFSDevice(); SysFSDevice(const std::string& sysfs_path, bool without_parent = false); SysFSDevice(SysFSDevice&& device); ~SysFSDevice(); SysFSDevice& operator=(SysFSDevice&& rhs_device); const std::string& getPath() const; const std::string& getName() const; const UEvent& getUEvent() const; const std::string& getParentPath() const; bool hasAttribute(const std::string& name) const; std::string readAttribute(const std::string& name, bool strip_last_null = false, bool optional = false) const; void setAttribute(const std::string& name, const std::string& value); int openAttribute(const std::string& name) const; void reload(); private: void reloadUEvent(); std::string _sysfs_path; std::string _sysfs_name; std::string _sysfs_parent_path; int _sysfs_dirfd; UEvent _uevent; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEvent.cpp000066400000000000000000000056711325273707200200640ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "UEvent.hpp" #include "UEventParser.hpp" #include "usbguard/Logger.hpp" namespace usbguard { UEvent::UEvent() { } UEvent::UEvent(UEvent&& rhs) : _attributes(std::move(rhs._attributes)) { } UEvent& UEvent::operator=(UEvent&& rhs) { _attributes = std::move(rhs._attributes); return *this; } UEvent UEvent::fromString(const std::string& uevent_string, bool attributes_only, bool trace) { UEvent uevent; parseUEventFromString(uevent_string, uevent, attributes_only, trace); return uevent; } void UEvent::clear() { _attributes.clear(); } void UEvent::setAttribute(const std::string& name, const std::string& value) { USBGUARD_LOG(Trace) << "Setting attribute: " << name << "=" << value; _attributes[name] = value; } std::string UEvent::getAttribute(const std::string& name) const { auto it = _attributes.find(name); if (it == _attributes.end()) { return std::string(); } else { return it->second; } } bool UEvent::hasAttribute(const std::string& name) const { return _attributes.count(name) == 1; } std::string UEvent::getHeaderLine() const { if (!hasAttribute("ACTION") || !hasAttribute("DEVPATH")) { throw std::runtime_error("uevent: missing required header line values"); } std::string header_line; header_line.append(getAttribute("ACTION")); header_line.append(1, '@'); header_line.append(getAttribute("DEVPATH")); return header_line; } std::string UEvent::toString(char separator) const { std::string uevent_string = getHeaderLine(); uevent_string.append(1, separator); for (auto const& kv_pair : _attributes) { uevent_string.append(kv_pair.first); uevent_string.append(1, '='); uevent_string.append(kv_pair.second); uevent_string.append(1, separator); } return uevent_string; } bool UEvent::hasRequiredAttributes() const { for (const std::string name : { "ACTION", "DEVPATH", "SUBSYSTEM" }) { if (!hasAttribute(name)) { return false; } } return true; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEvent.hpp000066400000000000000000000030751325273707200200650ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include #include namespace usbguard { class UEvent { public: UEvent(); UEvent(UEvent&& rhs); UEvent& operator=(UEvent&& rhs); static UEvent fromString(const std::string& uevent_string, bool attributes_only = false, bool trace = false); void clear(); void setAttribute(const std::string& name, const std::string& value); std::string getAttribute(const std::string& name) const; bool hasAttribute(const std::string& name) const; bool hasRequiredAttributes() const; std::string getHeaderLine() const; std::string toString(char separator = '\0') const; private: std::map _attributes; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEventDeviceManager.cpp000066400000000000000000000704551325273707200225010ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #if defined(HAVE_UEVENT) #include "UEventDeviceManager.hpp" #include "UEventParser.hpp" #include "SysFSDevice.hpp" #include "Base64.hpp" #include "Common/FDInputStream.hpp" #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include "usbguard/USB.hpp" #include #include #include #include #include #include #include #include #include #include #include #include namespace usbguard { UEventDevice::UEventDevice(UEventDeviceManager& device_manager, SysFSDevice& sysfs_device) : Device(device_manager) { /* * Look for the parent USB device and set the parent id * if we find one. */ const std::string sysfs_parent_path(sysfs_device.getParentPath()); const SysFSDevice sysfs_parent_device(sysfs_parent_path); if (sysfs_parent_device.getUEvent().getAttribute("DEVTYPE") == "usb_device") { setParentID(device_manager.getIDFromSysPath(sysfs_parent_path)); } else { setParentID(Rule::RootID); setParentHash(hashString(sysfs_parent_path)); } /* * Set name */ setName(sysfs_device.readAttribute("product", /*strip_last_null=*/true, /*optional=*/true)); /* * Set USB ID */ const std::string id_vendor(sysfs_device.readAttribute("idVendor", /*strip_last_null=*/true)); const std::string id_product(sysfs_device.readAttribute("idProduct", /*strip_last_null=*/true)); const USBDeviceID device_id(id_vendor, id_product); setDeviceID(device_id); /* * Set serial number */ setSerial(sysfs_device.readAttribute("serial", /*strip_last_null=*/true, /*optional=*/true)); /* * Set USB port */ setPort(sysfs_device.getName()); /* * Sync authorization target */ const std::string authorized_value(sysfs_device.readAttribute("authorized", /*strip_last_null=*/true)); if (authorized_value == "0") { setTarget(Rule::Target::Block); } else if (authorized_value == "1") { setTarget(Rule::Target::Allow); } else { /* * Block the device if we get an unexpected value */ setTarget(Rule::Target::Block); } /* * Process USB descriptor data. * * FDInputStream (stdio_filebuf) is responsible for closing the file * descriptor returned by sysfs_device.openAttribute(). * */ FDInputStream descriptor_stream(sysfs_device.openAttribute("descriptors")); /* * Find out the descriptor data stream size */ size_t descriptor_expected_size = 0; if (!descriptor_stream.good()) { throw ErrnoException("UEventDevice", sysfs_device.getPath(), errno); } initializeHash(); USBDescriptorParser parser(*this); if ((descriptor_expected_size = parser.parse(descriptor_stream)) < sizeof(USBDeviceDescriptor)) { throw Exception("UEventDevice", sysfs_device.getPath(), "USB descriptor parser processed less data than the size of a USB device descriptor"); } finalizeHash(); /* * From now own we take ownership of the SysFSDevice instance. */ _sysfs_device = std::move(sysfs_device); } SysFSDevice& UEventDevice::sysfsDevice() { return _sysfs_device; } const std::string& UEventDevice::getSysPath() const { return _sysfs_device.getPath(); } bool UEventDevice::isController() const { if (getPort().substr(0, 3) != "usb" || getInterfaceTypes().size() != 1) { return false; } const USBInterfaceType hub_interface("09:00:*"); return hub_interface.appliesTo(getInterfaceTypes()[0]); } std::string UEventDevice::getSystemName() const { return getSysPath(); } void UEventDevice::parseUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { USBGUARD_LOG(Trace); USBDescriptorParserHooks::parseUSBDescriptor(parser, descriptor_raw, descriptor_out); if (isLinuxRootHubDeviceDescriptor(descriptor_out)) { updateHashLinuxRootHubDeviceDescriptor(descriptor_raw); } else { updateHash(descriptor_raw, static_cast(descriptor_raw->bHeader.bLength)); } } void UEventDevice::loadUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor) { const auto type = static_cast(descriptor->bHeader.bDescriptorType); switch (type) { case USBDescriptorType::Device: loadDeviceDescriptor(parser, descriptor); break; case USBDescriptorType::Configuration: loadConfigurationDescriptor(parser, descriptor); break; case USBDescriptorType::Interface: loadInterfaceDescriptor(parser, descriptor); break; case USBDescriptorType::Endpoint: loadEndpointDescriptor(parser, descriptor); break; case USBDescriptorType::AssociationInterface: case USBDescriptorType::Unknown: case USBDescriptorType::String: default: USBGUARD_LOG(Debug) << "Ignoring descriptor: type=" << (int)type << " size=" << descriptor->bHeader.bLength; } } bool UEventDevice::isLinuxRootHubDeviceDescriptor(const USBDescriptor* const descriptor) { USBGUARD_LOG(Trace); if (descriptor->bHeader.bDescriptorType != USB_DESCRIPTOR_TYPE_DEVICE) { return false; } const USBDeviceDescriptor* const device_descriptor = \ reinterpret_cast(descriptor); if (device_descriptor->idVendor == 0x1d6b /* Linux Foundation */) { switch (device_descriptor->idProduct) { case 0x0001: /* 1.1 root hub */ case 0x0002: /* 2.0 root hub */ case 0x0003: /* 3.0 root hub */ return true; default: return false; } } return false; } void UEventDevice::updateHashLinuxRootHubDeviceDescriptor(const USBDescriptor* const descriptor) { USBGUARD_LOG(Trace); USBDeviceDescriptor descriptor_modified = *reinterpret_cast(descriptor); descriptor_modified.bcdDevice = 0; updateHash(&descriptor_modified, sizeof descriptor_modified); } /* * Manager */ UEventDeviceManager::UEventDeviceManager(DeviceManagerHooks& hooks, const std::string& sysfs_root, bool dummy_mode) : DeviceManager(hooks), _thread(this, &UEventDeviceManager::thread), _uevent_fd(-1), _wakeup_fd(-1), _sysfs_root(sysfs_root), _dummy_mode(dummy_mode), _enumeration(false), _enumeration_count(0) { setDefaultBlockedState(/*state=*/true); setEnumerationOnlyMode(/*state=*/false); USBGUARD_SYSCALL_THROW("UEvent device manager", (_wakeup_fd = eventfd(0, 0)) < 0); if (!_dummy_mode) { _uevent_fd = ueventOpen(); } else { _uevent_fd = ueventDummyOpen(); } } UEventDeviceManager::~UEventDeviceManager() { if (getRestoreControllerDeviceState()) { setDefaultBlockedState(/*state=*/false); // FIXME: Set to previous state } stop(); if (_uevent_fd >= 0) { (void)close(_uevent_fd); } if (_wakeup_fd >= 0) { (void)close(_wakeup_fd); } } void UEventDeviceManager::setDefaultBlockedState(bool state) { _default_blocked_state = state; } void UEventDeviceManager::setEnumerationOnlyMode(bool state) { _enumeration_only_mode = state; } void UEventDeviceManager::start() { _thread.start(); } void UEventDeviceManager::stop() { // stop monitor _thread.stop(/*do_wait=*/false); { /* Wakeup the device manager thread */ const uint64_t one = 1; USBGUARD_SYSCALL_THROW("Linux device manager", write(_wakeup_fd, &one, sizeof one) != sizeof one); } _thread.wait(); } void UEventDeviceManager::scan() { USBGUARD_LOG(Trace); std::unique_lock lock(_enumeration_mutex); Restorer, bool> \ r(_enumeration, /*transient=*/true, /*restored=*/false); if (!_dummy_mode) { _enumeration_count = ueventEnumerateDevices(); } else { _enumeration_count = ueventEnumerateDummyDevices(); } USBGUARD_LOG(Debug) << "_enumeration_count=" << _enumeration_count; if (_enumeration_count == 0) { return; } if (_enumeration_count < 0) { throw Exception("UEventDeviceManager", "present devices", "failed to enumerate"); } const auto timeout = std::chrono::seconds(2 * _enumeration_count); if (!_enumeration_complete.wait_for(lock, timeout, [&] { return (_enumeration_count > 0 ? false : true); })) { throw Exception("UEventDeviceManager", "present devices", "enumeration timeout"); } } std::shared_ptr UEventDeviceManager::applyDevicePolicy(uint32_t id, Rule::Target target) { USBGUARD_LOG(Trace) << "id=" << id << " target=" << Rule::targetToString(target); std::shared_ptr device = std::static_pointer_cast(getDevice(id)); std::unique_lock device_lock(device->refDeviceMutex()); sysfsApplyTarget(device->sysfsDevice(), target); device->setTarget(target); return std::move(device); } int UEventDeviceManager::ueventOpen() { int socket_fd = -1; USBGUARD_SYSCALL_THROW("UEvent device manager", (socket_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT)) < 0); try { const int optval = 1; USBGUARD_SYSCALL_THROW("UEvent device manager", setsockopt(socket_fd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof optval) != 0); /* * Set a 1MiB receive buffer on the netlink socket to avoid ENOBUFS error * in recvmsg. */ const size_t rcvbuf_max = 1024 * 1024; USBGUARD_SYSCALL_THROW("UEvent device manager", setsockopt(socket_fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_max, sizeof rcvbuf_max) != 0); struct sockaddr_nl sa = { }; sa.nl_family = AF_NETLINK; sa.nl_pid = getpid(); sa.nl_groups = -1; USBGUARD_SYSCALL_THROW("UEvent device manager", bind(socket_fd, reinterpret_cast(&sa), sizeof sa) != 0); } catch (...) { (void)close(socket_fd); throw; } return socket_fd; } int UEventDeviceManager::ueventDummyOpen() { int socket_fd = -1; USBGUARD_SYSCALL_THROW("UEvent device manager", (socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0); try { const int optval = 1; USBGUARD_SYSCALL_THROW("UEvent device manager", setsockopt(socket_fd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof optval) != 0); struct sockaddr_un sa = { }; sa.sun_family = AF_UNIX; strcpy(sa.sun_path, "/tmp/usbguard-dummy.sock"); USBGUARD_SYSCALL_THROW("UEvent device manager", bind(socket_fd, reinterpret_cast(&sa), sizeof sa) != 0); } catch (...) { (void)close(socket_fd); throw; } return socket_fd; } void UEventDeviceManager::sysfsApplyTarget(SysFSDevice& sysfs_device, Rule::Target target) { std::string name; std::string value("0"); switch (target) { case Rule::Target::Allow: name = "authorized"; value = "1"; break; case Rule::Target::Block: name = "authorized"; value = "0"; break; case Rule::Target::Reject: name = "remove"; value = "1"; break; case Rule::Target::Match: case Rule::Target::Device: case Rule::Target::Unknown: case Rule::Target::Invalid: default: throw std::runtime_error("Unknown rule target in applyDevicePolicy"); } sysfs_device.setAttribute(name, value); } void UEventDeviceManager::thread() { USBGUARD_LOG(Trace) << "Entering main loop."; try { const int max_fd = std::max(_uevent_fd, _wakeup_fd); fd_set readset; while (!_thread.stopRequested()) { struct timeval tv_timeout = { 5, 0 }; FD_ZERO(&readset); FD_SET(_uevent_fd, &readset); FD_SET(_wakeup_fd, &readset); switch (select(max_fd + 1, &readset, NULL, NULL, &tv_timeout)) { case 1: /* uevent or wakeup */ case 2: /* uevent and wakeup */ if (FD_ISSET(_wakeup_fd, &readset)) { USBGUARD_LOG(Debug) << "Wakeup event."; continue; } if (FD_ISSET(_uevent_fd, &readset)) { USBGUARD_LOG(Debug) << "UEvent read event."; ueventProcessRead(); } break; case 0: /* Timeout */ continue; case -1: /* Error */ default: USBGUARD_LOG(Error) << "UEventDeviceManager thread: select failed: errno=" << errno; _thread.stop(); } } /* Thread main loop */ } catch (const Exception& ex) { USBGUARD_LOG(Error) << "UEventDeviceManager thread: " << ex.message(); } USBGUARD_LOG(Trace) << "Leaving main loop."; } void UEventDeviceManager::ueventProcessRead() { std::string buffer(4096, 0); struct iovec iov[1]; iov[0].iov_base = (void*)&buffer[0]; iov[0].iov_len = buffer.capacity(); struct sockaddr_nl peer_sockaddr = { }; union { struct cmsghdr header; uint8_t ucred[CMSG_SPACE(sizeof(struct ucred))]; } cmsg_un; cmsg_un.header.cmsg_len = CMSG_LEN(sizeof(struct ucred)); cmsg_un.header.cmsg_level = SOL_SOCKET; cmsg_un.header.cmsg_type = SCM_CREDENTIALS; struct msghdr msg_header = { }; msg_header.msg_control = cmsg_un.ucred; msg_header.msg_controllen = sizeof cmsg_un.ucred; msg_header.msg_iov = iov; msg_header.msg_iovlen = 1; msg_header.msg_name = &peer_sockaddr; msg_header.msg_namelen = sizeof peer_sockaddr; const int rc = recvmsg(_uevent_fd, &msg_header, MSG_DONTWAIT); if (rc <= 0) { const int saved_errno = errno; if (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK) { USBGUARD_LOG(Warning) << "ueventProcessRead: " << "reading from uevent source would block thread execution"; return; } else { USBGUARD_LOG(Error) << "ueventProcessRead: " << "failed to read pending uevent: " << "rc=" << rc << " errno=" << saved_errno; throw ErrnoException("UEvent device manager", "recvmsg", saved_errno); } } buffer.resize((size_t)rc); const struct cmsghdr* const cmsg_header = CMSG_FIRSTHDR(&msg_header); if (cmsg_header == nullptr) { /* ignore */ USBGUARD_LOG(Warning) << "ueventProcessRead: " << "received uevent without required control message: ignoring."; return; } if (cmsg_header->cmsg_len != CMSG_LEN(sizeof(struct ucred)) || cmsg_header->cmsg_level != SOL_SOCKET || cmsg_header->cmsg_type != SCM_CREDENTIALS) { /* unexpected control message -- ignore */ USBGUARD_LOG(Warning) << "ueventProcessRead: " << "received uevent with an invalid control message: ignoring."; return; } const struct ucred* const cmsg_ucred = \ reinterpret_cast(CMSG_DATA(cmsg_header)); if (cmsg_ucred == nullptr) { /* missing ucred -- ignore */ USBGUARD_LOG(Warning) << "ueventProcessRead: " << "received uevent without required SCM_CREDENTIALS data: ignoring."; return; } if (cmsg_ucred->pid != 0 || cmsg_ucred->uid != 0 || cmsg_ucred->gid != 0) { /* unknown origin -- ignore */ USBGUARD_LOG(Debug) << "received uevent of unknown origin: ignoring."; return; } /* * Try to parse uevent from the buffer and process it. */ try { const UEvent uevent = UEvent::fromString(buffer, /*attributes_only=*/false, /*trace=*/false); ueventProcessUEvent(uevent); } catch (...) { USBGUARD_LOG(Warning) << "ueventProcessRead: received invalid uevent data"; USBGUARD_LOG(Debug) << "ueventProcessRead: uevent_data=" << base64Encode(buffer); } } void UEventDeviceManager::ueventProcessUEvent(const UEvent& uevent) { const std::string subsystem = uevent.getAttribute("SUBSYSTEM"); const std::string devtype = uevent.getAttribute("DEVTYPE"); const std::string action = uevent.getAttribute("ACTION"); /* * We don't care about the event if it's not from the "usb" subsystem. * The device type attribute value is checked later based on the data * read from the sysfs uevent file in the device directory. */ if (subsystem != "usb") { USBGUARD_LOG(Debug) << "Ignoring non-USB device:" << " subsystem=" << subsystem << " devtype=" << devtype << " action=" << action; return; } const std::string sysfs_devpath = _sysfs_root + uevent.getAttribute("DEVPATH"); try { std::unique_lock lock(_enumeration_mutex); if (action == "add" || action == "change") { uint32_t id = 0; const bool known_path = knownSysPath(sysfs_devpath, &id); lock.unlock(); if (known_path && id > 0) { processDevicePresence(id); } else { SysFSDevice sysfs_device(sysfs_devpath); /* * Do some additional sanity checking. */ if (sysfs_device.getUEvent().hasAttribute("DEVTYPE")) { const std::string devtype = sysfs_device.getUEvent().getAttribute("DEVTYPE"); if (devtype != "usb_device") { USBGUARD_LOG(Debug) << sysfs_devpath << ": UEvent DEVTYPE != usb_device. Ignoring event."; return; } } else { if (!sysfs_device.hasAttribute("descriptors")) { USBGUARD_LOG(Debug) << sysfs_devpath << ": UEvent doesn't refer to a device with a descriptors file. Ignoring event."; return; } } processDeviceInsertion(sysfs_device, /*signal_present=*/known_path); USBGUARD_LOG(Debug) << "Enumeration notify: sysfs_devpath=" << sysfs_devpath << " _enumeration=" << _enumeration << " known_path=" << known_path; if (_enumeration && known_path) { --_enumeration_count; _enumeration_complete.notify_one(); } } } else if (action == "remove") { lock.unlock(); processDeviceRemoval(sysfs_devpath); } else { USBGUARD_LOG(Warning) << "Ignoring unknown UEvent action: sysfs_devpath=" << sysfs_devpath << " action=" << action; } } catch (const Exception& ex) { USBGUARD_LOG(Warning) << "USB Device Exception: " << ex.message(); DeviceException(ex.message()); } catch (...) { USBGUARD_LOG(Warning) << "USB Device Exception: unknown exception"; DeviceException("unknown exception"); } } bool UEventDeviceManager::ueventEnumerateComparePath(const std::pair& a, const std::pair& b) { const std::string base_a = filenameFromPath(a.second, /*include_extension=*/true); const std::string base_b = filenameFromPath(b.second, /*include_extension=*/true); const bool a_has_usb_prefix = (0 == base_a.compare(0, 3, "usb")); const bool b_has_usb_prefix = (0 == base_b.compare(0, 3, "usb")); if (a_has_usb_prefix) { if (!b_has_usb_prefix) { return true; } } else { if (b_has_usb_prefix) { return false; } } if (base_a.size() < base_b.size()) { return true; } else if (base_a.size() > base_b.size()) { return false; } return base_a < base_b; } int UEventDeviceManager::ueventEnumerateDevices() { USBGUARD_LOG(Trace); return loadFiles(_sysfs_root + "/bus/usb/devices", UEventDeviceManager::ueventEnumerateFilterDevice, [this](const std::string& devpath, const std::string& buspath) { return ueventEnumerateTriggerDevice(devpath, buspath); }, UEventDeviceManager::ueventEnumerateComparePath); } int UEventDeviceManager::ueventEnumerateDummyDevices() { USBGUARD_LOG(Trace); return loadFiles(_sysfs_root + "/bus/usb/devices", UEventDeviceManager::ueventEnumerateFilterDevice, [this](const std::string& devpath, const std::string& buspath) { (void)buspath; UEvent uevent; uevent.setAttribute("SUBSYSTEM", "usb"); uevent.setAttribute("DEVTYPE", "usb_device"); uevent.setAttribute("ACTION", "add"); uevent.setAttribute("DEVPATH", removePrefix(_sysfs_root, devpath)); std::unique_ptr realpath_cstr(::realpath(devpath.c_str(), nullptr)); const std::string syspath(realpath_cstr.get()); learnSysPath(syspath); ueventProcessUEvent(uevent); return 1; }, UEventDeviceManager::ueventEnumerateComparePath); } std::string UEventDeviceManager::ueventEnumerateFilterDevice(const std::string& filepath, const struct dirent* direntry) { #if defined(_DIRENT_HAVE_D_TYPE) if (direntry->d_type != DT_UNKNOWN) { switch (direntry->d_type) { case DT_LNK: return symlinkPath(filepath); case DT_DIR: return filepath; default: return std::string(); } } else { /* * Unknown type. We have to call lstat. */ #endif struct stat st = { }; if (lstat(filepath.c_str(), &st) != 0) { /* * Cannot stat, skip this entry. */ USBGUARD_LOG(Warning) << "lstat(" << filepath << "): errno=" << errno; return std::string(); } if (S_ISLNK(st.st_mode)) { return symlinkPath(filepath, &st); } else if (S_ISDIR(st.st_mode)) { return filepath; } else { return std::string(); } #if defined(_DIRENT_HAVE_D_TYPE) } #endif /* UNREACHABLE */ return std::string(); } int UEventDeviceManager::ueventEnumerateTriggerDevice(const std::string& devpath, const std::string& buspath) { USBGUARD_LOG(Trace) << "devpath=" << devpath << " buspath=" << buspath; try { std::unique_ptr realpath_cstr(::realpath(devpath.c_str(), nullptr)); const std::string syspath(realpath_cstr.get()); SysFSDevice device(syspath); if (device.getUEvent().getAttribute("DEVTYPE") == "usb_device") { learnSysPath(syspath); device.setAttribute("uevent", "add"); return 1; } } catch (const Exception& ex) { USBGUARD_LOG(Warning) << "device enumeration exception: " << buspath << ": " << ex.message(); } catch (const std::exception& ex) { USBGUARD_LOG(Warning) << "device enumeration exception: " << buspath << ": " << ex.what(); } return 0; } void UEventDeviceManager::processDevicePresence(const uint32_t id) { USBGUARD_LOG(Trace) << "id=" << id; try { std::shared_ptr device = \ std::static_pointer_cast(DeviceManager::getDevice(id)); device->sysfsDevice().reload(); /* * TODO: Check attribute state * - authorized_default (in case of controller) */ DeviceEvent(DeviceManager::EventType::Present, device); return; } catch (const Exception& ex) { USBGUARD_LOG(Error) << "Present device exception: " << ex.message(); DeviceException(ex.message()); } catch (const std::exception& ex) { USBGUARD_LOG(Error) << "Present device exception: " << ex.what(); DeviceException(ex.what()); } catch (...) { USBGUARD_LOG(Error) << "BUG: Unknown device exception."; DeviceException("BUG: Unknown device exception."); } /* * We don't reject the device here (as is done in processDeviceInsertion) * because the device was already connected to the system when USBGuard * started. Therefore, if the device is malicious, it already had a chance * to interact with the system. */ } void UEventDeviceManager::processDeviceInsertion(SysFSDevice& sysfs_device, const bool signal_present) { try { std::shared_ptr device = std::make_shared(*this, sysfs_device); if (device->isController() && !_enumeration_only_mode) { USBGUARD_LOG(Debug) << "Setting default blocked state for controller device to " << _default_blocked_state; device->sysfsDevice().setAttribute("authorized_default", _default_blocked_state ? "0" : "1"); } insertDevice(device); /* * Signal insertions as presence if device enumeration hasn't * completed yet. */ if (signal_present) { DeviceEvent(DeviceManager::EventType::Present, device); } else { DeviceEvent(DeviceManager::EventType::Insert, device); } return; } catch (const Exception& ex) { USBGUARD_LOG(Error) << "Device insert exception: " << ex.message(); DeviceException(ex.message()); } catch (const std::exception& ex) { USBGUARD_LOG(Error) << "Device insert exception: " << ex.what(); DeviceException(ex.what()); } catch (...) { USBGUARD_LOG(Error) << "BUG: Unknown device insert exception."; DeviceException("BUG: Unknown device insert exception."); } /* * Skip device reject when in enumeration only mode. */ if (_enumeration_only_mode) { return; } /* * Something went wrong and an exception was generated. * Either the device is malicious or the system lacks some * resources to successfully process the device. In either * case, we take the safe route and fallback to rejecting * the device. */ USBGUARD_LOG(Warning) << "Rejecting device at syspath=" << sysfs_device.getPath(); sysfsApplyTarget(sysfs_device, Rule::Target::Reject); } void UEventDeviceManager::insertDevice(std::shared_ptr device) { DeviceManager::insertDevice(std::static_pointer_cast(device)); std::unique_lock device_lock(device->refDeviceMutex()); learnSysPath(device->getSysPath(), device->getID()); } void UEventDeviceManager::processDeviceRemoval(const std::string& sysfs_devpath) { USBGUARD_LOG(Trace) << "sysfs_devpath=" << sysfs_devpath; try { std::shared_ptr device = removeDevice(sysfs_devpath); DeviceEvent(DeviceManager::EventType::Remove, device); } catch (...) { /* Ignore for now */ USBGUARD_LOG(Debug) << "Removal of an unknown device ignored."; return; } } std::shared_ptr UEventDeviceManager::removeDevice(const std::string& syspath) { /* * FIXME: device map locking */ if (!knownSysPath(syspath)) { throw Exception("removeDevice", syspath, "unknown syspath, cannot remove device"); } std::shared_ptr device = DeviceManager::removeDevice(getIDFromSysPath(syspath)); _syspath_map.erase(syspath); return device; } uint32_t UEventDeviceManager::getIDFromSysPath(const std::string& syspath) const { uint32_t id = 0; const bool known = knownSysPath(syspath, &id); if (known && id > 0) { return id; } throw Exception("UEventDeviceManager", syspath, "unknown syspath"); } bool UEventDeviceManager::knownSysPath(const std::string& syspath, uint32_t* id_ptr) const { auto it = _syspath_map.find(syspath); uint32_t known_id = 0; bool known = false; if (it != _syspath_map.end()) { known = true; known_id = it->second; } if (id_ptr != nullptr) { *id_ptr = known_id; } return known; } void UEventDeviceManager::learnSysPath(const std::string& syspath, uint32_t id) { USBGUARD_LOG(Trace) << "syspath=" << syspath << " id=" << id; _syspath_map[syspath] = id; } void UEventDeviceManager::forgetSysPath(const std::string& syspath) { _syspath_map.erase(syspath); } } /* namespace usbguard */ #endif /* HAVE_UDEV */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEventDeviceManager.hpp000066400000000000000000000105121325273707200224720ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #if defined(HAVE_UEVENT) #include "Common/Thread.hpp" #include "SysFSDevice.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/DeviceManager.hpp" #include "usbguard/Device.hpp" #include "usbguard/Rule.hpp" #include "usbguard/USB.hpp" #include #include #include #include namespace usbguard { class UEventDeviceManager; class UEventDevice : public Device, public USBDescriptorParserHooks { public: UEventDevice(UEventDeviceManager& device_manager, SysFSDevice& sysfs_device); SysFSDevice& sysfsDevice(); const std::string& getSysPath() const; bool isController() const override; std::string getSystemName() const override; private: void parseUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) override; void loadUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor) override; bool isLinuxRootHubDeviceDescriptor(const USBDescriptor* descriptor); void updateHashLinuxRootHubDeviceDescriptor(const USBDescriptor* descriptor); SysFSDevice _sysfs_device; }; #if !defined(USBGUARD_SYSFS_ROOT) #define USBGUARD_SYSFS_ROOT "/sys" #endif class UEventDeviceManager : public DeviceManager { using DeviceManager::insertDevice; public: UEventDeviceManager(DeviceManagerHooks& hooks, const std::string& sysfs_root = USBGUARD_SYSFS_ROOT, bool dummy_mode = false); ~UEventDeviceManager(); void setDefaultBlockedState(bool state) override; void setEnumerationOnlyMode(bool state) override; void start() override; void stop() override; void scan() override; std::shared_ptr applyDevicePolicy(uint32_t id, Rule::Target target) override; void insertDevice(std::shared_ptr device); std::shared_ptr removeDevice(const std::string& syspath); uint32_t getIDFromSysPath(const std::string& syspath) const; protected: int ueventOpen(); int ueventDummyOpen(); void sysfsApplyTarget(SysFSDevice& sysfs_device, Rule::Target target); bool knownSysPath(const std::string& syspath, uint32_t* id = nullptr) const; void learnSysPath(const std::string& syspath, uint32_t id = 0); void forgetSysPath(const std::string& syspath); void thread(); void ueventProcessRead(); void ueventProcessUEvent(const UEvent& uevent); static bool ueventEnumerateComparePath(const std::pair& a, const std::pair& b); int ueventEnumerateDevices(); int ueventEnumerateDummyDevices(); static std::string ueventEnumerateFilterDevice(const std::string& filepath, const struct dirent* direntry); int ueventEnumerateTriggerDevice(const std::string& devpath, const std::string& buspath); void processDevicePresence(SysFSDevice& sysfs_device); void processDeviceInsertion(SysFSDevice& sysfs_device, bool signal_present); void processDevicePresence(uint32_t id); void processDeviceRemoval(const std::string& sysfs_devpath); private: Thread _thread; int _uevent_fd; int _wakeup_fd; std::map _syspath_map; std::string _sysfs_root; bool _default_blocked_state; bool _enumeration_only_mode; bool _dummy_mode; std::atomic _enumeration; std::atomic _enumeration_count; std::condition_variable _enumeration_complete; std::mutex _enumeration_mutex; }; } /* namespace usbguard */ #endif /* HAVE_UEVENT */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEventParser.cpp000066400000000000000000000103761325273707200212370ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "UEventParser.hpp" #include "UEvent.hpp" #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include #include namespace usbguard { namespace UEventParser { template struct actions : pegtl::nothing {}; template<> struct actions { template static void apply(const Input& in, UEvent& uevent) { try { const auto p = in.string().find_first_of('='); if (p == std::string::npos || p == (in.string().size() - 1)) { throw pegtl::parse_error("invalid attribute format", in); } const std::string key = in.string().substr(0, p); const std::string value = trim(in.string().substr(p + 1, std::string::npos), std::string("\n\0", 2)); for (const std::string header_key : { "ACTION", "DEVPATH" }) { if (key == header_key) { if (value != uevent.getAttribute(header_key)) { throw pegtl::parse_error("header value mismatch", in); } } } uevent.setAttribute(key, value); } catch (const pegtl::parse_error& ex) { throw; } catch (const std::exception& ex) { throw pegtl::parse_error(ex.what(), in); } } }; template<> struct actions { template static void apply(const Input& in, UEvent& uevent) { uevent.setAttribute("ACTION", in.string()); } }; template<> struct actions { template static void apply(const Input& in, UEvent& uevent) { uevent.setAttribute("DEVPATH", in.string()); } }; } /* namespace UEventParser */ void parseUEventFromFile(const std::string& uevent_path, UEvent& uevent, bool attributes_only, bool trace) { std::ifstream uevent_stream(uevent_path); if (uevent_stream.good()) { std::string uevent_string(4096, 0); uevent_stream.readsome(&uevent_string[0], uevent_string.capacity()); const auto read_size = uevent_stream.gcount(); if (read_size > 0) { uevent_string.resize(read_size); parseUEventFromString(uevent_string, uevent, attributes_only, trace); } } else { throw std::runtime_error("failed to open uevent source file"); } } template void parseUEventFromString(const std::string& uevent_string, UEvent& uevent, bool trace) { try { #if HAVE_PEGTL_LTE_1_3_1 if (!trace) { pegtl::parse(uevent_string, std::string(), uevent); } else { pegtl::parse(uevent_string, std::string(), uevent); } #else if (!trace) { pegtl::parse_string(uevent_string, std::string(), uevent); } else { pegtl::parse_string(uevent_string, std::string(), uevent); } #endif } catch (...) { throw; } } void parseUEventFromString(const std::string& uevent_string, UEvent& uevent, bool attributes_only, bool trace) { if (attributes_only) { parseUEventFromString(uevent_string, uevent, trace); } else { parseUEventFromString(uevent_string, uevent, trace); } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/UEventParser.hpp000066400000000000000000000036131325273707200212400ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include using namespace pegtl; namespace usbguard { class UEvent; namespace UEventParser { struct value : seq, star>> {}; struct key : seq, star>> {}; struct attribute : seq> {}; struct action : seq, star>> {}; struct devpath : seq> {}; struct header : seq, devpath, one<'\0'>> {}; struct uevent : seq {}; struct grammar : until {}; } /* namespace UEventParser */ void parseUEventFromFile(const std::string& uevent_path, UEvent& uevent, bool attributes_only = false, bool trace = false); void parseUEventFromString(const std::string& uevent_string, UEvent& uevent, bool attributes_only = false, bool trace = false); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Utility.cpp000066400000000000000000000076101325273707200203140ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Utility.hpp" #include "Common/Utility.hpp" #include "usbguard/Typedefs.hpp" #include namespace usbguard { namespace Utility { std::string escapeString(const std::string& string_raw) { std::string result; const std::locale c_locale("C"); for (auto it = string_raw.cbegin(); it != string_raw.cend(); ++it) { const char c = *it; /* * Escape any double-quote and backslash characters. */ if (c == '"') { result.append("\\"); result.append("\""); continue; } if (c == '\\') { result.append("\\"); result.append("\\"); continue; } /* * If the current character is printable in the "C" locale, * append it. Otherwise convert it to \xHH form, where HH is * the hexadecimal representation of the character value. */ if (std::isprint(c, c_locale)) { result.push_back((char)c); } else { const std::string hexbyte = numberToString((uint8_t)c, "\\x", 16, 2, '0'); result.append(hexbyte); } } return result; } std::string unescapeString(const std::string& string_escaped) { std::string result; bool escaped = false; const std::locale c_locale("C"); for (auto it = string_escaped.cbegin(); it < string_escaped.cend(); ++it) { const char c = *it; /* * Handle an escape sequence if needed, otherwise just * append the current character. */ if (escaped) { switch (c) { case '"': result.append("\""); break; case '\\': result.append("\\"); break; case 'x': { /* hexadecimal representation of a byte \xHH */ if (std::distance(string_escaped.end(), it) >=2) { throw std::runtime_error("Invalid escape sequence"); } const char hb[] = { *(it + 1), *(it + 2) }; if (!std::isxdigit(hb[0], c_locale) || !std::isxdigit(hb[1], c_locale)) { throw std::runtime_error("Invalid \\xHH escape sequence: HH is not a hexadecimal number"); } const std::string hexbyte(hb, 2); result.push_back((char)stringToNumber(hexbyte, 16)); ++it; ++it; } break; default: throw std::runtime_error("Unknown escape sequence"); } escaped = false; } else { if (c == '\\') { escaped = true; } else { result.push_back(c); } } } if (escaped) { throw std::runtime_error("Invalid escape sequence"); } return result; } std::string quoteEscapeString(const std::string& value) { std::string result; result.push_back('"'); result.append(escapeString(value)); result.push_back('"'); return result; } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/Utility.hpp000066400000000000000000000021771325273707200203240ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Typedefs.hpp" #include namespace usbguard { namespace Utility { std::string escapeString(const std::string& value); std::string unescapeString(const std::string& value); std::string quoteEscapeString(const std::string& value); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */usbguard-0.7.2+ds/src/Library/public/000077500000000000000000000000001325273707200174175ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Library/public/usbguard/000077500000000000000000000000001325273707200212335ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Library/public/usbguard/Audit.cpp000066400000000000000000000166631325273707200230210ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Audit.hpp" #include "Exception.hpp" #include "Logger.hpp" #include namespace usbguard { AuditIdentity::AuditIdentity() { _uid = getuid(); _pid = getpid(); } AuditIdentity::AuditIdentity(uid_t uid, pid_t pid) { _uid = uid; _pid = pid; } uid_t AuditIdentity::uid() const { return _uid; } pid_t AuditIdentity::pid() const { return _pid; } std::string AuditIdentity::toString() const { std::string identity_string; identity_string.append("{ uid="); identity_string.append(numberToString(uid())); identity_string.append(" pid="); identity_string.append(numberToString(pid())); identity_string.append(" }"); return identity_string; } AuditEvent::AuditEvent(const AuditIdentity& identity, std::shared_ptr& backend) : _commited(false), _identity(identity), _backend(backend) { } AuditEvent::AuditEvent(AuditEvent&& event) : _commited(event._commited), _identity(std::move(event._identity)), _backend(std::move(event._backend)), _keys(std::move(event._keys)) { /* * Mark the source event as commited so that * when it gets destructed, it won't be commited * to the backend. */ event.setCommited(true); } AuditEvent::~AuditEvent() { /* * If the event was not commited explicitly, assume * that that the result is a failure. */ if (!_commited) { failure(); } } void AuditEvent::commit(const std::string& result) { setKey("result", result); /* Skip backend commit if there's no backend set */ if (_backend != nullptr) { _backend->commit(*this); } /* * Mark as commited even if it wasn't actually commited * because of no valid backend. Otherwise the destructor * would try to commit it again as failed. */ setCommited(true); } void AuditEvent::success() { commit("SUCCESS"); } void AuditEvent::failure() { commit("FAILURE"); } const AuditIdentity& AuditEvent::identity() const { return _identity; } const AuditEvent::Keys& AuditEvent::keys() const { return _keys; } void AuditEvent::setCommited(bool state) { _commited = state; } void AuditEvent::setKey(const std::string& key, const std::string& value) { _keys.emplace(key, value); } AuditBackend::AuditBackend() { } AuditBackend::~AuditBackend() { } void AuditBackend::commit(const AuditEvent& event) { std::unique_lock lock(_mutex); write(event); } Audit::Audit(const AuditIdentity& identity) : _identity(identity) { } void Audit::setBackend(std::unique_ptr backend) { _backend = std::shared_ptr(std::move(backend)); } AuditEvent Audit::policyEvent(std::shared_ptr rule, Policy::EventType event) { return policyEvent(_identity, rule, event); } AuditEvent Audit::policyEvent(std::shared_ptr new_rule, std::shared_ptr old_rule) { return policyEvent(_identity, new_rule, old_rule); } AuditEvent Audit::policyEvent(std::shared_ptr device, Policy::EventType event) { return policyEvent(_identity, device, event); } AuditEvent Audit::policyEvent(std::shared_ptr device, Rule::Target old_target, Rule::Target new_target) { return policyEvent(_identity, device, old_target, new_target); } AuditEvent Audit::deviceEvent(std::shared_ptr device, DeviceManager::EventType event) { return deviceEvent(_identity, device, event); } AuditEvent Audit::deviceEvent(std::shared_ptr new_device, std::shared_ptr old_device) { return deviceEvent(_identity, new_device, old_device); } AuditEvent Audit::policyEvent(const AuditIdentity& identity, std::shared_ptr rule, Policy::EventType event_type) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Policy.") + Policy::eventTypeToString(event_type)); event.setKey("rule.id", numberToString(rule->getRuleID())); event.setKey("rule", rule->toString()); return event; } AuditEvent Audit::policyEvent(const AuditIdentity& identity, std::shared_ptr new_rule, std::shared_ptr old_rule) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Policy.") + Policy::eventTypeToString(Policy::EventType::Update)); event.setKey("rule.id", numberToString(old_rule->getRuleID())); event.setKey("rule.old", old_rule->toString()); event.setKey("rule.new", new_rule->toString()); return event; } AuditEvent Audit::policyEvent(const AuditIdentity& identity, std::shared_ptr device, Policy::EventType event_type) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Policy.Device.") + Policy::eventTypeToString(event_type)); event.setKey("target", Rule::targetToString(device->getTarget())); event.setKey("device.system_name", device->getSystemName()); event.setKey("device.rule", device->getDeviceRule()->toString()); return event; } AuditEvent Audit::policyEvent(const AuditIdentity& identity, std::shared_ptr device, Rule::Target old_target, Rule::Target new_target) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Policy.Device.") + Policy::eventTypeToString(Policy::EventType::Update)); event.setKey("target.old", Rule::targetToString(old_target)); event.setKey("target.new", Rule::targetToString(new_target)); event.setKey("device.system_name", device->getSystemName()); event.setKey("device.rule", device->getDeviceRule()->toString()); return event; } AuditEvent Audit::deviceEvent(const AuditIdentity& identity, std::shared_ptr device, DeviceManager::EventType event_type) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Device.") + DeviceManager::eventTypeToString(event_type)); event.setKey("device.system_name", device->getSystemName()); event.setKey("device.rule", device->getDeviceRule()->toString()); return event; } AuditEvent Audit::deviceEvent(const AuditIdentity& identity, std::shared_ptr new_device, std::shared_ptr old_device) { AuditEvent event(identity, _backend); event.setKey("type", std::string("Device.") + DeviceManager::eventTypeToString(DeviceManager::EventType::Update)); event.setKey("device.system_name", new_device->getSystemName()); event.setKey("device.rule.old", old_device->getDeviceRule()->toString()); event.setKey("device.rule.new", new_device->getDeviceRule()->toString()); return event; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Audit.hpp000066400000000000000000000105351325273707200230160ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Device.hpp" #include "DeviceManager.hpp" #include "Logger.hpp" #include "Policy.hpp" #include "Rule.hpp" #include "Typedefs.hpp" #include #include #include #include #include #include namespace usbguard { class DLL_PUBLIC AuditIdentity { public: AuditIdentity(); AuditIdentity(uid_t uid, pid_t pid); uid_t uid() const; pid_t pid() const; std::string toString() const; private: uid_t _uid; pid_t _pid; }; class AuditBackend; class DLL_PUBLIC AuditEvent { AuditEvent(const AuditIdentity& identity, std::shared_ptr& backend); public: using Keys = std::unordered_map; AuditEvent(AuditEvent&& event); AuditEvent(const AuditEvent& event) = delete; ~AuditEvent(); void success(); void failure(); const AuditIdentity& identity() const; const Keys& keys() const; private: void commit(const std::string& result); void setCommited(bool state); void setKey(const std::string& key, const std::string& value); bool _commited; AuditIdentity _identity; std::shared_ptr _backend; Keys _keys; friend class Audit; }; class DLL_PUBLIC AuditBackend { public: AuditBackend(); virtual ~AuditBackend(); virtual void write(const AuditEvent& event) = 0; void commit(const AuditEvent& event); private: std::mutex _mutex; }; class DLL_PUBLIC Audit { public: Audit(const AuditIdentity& identity); void setBackend(std::unique_ptr backend); AuditEvent policyEvent(std::shared_ptr rule, Policy::EventType event); AuditEvent policyEvent(std::shared_ptr new_rule, std::shared_ptr old_rule); AuditEvent policyEvent(std::shared_ptr device, Policy::EventType event); AuditEvent policyEvent(std::shared_ptr device, Rule::Target old_target, Rule::Target new_target); AuditEvent deviceEvent(std::shared_ptr device, DeviceManager::EventType event); AuditEvent deviceEvent(std::shared_ptr new_device, std::shared_ptr old_device); /* * Audit policy changes: * - rule append * - rule remove * - rule update * - policy parameter change * * Audit data: * - who: uid + pid * - when: time * - what: append, remove, update * - update: old, new */ AuditEvent policyEvent(const AuditIdentity& identity, std::shared_ptr rule, Policy::EventType event); AuditEvent policyEvent(const AuditIdentity& identity, std::shared_ptr new_rule, std::shared_ptr old_rule); AuditEvent policyEvent(const AuditIdentity& identity, std::shared_ptr device, Policy::EventType event); AuditEvent policyEvent(const AuditIdentity& identity, std::shared_ptr device, Rule::Target old_target, Rule::Target new_target); /* * Audit device changes: * - device insertion * - device removal * - device authorization target change * * Audit data: * - who: uid + pid * - when: time * - what: insert, remove, authorization target * - change: old, new */ AuditEvent deviceEvent(const AuditIdentity& identity, std::shared_ptr device, DeviceManager::EventType event); AuditEvent deviceEvent(const AuditIdentity& identity, std::shared_ptr new_device, std::shared_ptr old_device); private: AuditIdentity _identity; std::shared_ptr _backend; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/ConfigFile.cpp000066400000000000000000000033271325273707200237510ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "ConfigFilePrivate.hpp" #include "Common/Utility.hpp" namespace usbguard { ConfigFile::ConfigFile(const std::vector& known_names) : d_pointer(make_unique(*this, known_names)) { } ConfigFile::~ConfigFile() = default; void ConfigFile::open(const std::string& path, bool readonly) { d_pointer->open(path, readonly); } void ConfigFile::write() { d_pointer->write(); } void ConfigFile::close() { d_pointer->close(); } const std::string& ConfigFile::getSettingValue(const std::string& name) const { return d_pointer->getSettingValue(name); } void ConfigFile::setSettingValue(const std::string& name, std::string& value) { d_pointer->setSettingValue(name, value); } bool ConfigFile::hasSettingValue(const std::string& name) const { return d_pointer->hasSettingValue(name); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/ConfigFile.hpp000066400000000000000000000027241325273707200237560ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include "usbguard/Logger.hpp" #include #include #include namespace usbguard { class ConfigFilePrivate; class DLL_PUBLIC ConfigFile { public: ConfigFile(const std::vector& known_names = std::vector()); ~ConfigFile(); void open(const std::string& path, bool readonly = false); void write(); void close(); void setSettingValue(const std::string& name, std::string& value); bool hasSettingValue(const std::string& name) const; const std::string& getSettingValue(const std::string& name) const; private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Device.cpp000066400000000000000000000110321325273707200231330ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DevicePrivate.hpp" #include "Common/Utility.hpp" namespace usbguard { Device::Device(DeviceManager& manager) : d_pointer(make_unique(*this, manager)) { } Device::~Device() = default; Device::Device(const Device& rhs) : d_pointer(make_unique(*this, *rhs.d_pointer)) { } const Device& Device::operator=(const Device& rhs) { d_pointer.reset(new DevicePrivate(*this, *rhs.d_pointer)); return *this; } DeviceManager& Device::manager() const { return d_pointer->manager(); } std::mutex& Device::refDeviceMutex() { return d_pointer->refDeviceMutex(); } std::shared_ptr Device::getDeviceRule(const bool with_port, const bool with_parent_hash, const bool match_rule) { return d_pointer->getDeviceRule(with_port, with_parent_hash, match_rule); } std::string Device::hashString(const std::string& value) const { return d_pointer->hashString(value); } void Device::initializeHash() { d_pointer->initializeHash(); } void Device::updateHash(const void* const ptr, const size_t size) { d_pointer->updateHash(ptr, size); } void Device::updateHash(std::istream& descriptor_stream, const size_t expected_size) { d_pointer->updateHash(descriptor_stream, expected_size); } std::string Device::finalizeHash() { return d_pointer->finalizeHash(); } const std::string& Device::getHash() const { return d_pointer->getHash(); } void Device::setParentHash(const std::string& hash) { d_pointer->setParentHash(hash); } void Device::setID(uint32_t id) { d_pointer->setID(id); } uint32_t Device::getID() const { return d_pointer->getID(); } void Device::setParentID(uint32_t id) { d_pointer->setParentID(id); } uint32_t Device::getParentID() const { return d_pointer->getParentID(); } void Device::setTarget(Rule::Target target) { d_pointer->setTarget(target); } Rule::Target Device::getTarget() const { return d_pointer->getTarget(); } void Device::setName(const std::string& name) { d_pointer->setName(name); } const std::string& Device::getName() const { return d_pointer->getName(); } void Device::setDeviceID(const USBDeviceID& device_id) { d_pointer->setDeviceID(device_id); } const USBDeviceID& Device::getDeviceID() const { return d_pointer->getDeviceID(); } void Device::setPort(const std::string& port) { d_pointer->setPort(port); } const std::string& Device::getPort() const { return d_pointer->getPort(); } void Device::setSerial(const std::string& serial_number) { d_pointer->setSerial(serial_number); } const std::string& Device::getSerial() const { return d_pointer->getSerial(); } std::vector& Device::refMutableInterfaceTypes() { return d_pointer->refMutableInterfaceTypes(); } const std::vector& Device::getInterfaceTypes() const { return d_pointer->getInterfaceTypes(); } void Device::loadDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { d_pointer->loadDeviceDescriptor(parser, descriptor); } void Device::loadConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { d_pointer->loadConfigurationDescriptor(parser, descriptor); } void Device::loadInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { d_pointer->loadInterfaceDescriptor(parser, descriptor); } void Device::loadEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor) { d_pointer->loadEndpointDescriptor(parser, descriptor); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Device.hpp000066400000000000000000000056641325273707200231560ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Rule.hpp" #include "Typedefs.hpp" #include "USB.hpp" #include #include #include #include #include #include namespace usbguard { class DeviceManager; class DevicePrivate; class DLL_PUBLIC Device { public: Device(DeviceManager& manager); ~Device(); Device(const Device& rhs); const Device& operator=(const Device& rhs); DeviceManager& manager() const; std::mutex& refDeviceMutex(); std::shared_ptr getDeviceRule(bool with_port = true, bool with_parent_hash = true, bool match_rule = false); std::string hashString(const std::string& value) const; void initializeHash(); void updateHash(const void* ptr, size_t size); void updateHash(std::istream& descriptor_stream, size_t expected_size); std::string finalizeHash(); const std::string& getHash() const; void setParentHash(const std::string& hash); void setID(uint32_t id); uint32_t getID() const; void setParentID(uint32_t id); uint32_t getParentID() const; void setTarget(Rule::Target target); Rule::Target getTarget() const; void setName(const std::string& name); const std::string& getName() const; void setDeviceID(const USBDeviceID& device_id); const USBDeviceID& getDeviceID() const; void setPort(const std::string& port); const std::string& getPort() const; void setSerial(const std::string& serial_number); const std::string& getSerial() const; std::vector& refMutableInterfaceTypes(); const std::vector& getInterfaceTypes() const; virtual bool isController() const = 0; virtual std::string getSystemName() const = 0; void loadDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); void loadEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/DeviceManager.cpp000066400000000000000000000124401325273707200244320ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "DeviceManagerPrivate.hpp" #include "Common/Utility.hpp" #include "usbguard/DeviceManagerHooks.hpp" #include "usbguard/Exception.hpp" namespace usbguard { uint32_t DeviceManager::eventTypeToInteger(DeviceManager::EventType event) { return static_cast(event); } DeviceManager::EventType DeviceManager::eventTypeFromInteger(uint32_t event_integer) { switch (event_integer) { case static_cast(EventType::Insert): case static_cast(EventType::Update): case static_cast(EventType::Remove): break; default: throw std::runtime_error("Invalid event type integer value"); } return static_cast(event_integer); } std::string DeviceManager::eventTypeToString(DeviceManager::EventType event) { switch (event) { case DeviceManager::EventType::Present: return "Present"; case DeviceManager::EventType::Insert: return "Insert"; case DeviceManager::EventType::Remove: return "Remove"; case DeviceManager::EventType::Update: return "Update"; default: throw USBGUARD_BUG("unknown event type"); } } DeviceManager::DeviceManager(DeviceManagerHooks& hooks) : d_pointer(make_unique(*this, hooks)) { } DeviceManager::DeviceManager(const DeviceManager& rhs) : d_pointer(make_unique(*this, *rhs.d_pointer)) { } const DeviceManager& DeviceManager::operator=(const DeviceManager& rhs) { d_pointer.reset(new DeviceManagerPrivate(*this, *rhs.d_pointer)); return *this; } DeviceManager::~DeviceManager() = default; void DeviceManager::setRestoreControllerDeviceState(bool enabled) { d_pointer->setRestoreControllerDeviceState(enabled); } bool DeviceManager::getRestoreControllerDeviceState() const { return d_pointer->getRestoreControllerDeviceState(); } void DeviceManager::insertDevice(std::shared_ptr device) { d_pointer->insertDevice(device); } std::shared_ptr DeviceManager::removeDevice(uint32_t id) { return d_pointer->removeDevice(id); } std::vector> DeviceManager::getDeviceList() { return d_pointer->getDeviceList(); } std::vector> DeviceManager::getDeviceList(const Rule& query) { std::vector> matching_devices; for (auto const& device : getDeviceList()) { if (query.appliesTo(device->getDeviceRule())) { switch (query.getTarget()) { case Rule::Target::Allow: case Rule::Target::Block: if (device->getTarget() == query.getTarget()) { matching_devices.push_back(device); } break; case Rule::Target::Device: case Rule::Target::Match: matching_devices.push_back(device); break; case Rule::Target::Reject: case Rule::Target::Unknown: case Rule::Target::Invalid: default: throw std::runtime_error("Invalid device query target"); } } } return matching_devices; } std::shared_ptr DeviceManager::getDevice(uint32_t id) { return d_pointer->getDevice(id); } void DeviceManager::DeviceEvent(DeviceManager::EventType event, std::shared_ptr device) { d_pointer->DeviceEvent(event, device); } void DeviceManager::DeviceException(const std::string& message) { d_pointer->DeviceException(message); } } /* namespace usbguard */ #if defined(HAVE_UEVENT) #include "UEventDeviceManager.hpp" #endif std::shared_ptr usbguard::DeviceManager::create(DeviceManagerHooks& hooks, const std::string& backend) { #if defined(HAVE_UEVENT) if (backend == "udev") { USBGUARD_LOG(Warning) << "udev backend is OBSOLETE. Falling back to new default: uevent"; } if (backend == "uevent" || /* transition udev => uevent */backend == "udev") { return std::make_shared(hooks); } if (backend == "dummy") { const char* const device_root_cstr = getenv("USBGUARD_DUMMY_DEVICE_ROOT"); if (device_root_cstr == nullptr) { throw Exception("DeviceManager", "dummy", "USBGUARD_DUMMY_DEVICE_ROOT environment variable not defined"); } const std::string device_root(device_root_cstr); return std::make_shared(hooks, device_root, /*dummy_mode=*/true); } #endif throw Exception("DeviceManager", "backend", "requested backend is not available"); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/DeviceManager.hpp000066400000000000000000000053551325273707200244460ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Device.hpp" #include "Rule.hpp" #include "RuleSet.hpp" #include "Typedefs.hpp" #include #include #include #include #include namespace usbguard { class DeviceManagerHooks; class DeviceManagerPrivate; class DLL_PUBLIC DeviceManager { public: enum class EventType { Present = 0, Insert = 1, Update = 2, /* use case: writable attribute changed externally */ Remove = 3, }; static uint32_t eventTypeToInteger(EventType event); static EventType eventTypeFromInteger(uint32_t event_integer); static std::string eventTypeToString(EventType event); DeviceManager(DeviceManagerHooks& hooks); DeviceManager(const DeviceManager& rhs); const DeviceManager& operator=(const DeviceManager& rhs); virtual ~DeviceManager(); virtual void setDefaultBlockedState(bool state) = 0; virtual void setEnumerationOnlyMode(bool state) = 0; virtual void start() = 0; virtual void stop() = 0; virtual void scan() = 0; void setRestoreControllerDeviceState(bool enabled); bool getRestoreControllerDeviceState() const; virtual std::shared_ptr applyDevicePolicy(uint32_t id, Rule::Target target) = 0; virtual void insertDevice(std::shared_ptr device); std::shared_ptr removeDevice(uint32_t id); /* Returns a copy of the list of active USB devices */ std::vector> getDeviceList(); std::vector> getDeviceList(const Rule& query); std::shared_ptr getDevice(uint32_t id); std::mutex& refDeviceMapMutex(); /* Call Daemon instance hooks */ void DeviceEvent(EventType event, std::shared_ptr device); void DeviceException(const std::string& message); static std::shared_ptr create(DeviceManagerHooks& hooks, const std::string& backend); private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/DeviceManagerHooks.cpp000066400000000000000000000021061325273707200254340ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/DeviceManagerHooks.hpp" namespace usbguard { void DeviceManagerHooks::dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device) { (void)event; (void)device; /* NOOP */ } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/DeviceManagerHooks.hpp000066400000000000000000000023271325273707200254460ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Device.hpp" #include "DeviceManager.hpp" #include "Typedefs.hpp" #include #include #include namespace usbguard { class DLL_PUBLIC DeviceManagerHooks { public: virtual void dmHookDeviceEvent(DeviceManager::EventType event, std::shared_ptr device); virtual uint32_t dmHookAssignID() = 0; virtual void dmHookDeviceException(const std::string& message) = 0; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Exception.hpp000066400000000000000000000076421325273707200237130ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include #include #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include namespace usbguard { class DLL_PUBLIC Exception : public std::exception { public: Exception(const std::string& context, const std::string& object, const std::string& reason_val) : _context(context), _object(object), _reason(reason_val) { } Exception(const Exception& rhs) : _context(rhs._context), _object(rhs._object), _reason(rhs._reason) { } const std::string& context() const noexcept { return _context; } const std::string& object() const noexcept { return _object; } const std::string& reason() const noexcept { return _reason; } void setContext(const std::string& context) { _context = context; } void setObject(const std::string& object) { _object = object; } void setReason(const std::string& reason_val) { _reason = reason_val; } virtual std::string message() const noexcept { try { return _context + ": " + (!_object.empty() ? _object + ": " : "") + _reason; } catch (...) { return "usbguard::Exception: exception^2"; } } virtual const char* what() const noexcept { return "usbguard::Exception"; } private: std::string _context; std::string _object; std::string _reason; }; #define USBGUARD_BUG(m) \ ::usbguard::Exception(__PRETTY_FUNCTION__, "BUG", m) class ErrnoException : public Exception { public: ErrnoException(const std::string& context, const std::string& object, const int errno_value) : Exception(context, object, ErrnoException::reasonFromErrno(errno_value)) { } private: static std::string reasonFromErrno(const int errno_value) { char buffer[1024]; return std::string(strerror_r(errno_value, buffer, sizeof buffer)); } }; #define USBGUARD_SYSCALL_THROW(context, syscall_bool_expression) \ do { \ if (syscall_bool_expression) { \ throw usbguard::ErrnoException(context, #syscall_bool_expression, errno); \ } \ } while(0) class IPCException : public Exception { public: IPCException() : Exception("", "", "") { } IPCException(const Exception& exception, uint64_t message_id = 0) : Exception(exception), _message_id(message_id) { } IPCException(const std::string& context, const std::string& object, const std::string& reason, uint64_t message_id = 0) : Exception(context, object, reason), _message_id(message_id) { } IPCException(const IPCException& rhs) : Exception(rhs), _message_id(rhs._message_id) { } bool hasMessageID() const noexcept { return _message_id != 0; } uint64_t messageID() const noexcept { return _message_id; } void setMessageID(uint64_t message_id) { _message_id = message_id; } private: uint64_t _message_id; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/IPCClient.cpp000066400000000000000000000043441325273707200235160ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCClientPrivate.hpp" #include "Common/Utility.hpp" namespace usbguard { IPCClient::IPCClient(bool connected) : d_pointer(make_unique(*this, connected)) { } IPCClient::~IPCClient() = default; void IPCClient::connect() { d_pointer->connect(); } void IPCClient::disconnect() { d_pointer->disconnect(/*do_wait*/true); } bool IPCClient::isConnected() const { return d_pointer->isConnected(); } void IPCClient::wait() { d_pointer->wait(); } std::string IPCClient::setParameter(const std::string& name, const std::string& value) { return d_pointer->setParameter(name, value); } std::string IPCClient::getParameter(const std::string& name) { return d_pointer->getParameter(name); } uint32_t IPCClient::appendRule(const std::string& rule_spec, uint32_t parent_id) { return d_pointer->appendRule(rule_spec, parent_id); } void IPCClient::removeRule(uint32_t id) { d_pointer->removeRule(id); } const RuleSet IPCClient::listRules(const std::string& query) { return d_pointer->listRules(query); } uint32_t IPCClient::applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) { return d_pointer->applyDevicePolicy(id, target, permanent); } const std::vector IPCClient::listDevices(const std::string& query) { return d_pointer->listDevices(query); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/IPCClient.hpp000066400000000000000000000056771325273707200235350ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "DeviceManager.hpp" #include "Exception.hpp" #include "Interface.hpp" #include "Typedefs.hpp" #include #include #include #include namespace usbguard { class IPCClientPrivate; class DLL_PUBLIC IPCClient : public Interface { public: IPCClient(bool connected = false); virtual ~IPCClient(); void connect(); void disconnect(); bool isConnected() const; void wait(); std::string setParameter(const std::string& name, const std::string& value) override; std::string getParameter(const std::string& name) override; uint32_t appendRule(const std::string& rule_spec, uint32_t parent_id) override; void removeRule(uint32_t id) override; const RuleSet listRules(const std::string& query) override; const RuleSet listRules() { return listRules("match"); } uint32_t applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) override; const std::vector listDevices(const std::string& query) override; const std::vector listDevices() /* NOTE: left for compatibility */ { return listDevices("match"); } virtual void IPCConnected() {} virtual void IPCDisconnected(bool exception_initiated, const IPCException& exception) { (void)exception_initiated; (void)exception; } virtual void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) override { (void)id; (void)event; (void)target; (void)device_rule; } virtual void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) override { (void)id; (void)target_old; (void)target_new; (void)device_rule; (void)rule_id; } virtual void ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason) override { (void)context; (void)object; (void)reason; } private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/IPCServer.cpp000066400000000000000000000223411325273707200235430ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "IPCServerPrivate.hpp" #include "Common/Utility.hpp" #include "usbguard/Exception.hpp" #include #include namespace usbguard { void IPCServer::checkAccessControlName(const std::string& name) { if (name.size() > 32) { throw Exception("IPC access control", "name too long", name); } const std::string valid_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; if (name.find_first_not_of(valid_chars) != std::string::npos) { throw Exception("IPC access control", "name contains invalid character(s)", name); } } static const std::vector> section_ttable = { { "ALL", IPCServer::AccessControl::Section::ALL }, { "Policy", IPCServer::AccessControl::Section::POLICY }, { "Parameters", IPCServer::AccessControl::Section::PARAMETERS }, { "Devices", IPCServer::AccessControl::Section::DEVICES }, { "Exceptions", IPCServer::AccessControl::Section::EXCEPTIONS }, { "None", IPCServer::AccessControl::Section::NONE } }; IPCServer::AccessControl::Section IPCServer::AccessControl::sectionFromString(const std::string& section_string) { for (auto ttable_entry : section_ttable) { if (ttable_entry.first == section_string) { return ttable_entry.second; } } throw std::runtime_error("Invalid AccessControl::Section string"); } std::string IPCServer::AccessControl::sectionToString(const IPCServer::AccessControl::Section section) { for (auto ttable_entry : section_ttable) { if (ttable_entry.second == section) { return ttable_entry.first; } } throw std::runtime_error("Invalid AccessControl::Section value"); } static const std::vector> privilege_ttable = { { "ALL", IPCServer::AccessControl::Privilege::ALL }, { "modify", IPCServer::AccessControl::Privilege::MODIFY }, { "list", IPCServer::AccessControl::Privilege::LIST }, { "listen", IPCServer::AccessControl::Privilege::LISTEN }, { "none", IPCServer::AccessControl::Privilege::NONE } }; IPCServer::AccessControl::Privilege IPCServer::AccessControl::privilegeFromString(const std::string& privilege_string) { for (auto ttable_entry : privilege_ttable) { if (ttable_entry.first == privilege_string) { return ttable_entry.second; } } throw std::runtime_error("Invalid AccessControl::Section string"); } std::string IPCServer::AccessControl::privilegeToString(const IPCServer::AccessControl::Privilege privilege) { for (auto ttable_entry : privilege_ttable) { if (ttable_entry.second == privilege) { return ttable_entry.first; } } throw std::runtime_error("Invalid AccessControl::Privilege value"); } IPCServer::AccessControl::AccessControl() { /* Empty: no privileges */ } IPCServer::AccessControl::AccessControl(const std::string& access_control_string) { std::stringstream ss(access_control_string); load(ss); } IPCServer::AccessControl::AccessControl(IPCServer::AccessControl::Section section, IPCServer::AccessControl::Privilege privilege) { setPrivilege(section, privilege); } IPCServer::AccessControl::AccessControl(const IPCServer::AccessControl& rhs) : _access_control(rhs._access_control) { } IPCServer::AccessControl& IPCServer::AccessControl::operator=(const IPCServer::AccessControl& rhs) { _access_control = rhs._access_control; return *this; } bool IPCServer::AccessControl::hasPrivilege(IPCServer::AccessControl::Section section, IPCServer::AccessControl::Privilege privilege) const { if (section == Section::ALL || section == Section::NONE) { throw USBGUARD_BUG("Cannot test against ALL, NONE sections"); } const auto it = _access_control.find(section); if (it == _access_control.cend()) { return false; } return (it->second & static_cast(privilege)) == static_cast(privilege); } void IPCServer::AccessControl::setPrivilege(IPCServer::AccessControl::Section section, IPCServer::AccessControl::Privilege privilege) { if (section == Section::NONE) { throw USBGUARD_BUG("Cannot set privileges for NONE section"); } if (section == Section::ALL) { for (const auto& value : { Section::POLICY, Section::PARAMETERS, Section::EXCEPTIONS, Section::DEVICES }) { _access_control[value] |= static_cast(privilege); } } else { _access_control[section] |= static_cast(privilege); } } void IPCServer::AccessControl::clear() { _access_control.clear(); } void IPCServer::AccessControl::load(std::istream& stream) { std::string line; size_t line_number = 0; while (std::getline(stream, line)) { ++line_number; const size_t nv_separator = line.find_first_of("="); if (nv_separator == std::string::npos) { continue; } const std::string section_string = trim(line.substr(0, nv_separator)); const Section section = sectionFromString(section_string); const std::string privileges_string = line.substr(nv_separator + 1); std::vector privilege_strings; tokenizeString(privileges_string, privilege_strings, " ,", /*trim_empty=*/true); for (const std::string& privilege_string : privilege_strings) { const Privilege privilege = privilegeFromString(privilege_string); setPrivilege(section, privilege); } } } void IPCServer::AccessControl::save(std::ostream& stream) const { std::string access_control_string; for (auto const& section : { Section::DEVICES, Section::POLICY, Section::PARAMETERS, Section::EXCEPTIONS }) { bool section_is_empty = true; std::string section_string = sectionToString(section); section_string.append("="); for (auto const& privilege : { Privilege::LIST, Privilege::MODIFY, Privilege::LISTEN }) { if (hasPrivilege(section, privilege)) { const std::string privilege_string = privilegeToString(privilege); section_string.append(privilege_string); section_string.append(","); section_is_empty = false; } } if (!section_is_empty) { section_string.pop_back(); access_control_string.append(section_string); access_control_string.append("\n"); } } stream << access_control_string; } void IPCServer::AccessControl::merge(const IPCServer::AccessControl& rhs) { for (auto const& ac_entry : rhs._access_control) { _access_control[ac_entry.first] |= ac_entry.second; } } void IPCServer::AccessControl::merge(const std::string& access_control_string) { const AccessControl access_control(access_control_string); merge(access_control); } IPCServer::IPCServer() : d_pointer(make_unique(*this)) { } IPCServer::~IPCServer() = default; void IPCServer::start() { d_pointer->start(); } void IPCServer::stop() { d_pointer->stop(); } void IPCServer::DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) { d_pointer->DevicePresenceChanged(id, event, target, device_rule); } void IPCServer::DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) { d_pointer->DevicePolicyChanged(id, target_old, target_new, device_rule, rule_id); } void IPCServer::ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason) { d_pointer->ExceptionMessage(context, object, reason); } void IPCServer::addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac) { d_pointer->addAllowedUID(uid, ac); } void IPCServer::addAllowedGID(gid_t gid, const IPCServer::AccessControl& ac) { d_pointer->addAllowedGID(gid, ac); } void IPCServer::addAllowedUsername(const std::string& username, const IPCServer::AccessControl& ac) { d_pointer->addAllowedUsername(username, ac); } void IPCServer::addAllowedGroupname(const std::string& groupname, const IPCServer::AccessControl& ac) { d_pointer->addAllowedGroupname(groupname, ac); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/IPCServer.hpp000066400000000000000000000071601325273707200235520ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "DeviceManager.hpp" #include "Interface.hpp" #include "Rule.hpp" #include "Typedefs.hpp" #include #include #include #include #include #include #include #include #include namespace usbguard { class IPCServerPrivate; class DLL_PUBLIC IPCServer : public Interface { public: static void checkAccessControlName(const std::string& name); class AccessControl { public: enum class Section : uint8_t { NONE = 0, DEVICES = 1, POLICY = 2, PARAMETERS = 3, EXCEPTIONS = 4, ALL = 255 }; static Section sectionFromString(const std::string& section_string); static std::string sectionToString(const Section section); enum class Privilege : uint8_t { NONE = 0x00, LIST = 0x01, MODIFY = 0x02, LISTEN = 0x08, ALL = 0xff }; static Privilege privilegeFromString(const std::string& privilege_string); static std::string privilegeToString(const Privilege privilege); AccessControl(); AccessControl(const std::string& access_control_string); AccessControl(Section section, Privilege privilege); AccessControl(const AccessControl& rhs); AccessControl& operator=(const AccessControl& rhs); bool hasPrivilege(Section section, Privilege privilege) const; void setPrivilege(Section section, Privilege privilege); void clear(); void load(std::istream& stream); void save(std::ostream& stream) const; void merge(const AccessControl& rhs); void merge(const std::string& access_control_string); private: struct SectionHash { std::size_t operator()(Section value) const { return static_cast(value); } }; std::unordered_map _access_control; }; IPCServer(); virtual ~IPCServer(); void start(); void stop(); void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule); void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id); void ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason); void addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac); void addAllowedGID(gid_t gid, const IPCServer::AccessControl& ac); void addAllowedUsername(const std::string& username, const IPCServer::AccessControl& ac); void addAllowedGroupname(const std::string& groupname, const IPCServer::AccessControl& ac); private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Interface.hpp000066400000000000000000000041561325273707200236520ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "DeviceManager.hpp" #include "Rule.hpp" #include "RuleSet.hpp" #include "Typedefs.hpp" #include "USB.hpp" #include #include #include #include namespace usbguard { class DLL_PUBLIC Interface { public: /* Parameters */ virtual std::string setParameter(const std::string& name, const std::string& value) = 0; virtual std::string getParameter(const std::string& name) = 0; /* Methods */ virtual uint32_t appendRule(const std::string& rule_spec, uint32_t parent_id) = 0; virtual void removeRule(uint32_t id) = 0; virtual const RuleSet listRules(const std::string& query) = 0; virtual uint32_t applyDevicePolicy(uint32_t id, Rule::Target target, bool permanent) = 0; virtual const std::vector listDevices(const std::string& query) = 0; /* Signals */ virtual void DevicePresenceChanged(uint32_t id, DeviceManager::EventType event, Rule::Target target, const std::string& device_rule) = 0; virtual void DevicePolicyChanged(uint32_t id, Rule::Target target_old, Rule::Target target_new, const std::string& device_rule, uint32_t rule_id) = 0; virtual void ExceptionMessage(const std::string& context, const std::string& object, const std::string& reason) = 0; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Logger.cpp000066400000000000000000000232001325273707200231530ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Common/Utility.hpp" #include "usbguard/Logger.hpp" #include "usbguard/Exception.hpp" #include #include #include #include #include #include #include #include #include #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif #include namespace usbguard { /* Instantiate the logger */ Logger G_logger; const std::string LogStream::sourceToString(const Source& source) { return source.file + "@" + std::to_string(source.line) + "/" + source.function; } const std::string LogStream::levelToString(Level level) { switch (level) { case LogStream::Level::Audit: return "(A)"; case LogStream::Level::Error: return "(E)"; case LogStream::Level::Warning: return "(W)"; case LogStream::Level::Info: return "(i)"; case LogStream::Level::Debug: return "(D)"; case LogStream::Level::Trace: return "(T)"; default: throw std::runtime_error("BUG: unknown LogStream level value"); } } LogStream::LogStream(Logger& logger, const Source& source, const Level level) : _logger(logger), _source(source), _level(level) { } LogStream::LogStream(const LogStream& rhs) : std::basic_ios(), std::ostringstream(rhs.str()), _logger(rhs._logger), _source(rhs._source), _level(rhs._level) { } LogStream::~LogStream() { _logger.write(_source, _level, str()); } LogSink::LogSink(const std::string& name) : _name(name) { } LogSink::~LogSink() { } const std::string& LogSink::name() const { return _name; } /* * Internally required sinks */ class OStreamSink : public LogSink { public: OStreamSink(const std::string& name, std::ostream& stream) : LogSink(name), _ostream(stream) { } void write(const LogStream::Source& source, LogStream::Level level, const std::string& message) { _ostream << '[' << Logger::timestamp() << "] "; _ostream << LogStream::levelToString(level) << " "; if (level >= LogStream::Level::Debug) { _ostream << LogStream::sourceToString(source) << ": "; } _ostream << message; _ostream << std::endl; } ~OStreamSink() { _ostream.flush(); } private: std::ostream& _ostream; }; class ConsoleSink : public OStreamSink { public: ConsoleSink() : OStreamSink("console", std::clog) { } }; class SyslogSink : public LogSink { public: SyslogSink(const std::string& ident) : LogSink("syslog"), _ident(ident) { openlog(_ident.c_str(), LOG_NDELAY|LOG_PID|LOG_CONS, LOG_DAEMON); } ~SyslogSink() { closelog(); } int levelToPriority(const LogStream::Level level) { switch (level) { case LogStream::Level::Audit: return LOG_NOTICE; case LogStream::Level::Error: return LOG_ERR; case LogStream::Level::Warning: return LOG_WARNING; case LogStream::Level::Info: return LOG_INFO; case LogStream::Level::Debug: case LogStream::Level::Trace: return LOG_DEBUG; default: throw USBGUARD_BUG("Invalid LogStream::Level value"); } } void write(const LogStream::Source& source, LogStream::Level level, const std::string& message) { std::string log_message; if (level >= LogStream::Level::Debug) { log_message.append(LogStream::sourceToString(source)); log_message.append(": "); } log_message.append(message); syslog(levelToPriority(level), "%s", log_message.c_str()); } private: std::string _ident; }; class FileSink : public OStreamSink { public: FileSink(const std::string& filepath, bool append = true) : OStreamSink("file", _stream) { _filepath = filepath; _stream.open(filepath, append ? std::fstream::app : std::fstream::trunc); } ~FileSink() { _stream.close(); } private: std::string _filepath; std::ofstream _stream; }; class AuditFileSink : public OStreamSink { public: AuditFileSink(const std::string& filepath) : OStreamSink("auditfile", _stream) { _filepath = filepath; const auto saved_umask = umask(0177); try { _stream.open(filepath, std::fstream::app); } catch (...) { umask(saved_umask); throw; } umask(saved_umask); } void write(const LogStream::Source& source, LogStream::Level level, const std::string& message) { /* * AuditFileSink logs only Audit level messages. */ if (level == LogStream::Level::Audit) { OStreamSink::write(source, level, message); } } ~AuditFileSink() { _stream.close(); } private: std::string _filepath; std::ofstream _stream; }; Logger::Logger() : _enabled(true), _level(LogStream::Level::Warning) { const char* const envval = getenv("USBGUARD_DEBUG"); /* * If USBGUARD_DEBUG=1 is set in the current environment, * set the debugging level to the highest level. */ if (envval != nullptr && strcmp(envval, "1") == 0) { _level = LogStream::Level::Trace; } setOutputConsole(true); } Logger::~Logger() { } std::unique_lock Logger::lock() const { return std::unique_lock(_mutex); } void Logger::setEnabled(bool state, LogStream::Level level) { auto L = lock(); _enabled = state; _level = level; } bool Logger::isEnabled(LogStream::Level level) const { auto L = lock(); return (_enabled && _level >= level); } void Logger::setOutputConsole(const bool state) { auto L = lock(); if (state == true) { std::unique_ptr sink(new ConsoleSink); addOutputSink_nolock(sink); } else { delOutputSink_nolock("console"); } } void Logger::setOutputFile(bool state, const std::string& filepath, bool append) { auto L = lock(); if (state == true) { std::unique_ptr sink(new FileSink(filepath, append)); addOutputSink_nolock(sink); } else { delOutputSink_nolock("file"); } } void Logger::setOutputSyslog(bool state, const std::string& ident) { auto L = lock(); if (state == true) { std::unique_ptr sink(new SyslogSink(ident)); addOutputSink_nolock(sink); } else { delOutputSink_nolock("syslog"); } } void Logger::setAuditFile(bool state, const std::string& filepath) { auto L = lock(); if (state == true) { std::unique_ptr sink(new AuditFileSink(filepath)); addOutputSink_nolock(sink); } else { delOutputSink_nolock("auditfile"); } } void Logger::addOutputSink(std::unique_ptr& sink) { auto L = lock(); addOutputSink_nolock(sink); } void Logger::addOutputSink_nolock(std::unique_ptr& sink) { _sinks.emplace(sink->name(), std::move(sink)); } void Logger::delOutputSink(const std::string& name) { auto L = lock(); delOutputSink_nolock(name); } void Logger::delOutputSink_nolock(const std::string& name) { _sinks.erase(name); } LogStream Logger::operator()(const std::string& file, const int line, const std::string& function, LogStream::Level level) { const LogStream::Source source = { filenameFromPath(file, /*include_extension=*/true), line, function }; return LogStream(*this, source, level); } void Logger::write(const LogStream::Source& source, const LogStream::Level level, const std::string& message) { auto L = lock(); for (auto& kv_pair : _sinks) { auto& sink = kv_pair.second; try { sink->write(source, level, message); } catch (const std::exception& ex) { std::cerr << "Warning: sink->write failed for " << sink->name() << " sink: " << ex.what() << std::endl; } } } /* * Generate a timestamp string in the form: * . */ const std::string Logger::timestamp() { struct timeval tv_now = { 0, 0 }; if (gettimeofday(&tv_now, nullptr) != 0) { throw std::runtime_error("gettimeofday"); } /* * The following piece of code should work fine until * Sat Nov 20 17:46:39 UTC 2286. */ char buffer[16]; const int length = snprintf(buffer, sizeof buffer, "%.10" PRIu64 ".%03" PRIu64, (uint64_t)tv_now.tv_sec, (uint64_t)(tv_now.tv_usec / 1000)); if (length < 1 || static_cast(length) > (sizeof buffer - 1)) { throw std::runtime_error("Failed to convert timestamp to string"); } return std::string(buffer, (size_t)length); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Logger.hpp000066400000000000000000000070621325273707200231700ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include #include #include #include #include #include namespace usbguard { class Logger; class DLL_PUBLIC LogStream : public std::ostringstream { public: struct Source { std::string file; int line; std::string function; }; static const std::string sourceToString(const Source& source); enum class Level : int { Audit = -2, Error = -1, Warning = 0, Info = 1, Debug = 2, Trace = 3 }; static const std::string levelToString(Level level); LogStream(Logger& logger, const Source& source, Level level); LogStream(const LogStream& rhs); ~LogStream(); private: Logger& _logger; Source _source; Level _level; }; class DLL_PUBLIC LogSink { public: LogSink(const std::string& name); virtual ~LogSink(); const std::string& name() const; virtual void write(const LogStream::Source& source, LogStream::Level level, const std::string& message) = 0; private: std::string _name; }; class DLL_PUBLIC Logger { public: Logger(); ~Logger(); void setEnabled(bool state, LogStream::Level level = LogStream::Level::Warning); bool isEnabled(LogStream::Level level) const; void setOutputConsole(bool state); void setOutputFile(bool state, const std::string& filepath = std::string(), bool append = true); void setOutputSyslog(bool state, const std::string& ident = std::string()); void setAuditFile(bool state, const std::string& filepath); void addOutputSink(std::unique_ptr& sink); void delOutputSink(const std::string& name); LogStream operator()(const std::string& file, int line, const std::string& function, LogStream::Level level); void write(const LogStream::Source& source, LogStream::Level level, const std::string& message); /* * Generate a timestamp string in the form: * . */ static const std::string timestamp(); private: void addOutputSink_nolock(std::unique_ptr& sink); void delOutputSink_nolock(const std::string& name); std::unique_lock lock() const; mutable std::mutex _mutex; bool _enabled; LogStream::Level _level; std::map> _sinks; }; extern DLL_PUBLIC Logger G_logger; #if defined(__GNUC__) #define USBGUARD_SOURCE_FILE __BASE_FILE__ #else #define USBGUARD_SOURCE_FILE __FILE__ #endif #define USBGUARD_LOGGER usbguard::G_logger #define USBGUARD_FUNCTION __func__ #define USBGUARD_LOG(level) \ if (USBGUARD_LOGGER.isEnabled(usbguard::LogStream::Level::level)) \ USBGUARD_LOGGER(USBGUARD_SOURCE_FILE, __LINE__, USBGUARD_FUNCTION, usbguard::LogStream::Level::level) } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Policy.cpp000066400000000000000000000024271325273707200232030ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/Policy.hpp" #include "usbguard/Exception.hpp" namespace usbguard { std::string Policy::eventTypeToString(Policy::EventType event) { switch (event) { case Policy::EventType::Insert: return "Insert"; case Policy::EventType::Update: return "Update"; case Policy::EventType::Remove: return "Remove"; default: throw USBGUARD_BUG("unknown Policy::EventType value"); } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Policy.hpp000066400000000000000000000020571325273707200232070ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include namespace usbguard { class DLL_PUBLIC Policy { public: enum class EventType { Insert = 1, Update = 2, Remove = 3, }; static std::string eventTypeToString(EventType event); }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Predicates.hpp000066400000000000000000000022721325273707200240320ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Logger.hpp" #include "Typedefs.hpp" namespace usbguard { namespace Predicates DLL_PUBLIC { /* * Return true if the source set is a subset of the * target set. Otherwise return false. */ template bool isSubsetOf(const T& source, const T& target) { USBGUARD_LOG(Trace) << "generic isSubsetOf"; return source == target; } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Rule.cpp000066400000000000000000000205671325273707200226600ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RulePrivate.hpp" #include "Utility.hpp" #include "Common/Utility.hpp" namespace usbguard { template<> std::string toRuleString(const std::string& value) { return Utility::quoteEscapeString(value); } const uint32_t Rule::RootID = std::numeric_limits::min(); const uint32_t Rule::DefaultID = std::numeric_limits::max(); const uint32_t Rule::LastID = std::numeric_limits::max() - 2; const uint32_t Rule::ImplicitID = std::numeric_limits::max() - 1; Rule::Rule() : d_pointer(make_unique(*this)) { } Rule::~Rule() = default; Rule::Rule(const Rule& rhs) : d_pointer(make_unique(*this, *rhs.d_pointer)) { } const Rule& Rule::operator=(const Rule& rhs) { d_pointer.reset(new RulePrivate(*this, *rhs.d_pointer)); return *this; } void Rule::setRuleID(uint32_t rule_id) { d_pointer->setRuleID(rule_id); } uint32_t Rule::getRuleID() const { return d_pointer->getRuleID(); } void Rule::setTarget(Rule::Target target) { d_pointer->setTarget(target); } Rule::Target Rule::getTarget() const { return d_pointer->getTarget(); } void Rule::setDeviceID(const USBDeviceID& value) { d_pointer->setDeviceID(value); } const USBDeviceID& Rule::getDeviceID() const { return d_pointer->getDeviceID(); } const Rule::Attribute& Rule::attributeDeviceID() const { return d_pointer->attributeDeviceID(); } Rule::Attribute& Rule::attributeDeviceID() { return d_pointer->attributeDeviceID(); } void Rule::setSerial(const std::string& value) { d_pointer->setSerial(value); } const std::string& Rule::getSerial() const { return d_pointer->getSerial(); } const Rule::Attribute& Rule::attributeSerial() const { return d_pointer->attributeSerial(); } Rule::Attribute& Rule::attributeSerial() { return d_pointer->attributeSerial(); } void Rule::setName(const std::string& value) { d_pointer->setName(value); } const std::string& Rule::getName() const { return d_pointer->getName(); } const Rule::Attribute& Rule::attributeName() const { return d_pointer->attributeName(); } Rule::Attribute& Rule::attributeName() { return d_pointer->attributeName(); } void Rule::setHash(const std::string& value) { d_pointer->setHash(value); } const std::string& Rule::getHash() const { return d_pointer->getHash(); } const Rule::Attribute& Rule::attributeHash() const { return d_pointer->attributeHash(); } Rule::Attribute& Rule::attributeHash() { return d_pointer->attributeHash(); } void Rule::setParentHash(const std::string& value) { d_pointer->setParentHash(value); } const std::string& Rule::getParentHash() const { return d_pointer->getParentHash(); } const Rule::Attribute& Rule::attributeParentHash() const { return d_pointer->attributeParentHash(); } Rule::Attribute& Rule::attributeParentHash() { return d_pointer->attributeParentHash(); } void Rule::setViaPort(const std::string& value) { d_pointer->setViaPort(value); } const std::string& Rule::getViaPort() const { return d_pointer->getViaPort(); } const Rule::Attribute& Rule::attributeViaPort() const { return d_pointer->attributeViaPort(); } Rule::Attribute& Rule::attributeViaPort() { return d_pointer->attributeViaPort(); } const Rule::Attribute& Rule::attributeWithInterface() const { return d_pointer->attributeWithInterface(); } Rule::Attribute& Rule::attributeWithInterface() { return d_pointer->attributeWithInterface(); } const Rule::Attribute& Rule::attributeConditions() const { return d_pointer->attributeConditions(); } Rule::Attribute& Rule::attributeConditions() { return d_pointer->attributeConditions(); } bool Rule::appliesTo(std::shared_ptr rhs) const { return appliesTo(*rhs); } bool Rule::appliesTo(const Rule& rhs) const { return d_pointer->appliesTo(rhs); } bool Rule::appliesTo(const Rule& rhs) { updateMetaDataCounters(/*applied=*/false, /*evaluated=*/true); return d_pointer->appliesTo(rhs); } bool Rule::isImplicit() const { return d_pointer->getRuleID() == Rule::DefaultID; } Rule::operator bool() const { return !(getTarget() == Target::Unknown || getTarget() == Target::Invalid); } std::string Rule::toString(bool invalid) const { return d_pointer->toString(invalid); } void Rule::updateMetaDataCounters(bool applied, bool evaluated) { d_pointer->updateMetaDataCounters(applied, evaluated); } Rule Rule::fromString(const std::string& rule_string) { return RulePrivate::fromString(rule_string); } std::unique_ptr& Rule::internal() { return d_pointer; } const std::unique_ptr& Rule::internal() const { return d_pointer; } static const std::vector> target_ttable = { { "allow", Rule::Target::Allow }, { "block", Rule::Target::Block }, { "reject", Rule::Target::Reject }, { "match", Rule::Target::Match }, { "device", Rule::Target::Device } }; const std::string Rule::targetToString(const Rule::Target target) { for (auto ttable_entry : target_ttable) { if (ttable_entry.second == target) { return ttable_entry.first; } } throw std::runtime_error("Invalid rule target string"); } Rule::Target Rule::targetFromString(const std::string& target_string) { for (auto ttable_entry : target_ttable) { if (ttable_entry.first == target_string) { return ttable_entry.second; } } throw std::runtime_error("Invalid rule target string"); } uint32_t Rule::targetToInteger(const Rule::Target target) { return static_cast(target); } Rule::Target Rule::targetFromInteger(const uint32_t target_integer) { switch (target_integer) { case static_cast(Rule::Target::Allow): case static_cast(Rule::Target::Block): case static_cast(Rule::Target::Reject): case static_cast(Rule::Target::Match): case static_cast(Rule::Target::Device): break; default: throw std::runtime_error("Invalid rule target integer value"); } return static_cast(target_integer); } static const std::vector> set_operator_ttable = { { "all-of", Rule::SetOperator::AllOf }, { "one-of", Rule::SetOperator::OneOf }, { "none-of", Rule::SetOperator::NoneOf }, { "equals", Rule::SetOperator::Equals }, { "equals-ordered", Rule::SetOperator::EqualsOrdered }, { "match", Rule::SetOperator::Match } }; const std::string Rule::setOperatorToString(const Rule::SetOperator& op) { for (auto ttable_entry : set_operator_ttable) { if (ttable_entry.second == op) { return ttable_entry.first; } } throw std::runtime_error("Invalid set operator string"); } Rule::SetOperator Rule::setOperatorFromString(const std::string& set_operator_string) { for (auto ttable_entry : set_operator_ttable) { if (ttable_entry.first == set_operator_string) { return ttable_entry.second; } } throw std::runtime_error("Invalid set operator string"); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Rule.hpp000066400000000000000000000327301325273707200226600ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "RuleCondition.hpp" #include "Exception.hpp" #include "Logger.hpp" #include "Predicates.hpp" #include "Typedefs.hpp" #include "USB.hpp" #include #include #include #include #include namespace usbguard { template std::string toRuleString(T* const value) { return value->toRuleString(); } template std::string toRuleString(const T& value) { return value.toRuleString(); } template<> std::string DLL_PUBLIC toRuleString(const std::string& value); class RulePrivate; class DLL_PUBLIC Rule { public: /** * Rule target enumeration. */ enum class Target { Allow = 0, /**< Devices matching this rule will be authorized */ Block = 1, /**< Devices matching this rule will not be authorized */ Reject = 2, /**< Devices matching this rule will not be authorized and will be detached */ Match = 3, /**< Special target which can be used to trigger actions. The rule wont affect the final decision. */ Unknown = 4, /**< Unknown target. Used for default constructed rules. */ Device = 5, /**< Special target which can only be used for a rule that represents a single device */ Invalid = 6 }; static const std::string targetToString(Target target); static Target targetFromString(const std::string& target_string); static uint32_t targetToInteger(Target target); static Target targetFromInteger(uint32_t target_integer); enum class SetOperator { AllOf, OneOf, NoneOf, Equals, EqualsOrdered, Match /* Special operator: matches anything, cannot be used directly in a rule */ }; static const std::string setOperatorToString(const Rule::SetOperator& op); static SetOperator setOperatorFromString(const std::string& set_operator_string); /**< Sequence number of the (fake) root rule */ static const uint32_t RootID; /**< Sequence number assigned to default constructed rules. Cannot be used for searching. */ static const uint32_t DefaultID; /**< Sequence number for specifying that the last rule in the ruleset should be used in context of the operation */ static const uint32_t LastID; /**< Sequence number of the implicit target rule */ static const uint32_t ImplicitID; template class Attribute { public: Attribute(const char* name) { _name = name; _set_operator = SetOperator::Equals; } Attribute(const Attribute& rhs) { _name = rhs._name; _set_operator = rhs._set_operator; _values = rhs._values; } void setSetOperator(SetOperator op) { _set_operator = op; } SetOperator setOperator() const { return _set_operator; } void append(ValueType&& value) { _values.emplace_back(std::move(value)); } void append(const ValueType& value) { _values.push_back(value); } size_t count() const { return _values.size(); } bool empty() const { return count() == 0; } void clear() { _values.clear(); _set_operator = SetOperator::Equals; } const ValueType& get() const { if (count() == 1) { return _values[0]; } else if (count() == 0) { throw std::runtime_error("BUG: Accessing an empty attribute"); } else { throw std::runtime_error("BUG: Accessing a multivalued attribute using get()"); } } const ValueType& get(size_t index) const { return _values.at(index); } void set(ValueType&& value) { if (count() > 1) { throw std::runtime_error("BUG: Setting single value for a multivalued attribute"); } if (count() == 0) { append(value); } else { _values[0] = std::move(value); } } void set(const ValueType& value) { if (count() > 1) { throw std::runtime_error("BUG: Setting single value for a multivalued attribute"); } if (count() == 0) { append(value); } else { _values[0] = value; } } void set(const std::vector& values, SetOperator op) { _values = values; _set_operator = op; } bool appliesTo(const Attribute& target) const { USBGUARD_LOG(Trace) << "entry:" << " source=" << this->toRuleString() << " target=" << target.toRuleString(); bool applies = false; /* Nothing applies to anything */ if (empty()) { USBGUARD_LOG(Debug) << "empty source value, setting applies=true"; applies = true; } else { USBGUARD_LOG(Debug) << "set_operator=" << setOperatorToString(setOperator()); switch (setOperator()) { case SetOperator::Match: applies = true; break; case SetOperator::AllOf: applies = setSolveAllOf(_values, target._values); break; case SetOperator::OneOf: applies = setSolveOneOf(_values, target._values); break; case SetOperator::NoneOf: applies = setSolveNoneOf(_values, target._values); break; case SetOperator::Equals: applies = setSolveEquals(_values, target._values); break; case SetOperator::EqualsOrdered: applies = setSolveEqualsOrdered(_values, target._values); break; default: throw USBGUARD_BUG("Invalid set operator value"); } } USBGUARD_LOG(Trace) << "return:" << " applies=" << applies; return applies; } std::string toRuleString() const { std::string result; result.append(_name); result.append(" "); const bool nondefault_op = setOperator() != SetOperator::Equals; const bool multiset_form = count() > 1 || nondefault_op; if (multiset_form) { if (nondefault_op) { result.append(setOperatorToString(setOperator())); result.append(" "); } result.append("{ "); } for (const auto& value : _values) { result.append(usbguard::toRuleString(value)); result.append(" "); } if (multiset_form) { result.append("}"); } else { /* * Remove the trailing space in case of a single * valued attribute. */ result.erase(result.end() - 1); } return result; } const std::vector& values() const { return _values; } std::vector& values() { return _values; } private: /* * All of the items in source set must match an item in the target set */ bool setSolveAllOf(const std::vector& source_set, const std::vector& target_set) const { USBGUARD_LOG(Trace); for (auto const& source_item : source_set) { bool match = false; for (auto const& target_item : target_set) { if (Predicates::isSubsetOf(source_item, target_item)) { match = true; break; } } if (!match) { return false; } } return true; } /* * At least one of the items in the source set must match an item in the target set */ bool setSolveOneOf(const std::vector& source_set, const std::vector& target_set) const { USBGUARD_LOG(Trace); for (auto const& source_item : source_set) { for (auto const& target_item : target_set) { if (Predicates::isSubsetOf(source_item, target_item)) { return true; } } } return false; } /* * None of the the items in the rule set must match any item in the * applies_to set */ bool setSolveNoneOf(const std::vector& source_set, const std::vector& target_set) const { USBGUARD_LOG(Trace); for (auto const& source_item : source_set) { for (auto const& target_item : target_set) { if (Predicates::isSubsetOf(source_item, target_item)) { return false; } } } return true; } /* * Every item in the rule set must match one item in the * applies_to set and the sets have to have the same number * of items */ bool setSolveEquals(const std::vector& source_set, const std::vector& target_set) const { USBGUARD_LOG(Trace); if (source_set.size() != target_set.size()) { return false; } else { for (auto const& source_item : source_set) { bool match = false; for (auto const& target_item : target_set) { if (Predicates::isSubsetOf(source_item, target_item)) { match = true; break; } } if (!match) { return false; } } return true; } } /* * The sets are treated as arrays and they have to me equal * (same number of items at the same positions) */ bool setSolveEqualsOrdered(const std::vector& source_set, const std::vector& target_set) const { USBGUARD_LOG(Trace); if (source_set.size() != target_set.size()) { return false; } for (size_t i = 0; i < source_set.size(); ++i) { if (!Predicates::isSubsetOf(source_set[i], target_set[i])) { return false; } } return false; } std::string _name; SetOperator _set_operator; std::vector _values; }; /** * Construct a default rule. * This rule matches only a default rule and cannot be converted to a string * representation. */ Rule(); ~Rule(); Rule(const Rule& rhs); const Rule& operator=(const Rule& rhs); void setRuleID(uint32_t rule_id); uint32_t getRuleID() const; void setTarget(Rule::Target target); Target getTarget() const; void setDeviceID(const USBDeviceID& value); const USBDeviceID& getDeviceID() const; const Attribute& attributeDeviceID() const; Attribute& attributeDeviceID(); void setSerial(const std::string& value); const std::string& getSerial() const; const Attribute& attributeSerial() const; Attribute& attributeSerial(); void setName(const std::string& value); const std::string& getName() const; const Attribute& attributeName() const; Attribute& attributeName(); void setHash(const std::string& value); const std::string& getHash() const; const Attribute& attributeHash() const; Attribute& attributeHash(); void setParentHash(const std::string& value); const std::string& getParentHash() const; const Rule::Attribute& attributeParentHash() const; Rule::Attribute& attributeParentHash(); void setViaPort(const std::string& value); const std::string& getViaPort() const; const Attribute& attributeViaPort() const; Attribute& attributeViaPort(); /* * Set/get for a single value isn't useful for the * with-interface attribute as it usualy contains * multiple values. Therefore, we provide only the * attribute accessors in this case. */ const Attribute& attributeWithInterface() const; Attribute& attributeWithInterface(); const Attribute& attributeConditions() const; Attribute& attributeConditions(); bool appliesTo(std::shared_ptr rhs) const; bool appliesTo(const Rule& rhs) const; bool appliesTo(const Rule& rhs); bool isImplicit() const; operator bool() const; std::string toString(bool invalid = false) const; void updateMetaDataCounters(bool applied = true, bool evaluated = false); std::unique_ptr& internal(); const std::unique_ptr& internal() const; /*** Static methods ***/ static Rule fromString(const std::string& rule_string); private: std::unique_ptr d_pointer; }; } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleCondition.cpp000066400000000000000000000143731325273707200245250ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "usbguard/RuleCondition.hpp" #include "usbguard/Rule.hpp" #include "usbguard/Logger.hpp" #include #include namespace usbguard { RuleConditionBase::RuleConditionBase(const std::string& identifier, const std::string& parameter, bool negated) : _identifier(identifier), _parameter(parameter), _negated(negated) { } RuleConditionBase::RuleConditionBase(const std::string& identifier, bool negated) : _identifier(identifier), _negated(negated) { } RuleConditionBase::RuleConditionBase(const RuleConditionBase& rhs) : _identifier(rhs._identifier), _parameter(rhs._parameter), _negated(rhs._negated) { } RuleConditionBase::~RuleConditionBase() { fini(); } void RuleConditionBase::init(Interface* const interface_ptr) { (void)interface_ptr; } void RuleConditionBase::fini() { } bool RuleConditionBase::evaluate(const Rule& rule) { return isNegated() ? !update(rule) : update(rule); } const std::string& RuleConditionBase::identifier() const { return _identifier; } const std::string& RuleConditionBase::parameter() const { return _parameter; } bool RuleConditionBase::hasParameter() const { return !_parameter.empty(); } bool RuleConditionBase::isNegated() const { return _negated; } const std::string RuleConditionBase::toString() const { std::string condition_string; if (isNegated()) { condition_string.append("!"); } condition_string.append(identifier()); if (hasParameter()) { condition_string.append("("); condition_string.append(parameter()); /* TODO: Escape parameter string */ condition_string.append(")"); } return condition_string; } const std::string RuleConditionBase::toRuleString() const { return toString(); } } /* namespace usbguard */ #include "AllowedMatchesCondition.hpp" #include "LocaltimeCondition.hpp" #include "FixedStateCondition.hpp" #include "RandomStateCondition.hpp" #include "RuleAppliedCondition.hpp" #include "RuleEvaluatedCondition.hpp" #include #include namespace usbguard { RuleConditionBase* RuleConditionBase::getImplementation(const std::string& condition_string) { if (condition_string.empty()) { throw std::runtime_error("Empty condition"); } const bool negated = condition_string[0] == '!'; const size_t identifier_start = negated ? 1 : 0; const size_t p_pos = condition_string.find_first_of('('); std::string identifier; std::string parameter; if (p_pos == std::string::npos) { /* * The rest of the condition_string should be * a condition identifier -- without a parameter. */ identifier = condition_string.substr(identifier_start); if (identifier.size() < 1) { throw std::runtime_error("Invalid condition string. Missing identifier."); } } else { const size_t parameter_size = condition_string.size() - p_pos; if (parameter_size < 3 /* two parentheses + at least one character */) { throw std::runtime_error("Invalid condition string. Invalid parameter."); } const size_t identifier_size = p_pos - identifier_start; identifier = condition_string.substr(identifier_start, identifier_size); if (condition_string[condition_string.size() - 1] != ')') { throw std::runtime_error("Invalid condition string. Malformed parameter."); } parameter = condition_string.substr(p_pos + 1, parameter_size - 2); } return getImplementation(identifier, parameter, negated); } RuleConditionBase* RuleConditionBase::getImplementation(const std::string& identifier, const std::string& parameter, bool negated) { if (identifier == "allowed-matches") { return new AllowedMatchesCondition(parameter, negated); } if (identifier == "localtime") { return new LocaltimeCondition(parameter, negated); } if (identifier == "true") { return new FixedStateCondition(true, negated); } if (identifier == "false") { return new FixedStateCondition(false, negated); } if (identifier == "random") { return new RandomStateCondition(parameter, negated); } if (identifier == "rule-applied") { return new RuleAppliedCondition(parameter, negated); } if (identifier == "rule-evaluated") { return new RuleEvaluatedCondition(parameter, negated); } throw std::runtime_error("Unknown rule condition"); } RuleCondition::RuleCondition() { } RuleCondition::RuleCondition(const std::string& condition_string) : _condition(RuleConditionBase::getImplementation(condition_string)) { } RuleCondition::RuleCondition(const RuleCondition& rhs) : _condition(rhs._condition->clone()) { } RuleCondition::RuleCondition(RuleCondition&& rhs) : _condition(std::move(rhs._condition)) { } RuleCondition& RuleCondition::operator=(const RuleCondition& rhs) { _condition.reset(rhs._condition->clone()); return *this; } RuleCondition& RuleCondition::operator=(RuleCondition&& rhs) { _condition = std::move(rhs._condition); return *this; } RuleConditionBase* RuleCondition::operator->() { return _condition.get(); } RuleConditionBase& RuleCondition::operator*() { return *_condition.get(); } std::string RuleCondition::toRuleString() const { return _condition->toRuleString(); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleCondition.hpp000066400000000000000000000047201325273707200245250ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include #include namespace usbguard { class Interface; class Rule; class DLL_PUBLIC RuleConditionBase { public: RuleConditionBase(const std::string& identifier, const std::string& parameter, bool negated = false); RuleConditionBase(const std::string& identifier, bool negated = false); RuleConditionBase(const RuleConditionBase& rhs); virtual ~RuleConditionBase(); virtual void init(Interface* const interface_ptr); virtual void fini(); virtual bool update(const Rule& rule) = 0; virtual RuleConditionBase* clone() const = 0; bool evaluate(const Rule& rule); const std::string& identifier() const; const std::string& parameter() const; bool hasParameter() const; bool isNegated() const; const std::string toString() const; const std::string toRuleString() const; static RuleConditionBase* getImplementation(const std::string& condition_string); static RuleConditionBase* getImplementation(const std::string& identifier, const std::string& parameter, bool negated); private: const std::string _identifier; const std::string _parameter; const bool _negated; }; class DLL_PUBLIC RuleCondition { public: RuleCondition(); RuleCondition(const std::string& condition_string); RuleCondition(const RuleCondition& rhs); RuleCondition(RuleCondition&& rhs); RuleCondition& operator=(const RuleCondition& rhs); RuleCondition& operator=(RuleCondition&& rhs); RuleConditionBase* operator->(); RuleConditionBase& operator*(); std::string toRuleString() const; private: std::unique_ptr _condition; }; } /*namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleParser.cpp000066400000000000000000000045501325273707200240270ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "RuleParser.hpp" #include "RuleParser/Grammar.hpp" #include "RuleParser/Actions.hpp" #include "RulePrivate.hpp" #include "usbguard/Typedefs.hpp" #include "usbguard/USB.hpp" #include "usbguard/Logger.hpp" #include "Common/Utility.hpp" #include #include #include #include namespace usbguard { Rule parseRuleFromString(const std::string& rule_spec, const std::string& file, size_t line, bool trace) { try { Rule rule; #if HAVE_PEGTL_LTE_1_3_1 if (!trace) { pegtl::parse(rule_spec, file, rule); } else { pegtl::parse(rule_spec, file, rule); } #else if (!trace) { pegtl::parse_string(rule_spec, file, rule); } else { pegtl::parse_string(rule_spec, file, rule); } #endif return rule; } catch (const pegtl::parse_error& ex) { RuleParserError error(rule_spec); error.setHint(ex.what()); #if HAVE_PEGTL_LTE_1_3_1 error.setOffset(ex.positions[0].column); #else error.setOffset(ex.positions[0].byte_in_line); #endif if (!file.empty() || line != 0) { error.setFileInfo(file, line); } throw error; } catch (const std::exception& ex) { throw; } } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleParser.hpp000066400000000000000000000047771325273707200240470ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include "Rule.hpp" #include #include #include namespace usbguard { class RuleParserError : public std::exception { public: RuleParserError(const std::string& rule_spec, const std::string& hint = "", const std::string& file = "", size_t error_line = 0, unsigned int error_offset = 0) : _rule_spec(rule_spec), _hint(hint), _offset(error_offset), _file(file), _line(error_line) { } void setHint(const std::string& hint) { _hint = hint; } void setOffset(size_t offset) { _offset = offset; } void setFileInfo(const std::string& file, size_t error_line, size_t error_offset = 0) { _file = file; _line = error_line; _offset = error_offset; } const char* what() const noexcept { return "RuleParserError"; } const std::string& rule() const { return _rule_spec; } const std::string& hint() const { return _hint; } bool hasFileInfo() const { return !_file.empty(); } const std::string fileInfo() const { return _file + ": line=" + std::to_string(_line) + ": offset=" + std::to_string(_offset); } const std::string& file() const { return _file; } size_t line() const { return _line; } size_t offset() const { return _offset; } protected: const std::string _rule_spec; std::string _hint; size_t _offset; std::string _file; size_t _line; }; DLL_PUBLIC Rule parseRuleFromString(const std::string& rule_spec, const std::string& file = std::string(), size_t line = 0, bool trace = false); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleSet.cpp000066400000000000000000000057251325273707200233330ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Typedefs.hpp" #include "RuleSetPrivate.hpp" #include "Common/Utility.hpp" namespace usbguard { RuleSet::RuleSet(Interface* const interface_ptr) : d_pointer(make_unique(*this, interface_ptr)) { } RuleSet::~RuleSet() = default; RuleSet::RuleSet(const RuleSet& rhs) : d_pointer(make_unique(*this, *rhs.d_pointer)) { } const RuleSet& RuleSet::operator=(const RuleSet& rhs) { d_pointer.reset(new RuleSetPrivate(*this, *rhs.d_pointer)); return *this; } void RuleSet::load(const std::string& path) { d_pointer->load(path); } void RuleSet::load(std::istream& stream) { d_pointer->load(stream); } void RuleSet::save(const std::string& path) const { d_pointer->save(path); } void RuleSet::save(std::ostream& stream) const { d_pointer->save(stream); } void RuleSet::setDefaultTarget(Rule::Target target) { d_pointer->setDefaultTarget(target); } Rule::Target RuleSet::getDefaultTarget() const { return d_pointer->getDefaultTarget(); } void RuleSet::setDefaultAction(const std::string& action) { d_pointer->setDefaultAction(action); } uint32_t RuleSet::appendRule(const Rule& rule, uint32_t parent_id) { return d_pointer->appendRule(rule, parent_id); } uint32_t RuleSet::upsertRule(const Rule& match_rule, const Rule& new_rule, const bool parent_insensitive) { return d_pointer->upsertRule(match_rule, new_rule, parent_insensitive); } std::shared_ptr RuleSet::getRule(uint32_t id) { return d_pointer->getRule(id); } bool RuleSet::removeRule(uint32_t id) { return d_pointer->removeRule(id); } std::shared_ptr RuleSet::getFirstMatchingRule(std::shared_ptr device_rule, uint32_t from_id) const { return d_pointer->getFirstMatchingRule(device_rule, from_id); } std::vector> RuleSet::getRules() { return d_pointer->getRules(); } uint32_t RuleSet::assignID(std::shared_ptr rule) { return d_pointer->assignID(rule); } uint32_t RuleSet::assignID() { return d_pointer->assignID(); } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/RuleSet.hpp000066400000000000000000000110121325273707200233220ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Rule.hpp" #include "Typedefs.hpp" #include #include #include #include #include namespace usbguard { class RuleSetPrivate; class Interface; class DLL_PUBLIC RuleSet { public: /** * Construct an empty ruleset. */ RuleSet(Interface* const interface_ptr); RuleSet(const RuleSet& rhs); const RuleSet& operator=(const RuleSet& rhs); ~RuleSet(); /** * Load a ruleset from a file at `path'. * Internally, this opens an input file stream and calls load(std::istream& stream). */ void load(const std::string& path); /** * Load a ruleset from an input stream. * The stream is read using std::getline() and each line is parsed as a separate rule. * Empty lines are skipped. */ void load(std::istream& stream); /** * Save the ruleset to a file at `path'. * If a file exists at `path', it will be overwritten. Internally, this opens an output * stream and calls save(std::ostream& stream). */ void save(const std::string& path) const; /** * Write the ruleset to an output stream. * Each rule is serialized to it's string representation and written line by line to * the output stream. */ void save(std::ostream& stream) const; /** * Set an implicit default target which will be used if there's no match for a device * rule. */ void setDefaultTarget(Rule::Target target); /** * Get the implicit target value. */ Rule::Target getDefaultTarget() const; /** * Set an implicit default action which will be used if there's no match for a device * rule. */ void setDefaultAction(const std::string& action); /** * Assign a sequence number to a rule and append it to the rule set. * If `parent_id' is not specified, the rule will be appended at the end od the ruleset. * The method returns the sequence number assigned to the rule. */ uint32_t appendRule(const Rule& rule, uint32_t parent_id = Rule::LastID); /** * Search for a rule that matches `match_rule' rule and update it with a rule specified * by `new_rule'. Fail if multiple rules match. If there are no matching rules, append * the `new_rule' rule to the rule set. * * Returns the id of the updated or new rule. */ uint32_t upsertRule(const Rule& match_rule, const Rule& new_rule, bool parent_insensitive = false); /** * Get a rule pointer to a rule with the specified sequence number. * Returns nullptr if no such rule exists. */ std::shared_ptr getRule(uint32_t id); /** * Remove a rule from the ruleset. * The method returns true if a rule was removed and false otherwise. */ bool removeRule(uint32_t id); /** * Find first rule in the ruleset which matched the specified device rule. * If `from_id' isn't specified, the method searches from the beginning of the ruleset. * If no matching rule is found, nullptr is returned. */ std::shared_ptr getFirstMatchingRule(std::shared_ptr device_rule, uint32_t from_id = 1) const; /** * Get all rules from the set. */ std::vector> getRules(); /** * Get the oldest rule that timed out and should be removed from the ruleset. * Returns nullptr if there are not timed out rules. */ std::shared_ptr getTimedOutRule(); /** * Assign a unique sequence number to a rule. * Return the assigned sequence number. */ uint32_t assignID(std::shared_ptr rule); /** * Generate a unique sequence number. */ uint32_t assignID(); private: std::unique_ptr d_pointer; }; } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Typedefs.cpp000066400000000000000000000017571325273707200235340ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "Typedefs.hpp" namespace usbguard { template<> bool matches(const std::string& a, const std::string& b) { return a == b; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/Typedefs.hpp000066400000000000000000000035451325273707200235360ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include #include namespace usbguard { template bool matches(const T& a, const T& b) { return a == b; } template<> bool matches(const std::string& a, const std::string& b); /* * Atomic */ template using Atomic = std::atomic; /* * Symbol visibility */ #if defined _WIN32 || defined __CYGWIN__ #ifdef BUILDING_DLL #ifdef __GNUC__ #define DLL_PUBLIC __attribute__ ((dllexport)) #else #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. #endif #else #ifdef __GNUC__ #define DLL_PUBLIC __attribute__ ((dllimport)) #else #define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. #endif #endif #define DLL_LOCAL #else #if __GNUC__ >= 4 #define DLL_PUBLIC __attribute__ ((visibility ("default"))) #define DLL_LOCAL __attribute__ ((visibility ("hidden"))) #else #define DLL_PUBLIC #define DLL_LOCAL #endif #endif } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/USB.cpp000066400000000000000000000377411325273707200224040ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "USB.hpp" #include "Common/ByteOrder.hpp" #include "Common/Utility.hpp" #include "Logger.hpp" #include #include #include namespace usbguard { USBDeviceID::USBDeviceID() { } USBDeviceID::USBDeviceID(const std::string& vendor_id, const std::string& product_id) { checkDeviceID(vendor_id, product_id); setVendorID(vendor_id); setProductID(product_id); } USBDeviceID::USBDeviceID(const USBDeviceID& rhs) { _vendor_id = rhs._vendor_id; _product_id = rhs._product_id; } void USBDeviceID::checkDeviceID(const std::string& vendor_id, const std::string& product_id) { if (vendor_id.empty() || vendor_id == "*") { /* product id must be empty or "*" */ if (!product_id.empty() && product_id != "*") { throw std::runtime_error("Invalid USB device id format"); } } if (vendor_id.size() > USB_VID_STRING_MAX_LENGTH) { throw std::runtime_error("Vendor ID string size out of range"); } if (product_id.size() > USB_PID_STRING_MAX_LENGTH) { throw std::runtime_error("Product ID string size out of range"); } } void USBDeviceID::setVendorID(const std::string& vendor_id) { checkDeviceID(vendor_id, _product_id); _vendor_id = vendor_id; } void USBDeviceID::setProductID(const std::string& product_id) { checkDeviceID(_vendor_id, product_id); _product_id = product_id; } const std::string& USBDeviceID::getVendorID() const { return _vendor_id; } const std::string& USBDeviceID::getProductID() const { return _product_id; } std::string USBDeviceID::toRuleString() const { return _vendor_id + ":" + _product_id; } std::string USBDeviceID::toString() const { return toRuleString(); } bool USBDeviceID::isSubsetOf(const USBDeviceID& rhs) const { if (_vendor_id.empty() || _vendor_id == "*") { return true; } else if (_vendor_id != rhs._vendor_id) { return false; } if (_product_id.empty() || _product_id == "*") { return true; } else if (_product_id != rhs._product_id) { return false; } return true; } template<> bool Predicates::isSubsetOf(const USBDeviceID& source, const USBDeviceID& target) { USBGUARD_LOG(Trace) << "source=" << source.toString() << " target=" << target.toString(); const bool result = source.isSubsetOf(target); USBGUARD_LOG(Trace) << "result=" << result; return result; } USBInterfaceType::USBInterfaceType() { _bClass = 0; _bSubClass = 0; _bProtocol = 0; _mask = 0; } USBInterfaceType::USBInterfaceType(uint8_t bClass, uint8_t bSubClass, uint8_t bProtocol, uint8_t mask) { _bClass = bClass; _bSubClass = bSubClass; _bProtocol = bProtocol; _mask = mask; } USBInterfaceType::USBInterfaceType(const USBInterfaceDescriptor& descriptor, uint8_t mask) { _bClass = descriptor.bInterfaceClass; _bSubClass = descriptor.bInterfaceSubClass; _bProtocol = descriptor.bInterfaceProtocol; _mask = mask; } USBInterfaceType::USBInterfaceType(const std::string& type_string) { std::vector tokens; tokenizeString(type_string, tokens, ":", /*trim_empty=*/false); _bClass = 0; _bSubClass = 0; _bProtocol = 0; _mask = 0; if (tokens.size() != 3) { throw std::runtime_error("Invalid type_string"); } if (tokens[0].size() != 2) { throw std::runtime_error("Invalid type_string"); } else { _bClass = stringToNumber(tokens[0], 16); _mask |= MatchClass; } if (tokens[1] != "*") { if (tokens[1].size() != 2) { throw std::runtime_error("Invalid type_string"); } else { _bSubClass = stringToNumber(tokens[1], 16); _mask |= MatchSubClass; } } if (tokens[2] != "*") { if (tokens[2].size() != 2) { throw std::runtime_error("Invalid type_string"); } else { _bProtocol = stringToNumber(tokens[2], 16); _mask |= MatchProtocol; } } if (!(_mask == (MatchAll) || _mask == (MatchClass|MatchSubClass) || _mask == (MatchClass))) { throw std::runtime_error("Invalid type_string"); } } bool USBInterfaceType::operator==(const USBInterfaceType& rhs) const { return (_bClass == rhs._bClass && _bSubClass == rhs._bSubClass && _bProtocol == rhs._bProtocol && _mask == rhs._mask); } bool USBInterfaceType::appliesTo(const USBInterfaceType& rhs) const { if (_mask & MatchClass) { if (_bClass != rhs._bClass) { return false; } } if (_mask & MatchSubClass) { if (_bSubClass != rhs._bSubClass) { return false; } } if (_mask & MatchProtocol) { if (_bProtocol != rhs._bProtocol) { return false; } } return true; } template<> bool Predicates::isSubsetOf(const USBInterfaceType& source, const USBInterfaceType& target) { return source.appliesTo(target); } const std::string USBInterfaceType::typeString() const { return USBInterfaceType::typeString(_bClass, _bSubClass, _bProtocol, _mask); } const std::string USBInterfaceType::toRuleString() const { return typeString(); } const std::string USBInterfaceType::typeString(uint8_t bClass, uint8_t bSubClass, uint8_t bProtocol, uint8_t mask) { std::string type_string(""); if (mask & MatchClass) { type_string.append(numberToString(bClass, "", 16, 2, '0') + ":"); if (mask & MatchSubClass) { type_string.append(numberToString(bSubClass, "", 16, 2, '0') + ":"); if (mask & MatchProtocol) { type_string.append(numberToString(bProtocol, "", 16, 2, '0')); } else { type_string.append("*"); } } else { type_string.append("*:*"); } } else { throw std::runtime_error("BUG: cannot create type string, invalid mask"); } return type_string; } void USBParseDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; const USBDeviceDescriptor* device_raw = reinterpret_cast(descriptor_raw); USBDeviceDescriptor* device_out = reinterpret_cast(descriptor_out); /* Copy 1:1 */ *device_out = *device_raw; /* Convert multibyte field to host endianness */ device_out->bcdUSB = busEndianToHost(device_raw->bcdUSB); device_out->idVendor = busEndianToHost(device_raw->idVendor); device_out->idProduct = busEndianToHost(device_raw->idProduct); device_out->bcdDevice = busEndianToHost(device_raw->bcdDevice); } void USBParseConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; const USBConfigurationDescriptor* configuration_raw = reinterpret_cast(descriptor_raw); USBConfigurationDescriptor* configuration_out = reinterpret_cast(descriptor_out); /* Copy 1:1 */ *configuration_out = *configuration_raw; /* Convert multibyte field to host endianness */ configuration_out->wTotalLength = busEndianToHost(configuration_raw->wTotalLength); } void USBParseInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; const USBInterfaceDescriptor* interface_raw = reinterpret_cast(descriptor_raw); USBInterfaceDescriptor* interface_out = reinterpret_cast(descriptor_out); /* Copy 1:1 */ *interface_out = *interface_raw; } void USBParseEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; const USBEndpointDescriptor* endpoint_raw = reinterpret_cast(descriptor_raw); USBEndpointDescriptor* endpoint_out = reinterpret_cast(descriptor_out); *endpoint_out = *endpoint_raw; endpoint_out->wMaxPacketSize = busEndianToHost(endpoint_raw->wMaxPacketSize); } void USBParseAudioEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; const USBAudioEndpointDescriptor* endpoint_raw = reinterpret_cast(descriptor_raw); USBAudioEndpointDescriptor* endpoint_out = reinterpret_cast(descriptor_out); *endpoint_out = *endpoint_raw; endpoint_out->wMaxPacketSize = busEndianToHost(endpoint_raw->wMaxPacketSize); } void USBParseUnknownDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { (void)parser; *descriptor_out = *descriptor_raw; } void USBDescriptorParserHooks::parseUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out) { USBGUARD_LOG(Trace); const auto type = static_cast(descriptor_raw->bHeader.bDescriptorType); const auto size = descriptor_raw->bHeader.bLength; switch (type) { case USBDescriptorType::Device: switch (size) { case sizeof(USBDeviceDescriptor): USBParseDeviceDescriptor(parser, descriptor_raw, descriptor_out); return; default: throw Exception("USB descriptor parser", "device descriptor", "unexpected descriptor size"); } break; case USBDescriptorType::Configuration: switch (size) { case sizeof(USBConfigurationDescriptor): USBParseConfigurationDescriptor(parser, descriptor_raw, descriptor_out); return; default: throw Exception("USB descriptor parser", "configuration descriptor", "unexpected descriptor size"); } break; case USBDescriptorType::Interface: switch (size) { case sizeof(USBInterfaceDescriptor): USBParseInterfaceDescriptor(parser, descriptor_raw, descriptor_out); return; default: throw Exception("USB descriptor parser", "interface descriptor", "unexpected descriptor size"); } break; case USBDescriptorType::Endpoint: switch (size) { case sizeof(USBEndpointDescriptor): USBParseEndpointDescriptor(parser, descriptor_raw, descriptor_out); return; case sizeof(USBAudioEndpointDescriptor): USBParseAudioEndpointDescriptor(parser, descriptor_raw, descriptor_out); return; default: throw Exception("USB descriptor parser", "endpoint descriptor", "unexpected descriptor size"); } break; case USBDescriptorType::String: case USBDescriptorType::AssociationInterface: case USBDescriptorType::Unknown: default: USBParseUnknownDescriptor(parser, descriptor_raw, descriptor_out); return; } /* UNREACHABLE */ } void USBDescriptorParserHooks::loadUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor) { (void)parser; (void)descriptor; USBGUARD_LOG(Trace); } USBDescriptorParser::USBDescriptorParser(USBDescriptorParserHooks& hooks) : _hooks(hooks) { } size_t USBDescriptorParser::parse(std::istream& stream) { size_t size_processed = 0; while (stream.good()) { USBDescriptorHeader header; stream.read(reinterpret_cast(&header), sizeof header); if (stream.gcount() != sizeof header) { /* * If we read nothing and the stream if at EOF, just break * the loop and return normally. Checking the sanity of the * parsed descriptor data is up to the higher layers. */ if (stream.gcount() == 0 && stream.eof()) { break; } /* * Otherwise throw an exception because there's unknown garbage * in the stream which cannot be a valid USB descriptor. */ else { throw std::runtime_error("Cannot parse descriptor data: partial read while reading header data"); } } /* * The bLength value has to be at least 2, because that is the size of the USB * descriptor header. */ if (header.bLength < sizeof(USBDescriptorHeader)) { throw std::runtime_error("Invalid descriptor data: bLength is less than the size of the header"); } /* * Let's try to read the rest of the descriptor data before we start looking * for the descriptor type handler. If there's not enough data in the stream, * then there's no point for searching for the handler. */ USBDescriptor descriptor; descriptor.bHeader = header; memset(&descriptor.bDescriptorData, 0, sizeof descriptor.bDescriptorData); /* * We read (bLength - header_size) amount of data here because the bLength value * counts in the size of the header too and we already read it from the stream. */ stream.read(reinterpret_cast(&descriptor.bDescriptorData), header.bLength - sizeof(USBDescriptorHeader)); if (stream.gcount() != (std::streamsize)(header.bLength - sizeof(USBDescriptorHeader))) { throw std::runtime_error("Invalid descriptor data: bLength value larger than the amount of available data"); } USBDescriptor descriptor_parsed; descriptor_parsed.bHeader = header; memset(&descriptor_parsed.bDescriptorData, 0, sizeof descriptor_parsed.bDescriptorData); _hooks.parseUSBDescriptor(this, &descriptor, &descriptor_parsed); _hooks.loadUSBDescriptor(this, &descriptor_parsed); setDescriptor(header.bDescriptorType, descriptor_parsed); size_processed += header.bLength; } return size_processed; } const std::vector* USBDescriptorParser::getDescriptor(uint8_t bDescriptorType) const { auto const& it = _dstate_map.find(bDescriptorType); if (it == _dstate_map.end()) { return nullptr; } return &it->second; } void USBDescriptorParser::setDescriptor(uint8_t bDescriptorType, const USBDescriptor& descriptor) { auto& descriptors = _dstate_map[bDescriptorType]; bool set = false; for (auto& stored_descriptor : descriptors) { if (stored_descriptor.bHeader.bLength == descriptor.bHeader.bLength) { stored_descriptor = descriptor; set = true; } } if (!set) { descriptors.push_back(descriptor); } /* * Count in the descriptor no matter if we overwrote one or not. * We are counting all occurences of a descriptor type. */ ++_count_map[bDescriptorType]; } void USBDescriptorParser::delDescriptor(uint8_t bDescriptorType) { _dstate_map.erase(bDescriptorType); } bool USBDescriptorParser::haveDescriptor(uint8_t bDescriptorType) const { return _dstate_map.count(bDescriptorType) > 0; } const std::vector> USBDescriptorParser::getDescriptorCounts() const { std::vector> counts; for (auto const& kv : _count_map) { counts.push_back(std::make_pair(kv.first, kv.second)); } std::sort(counts.begin(), counts.end()); return counts; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/USB.hpp000066400000000000000000000220441325273707200223770ustar00rootroot00000000000000// // Copyright (C) 2015 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Predicates.hpp" #include "Typedefs.hpp" #include #include #include #include #include #include #include #include namespace usbguard { /* * Maximum lenght of a string that is read from a USB descriptor * Since the string descriptors have an 8-bit length field, the * maximum lenght of a string stored in a string descriptor is * UINT8_MAX minus the size of the length field (1 byte) and the * size of the type field (1 byte). */ const size_t USB_GENERIC_STRING_MAX_LENGTH = UINT8_MAX - 2; /* Maximum lenght of the vendor id in string form */ const size_t USB_VID_STRING_MAX_LENGTH = 4; /* Maximum lenght of the product id in string form */ const size_t USB_PID_STRING_MAX_LENGTH = 4; /* Maximum lenght of the port in string form */ const size_t USB_PORT_STRING_MAX_LENGTH = PATH_MAX; /* * NOTE: The USB specification dictates that all multibyte data fields * are in little-endian form. The structures defined bellow are * used for platform-independed passing of the USB descriptor * data to the Device class. The Device class assumes that the * values are in host-specific endianness. */ const uint8_t USB_DESCRIPTOR_TYPE_UNKNOWN = 0x00; const uint8_t USB_DESCRIPTOR_TYPE_DEVICE = 0x01; const uint8_t USB_DESCRIPTOR_TYPE_CONFIGURATION = 0x02; const uint8_t USB_DESCRIPTOR_TYPE_STRING = 0x03; const uint8_t USB_DESCRIPTOR_TYPE_INTERFACE = 0x04; const uint8_t USB_DESCRIPTOR_TYPE_ENDPOINT = 0x05; const uint8_t USB_DESCRIPTOR_TYPE_ASSOCIATION_INTERFACE = 0x0b; enum class USBDescriptorType : uint8_t { Unknown = USB_DESCRIPTOR_TYPE_UNKNOWN, Device = USB_DESCRIPTOR_TYPE_DEVICE, Configuration = USB_DESCRIPTOR_TYPE_CONFIGURATION, String = USB_DESCRIPTOR_TYPE_STRING, Interface = USB_DESCRIPTOR_TYPE_INTERFACE, Endpoint = USB_DESCRIPTOR_TYPE_ENDPOINT, AssociationInterface = USB_DESCRIPTOR_TYPE_ASSOCIATION_INTERFACE }; struct DLL_PUBLIC USBDescriptorHeader { uint8_t bLength; uint8_t bDescriptorType; } __attribute__((packed)); struct DLL_PUBLIC USBDescriptor { struct USBDescriptorHeader bHeader; uint8_t bDescriptorData[256-sizeof(USBDescriptorHeader)]; } __attribute__((packed)); struct DLL_PUBLIC USBDeviceDescriptor { struct USBDescriptorHeader bHeader; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize; uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; uint8_t iManufacturer; uint8_t iProduct; uint8_t iSerialNumber; uint8_t bNumConfigurations; } __attribute__((packed)); struct DLL_PUBLIC USBConfigurationDescriptor { struct USBDescriptorHeader bHeader; uint16_t wTotalLength; uint8_t bNumInterfaces; uint8_t bConfigurationValue; uint8_t iConfiguration; uint8_t bmAttributes; uint8_t bMaxPower; } __attribute__((packed)); struct DLL_PUBLIC USBInterfaceDescriptor { struct USBDescriptorHeader bHeader; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bNumEndpoints; uint8_t bInterfaceClass; uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; uint8_t iInterface; } __attribute__((packed)); struct USBEndpointDescriptor { struct USBDescriptorHeader bHeader; uint8_t bEndpointAddress; uint8_t bmAttributes; uint16_t wMaxPacketSize; uint8_t bInterval; } __attribute__((packed)); struct USBAudioEndpointDescriptor { struct USBDescriptorHeader bHeader; uint8_t bEndpointAddress; uint8_t bmAttributes; uint16_t wMaxPacketSize; uint8_t bInterval; uint8_t bRefresh; uint8_t bSynchAddress; } __attribute__((packed)); class DLL_PUBLIC USBDeviceID { public: USBDeviceID(); USBDeviceID(const std::string& vendor_id, const std::string& product_id = std::string()); USBDeviceID(const USBDeviceID& rhs); static void checkDeviceID(const std::string& vendor_id, const std::string& product_id); void setVendorID(const std::string& vendor_id); void setProductID(const std::string& product_id); const std::string& getVendorID() const; const std::string& getProductID() const; std::string toRuleString() const; std::string toString() const; bool isSubsetOf(const USBDeviceID& rhs) const; private: std::string _vendor_id; std::string _product_id; }; namespace Predicates DLL_PUBLIC { template<> bool isSubsetOf(const USBDeviceID& source, const USBDeviceID& target); } class DLL_PUBLIC USBInterfaceType { public: static const uint8_t MatchClass = 1<<0; static const uint8_t MatchSubClass = 1<<1; static const uint8_t MatchProtocol = 1<<2; static const uint8_t MatchAll = MatchClass|MatchSubClass|MatchProtocol; USBInterfaceType(); USBInterfaceType(uint8_t bClass, uint8_t bSubClass, uint8_t bProtocol, uint8_t mask = MatchAll); USBInterfaceType(const USBInterfaceDescriptor& descriptor, uint8_t mask = MatchAll); USBInterfaceType(const std::string& type_string); bool operator==(const USBInterfaceType& rhs) const; bool appliesTo(const USBInterfaceType& rhs) const; const std::string typeString() const; const std::string toRuleString() const; static const std::string typeString(uint8_t bClass, uint8_t bSubClass, uint8_t bProtocol, uint8_t mask = MatchAll); private: uint8_t _bClass; uint8_t _bSubClass; uint8_t _bProtocol; uint8_t _mask; }; namespace Predicates DLL_PUBLIC { template<> bool isSubsetOf(const USBInterfaceType& source, const USBInterfaceType& target); } class USBDescriptorParser; class DLL_PUBLIC USBDescriptorParserHooks { public: virtual void parseUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_in, USBDescriptor* descriptor_out); virtual void loadUSBDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor); }; class DLL_PUBLIC USBDescriptorParser { public: USBDescriptorParser(USBDescriptorParserHooks& hooks); /** * Initiate parsing of USB descriptors from an input stream. * * Returns number of bytes succesfully parsed/processed from * the stream. */ size_t parse(std::istream& stream); /** * Return a pointer to a USBDescriptor of type bDescriptorType that * is stored in the USB descriptor state. If there's no such descriptor, * then nullptr is returned. */ const std::vector* getDescriptor(uint8_t bDescriptorType) const; /** * Set the active instance of an USB descriptor of bDescriptorType type. */ void setDescriptor(uint8_t bDescriptorType, const USBDescriptor& descriptor); /** * Delete the active instance of an USB descriptor of bDescriptorType type. */ void delDescriptor(uint8_t bDescriptorType); /** * Returns true if the descriptor state contains a USB descriptor of type bDescriptorType. */ bool haveDescriptor(uint8_t bDescriptorType) const; /** * Returns a vector of (bDescriptorType, count) pairs. */ const std::vector> getDescriptorCounts() const; private: USBDescriptorParserHooks& _hooks; std::unordered_map> _dstate_map; /**< Descriptor State Map */ std::unordered_map _count_map; }; void DLL_PUBLIC USBParseDeviceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); void DLL_PUBLIC USBParseConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); void DLL_PUBLIC USBParseInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); void DLL_PUBLIC USBParseEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); void DLL_PUBLIC USBParseAudioEndpointDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); void DLL_PUBLIC USBParseUnknownDescriptor(USBDescriptorParser* parser, const USBDescriptor* descriptor_raw, USBDescriptor* descriptor_out); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/USBGuard.cpp000066400000000000000000000045261325273707200233620ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #ifdef HAVE_BUILD_CONFIG_H #include #endif #include "USBGuard.hpp" #include "ConfigFile.hpp" #include "Exception.hpp" #include "Logger.hpp" #include #include #ifndef USBGUARD_DAEMON_CONF_PATH # warning "Using hard-coded USBGUARD_DAEMON_CONF_PATH value" #define USBGUARD_DAEMON_CONF_PATH "/etc/usbguard/usbguard-daemon.conf" #endif namespace usbguard { std::string getDaemonConfigPath() { USBGUARD_LOG(Trace); const char* const envval = getenv("USBGUARD_DAEMON_CONF"); if (envval != nullptr) { USBGUARD_LOG(Debug) << "Returning environment variable path: " << envval; return std::string(envval); } else { USBGUARD_LOG(Debug) << "Returning build-time path: " << USBGUARD_DAEMON_CONF_PATH; return std::string(USBGUARD_DAEMON_CONF_PATH); } } std::string getIPCAccessControlFilesPath() { USBGUARD_LOG(Trace); const std::string daemon_conf_path = getDaemonConfigPath(); ConfigFile daemon_conf; daemon_conf.open(daemon_conf_path); if (daemon_conf.hasSettingValue("IPCAccessControlFiles")) { return daemon_conf.getSettingValue("IPCAccessControlFiles"); } throw Exception("getIPCAccessControlFilesPath", daemon_conf_path, "IPCAccessControlFiles not set"); } std::string getIPCAccessControlFileBasename(const std::string& name, bool is_group) { USBGUARD_LOG(Trace) << "name=" << name << " is_group=" << is_group; std::string basename; if (is_group) { basename.append(":"); } basename.append(name); return basename; } } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Library/public/usbguard/USBGuard.hpp000066400000000000000000000020711325273707200233600ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #pragma once #include "Typedefs.hpp" #include namespace usbguard { DLL_PUBLIC std::string getDaemonConfigPath(); DLL_PUBLIC std::string getIPCAccessControlFilesPath(); DLL_PUBLIC std::string getIPCAccessControlFileBasename(const std::string& name, bool is_group); } /* namespace usbguard */ /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/000077500000000000000000000000001325273707200156375ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Tests/Makefile.am000066400000000000000000000065461325273707200177060ustar00rootroot00000000000000## ## Copyright (C) 2016 Red Hat, 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 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 . ## ## Authors: Daniel Kopecek ## AM_CPPFLAGS=\ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/Library \ -I$(top_srcdir)/src/Library/public \ @catch_CFLAGS@ EXTRA_DIST=\ $(top_srcdir)/src/Tests/custom.supp \ $(top_srcdir)/src/Tests/test-driver \ $(top_srcdir)/src/Tests/bash-testlib.sh \ $(top_srcdir)/src/ThirdParty/Catch \ $(top_srcdir)/src/Tests/USB/test-descriptor-parser.sh \ $(top_srcdir)/src/Tests/USB/data/0001.bin \ $(top_srcdir)/src/Tests/USB/data/0001.out \ $(top_srcdir)/src/Tests/Rules/test-rules.sh \ $(top_srcdir)/src/Tests/Rules/test-rules.good \ $(top_srcdir)/src/Tests/Rules/test-rules.bad \ $(top_srcdir)/src/Tests/UseCase/000_executable.sh \ $(top_srcdir)/src/Tests/UseCase/001_cli_policy.sh \ $(top_srcdir)/src/Tests/UseCase/002_cli_devices.sh \ $(top_srcdir)/src/Tests/UseCase/003_cli_devices_dummy.sh \ $(top_srcdir)/src/Tests/UseCase/004_daemonize.sh \ $(top_srcdir)/src/Tests/UseCase/DummyDevices \ $(top_srcdir)/src/Tests/Source/check-driver.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/copyright.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/vim-modeline.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/spell-check.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/spell-check.rws \ $(top_srcdir)/src/Tests/Source/CheckScripts/private-with-build-config.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/public-without-build-config.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/code-style.sh LOG_DRIVER=\ $(top_srcdir)/src/Tests/test-driver TESTS_ENVIRONMENT=\ builddir=$(top_builddir) \ srcdir=$(top_srcdir) \ abs_top_srcdir=$(abs_top_srcdir) \ USBGUARD_TESTLIB_BASH=$(top_srcdir)/src/Tests/bash-testlib.sh \ USBGUARD=$(top_builddir)/usbguard \ USBGUARD_DAEMON=$(top_builddir)/usbguard-daemon \ USBGUARD_DBUS=$(top_builddir)/usbguard-dbus TESTS=\ test-unit \ test-regression \ USB/test-descriptor-parser.sh \ Rules/test-rules.sh if FULL_TEST_SUITE_ENABLED TESTS+=\ Source/check-driver.sh \ UseCase/000_executable.sh \ UseCase/001_cli_policy.sh \ UseCase/002_cli_devices.sh \ UseCase/003_cli_devices_dummy.sh \ UseCase/004_daemonize.sh endif check_PROGRAMS=\ test-unit \ test-regression test_unit_SOURCES=\ main.cpp \ Unit/test_Rule.cpp \ Unit/test_RuleParser.cpp \ Unit/test_Base64.cpp \ Unit/test_UEvent.cpp \ Unit/test_UEventParser.cpp \ Unit/test_Utility.cpp \ Unit/test_RuleAttribute_id.cpp \ Unit/test_IPCServer_AccessControl.cpp test_unit_LDADD=\ $(top_builddir)/libusbguard.la test_unit_LDFLAGS=\ -static test_regression_SOURCES=\ main.cpp \ Regression/test_Rule_ghi37.cpp \ Regression/test_Rule_ghi113.cpp \ Regression/github-PR209-config-parser.cpp test_regression_LDADD=\ $(top_builddir)/libusbguard.la usbguard-0.7.2+ds/src/Tests/Makefile.in000066400000000000000000001241721325273707200177130ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-unit$(EXEEXT) test-regression$(EXEEXT) \ USB/test-descriptor-parser.sh Rules/test-rules.sh \ $(am__append_1) @FULL_TEST_SUITE_ENABLED_TRUE@am__append_1 = \ @FULL_TEST_SUITE_ENABLED_TRUE@ Source/check-driver.sh \ @FULL_TEST_SUITE_ENABLED_TRUE@ UseCase/000_executable.sh \ @FULL_TEST_SUITE_ENABLED_TRUE@ UseCase/001_cli_policy.sh \ @FULL_TEST_SUITE_ENABLED_TRUE@ UseCase/002_cli_devices.sh \ @FULL_TEST_SUITE_ENABLED_TRUE@ UseCase/003_cli_devices_dummy.sh \ @FULL_TEST_SUITE_ENABLED_TRUE@ UseCase/004_daemonize.sh check_PROGRAMS = test-unit$(EXEEXT) test-regression$(EXEEXT) subdir = src/Tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/libgcrypt.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)/src/build-config.h.in CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__dirstamp = $(am__leading_dot)dirstamp am_test_regression_OBJECTS = main.$(OBJEXT) \ Regression/test_Rule_ghi37.$(OBJEXT) \ Regression/test_Rule_ghi113.$(OBJEXT) \ Regression/github-PR209-config-parser.$(OBJEXT) test_regression_OBJECTS = $(am_test_regression_OBJECTS) test_regression_DEPENDENCIES = $(top_builddir)/libusbguard.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_test_unit_OBJECTS = main.$(OBJEXT) Unit/test_Rule.$(OBJEXT) \ Unit/test_RuleParser.$(OBJEXT) Unit/test_Base64.$(OBJEXT) \ Unit/test_UEvent.$(OBJEXT) Unit/test_UEventParser.$(OBJEXT) \ Unit/test_Utility.$(OBJEXT) \ Unit/test_RuleAttribute_id.$(OBJEXT) \ Unit/test_IPCServer_AccessControl.$(OBJEXT) test_unit_OBJECTS = $(am_test_unit_OBJECTS) test_unit_DEPENDENCIES = $(top_builddir)/libusbguard.la test_unit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(test_unit_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)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles 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 = $(test_regression_SOURCES) $(test_unit_SOURCES) DIST_SOURCES = $(test_regression_SOURCES) $(test_unit_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ ANALYZE_CONFIGURE_ARGS = @ANALYZE_CONFIGURE_ARGS@ AR = @AR@ ASCIIDOCTOR = @ASCIIDOCTOR@ ASPELL = @ASPELL@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BUSCONFIG_DIR = @DBUS_BUSCONFIG_DIR@ DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GDBUS_CODEGEN = @GDBUS_CODEGEN@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLKIT_POLICY_DIR = @POLKIT_POLICY_DIR@ PROTOC = @PROTOC@ QT4LRELEASE = @QT4LRELEASE@ QT4MOC = @QT4MOC@ QT4RCC = @QT4RCC@ QT4UIC = @QT4UIC@ QT5LRELEASE = @QT5LRELEASE@ QT5MOC = @QT5MOC@ QT5RCC = @QT5RCC@ QT5UIC = @QT5UIC@ QTLRELEASE = @QTLRELEASE@ QTMOC = @QTMOC@ QTRCC = @QTRCC@ QTUIC = @QTUIC@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@ VERSION = @VERSION@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ atomic_LIBS = @atomic_LIBS@ audit_CFLAGS = @audit_CFLAGS@ audit_LIBS = @audit_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ catch_CFLAGS = @catch_CFLAGS@ catch_LIBS = @catch_LIBS@ crypto_CFLAGS = @crypto_CFLAGS@ crypto_LIBS = @crypto_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dbus_CFLAGS = @dbus_CFLAGS@ dbus_LIBS = @dbus_LIBS@ 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@ libcapng_CFLAGS = @libcapng_CFLAGS@ libcapng_LIBS = @libcapng_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pegtl_AC_CFLAGS = @pegtl_AC_CFLAGS@ pegtl_CFLAGS = @pegtl_CFLAGS@ pegtl_LIBS = @pegtl_LIBS@ polkit_CFLAGS = @polkit_CFLAGS@ polkit_LIBS = @polkit_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ protobuf_CFLAGS = @protobuf_CFLAGS@ protobuf_LIBS = @protobuf_LIBS@ psdir = @psdir@ qb_CFLAGS = @qb_CFLAGS@ qb_LIBS = @qb_LIBS@ qt4_CFLAGS = @qt4_CFLAGS@ qt4_LIBS = @qt4_LIBS@ qt5_CFLAGS = @qt5_CFLAGS@ qt5_LIBS = @qt5_LIBS@ qt_CFLAGS = @qt_CFLAGS@ qt_LIBS = @qt_LIBS@ sbindir = @sbindir@ seccomp_CFLAGS = @seccomp_CFLAGS@ seccomp_LIBS = @seccomp_LIBS@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ 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)/src/Library \ -I$(top_srcdir)/src/Library/public \ @catch_CFLAGS@ EXTRA_DIST = \ $(top_srcdir)/src/Tests/custom.supp \ $(top_srcdir)/src/Tests/test-driver \ $(top_srcdir)/src/Tests/bash-testlib.sh \ $(top_srcdir)/src/ThirdParty/Catch \ $(top_srcdir)/src/Tests/USB/test-descriptor-parser.sh \ $(top_srcdir)/src/Tests/USB/data/0001.bin \ $(top_srcdir)/src/Tests/USB/data/0001.out \ $(top_srcdir)/src/Tests/Rules/test-rules.sh \ $(top_srcdir)/src/Tests/Rules/test-rules.good \ $(top_srcdir)/src/Tests/Rules/test-rules.bad \ $(top_srcdir)/src/Tests/UseCase/000_executable.sh \ $(top_srcdir)/src/Tests/UseCase/001_cli_policy.sh \ $(top_srcdir)/src/Tests/UseCase/002_cli_devices.sh \ $(top_srcdir)/src/Tests/UseCase/003_cli_devices_dummy.sh \ $(top_srcdir)/src/Tests/UseCase/004_daemonize.sh \ $(top_srcdir)/src/Tests/UseCase/DummyDevices \ $(top_srcdir)/src/Tests/Source/check-driver.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/copyright.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/vim-modeline.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/spell-check.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/spell-check.rws \ $(top_srcdir)/src/Tests/Source/CheckScripts/private-with-build-config.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/public-without-build-config.sh \ $(top_srcdir)/src/Tests/Source/CheckScripts/code-style.sh LOG_DRIVER = \ $(top_srcdir)/src/Tests/test-driver TESTS_ENVIRONMENT = \ builddir=$(top_builddir) \ srcdir=$(top_srcdir) \ abs_top_srcdir=$(abs_top_srcdir) \ USBGUARD_TESTLIB_BASH=$(top_srcdir)/src/Tests/bash-testlib.sh \ USBGUARD=$(top_builddir)/usbguard \ USBGUARD_DAEMON=$(top_builddir)/usbguard-daemon \ USBGUARD_DBUS=$(top_builddir)/usbguard-dbus test_unit_SOURCES = \ main.cpp \ Unit/test_Rule.cpp \ Unit/test_RuleParser.cpp \ Unit/test_Base64.cpp \ Unit/test_UEvent.cpp \ Unit/test_UEventParser.cpp \ Unit/test_Utility.cpp \ Unit/test_RuleAttribute_id.cpp \ Unit/test_IPCServer_AccessControl.cpp test_unit_LDADD = \ $(top_builddir)/libusbguard.la test_unit_LDFLAGS = \ -static test_regression_SOURCES = \ main.cpp \ Regression/test_Rule_ghi37.cpp \ Regression/test_Rule_ghi113.cpp \ Regression/github-PR209-config-parser.cpp test_regression_LDADD = \ $(top_builddir)/libusbguard.la 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 src/Tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(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 Regression/$(am__dirstamp): @$(MKDIR_P) Regression @: > Regression/$(am__dirstamp) Regression/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Regression/$(DEPDIR) @: > Regression/$(DEPDIR)/$(am__dirstamp) Regression/test_Rule_ghi37.$(OBJEXT): Regression/$(am__dirstamp) \ Regression/$(DEPDIR)/$(am__dirstamp) Regression/test_Rule_ghi113.$(OBJEXT): Regression/$(am__dirstamp) \ Regression/$(DEPDIR)/$(am__dirstamp) Regression/github-PR209-config-parser.$(OBJEXT): \ Regression/$(am__dirstamp) \ Regression/$(DEPDIR)/$(am__dirstamp) test-regression$(EXEEXT): $(test_regression_OBJECTS) $(test_regression_DEPENDENCIES) $(EXTRA_test_regression_DEPENDENCIES) @rm -f test-regression$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_regression_OBJECTS) $(test_regression_LDADD) $(LIBS) Unit/$(am__dirstamp): @$(MKDIR_P) Unit @: > Unit/$(am__dirstamp) Unit/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Unit/$(DEPDIR) @: > Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_Rule.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_RuleParser.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_Base64.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_UEvent.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_UEventParser.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_Utility.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_RuleAttribute_id.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) Unit/test_IPCServer_AccessControl.$(OBJEXT): Unit/$(am__dirstamp) \ Unit/$(DEPDIR)/$(am__dirstamp) test-unit$(EXEEXT): $(test_unit_OBJECTS) $(test_unit_DEPENDENCIES) $(EXTRA_test_unit_DEPENDENCIES) @rm -f test-unit$(EXEEXT) $(AM_V_CXXLD)$(test_unit_LINK) $(test_unit_OBJECTS) $(test_unit_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f Regression/*.$(OBJEXT) -rm -f Unit/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Regression/$(DEPDIR)/github-PR209-config-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Regression/$(DEPDIR)/test_Rule_ghi113.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Regression/$(DEPDIR)/test_Rule_ghi37.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_Base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_IPCServer_AccessControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_Rule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_RuleAttribute_id.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_RuleParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_UEvent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_UEventParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Unit/$(DEPDIR)/test_Utility.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @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 $$? test-unit.log: test-unit$(EXEEXT) @p='test-unit$(EXEEXT)'; \ b='test-unit'; \ $(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-regression.log: test-regression$(EXEEXT) @p='test-regression$(EXEEXT)'; \ b='test-regression'; \ $(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) USB/test-descriptor-parser.sh.log: USB/test-descriptor-parser.sh @p='USB/test-descriptor-parser.sh'; \ b='USB/test-descriptor-parser.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) Rules/test-rules.sh.log: Rules/test-rules.sh @p='Rules/test-rules.sh'; \ b='Rules/test-rules.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) Source/check-driver.sh.log: Source/check-driver.sh @p='Source/check-driver.sh'; \ b='Source/check-driver.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) UseCase/000_executable.sh.log: UseCase/000_executable.sh @p='UseCase/000_executable.sh'; \ b='UseCase/000_executable.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) UseCase/001_cli_policy.sh.log: UseCase/001_cli_policy.sh @p='UseCase/001_cli_policy.sh'; \ b='UseCase/001_cli_policy.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) UseCase/002_cli_devices.sh.log: UseCase/002_cli_devices.sh @p='UseCase/002_cli_devices.sh'; \ b='UseCase/002_cli_devices.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) UseCase/003_cli_devices_dummy.sh.log: UseCase/003_cli_devices_dummy.sh @p='UseCase/003_cli_devices_dummy.sh'; \ b='UseCase/003_cli_devices_dummy.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) UseCase/004_daemonize.sh.log: UseCase/004_daemonize.sh @p='UseCase/004_daemonize.sh'; \ b='UseCase/004_daemonize.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: $(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) -rm -f Regression/$(DEPDIR)/$(am__dirstamp) -rm -f Regression/$(am__dirstamp) -rm -f Unit/$(DEPDIR)/$(am__dirstamp) -rm -f Unit/$(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-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) Regression/$(DEPDIR) Unit/$(DEPDIR) -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 -rf ./$(DEPDIR) Regression/$(DEPDIR) Unit/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: usbguard-0.7.2+ds/src/Tests/Regression/000077500000000000000000000000001325273707200177575ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Tests/Regression/github-PR209-config-parser.cpp000066400000000000000000000051221325273707200252540ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/ConfigFile.hpp" #include #include #include #include #include using namespace usbguard; static std::string createFile(const std::vector lines) { std::string filepath("/tmp/usbguard-test.XXXXXX"); const int fd = ::mkstemp(&filepath[0]); if (fd < 0) { throw std::runtime_error("cannot create temporary file"); } for (const auto& line : lines) { ::write(fd, line.c_str(), line.size()); ::write(fd, "\n", 1); } ::close(fd); return filepath; } TEST_CASE("Regression: GitHub PR #209", "[regression]") { std::vector known_keys = { "keyA", "keyB", "fooB", "barF" }; ConfigFile config(known_keys); SECTION("key=value inside a comment should be ignored") { const std::string path = createFile({ "# keyA=foo", "keyA=bar", "# unknown=foo" }); REQUIRE_NOTHROW(config.open(path)); } SECTION("empty line is not a syntax error") { const std::string path = createFile({ "# comment", "", "# comment", "", "", "fooB=bar" }); REQUIRE_NOTHROW(config.open(path)); } SECTION("unknown key=value should trigger an error") { const std::string path = createFile({ "unknown=foo", "keyA=bar" }); REQUIRE_THROWS(config.open(path)); } SECTION("known key=value should not trigger an error") { const std::string path = createFile({ "keyA=foo", "keyB=bla", "fooB=bar", "barF=asdf" }); REQUIRE_NOTHROW(config.open(path)); } SECTION("syntax error should trigger an error") { const std::string path = createFile({ "keyA=foo", "adfsdlfkj", "keyB=b" }); REQUIRE_THROWS(config.open(path)); } SECTION("trim value") { const std::string path = createFile({ "keyA= foo", "keyB=bar" }); REQUIRE_NOTHROW(config.open(path)); REQUIRE(config.getSettingValue("keyA") == "foo"); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Regression/test_Rule_ghi113.cpp000066400000000000000000000024371325273707200235130ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/Rule.hpp" #include using namespace usbguard; TEST_CASE("Regression: GitHub issue #113", "[regression]") { Rule target_rule; Rule source_rule; const std::string source_rule_spec = \ "allow with-interface equals { 08:*:* }"; const std::string target_rule_spec = \ "allow with-interface equals { 08:06:50 }"; CHECK_NOTHROW(target_rule = Rule::fromString(target_rule_spec)); CHECK_NOTHROW(source_rule = Rule::fromString(source_rule_spec)); REQUIRE(source_rule.appliesTo(target_rule)); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Regression/test_Rule_ghi37.cpp000066400000000000000000000026201325273707200234320ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/Rule.hpp" #include using namespace usbguard; TEST_CASE("Regression: GitHub issue #37", "[regression]") { Rule rule; const std::string valid_rule_string = \ "allow 17ef:6016 name \"ThinkPad USB Laser Mouse\" with-interface 03:01:02 hash \"b2b49929ddce325f217adc89cd2b6c20\""; const std::string invalid_rule_string = \ "allow 17ef:6016 name \"ThinkPad USB Laser Mouse\" with-interface \"03:01:02\" hash \"b2b49929ddce325f217adc89cd2b6c20\""; SECTION("from string") { REQUIRE_NOTHROW(rule = Rule::fromString(valid_rule_string)); REQUIRE_THROWS(rule = Rule::fromString(invalid_rule_string)); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Rules/000077500000000000000000000000001325273707200167315ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Tests/Rules/test-rules.bad000066400000000000000000000026631325273707200215170ustar00rootroot00000000000000alloww asdf 123 .:][}{}{(*#*&^!&^% @(&(*##$ #()($#)($# ())(! !@_#)$_#)$!*@ -=-+_!@# """ " allow allow block block match allow allow { } allow id 1234:123 allow 1234:1234 id 1234:1234 allow id asdf:* allow *:1234 allow name allow name " allow name "a allow name "\" allow name "a\" allow name \"asdf" allow name "foo' allow name one-of allow name one-of { allow name one-of } allow name { allow name } allow name { a } allow name } a { allow name \"a\" allow with-interface allow with-interface 1:: allow with-interface 12:*:34 allow with-interface ::: allow with-interface asdf allow with-interface "12:21:32" allow with-interface *:*:* allow with-interface *:22:22 allow with-interface one-of allow with-interface one-of { allow with-interface one-of { a } allow with-interface { allow with-interface } allow with-interface one-of { * } allow with-interface some { 12:12:12 } allow unknown-attribute allow unknown-attribute "s" allow if allow if unknown-condition allow if !unknown-condition allow if randomM allow if !randomM allow if random( allow if (true allow if )false allow if !(true allow if !)true( allow if true(( allow if true((( allow if false))(() allow if !true( allow if !!() allow name "asdf" name "foo" allow hash "a" hash "b" allow via-port "1" via-port "2" allow with-interface 12:34:56 with-interface 12:34:56 allow with-interface one-of { 12:12:23 } with-interface 12:11:11 allow if allowed-matches(fooo) allow if !allowed-matches(aaaa) usbguard-0.7.2+ds/src/Tests/Rules/test-rules.good000066400000000000000000003547731325273707200217350ustar00rootroot00000000000000allow allow hash "0,;UW~fn" id { 7Dbb:* } serial "R0Ci+jH'" parent-hash { "f+n`s" via-port "/^WlPN7G" if rule-evaluated allow hash "7/G>!^p" "qV*i-WBa" "n0|g}USf" "dcQck[gN" "PQ<$8>`<" "9p#l$|Zz" } id none-of { F53A:* EE2D:f1aD 37AC:* 3F4E:64Cc Bdae:C0Fa } if !localtime(2:00) allow hash "`dcN*WO{" name "77QNHYnV" if true allow hash "]:.drVPa" serial "v]s`5riB" via-port "%C`qdl9b" id all-of { fA6E:* b8aE:* } parent-hash "!dcVB5iT" if allowed-matches(name "mIba4_Mk") allow hash "ED2+}Aq;" via-port { "40&EC96o" "R}h>w8bo" } parent-hash none-of { "O-r:.&r@" "!8q1mk`]" "~RaG}];g" } name "xk52974}" allow hash "}ENfT*po" serial "+!5>^#.e57" "Bh:H^^]p" "iKyrj'pU" "@9#Y[L`b" "h<}5Bx8Q" ".`B2yV%]" "sk.KTkP?" "c0JwUOVF" } allow hash equals { "^~{X`8%G" "l2ZG4|0;" "7KfL'b}G" "lt]n3L6?" "FG5k+TZ=" "Vz G3qgF" } if localtime(1:00) allow hash "G4Rs_h^K" if equals { true false !true false } allow hash ";[+iMTt8" parent-hash "<|t33w6A" serial "[IM:Uk_x" via-port { "-+

C%r2" } if !true allow hash ".J5^}hQb" with-interface 5F:2e:7E name { "h&" "?K[l4Aqj" "DT4mJ'l:" } parent-hash "+%B|QI?J" serial one-of { ";1r?7CK{" "B[{$Z9Zs" } allow hash "nK1,uv0#" if random allow hash none-of { "_aIEAY0#" "%T&N>rOM" } allow hash none-of { ".g$YW/wh" } id { 68bd:* } if false allow hash none-of { "l1p^N/f|" "WT9J&<'o" "%9B:~Gsj" "TL,%eV^;" } id one-of { 5abc:9CF8 251b:* 3cE8:* fEA4:E9c2 eC4b:cBb2 } parent-hash equals { "X7N]j&@&" " ZC73tCY" "Mh~*pfG5" "A!IMm wH" "=mAH/N3x" "1fcf>wS4" } name "{Fm1CveV" with-interface equals-ordered { 7b:*:* CE:*:* 9d:*:* c9:86:56 } serial "v5 r!_%z" if !localtime(2:00) allow hash none-of { "ZHf7%6|N" "FA'+RV+9" "?>T.<>!W" "yG%'yESl" "z`auPzt]" "rZ /Xcz'" "uhW8Gx{," "mee*EO7c" } parent-hash equals-ordered { "1+oKbeQS" "$[!I+$9y" "Lfs-6a.}" "}&+<&ImA" } with-interface equals { 6F:*:* d7:3c:* f7:3D:* } serial one-of { "Mapp{$~A" "|D05t[i3" } allow hash one-of { "Dkd!Q#=+" "CfE5nF8k" "'s#S9?|." } id all-of { 1F7E:* c071:6f21 802e:* 597f:D40D D7DC:* 5Fb5:E9A7 } serial { ":0d&r~!K" "XM~fa90H" "D 6TPPY%" } name "J>'#e%a9" with-interface CC:*:* parent-hash equals-ordered { "l9~!%M" "s=j,ae%{" "&%6;CGO!" } with-interface 6B:CC:aE allow hash { "PPF@}b$w" "kWEdlQP]" "xf1.6KU." "[W}|d8@w" "iiegC8j'" "b:,Oz7b`" } if !false allow hash "$`.V[[pp" serial all-of { "~&4>K V/" } parent-hash one-of { "lhY4P~HZ" "e=Ffoxc$" } via-port all-of { "1ojWQ6aI" "7XX!-Wl7" } with-interface { 59:*:* bD:*:* 6e:e6:1d 48:B0:* } name "/p`.VJo3" id { C08f:B236 a3C6:* c172:* 172e:* b4EC:5Abe 3fFc:* } allow hash { "XGhA|X2O" "$m1pNS?Z" "dJ^14C5G" "m_6$Ih?>" "Y8T~fQEw" } if !false allow hash { "Yh-b02~R" } via-port "1:,-fGHp" parent-hash "4 /Y,%7#" id 9E22:* serial equals-ordered { "Q5Pf{3,o" "Mz'ins,j" "8St ![=~" ",.aGjpEF" "[~2hoeW+" "Okz:luY$" } with-interface f1:B7:* if !false allow hash "Ze$Y]H-}" serial { "Vf0rpbah" "OABxYWKs" "gr%EW`a8" } name { "W[X7V?5H" "4lRj=/z:" "i,xidFv?" "GFk%I*Kw" "hYw;84}>" "| Pcppq]" "{Dq:R2I[" } parent-hash "V=Tm&QNu" via-port "5pkH%vF1" with-interface one-of { 9b:DC:* bE:*:* e1:FE:8E } allow hash "}z;-h7lN" serial { "r9}TsY|a" "8 %Fm9qt" "8GN+~AhO" "4#F5/umx" "]j+B8_X " "re0J-H&g" "BTB@VR!~" } with-interface 7c:ef:9d id none-of { bDaC:93a9 c89B:E54E Aa0d:6b1F add8:* 88c4:F43c 1951:* 6bAF:* 525a:aEd5 } parent-hash none-of { "SeiB;IA2" "#5NgvMKr" "`uGLEvkc" } if rule-evaluated allow id { 05fe:2F6d dc7E:2D96 58b1:C3Fc Bdba:1FF9 } if equals { true false !true false } allow id 0da4:bCa4 with-interface { 8B:A1:33 Fd:F0:* CE:88:Aa bC:b0:B6 7F:dc:* dc:a0:* 49:5C:* F5:91:c9 } parent-hash all-of { "Qzr|1q[_" "KJ[jX{xE" "Q.!1S]6L" "4$--bt$0" } allow id 20F6:* allow id 48c9:B016 name "KOGY9jPX" with-interface fe:0b:* hash "oyH8A,$!" allow id { 5D3C:* 1b7A:b4Fd 8e78:* BD37:* } name { "ylD+:/QD" "Y@euy;FU" "F`^H5kN/" "XO}Lx,a|" "H6!" "DgB[7?5T" "uj.[jx!u" } if random(0.4) allow id 72Af:bfba allow id 7DfA:* with-interface DD:e5:Be parent-hash "YTv7H7H%" via-port "0uqZ07UE" allow id 8eC5:2C0c allow id { A3Ad:* e055:* b604:* E5Ad:F2fe } hash "ET_HeN*q" if one-of { true false !true false } allow id aB52:77bF parent-hash equals-ordered { "A3v9`>/+" "p~rv^nX " "rz8?C3:Y" "3SZ`SCw{" } via-port { "VIt>_={s" "cT]4COiw" } name none-of { "aG;R`0ds" "NgG{A:@h" "eN,+x=$r" "C0;EZ+g8" "<4n=yjC4" } serial { "+$7LGe.y" "F6s-r`%@" "WO_J|n,>" } with-interface { F2:*:* } hash "P&qIs}z." if random(0.4) allow id all-of { 451C:B71F 43bb:* DEBF:EAFA 1Dea:70a7 bd2e:D081 bf2D:0520 965b:D9b5 9Ac6:FfFb } hash "PyG; {74" via-port "dUWuEnRL" name "}gYy!+%@" parent-hash "V_/o" } serial "X|B74.!P" allow id all-of { f30E:* 5958:D3b6 f011:0F3e B8ca:* 490b:* 62f5:* 83C3:03CF 4feb:8670 } name "2Qe];N4v" parent-hash "+QWdQN5a" if none-of { true false !true false } allow id { B946:* 80D2:* FEac:BfD0 3c95:1Bc7 5D17:5FB5 } via-port { "~QpGvq4J" "`@*JB^v" "Q&A7Gl%r" "3ft_s>k{" } parent-hash equals-ordered { "dA&3ON]`" "O2OS|dD#" "TDYRcq1a" "a'kBKxjc" "]FTZ>Z=N" "]:;YJpx3" "K6W }mA~" } if random allow id c260:db5a name "p;_SQ#>L" hash { "Oes4J15<" "x&XKMkp&" "2V+woIfH" } serial ":/2T.nBf" with-interface { 35:18:0f e8:F9:* 17:d3:2F Ff:*:* 71:CB:A2 03:dE:C6 Ff:*:* } via-port one-of { "W9nu]BwQ" "N}_J'*IG" "PFrDg`6Y" "%dRgg= $" } allow id c76C:C376 parent-hash "1UWK2fl0" name ">]yZsrHU" with-interface Cd:D9:d7 hash "sJL''W3r" allow id c7ed:* allow id C8bB:dcCC name none-of { ". m'^RD*" "'zj,of#m" "-2RwM-rh" "hOH8S;`_" "Xm{CNeaN" "Ce-G@=A5" "-/y:O4Qs" } hash one-of { "/jBC#9kV" "[Dp,S=D{" "$dL:dX@a" } allow id Cb83:a9Be with-interface { 8d:DF:* 35:1F:09 F6:0d:* 3B:f4:* c7:DB:d0 } hash "zHD=j|a+" via-port "$H*'?,iB" parent-hash one-of { "N,h-'/f4" "$OOiB7K[" "86*X;B]1" "4C7PDxoQ" "WA?`>:]~" "6te1E5%j" } if rule-applied allow id D408:10FE allow id { E55A:ECce Dc25:AC43 E2e0:1Eeb f2bb:* EDcE:Ca4B FC5a:8E2c 05D4:* } serial all-of { "]7@n[1ne" "+'YRO_ `" "PX3B?e{h" "DT@~'zRU" } with-interface A0:Df:aE via-port { "1`&!3HwN" "@%l4H Xc" "E^rGr" } parent-hash "o'hfJcWM" with-interface d3:6E:5E via-port "<$'q;*z;" if equals-ordered { true false !true false } allow id equals { eAf0:* 8c1F:BdbA A4c2:* } with-interface Fa:Ed:B5 serial { "Z$VaGc @" "dpk[]q.E" ".=]vVV7h" "u[8zh9VJ" "brrZLkLC" "PGyQyu3{" ">9ji5:GV" "s97swV4U" } allow id equals { fAfB:* } with-interface { 2A:32:* Ac:eB:* c9:c8:* B7:fA:7A 63:eb:1f } hash "&.o~[n@+" parent-hash "oZ?:o'W[" name "y]jIUd2~" if !true allow id equals-ordered { 2Ddf:22ef } parent-hash "A!egv?S<" if rule-applied allow id equals-ordered { 6c7F:* 6D6b:DdDe } via-port none-of { " h~c1*" ":M%Ui>8<" "FY1bT9D3" } name "j]t7<2v7" if one-of { true false !true false } allow id equals-ordered { D495:* 056f:* 7FB3:* d1fF:eE79 } parent-hash { "$8LO231_" "5SP0qyB9" "~[5+nh2X" "VjuuAOQ9" "3wuU8Xz5" "ARF@0Y2>" "GnM>tIAN" "3%?K+uuA" } via-port "qEMw&;Oy" allow id equals-ordered { ec40:* 33ae:* 0132:DEAa 3e9D:* Cae1:c797 04aF:6Da1 } hash equals { "L[!1|}Ac" "u?,^/[-|" "zph#X|D%" } with-interface Fd:*:* name all-of { ".PIxe29n" "zL9vQizi" "Vne?{?'Y" } if !false allow id equals-ordered { EcE1:* 0240:B0AF EB5D:* 65A6:bc64 B994:E8F6 EFD6:* } with-interface equals { 8b:3C:cb dB:Bf:9d d0:*:* C6:aF:fE 62:8f:cC } parent-hash "07[`C+9u" via-port all-of { "lw&'GZ>p" "oKlvq+{g" "}i]Xb'pO" } name "9u>+Np/." hash all-of { "Hve1[Jx-" "-[7ltq:#" "DPru/Dtu" "D,7bJQ~o" "-@0F&<=&" "M'Bjgq?v" "5Q~Xx.{X" } serial "J,n~b9X%q" via-port { "fTptq#Q9" "~['/1 2L" "8c@pX7hX" "Fou=^`~S" } with-interface 5d:65:C3 allow id none-of { 4B70:* } serial one-of { "6JqhX7a|" "}dV^t{gv" "!y>~auXi" "3X4,.Tls" "54n_J;Q?" } via-port "kgA81,-r" with-interface CB:*:* parent-hash { "s, X" "_PwWqo=1" } if !true allow id one-of { 874a:A0B8 } parent-hash all-of { "GMb!D3I_" "bxF4[l5N" "*tM{'!'+" ",Tco:?hg" "D?U`;=0-" "P_GfeNV%" } hash { "rOHjh;8%" "E'[[Fq3=" "U{3aVyHL" "[c rnTm$" "z3'rghe[" "8]TGNLO%" "66E[G40h" } with-interface 07:Ea:* if !false allow if all-of { true false !true false } allow if allowed-matches(name ":[-iqZSZ") allow if allowed-matches(name "" if !false allow name { "37p3KD0x" "5z~bz" "h ?2LMf&" "oCV{w=8h" "8qHrb,d[" "s[9kX,yz" ":!^uH[Vy" } allow name "3D~eQFQn" allow name "3Z|DTZq=" with-interface 85:Ef:Cf serial "d`~6Cu=>" allow name "6'G^QN?x" id { d762:65D3 EFbd:* ed10:F7CF c396:EE28 } hash "}${i|4!o" via-port one-of { "EQb9Mzv*" "R}|/Ai_{" "VpoE,d7@" "'QJ`NUgS" "3T/50kAt" ",uW%p<&o" "-xZcF~$t" "#]TZfEFQ" } if rule-evaluated allow name "9@7!n{A%" id { aEa1:* 6bfC:* 1aa8:1685 } serial "9fh47>H%" parent-hash { "zxcUD&.2" "Aw=j+-'i" } allow name "cD&=*qkq" hash none-of { "/WSKm8b?" "mb++4:3I" "3UY#SZXf" "hDjN;{a_" "@U vf|4L" } parent-hash { "K_i=]Hx>" "#UZeheA@" "Na9D>'!v" "j/,b[ nL" "fAYN!*;N" "}M<$,h7K" } serial "KgEYoZxx" allow name "']D0sP&M" allow name "/DCOH}@<" allow name { "du9L16I " "RiKHm8Tn" "gE/kbws}" } parent-hash "1N^nE0-6" id 4C7F:* hash "#}u?P~Tq" if rule-applied allow name equals { " :6#e*Q;" "6>ja^0mE" "cde=`$kf" "!Q>F2][." ":4uLy@?N" "e7qJkQ=d" "s4w#JWZn" } hash "BZ:Rs,AF" via-port { ":{bSGo0^" } serial { "#|0#fK/M" "<#Y_oIT_" } parent-hash { "q{UtS-B0" "3Af*y&SP" "6OFD!,']" "ryf1'F,'" "xx!Et !_" "HQiPr:Db" ",Y =LT4u" "[T8dN:C6" } with-interface one-of { d5:F8:* 63:*:* Cc:1D:* c8:c2:09 } id one-of { aA08:* aB8B:C85a cdA4:53bE 9dAe:* B4ef:7C82 } allow name equals-ordered { "&],UqnDi" } hash "Db{f$[Lv" parent-hash "HHC@t4%w" serial "]*M}[r=5" via-port { "e6rPZ]t." ";=DY-Wqz" "J@q!t'@v" "H;-~rFd:" } with-interface bE:12:* if rule-evaluated allow name equals-ordered { "#+YB h:2" "mE=:SKc," "q{@4fsSv" } id 0f2B:* with-interface { 8E:0B:39 fA:*:* 21:58:* 9e:A6:0a } via-port "Vp#rh#m," allow name "GqUY{0Ut" parent-hash "?;iHlp Z" serial "f6?,LBv}" with-interface { 83:E4:eF c2:11:* a3:4f:* a9:94:* F1:*:* Cc:*:* bA:ed:Ab fe:38:f2 } hash all-of { "%`$ec*.Y" "f4,G}6lB" "&w`Ucdcq" "MUVz'UI}" "D6.PaC1g" ".UA5xz3N" } id 7fAe:* via-port equals { "A<0dr.AA" "7N0iB;X}" "W!e^1G&&" "a4BHz:XOx" "W!mhO{L}" "DOdT/ 5A" } parent-hash "2$^xC7-`" serial all-of { ",I2r9;3}" "1CI_]QEu" "DTg78`Zp" "e,5`PfuZ" "|q^LpDd1" "-m3DH3'v" } id equals-ordered { 8dda:8BBf } if false allow name "`k?PG#J4" parent-hash one-of { "{i3{jwf`" "0!6efXQ!" "7?Uog-X;" ",roZSqx0" "o?L7H+g?" "NDYoy5s^" } serial "Wha!%Rq9" via-port equals { "Mw3s1*#g" "-Ro@q0M~" } hash "20OO7g>z" allow name "l+I-j+&q" hash "81_}}RUb" id { ebe7:* aDCf:* D329:e8e0 9fab:A659 f4e6:* 7Bc4:78Bd FcAb:ABe9 } via-port none-of { "ZZr$x->i" "uTW7l^JO" } parent-hash equals-ordered { "bg?j!M3O" "~iWT#~uZ" " OsS6L7m" } serial "%GVv.0P3" "8Bd%DyNg" "ORRNa!_~" "ARr!_a?h" "[e:Z-4WK" } via-port { "*|W~G;%E" "k@nh6" "Vn^WcD6" } serial "M+z$_lfi" with-interface { 6C:*:* cf:*:* 92:07:* } hash "Zb#]:;`e" via-port equals-ordered { ";q0M6N2B" } if one-of { true false !true false } allow name none-of { "S3Q2/$4a" "q=~JA!0:" } allow name one-of { "q=-gjqt$" ">kt31^bN" "`7xQAsIr" " 2hwgFS-" ">?O+c.b]" } with-interface 63:*:* via-port "GAN{&i_Y" id { a389:CA3D 91dB:* ac8A:* DA4D:2F10 6707:5F13 5D0c:* 6FEF:* } serial equals { "tk5'E`5Q" "co|R-ibm" "+?awhGRs" "@iH1%wZ-" "wqu^QUv%" "jBAD]_pt" } allow name one-of { "}Q&-.Ak:t" id 9Fef:9460 parent-hash { "u8'C+%lK" " 8cH|KUz" "=[=}Lc*r" "5o+Vn[+V" } via-port ",95vqo!sC1" "lr&+jB&T" ">4f$1ayK" "5F_1d7G*" } parent-hash { "<2+,T,52" ",XYEO?P*" } allow name "R=sdxV,Y" via-port "=d[t5h4," parent-hash all-of { "YmqYD78V" "+T5$rA>M" "_%@X>Xb]" "7~8=&uj~" "%+:ch]kG" } id all-of { 41CF:* 8CB5:B2E8 A6c8:d4FD d3Ab:6BF1 eceD:93c0 6bcB:4caB } if rule-applied allow name ">SqzPBsW" serial "e8-9+zcm" via-port { "oD*t>I2G" "]P@Q}FE%" "zN^EB[3A" "T=gq07]%" "h +1A/#p" "E Oex~!J" } id B98f:a9eC allow name "$*tE^1xL" hash "zvcmQ0rP" id { ADcf:Dad1 eCa7:* 49c7:* 8495:4fDC CfA8:* cacc:* } serial "E$,i-GG#" via-port "}XJ<" "^Oy5cxN " "j?+ul]g[" "PxfVC4?n" } if allowed-matches(name "&hGim?6C") allow name { "XM<9p =]" "q:3N!abA" "@rt00mps" "2qBA[-M9" "vql-d~Ni" } parent-hash "Fc7d?/.o" allow name { "~Y-7/9*'" "c4UzgH}Q" "TYXi#LvP" "g}ZK~$rs" } with-interface 64:d9:29 id { a1a6:08d7 A7Fa:* } hash { "$M[mDQhq" "KWFpzE4Q" "+7-{36$M" "ic8+wB[g" "tp#Q@r2}" "MS/YNz:1" "gtN$b1*." } serial { "3LZ@=P.h" "e1G]_~QV" } parent-hash { "YOJ^DlF6" "p#v>3u!6" "zJkH/<>`" "*hBtqYA}" "f'4E,#;o" "2}-A Ez}" "=RGciD#F" "DXxtELsu" } via-port equals { "Qn=" "j}j3uC;~" "8&b=Y_SX" } allow name " ,YBx6N_" with-interface none-of { 0E:*:* B5:*:* 10:*:* F5:5e:* 0d:BA:88 C6:b5:* } allow name "z|IB SEY" parent-hash { "+n_fFr`q" "F#$yVikY" "R%5gTF^a" } via-port "&D.%`l{N" serial "{*DrR]zU" hash { "%{7uRMfn" "bU';0e$w" "arg-[ys" "M2/@&O!'" "_#~N!c>0" } id 6E30:* with-interface e9:*:* serial { "B:Jka`S_" "#l }5^lr" "Oxy%w|FX" "Rjsn;x#K" } allow parent-hash "3[&-m_~;" id E28a:* allow parent-hash { "3&zqdh8[" "Mjv0D_MN" "jhVFba3?" } via-port { "E,67tOTO" "?@Un*TsF" ",+0C@3f7" "4^KE1n]d" ".mP1wP._" } allow parent-hash "'5pDBaw<" hash "Ya|;FG'+" name "Og^#MkS0" with-interface F0:12:86 if localtime(1:00) allow parent-hash "A4=eRNin" with-interface C6:25:* serial "* 6Z~LPp" id none-of { CBBA:C1c9 D7dA:* B6E3:Dc48 8293:* 9185:* 8f4C:F9a2 } via-port equals-ordered { "n]t/5m-g" } name "+#&[9Bev" hash { "%fTl{ u*" "n4-`0DIY" "=tALKv=b" } if random(0.4) allow parent-hash all-of { "D=AaAX]7" "=`S 4xFt" "ZA]c15 9" "K[z]i 1B" "|S'nQ,E3" "zfwpF<`T" "G@>3P'~N" "n5alcGz]" } serial one-of { "]njX,04R" "I7?`E=n`" "{sK]nGUP" "q3k%kk2x" "=tcG}rXP" "34c.oB$;" "?[sBK!7?" "A`X+oJ D" } hash ">jM6~J]m" name { "]?]xb=hi" } via-port { "{dZAF&>-" "%JU0{xTM" "BfYzE>+6" "h:<1[TbO" "4M+fce[?" "wOe&Y3lp" } with-interface { 3f:*:* A2:*:* b2:26:* CE:DC:* } allow parent-hash { ".b]|+$8e" "q*]AB8ly" } hash "8%" "q*$~CQ{r" "2xq M}.r" "jZ&o8.hK" "b^lx*@oZ" "]}B[V~f4" "A4Ws$}u'" } with-interface 8A:44:0b hash "}Q{Z1G+I" allow parent-hash "dycoj6=Y" name ";^$HUw78" allow parent-hash equals { "6>5oT*QC" "nC/Y{x:-" } hash "XS|2m_>%" allow parent-hash equals { "6vK,de0o" "<6zj49sE" "Qsdp*CXN" "9k'!4k8y" "A`dDkxXc" } via-port "}Zh2*^>3" id DB7C:5cc4 name "h$eT+AGD" serial { "61wIC.n}" "}S=t/JA<" "6+zCIpB@" } hash { "`G4Q_D:," "6ns^MSHQ" "!,`?=25@-Tjue" } serial equals-ordered { "'WO8VRS}" "X_aq-O M" } with-interface dB:*:* id 169A:* allow parent-hash equals-ordered { "Dr#u7kLk" "S:Q3|PED" "g|YuJBTf" "DuKE=VIR" "';gAGW#v" "zYTf:[u1" "E$H*#Tc" } hash none-of { "LdT=}aPm" "Y-X}4;N8" ">]K];" "}R#YcGAW" "xYDD-qJ_" "]d[05hdg" "jV?`Lf'Y" "uwwgTx>G" "*hJ6xz20" } allow parent-hash "eqW u;t$" allow parent-hash "f1F`]460" via-port none-of { "1*B=r%ZC" } id one-of { E8ea:* CD3f:9022 } hash none-of { "3dC;=a7^" "HAs4PM.%" "jWC8BP^Y" "ubSo=drk" } allow parent-hash "g1E d'mB" via-port "AM&o;>ja" serial { "Wjjgt<;l" "hV@a.sKQ" "$}$W7nl!" ">2'Rfeas" } id dd0A:* allow parent-hash "hI<5-~BV" allow parent-hash "j?keU3u0" hash { "^RxX'9No" "0NFX870}" "VGj0ey_2" } id none-of { 0Dda:FAbc } name none-of { "LUcTt<83" } serial "P};lVbS`" with-interface { F2:*:* 10:b4:1b 81:*:* 2d:4e:6c f3:69:67 b2:*:* 0e:02:8A 29:*:* } allow parent-hash "?k05p`{P" name { "NaW&vobv" "HJ;9IJU" } via-port all-of { "f-#G^eiT" ",U8CGp6%" "U%>I4h#A" "L|gwgzt_" "_8JzwYW2" } serial { "&KO" "G`g`6Zx9" "=L@q[t/M" "Cw3fTNsU" "oT%/m{|l" "cwTq2~e:" "o:v8;mK7" "ibX2M,jX" } serial "xQY?[l}S" hash none-of { ";vD*dCVS" "Umg|w}n1" "-zR8eb$=" "&uF1!1Of" "1deUS+,V" "Pgc}}#T6" "VV*9?NYc" } if true allow parent-hash none-of { "wWAlt+a2" "$|p_HABv" "7@dF#y#Q" "i0;+qg^j" "grc wTv2" "e9/F{PmO" } with-interface cd:*:* serial "{^THpO#8" via-port one-of { "!Lw2?sbP" "C%#tO``]" "X;M=p>rz" "y=VKS?kP" "p8^`4s$<" } hash equals { "dscOOhUE" "UF4Z@LE;" "wY.*RV^2" "b'xY7yIs" "MGf;wg7X" } name { "-Gi3xX_b" "RdEq$oE0" "%:[X&IO!" "IVt|{0ov" "sM%P|hIf" } if true allow parent-hash one-of { "1!c sXx." "0?OSRz]'" "pHd2:j2C" ";+n:wE5r" } with-interface all-of { d1:*:* 96:E9:F3 Ee:ee:* 03:*:* } id 72EA:2feE serial "xWht+3z2" name "IjD9>JQL" allow parent-hash { "-P5iX2'i" " vEpe_rn/:?3n" } hash equals { "'m89QdGH" "cl.oFO9<" "PIjylETk" "Co7Zw!;k" "wySgI&Km" "WvAz|4+s" "`28gOaOc" } with-interface equals { 52:ba:* BD:Ef:* c2:*:* } serial none-of { "Ns'PECqA" "[qSQdvr1" "MoT[zjp7" } id 2F08:a478 name all-of { "v3:g5kYZ" "noV[8ufu" " '|h=he7" "v nDRB@m" "'v20C{`*" } if true allow parent-hash "zs87c%:_" name "vF#*!p=|" with-interface { BF:eb:* 6E:c5:AE } hash one-of { "w 1<;MF1" "z9Q$[,52" "UlD]a#C^" ":C~R.f~q" "xa1hxvMS" "E }TNsit" "s&rBcjA#" "@K,Ao5/c" } id 3465:* if !false allow parent-hash "z.,+?>;|" via-port { ":@V1!w8|" "_OiWE[N;" "!NGSs#:Y" "DC@1uv!:" "qnf$d[nl" } serial { "'{e*.PKQ" } hash "sk*>:>0g" id Fbc5:BCEF allow serial "13gwVVH5" parent-hash "^$#pYu'q" via-port " ;Oqn1Y-" id 34B6:05b0 hash "Gme/.b;n" name "uB69{#>*" if !localtime(2:00) allow serial "#-|2VG'4" if rule-evaluated allow serial { "4ZAH# [a" "_K.HiYlO" "RuH9uNPX" "JSB}mk`L" } id 38D7:C5a3 name "otYR$=X2" with-interface { Fb:bc:b8 Be:*:* DD:*:* Ac:*:* 11:49:* 00:*:* 9d:*:* } allow serial "5%[xymld" allow serial "7>lGW!SQ" id AfA2:9aAA parent-hash "Jc{r^WNm" if rule-applied allow serial { "9!MA;6gh" "*E8l%9;>" "o6u'hRRI" "p `m@N-S" "rnmK[1M%" "//+a79&t" } via-port equals-ordered { "]/EQL?a2" "Imk7@r=E" ":,a-OO{l" "JW/|jwu3" "WDNq;;7?" "WJ;x@6@6" } parent-hash "i&mhTu/!" if !localtime(2:00) allow serial ";}!>]9]o" via-port { "nHGDZ6.Q" "U_[C!lOE" "A3hL1:Vw" "1nHsoOWB" "f/Kl}-E*" "6v %^hZ" } with-interface 3F:30:* hash { ">_,N9e>w" "[H*I6oM^" "&c4$C3]~" "'VH5*=1&N%" } name "j+lljhgn" if rule-evaluated allow serial all-of { "Q]a4D;'-" "w^QOYRtT" } with-interface 9E:*:* name one-of { ".cqJn~i=" } allow serial all-of { "YZ^O^HfL" "Xc9/|?T$" "F>ab@Yq^" } name { ",ysz`6* " "xV1|i:~&" "u37WO][m" "JJnBEv89" "BM1..j!-" "2RFBXTBU" "+5&nHUe$" } with-interface 1e:*:* id { E2e3:* aE3c:Fa1d 37E3:* } hash "QH.BnmL." parent-hash "?&0>iFQw" allow serial "ba/53DHw" hash "NB8T<0+]" name { "UFVo Ze1" } parent-hash "SXz6H$e]" with-interface { 4f:9F:Ad A1:a8:A8 } id { baA9:36BE e5a8:875f fE1d:* EFFd:* bF1f:b5C3 03bB:* d2Ce:b1Db 570A:* } via-port all-of { "aVE]qHo" "p@hwy-nI@ks" "5I8}nUXl" "8;@,13g]" } if !true allow serial "%dyTA'MH" via-port { " fa:z['B" ".*;Kc%AT" "te~8wquE" "%/#VKyfS" } if rule-evaluated allow serial equals-ordered { "J#Ak$o3t" "jh[n.8cd" "baM`%%3e" "&bHo-b=a" "Y'I5ZW4@" "|K64FHR`" "l9sPVPr4" "3i'`_Z.Q" } allow serial equals-ordered { "jEKy4X&4" "IJD.><+l" } hash none-of { "A%Z$&Y;5" "q+Q7w-#7" "DOl$aKm^" "c4eKs$;2" "A5O%3?Oa" ",I#V{![0" "tU3f{ao&" } name { "S34X`%W$" "T;ePLNJG" "7x~qOD,." "Q?6d_Yd" "1rv`lev{" "`M@QqQ>." ":MN7Jh;=" "uRQ|tG[G" } with-interface 96:20:* via-port { "jvE;f2v]" "t1sH?c45" "}q{$6X.Y" "$&EDA_ez" "G@l]P#hc" } parent-hash "JRa3 TBB" allow serial "; =[@`" if rule-evaluated allow serial { "j[C^[]83" "g;ZB88;o" "_u5RxUr<" "bos/#6v:" "-e-'xp!S" } via-port { "~_nV#:Zp" "lv+8UnAo" "g/'*O@V]" "^uC$>d[}" "oA B;-}V" } id b569:* name "~XKeZMrl" parent-hash ">J:{MFJ$" hash "a5JEFomo" with-interface { 1E:f6:48 8B:d6:4f 0E:FC:* d0:5d:* 4a:*:* 1B:*:* } if localtime(1:00) allow serial " Kc01#Po" if !false allow serial ",MN%?.Y>" via-port ":^~;QaQq" name none-of { "3#G_;-a$" ".|mn0#_y" "tIq5=5nZ" "kBHA2_`y" "F4wUJ!-A" "=[0NEa.>" "latZgmqU" } id { 99fA:* 8fB8:* bD00:F90B eBCa:b0CC 49A3:* 495F:7F6A } parent-hash one-of { "sE0ORb:C" "ViwOg75q" ":x~,ntB%" "yKvoEhW@" "iy/,{&cf" "R~WcTWC3" "7u^SodZ1" } hash none-of { "m'%!b@Wy" "^v%pr|v " } with-interface { B5:*:* 3F:Cb:E3 F1:*:* FD:*:* Bc:*:* b6:F0:7e 17:c9:* } if true allow serial none-of { "3H5B@Hdm" "uA_q2`~U" "!syR`O,s" "DaX=w5%!" "}C=-=#%J" "3lp4BeIA" "@V|L#{Q*" "hf:?q'!Y" } via-port ".sZAu,K#" parent-hash "lR-:Z~S*" allow serial none-of { "7ZS>.Z_L" "^JC~{@J;" "LHIAhTY*" "t0XzZ,Aa" } with-interface aC:f9:78 if true allow serial { "nR*zOrIM" } if rule-evaluated allow serial "?Of=@o&9" id equals-ordered { b2f9:D590 9aA2:fF4a BF83:b6eC Ff1F:* 2fFF:* } parent-hash " ;ndZ.|N" allow serial one-of { "8JZG.Sv," } id { f38C:3FeC 3e37:* aAaB:* 9B0e:3eD3 Ec82:4a10 dAeA:916f c099:* } name "R5kbH4hm" parent-hash { "-0wkb,S5" "}:?%{mEK" "3t;L%x;:" "n_n>XID5" } if rule-applied allow serial one-of { "y]ZovAW[" "LO|~3Z^c" "0S|IIQ;%" "ev,O$V1" } parent-hash "6e1>8lB#" id equals-ordered { 2ecd:62C0 } hash { "jfX=U2-l" "6D~'X`zd" "9Mwid$/b" "o;p@JxY>" "2{Du3+iT" "}C0aw,>D" "?EEjh8/-" "Q+ve-G!{" } name ":/Y|DfTc" allow serial "R3!drwed" hash "La`$Iv[~" via-port none-of { "nD*y`It:" "_KI 27ER" "i3A`9]" "GC[:}B%T" "3wUV< &4" } with-interface { f2:eb:ee AC:*:* 16:36:63 85:74:* } parent-hash "6LD`eCtV" id all-of { 687C:* } if random allow serial "+{sxQai6" with-interface 9B:*:* allow serial "TB$*R1FV" name "FJsN 5G]" via-port "L&2wy`d%" allow serial "wzv*1-?;" id 530E:* parent-hash "z~1]XEki" allow serial "[x{r=@3?" via-port "XAqCV`lo" name " oND]_[e" id 9dB5:6eCe hash one-of { "]'0ySg`@" } with-interface all-of { 3d:*:* } parent-hash none-of { "L}aJXUI7" } allow serial "Ysvz,r^=" parent-hash "pABE8HA:" via-port ".WT$UVKO" id Fc9E:7Ae4 name "$m_fy '." hash "'*'$p]V=" with-interface { Fa:*:* Dd:cF:* ac:5F:ce 49:EF:* 84:Ea:Ed } if !localtime(2:00) allow serial { "_Zf`R.Ow" "ZsrHlOHR" } parent-hash all-of { "*ev,d+a0" "]bk9[l/s" "6 7f66c6" "dwq|U+-{" "dV3ufcs<" "Ao$m@tW9" } with-interface none-of { 27:*:* 5d:da:* 1A:EF:* } allow serial { ",zqU4:Et" "@wn77Y]6" "% =wSK'p" "7?xc-:P~" "@N`5h13]" "hpTi^C~q" ",I3xAfmW" "@BcWV1{~" } hash "ko%GG-j." id { 5A8c:* Fbe7:6425 C2Cc:* 7BDf:1e6d f9C1:* 4B92:79A7 } if localtime(1:00) allow serial { "}Zy8#M%K" "Kk}@K-Ad" "rs=9 |@/" "z0x[[%om" "HVsG5*vk" "Yzb.i<7%" "kq0pM%4|" "%K/cN{Pe" } id one-of { 1cab:fF2A c963:* baCa:* 212D:* } if random(0.4) allow via-port { "0$kiH'b2" ":*x`tsTZ" "EDujY+cd" "s&Y@bFS~" "q QEPzk[" "zEZ+{$?j" "%ieRj@~h" "pvor/A<`" } hash one-of { "w$a#5o'1" "Xj{E1|HE" } serial one-of { "Md'Ms-W|" "1NJuuJjP" "wV6Wkc^D" "rr3go=Fa" } parent-hash "Xza{L#/X" allow via-port { "18wAQlLj" "*{R|trH4" "&Q:M6cMj" "DJDO=$bA" } name "wqx/*A'C" id { 6d37:* 906F:6a5E AEDe:* Ff20:* e20d:73Dc CFcd:F3eC ea94:* bFd2:* } allow via-port { "4ic+&t{-" "j;yK~HH" "m;dO6a4+" "S t|lsQ " "k5Ye/qgb" "L3H4$bok" } serial "l#[1-pdf" id 1eDf:aC95 allow via-port all-of { "8hKR|Fu," } hash "/3ow6o*c" parent-hash "=gkx9? ?" allow via-port all-of { "xOqZKm8O" "MWR#= Kt" "X7:T,]/O" "Zyqi><=/" } parent-hash equals-ordered { "Zt9k8aYP" "pKJK}@dx" "SE9]?aJ1" "A5^,0+ne" "1*iKy%c~" } with-interface 4D:ee:8D hash "s}QJp=EU" if localtime(1:00) allow via-port "A~m~~kR@" name "3RvDO:J" "Q%$[nB`<" "?5W/1L" "W78" "7>BYqJFW" "a ,9qYS#" } with-interface 1e:CC:* parent-hash { "R]z/CO>]" "!lPQ_T/g" "F>-j2#!M" ":amy4QD^" } if !localtime(2:00) allow via-port "b/&kaa& " if rule-evaluated allow via-port "E58yEB,A" id { B2f9:beb2 } with-interface 6b:6B:DF allow via-port equals { "M=alL4,~" "xbe`6m-<" "}i1WqZE|" "s9R2acSQ" } id all-of { FE9D:* 8ecD:* 3836:4F1f bA4E:EFdb 16a1:* E6B4:66CA } serial { "9$77IY}." "dbKA654h" "eiZkAE=/GT[{o" "6I6@`#BR" "yitwi F%" "9yu_In4c" "vMa'C8>`" } name "q5'*2eOv" if true allow via-port equals-ordered { "K^p-OhWU" "4Z3H!}U8" "cfn9R$'E" "lYccdk*j" "@mL<&f,<" "1d9,9.Zj" "L_%J]tR%" } if allowed-matches(name "Go|<6C~'") allow via-port "}Fk=2,1E" serial "`=+!$1A|" hash all-of { "B9,>T+qK" ">dOVxI`@" } name { "g_d~maU!" "`g8bJ6?." "X%&|'ZVQ" "O_A+/oUH" ".!wOMBvS" "[dzi@mC/" ";nCL,7TQ" "A!9*m[7U" } id equals { D5ad:51f4 33Ba:9D4b 4c1d:de75 03bF:E9D3 49eb:* B93D:7F3B 2320:9cCd cBa6:* } with-interface 7B:0a:BE parent-hash equals-ordered { ",ZTVihf," "R`n'%W?!" "?D~.![q&" "5H=;[FM{" "J;d,?-q]" "m*:y9DD%" } allow via-port "HnEl>4*5" parent-hash none-of { "taS6,Ly&" "0bju}_,A" "GtlS[Vrf" "kZ$x#x|l" "w,iZw`<%" "c=s3!Wed" "Fu1Ep`:Z" } hash { "p%C1e &k" "XYJ#~iig" } with-interface { cB:D4:09 7F:Ad:* Fd:AB:E6 4B:DC:c8 ec:af:c6 9b:C0:* 4F:3E:00 } name "ylhT1~6m" if localtime(1:00) allow via-port "'I3[&dV^" serial { "zKl>>$UF" "Gna5cvVv" "17=s3D-9" "[05-~_n2" "+*xe!oY|" "FV^?Qv.O" "ELmS;E[Y" "o{bMdi2P" } name { "H2Mva{T9" "Z?<$?Yu>" "s~b%?*9X" "VP5K5@}f" } hash "qyzNDvL|" id dcd7:2f35 with-interface one-of { 9D:*:* f0:EA:* D8:*:* } parent-hash equals { "|!-Qg--v" "^evR]Vg2" "8Eg*Z!IL" } allow via-port "I'}e!NBd" name { "clgkJ/.1" "_~gKmJ6c" "uJ!{b{kf6" "X:r'|Ql-" "|g:vSQPo" "&J6*wr'u" "bcN{k4'7" "%%k.R;`V" "3Pf;hL[," } with-interface { df:fD:* 0A:4F:* } name equals { "6CRf.#D^" "4$;M@PtL" "zODT&~k@" "vP iDjHgdl%D" with-interface equals-ordered { 4d:*:* 14:fc:* } serial "u1@4;qy@" hash "C+?T.}L+" id all-of { A2ec:* } parent-hash "9wkrTo}/" allow via-port "jKG$9?]y" name "^#*REo%gV|*%7gd" ";==4qGOg" "$~vN-g&C" } with-interface c6:CF:* parent-hash equals { "LyAJ`.0R" "s^{1LRq~" ">EMk=l9^" "FP=|?&[d" "v.V[` T!" "JwL#x35f" } hash "@4?1nf8d" allow via-port "l,C[xF9q" with-interface { 9F:Dc:* c4:*:* a3:F8:EC cb:*:* 7C:b2:2D 76:6D:* } allow via-port " N'Drw /" name { "yM}En>b." "}&zN1e|6" } id all-of { 7cFb:* 4E08:AAda ccfC:9000 7DBA:838D 51eb:* 1AEb:* } hash "dk^GY`u?" with-interface none-of { c2:DB:* 17:f0:bF 4D:c2:* 2D:*:* } serial "q/[" } parent-hash equals { "h0n0UAV:" "=D]l*N}m" "fi4hn}of" "~kO9Jbv'" "UQu*t#C1" "B fA?>Oa" } if true allow via-port "pb5CfNij" id all-of { Caa3:DeC6 0B2B:* } parent-hash { "FoYn&pG%" "BlS1aCnl" } allow via-port "pqwFCcs&" allow via-port "=qD&%u6x" hash "Xt3Nj#0!" id 0Ffb:66af with-interface 72:*:* name { "HTaWQswf" "S&|otHSN" "uhi6etZ{" } parent-hash "Vt*!ktW-" allow via-port "[Qk2vU8k" with-interface C3:b1:B2 id equals { aFe4:* deBB:6f6D F439:E77e 1e2a:* C7B5:dEDf } allow via-port "rf+1o/d]" parent-hash { "eA*,txrY" } if random(0.4) allow via-port { "^rTs?/lg" "ZE2L?#?c" "n-k~&6c>" } parent-hash { "Oa[S*Ln/" "RsG#@J&W" "b[]4m7W<" "&rM`le#t" } with-interface db:58:* serial "WM}iEQT]" name one-of { "OK:rpzt$" "I2yzR0|@" "FL>tTY{K" "7[/K2Nvx" } if rule-applied allow via-port "tTNJq{Bb" allow via-port "-=UR']>v" if localtime(1:00) allow via-port { "VU[i`N0W" "fB<%eCU9" "@SQ&do ~" "Qe?0Wkgn" } hash all-of { "N?e5Ax8p" "{Sn|T?w'" "j'~s8Q{q" "oM?S6?r8" } parent-hash "$sS4Fl9o" with-interface none-of { 96:*:* E2:*:* Fa:2e:0c f4:*:* e3:12:* } allow via-port { "VX'5,yGt" } serial none-of { "YdyFnK4r" } if localtime(1:00) allow with-interface { 0C:08:97 Aa:e0:* } via-port { "MU;,4G[h" "]v$$XKFh" ";,MZT'Dh" "g00{lD%j" "wRUZ*``0" "8#!J{gQ@" "`Z?3p92&" } hash "KYHTnNgP" id one-of { C60C:* d2EE:aDe8 ead7:214B 75Bc:59a6 3129:* AE7E:d25d ee2e:* A21D:* } name "n0CKUNor" allow with-interface { 14:E1:ee a9:ef:1e } name "$T[3!PZT'" } name "5K;E#z &" via-port { "Td'H/ VL" ":JR8Pf-y" "bcPr&3-N" "m,mo$xhm" "z+y&F4DE" "2J*&~~Q5" "%:{xUtY*" } if !true allow with-interface 28:fC:* id { ea02:8AA5 a850:18D3 db89:7D4e A936:* f9Fa:4ac5 5459:A4Ff } hash none-of { "w$4hD/zo" ">_kkI0SC" } via-port { "K 2yQU+K" "fFeBLR]-" "$4nL V]/" "McY*:%l*" "XHw.PIY~" "2f^.Riim" "!g;w8d3f" } name { "a@'MGh%H" "^c ?*4m;" "8+zFVU$^" "Fd]OSOtL" "7[:I!zm/" "16ef=Dwr" "g'!iYZf#" "5E [lcvs" } serial { "Y&Dek#;E" "n,SM_P.`" "uam6mmBw" } if random allow with-interface { 3D:*:* dd:8f:* 52:*:* 1B:*:* dD:5f:* C0:60:* } hash "VO>%S5V7" allow with-interface { 43:b0:46 1d:*:* } if true allow with-interface { 4f:*:* 2E:F2:* df:*:* bD:ab:* } id all-of { 00F4:A611 14Ca:e9fD bbBc:* 6ac0:* 6bBb:* 2CbD:* A451:* } name all-of { "s8MybXM1" "%of*apu1" ";XgD.EWB" "$ry_*ET9" "dy3c34$q" "7B:IGp'W" } hash "8ubY&%6F" serial ":d.ZIO8O" parent-hash { "J'lqfII1" } via-port "IQ11oX7G" if random allow with-interface 67:*:* id { C2cE:* 443F:* a9Aa:* 55cE:* 7c56:CcC4 b3e3:5ED9 } serial { "6Tkd8" "Yc&T]av-" "/a'c2kC0" "_PsP6?rO" } parent-hash "noA73;e " hash { "xy:]/`lW" "R9EGbN1s" "D'2[:{`M" "c[R|zY.I" "S}S/Q6@8" ";n|+@}IC" } allow with-interface 70:8D:12 hash { "dOA|E$KY" } if false allow with-interface 7b:1D:* hash none-of { "+?E1L~L^" "=bx #1t$" "C99wrqMY" "ipuISR23" } via-port "xHe$bQv=" serial { "e5Z7M,dp" "Yn?y@k{>" "cs#_v=C}|T9" "c8N/kzhI" "'_10jW!s" "#[ijCZT?" } allow with-interface { 7B:FF:15 cE:8b:* 53:07:* 11:*:* 6b:ef:44 72:C5:E0 e5:4d:14 eA:a5:f7 } name equals-ordered { "#aJ3LxP:" "N-KYq1[!" } if random allow with-interface { 87:aA:Fd F0:eC:* 52:59:76 0a:5e:* 08:*:* cD:*:* Ad:Ac:* } id { 28EB:* B4aA:ea2d eb0E:* } serial one-of { "0'n*r_cs" "iw8WWWLl" "Lsg}?$:1" "|RHjrA_/" "vJEBSSwb" } via-port "plL|:RZH" parent-hash equals-ordered { "}14Ly8L." } name "'1&7cKcR" if false allow with-interface { 9E:50:ce 8E:*:* 00:*:* 72:*:* 95:58:* } allow with-interface a0:c0:* hash "7&;B'tjr" id 077c:* parent-hash one-of { "S09lIr][" "U=<4iNZO" "ZiC5C%zw" "S?{>D_v%" "-l--E/ 5" } via-port "t8[0kfcv" serial equals-ordered { "7&ui :_p" "xlXLn{[0" "[Eohy@T1" "/8z3ntu:" "Vlia.R}h" } allow with-interface { AB:E9:* c4:EE:a9 44:95:* Db:*:* FB:41:* a9:44:* e5:*:* fe:*:* } via-port all-of { "S[XnKOGQ" "no;OuBFCY7" ";9_u6Z`," "Ib-xY8QF" } hash "+NWLov?c" serial none-of { "2Gi$mO%3" } parent-hash "Cj>HG@S-" allow with-interface bA:24:aa hash "!e!GLMrL" serial "6zRoS=#<" if true allow with-interface c7:F7:1A via-port { "|G6xBNe}" "_Vq7=tvM" } allow with-interface d3:03:2D parent-hash "}c4h_7%u" serial { "fWj!mqv^" ":}u~?I-l" "+ur+ WP9" "WT*6Wh|d" "O{@J,-+V" ";6IV^ec9" "EFjCq35E" "@6XSX3Kg" } via-port { "=mNB3G6z" "cy~o3RC%" "tZNj_T~y" "LPmId,3{" "i$M=pT#2" } id 9Ce0:* name { "0SH8.KEt" "galw}Sp3" "q3BQaY4y" "mP'DrTlq" "frxCfAif" "dix=6YG_x" "LQy7f=" if false allow with-interface one-of { A1:*:* DF:3E:e9 AA:*:* D3:d0:B2 7D:*:* Af:*:* } serial one-of { "6n%M`N$E" "9/,dG;Ur" "bI-NjCOw" "7XxBE}pR" "s=x~XEj5" "i}0R#%;V" } parent-hash equals-ordered { ">QOe0;Y]" "o`=]c:|$" "MSMcbHJA" "^`.4!7w7" } id eEb2:* hash "5-0v1wDe" via-port "Pao*1:w/" allow with-interface one-of { Aa:A5:fF a2:b0:4c Bc:cD:Ab Ea:B2:B8 Bf:*:* d5:B8:dB } hash equals { "'=GN}0o=" "E]cGge^s" } name "!qCiGB,J" parent-hash "yneIkx'u" allow with-interface one-of { c3:5A:cD A8:af:* } id a1fe:* via-port "Qh5Fl.$9" parent-hash "GYqxZ?a[" block block hash "7k9=0w;>" via-port equals { "uAn$>}g'" " Idtdm=Z" "L5+~$p9G" ".<2^/*_#" } name all-of { "CH'-JLED" "A!a^flj}" "VZB4bM29" "zQibW[lk" "~.O];jOw" } id b96e:* with-interface none-of { b8:*:* 1a:fA:* 7e:B6:97 57:*:* 8D:d8:* } serial "&02OlmQ." parent-hash "Y{cAzv[U" block hash "8$^jgkWg" block hash "aeTX#Tfw" via-port "V!N3Ipm@" parent-hash { ";l}?;R.9" } id 0Cc2:* block hash all-of { "I8{]4TvS" ";>w8mQ3E" "iU_;>55>" "de.:[T/{" "8@Y~;~Ud" } id equals { 8B12:ABF2 dcEf:* ddfE:24A6 FEa2:a862 e0ac:61dF 2612:709b 3Ff0:* 90Be:* } block hash all-of { "wfr9j]&," "aM}B47'0" "u]Nso^u`" "Rs U3PGv" "Bd0PDz{&" " .T@Ue6:" "-Ca=Qf34" } parent-hash "?,dfADqq" with-interface one-of { 0d:*:* bE:7B:9a } if allowed-matches(name "E:!wSp0/") block hash { "CN/]>ajf" "z0K/.E/~" } id fa24:a8B3 name "Pkw.EF=y" block hash equals-ordered { "!,@nBB+`" "xH@nx/vL" "~@}AC*Ly" "0mH@|z$f" } with-interface equals { E7:3A:* Ea:*:* 15:3f:* BE:*:* de:Bd:a3 Df:bF:* a0:c2:* } parent-hash "zy5`RAoP" via-port "hF/%W||k" block hash equals { "S MTzat_" "}y?9*DWF" "'1CZDI`s" "-J/qh^QB" "&[*Wb_/7" "@e^dU:tQ" "+t5v%1$8" if random block hash { "F>ws8LBg" "4oHO_`ho" "p82KS+hW" "&$PM2XAg" "#r>H#ci*" ",S:LX&96" "%5f`N/uF" "^}v{9$U9" } parent-hash "%YGaV~vW" id { 96df:52c7 aDbD:fFb7 94Bc:* ccdD:c235 ebB9:48EA 9969:a8A9 } via-port "K|@HOjK9" serial none-of { "3-lGLJWE" } name { "?fYq.09H" } if !false block hash "KsHd#KO7" if !false block hash "LoI;c;|;" id { 3AE3:1AC7 ba1f:* f4cf:5ca4 33F3:EDDf C42C:* } block hash none-of { "vwFpit9'" "-JOnStM>" "G1N~ qo=" } id cD21:* serial none-of { "ymL7n{J#" "VFxa[d?`" } if !false block hash one-of { "^!H2I&&>" "zEe#+kmV" } serial "6qCWFY8N" id one-of { dFaC:3fE8 Bea9:b380 } parent-hash { "DwO;./Z~" "L[A%lFK@" "0=p;s|wy" "R#`w4kI<" "tsA0y" "tMDz<3%Q" "-+.e|mmH" } block hash "oumf218x" serial "~7ptfL|S" via-port equals-ordered { ".w.ANTfz" } parent-hash { "mZ]JlT9:" } block hash { ".P%.>a{w" "wC[{`i8^" "8W`:aPG." "{eB8'|J>" } block hash "Pl;NW^Kb" block hash { "$q4Dl?8>" "#b3;ft]c" "vH4O#2Vo" "@3-o4p>." "|r =Obpa" } name { "7|+eABNJ" } via-port "E!4R'w^F" if true block hash "&Qf696`H" serial "/yO&59%H" with-interface Fa:54:* name "E,=~G<.x" via-port all-of { "lDrl.tlM" ";n}9z?W+" "U6`<[?}|" "Be/u 'JI" } if !true block hash "QW`eGv7n" via-port "{c*W-Ba'" serial "2=Ii_1z3" name { "@qlK{p}X" } with-interface { 14:21:DB 1e:fF:* e2:*:* } id { 5A3e:* 2D3D:a95F Aaf9:* } if rule-applied block hash { "R2]4[$HM" "L?^FEDKK" "Y,A|pSj," "]l8AIp;x" "z]59obZ<" } serial "+|zv[%X" "'/`v17ou" } block hash "V_1:S1^|" "= ig5cd|" "B@Wc+90b" "hYoiJ8j8" } parent-hash "tc=!Fe@a" block hash "vu9;@,zf" name { "AI5GR%}}" "4*Y6#;A&" "w[7270C4" "8%x#+WSy" "fstZ6{MN" } via-port { "Vf4KG%]a" "56:/Yh`3" "6g12o*Y8" "e6]u7?C<" } id 45Bc:7eDD with-interface Ef:*:* block hash "XKY9u-i`" name { "Di^w/[6j" "qDuN82P<" "pSEsRC+m" "h6xx'H4n" "}kO%Yf.8" "Wjg T@g<" } parent-hash equals-ordered { "Z`iH X1@" "3f% -uN." "ab3&IXW}" "I&[ee27]" "1&}~P88|" "@u0rQJtY" "?[21I&C#" } id one-of { 04Ad:* f5EC:* 8b6D:* DaAD:* BAF2:5ADb 6cFF:0ffb } block hash { "Y@2^&:1J" } name { "z65Hr9[n" "OBR`.4Ac" "gp:rgD5-" } via-port { "aX$s/Is&" "M[_C.dXB" } id B06E:* parent-hash "4nG|WX{E" serial "Q5LK-k0m" if allowed-matches(name "TP5S>yMp") block hash { "yG<]?d;&" "1b|1g!1x" "iHmS?^ys" } serial { "Jx9eD!L," "/l t^MGd" ".QM[QCnd" "O956P'v;" } if random(0.4) block hash { "'yq[dzkm" } serial "I5OdR;B " with-interface AE:*:* parent-hash ";B>c2noM" name { "<05hjw]z" "d5{Z#Krs" "~aS{~?|m" "AY`XF-.&" "sm-FCmrr" "VE^8J,mG" "$yx&AkNS" "TBvj}%u%" } via-port ">'S`PR{^" id cd3f:c410 block hash "]Yq/zy7." block hash "^YTGF'cy" via-port " x*^{P23" name "Uy~j6mo%" id 167E:3E86 serial "pTI-k^x3" with-interface 30:*:* parent-hash "4KwDj+Mb" if localtime(1:00) block hash "z/,=KJA^" id { 5A34:* DA7d:* } parent-hash "#7Vbsiwb" with-interface { F3:Ab:ab } name "!Wk!y48D" block hash { "zkz'l%|e" "mn:-" "Tnf;c[,9" } block id 1d94:* via-port ";6m3hr,#" name equals { "u5BL~+Iw" "8V>4|N,g" "GG-SP%F " } parent-hash "D~yq2!`U" with-interface { d8:0A:* 9e:*:* f0:bE:* } hash "+9,I5<'U" if none-of { true false !true false } block id { 2B53:ebe5 a450:263f 8CD6:65Bb F938:* } parent-hash equals-ordered { "1bXFHB=V" } name "$Ta3nV?n" via-port equals { "e4{l-'.{" "HPbds!s-" ",p~tl}H;" "Q$pM:Dyx" } hash "9V:G&u0R" with-interface { 7e:*:* 01:80:* 10:*:* DA:ad:* 72:*:* aF:F3:5d } block id { 3BCb:E9Ac } with-interface equals { 5E:27:* d0:*:* b4:*:* } name equals { "K1?S?{QO" "Go|IG[D=" ",QhlJ/K=" "2XPr{.Qm" "LHBidWpJ" "e`N}8U.." "e%]y`i@w" } parent-hash equals { "Zs. GigL" "dM+n,UiW" "UjjY}+9?" "@Y nskCK" } via-port { "XL^>,O.4" "q&rZ'1q{" "sy#%6k4q" } if random(0.4) block id 44b4:5df8 serial { "uMRoMBw+" } name { "xb0$* rD" "*8;NyRL0" ">SHv+p#d" ",UAi0[Z," "- SrX62C" ";}XcO;?y" "{.27Uh<*" "@:DqXN8q" } parent-hash "h[n+P@kT" hash one-of { "/^sy_5=n" "bf^`gu?m" "~eW<.0OA" "xB$~&z&*" "O.JtGL63" "j^xE=&X[" } if random(0.4) block id 4AAd:4b12 serial { "Mn01^T*6" "U<-b4YcS" "&KXb>a9~" ".HGwBgPs" } via-port one-of { "'1SpdnS3" "95O/~:Kf" "7LOYj*uP" "8dgeM}6T" "K_v&tJli" } with-interface CF:EA:fe hash "ajwu53_r" block id { 582F:dF7C 3cFB:* 9FdF:* } parent-hash ".f,8PG5;" via-port none-of { "-wmvAWJ6" "U{_*+s9K" "36#:;hDp" "ayEl.@J." ".Wg;O[x1" "M7H?n[|," "!n5'neLK" "UR/;l*id" } name { "U@9@6_wp" "r#=+WCY>" "4Q!%>u> " "rUPDX=N!" "a>{3OEH1" "<095NUYL" } hash "PsffPxFy" with-interface 13:*:* serial "KlA{huO%" if false block id 58F7:Eb14 via-port ">s_V[KA~" serial { ">L^$v|u+" "%e PCE+u" ">#[0jB4P" } parent-hash "^9AeMvRH" name "SDw{l&Ao" hash "cI8_@gq8" with-interface { 97:*:* dc:E5:* ce:57:64 5B:6B:* e5:*:* BF:cf:b7 c2:e9:9c } block id { 95d1:8F77 0eCa:* ea6e:Ed87 2c38:* } hash "6k9t'FmU" name "i`Wc6n^m" serial { "X7HHs[t." "'O5_vE1X" "lxf3v&z2" ".z:: yj," } with-interface 8C:*:* serial "m!s3.;fB" block id { ac1D:17F3 1E69:3C4c 96C8:* f5cE:* 79f6:* 1C3E:CA80 4F62:fE6F 5cAB:* } parent-hash "t?_DE75_" hash "QC7cocdT" if localtime(1:00) block id { B5A7:* 32A7:* 68d1:84F3 509a:* } via-port "w%RRQZ-`" parent-hash "pq_r!4}*" with-interface one-of { c5:e9:* fd:D4:D1 B0:04:15 } serial "<}~5zxX" "*$V+ vU{" "M4Tm+T[," "]_j^xQ;:" "l'Ek6f1'" } if all-of { true false !true false } block id Bb10:* block id { bCdc:fbd7 FaF3:* 3fCe:* f48a:* 3eD3:24Da 65E3:06EB BeFd:2b29 0fDD:* } name "lg;`0??e" parent-hash "FL;%ohya" block id bEf8:DFc1 serial { "=$*M5&,]" "> G6>u A" "gXpU|UjS" } via-port equals-ordered { "X SfAtNy" "g-0Pxz'a" "|&kP#Zo0" "s_4qo@2U" "a={k/y%]" "$J|5$HpJ" "MWpbA_v~" "vf&+vM0S" } block id C349:* with-interface { 4e:*:* } hash { "iz6%]gx&" "'8saqxFU" "q_oUgsnH" "EmP}l^HZ" "LCLZElyo" " ;aRXKVu" } parent-hash "pf4^r3O@" via-port { "Wo*4CG-|" "XIfhL!E<" "1R1x-T$j" } hash "'_G ygl;" with-interface 1d:ed:5B serial none-of { "CcRRT|4A" "$esS|nRf];G>" } via-port "UPbzX}8w" parent-hash "TS.u5Zkn" block id { C9dC:* c7ff:F1aa bB5e:* D1A1:* befC:* 4Cf9:8DcF e804:EaFf D181:EfdA } with-interface { B0:*:* 15:*:* 9A:*:* F2:c7:A2 } block id { cA9C:a91A eF08:* 1e19:c9dF E02A:* D0Ca:6717 fAf9:d9cf cfaD:* } parent-hash "^%vz#? ]" hash equals-ordered { "f$wv-oK[" "C[YfK4Rp" "rA,Y/YrS" "syCs^^q+" "ept^7P,B" "!G56=1[o" "P@=RPXR4" } with-interface all-of { De:*:* 72:2E:71 } via-port { " jJ-Tk#6" "Du6- &-_" "b0BOwEx1" "Gf3bpJ86" } name { "*6,0XVx#" "SoXPDrC4" "*[-wmbki" "6^DHj4of" "I]HM*47l" } if !false block id { CDDb:* F2Fb:* 3B71:* } with-interface none-of { E3:Cb:* 8E:*:* 56:9b:* Ab:Ef:* } parent-hash equals { "!+}7|z[&" "7SoEJ,ha" "Yt}z85lb" "dzNn.mPQ" } via-port { "iMJ30j_v" "oI|W5':r" "bRk&$*%9" "arT]]~T~" } serial all-of { "Fji<[ku+" ":=5MTQt0" "UDBA8cc2" "4IuitCCq" } if !true block id { d669:* 25F2:32fc c5Cb:cED7 f9dC:9AaA 43A3:* b3A0:BaF7 } serial { "cwXg3|J8" "bMi&3 mt" "7=Vz,po?" "jNEk=Yns" "?Nx}#XZ+" "Y+eP8V{g" "t8H{kV}@" } via-port { "`d&dZ<1p" } name { "o-d/}:O1" } with-interface none-of { 3f:*:* 70:*:* A2:*:* 81:*:* c0:10:37 1F:91:7C C4:*:* Ee:91:5F } hash "+Fmdx!Nq" if localtime(1:00) block id deEf:* hash "Cb'`nt" "|M%.S;+," "wYa[{$c>" } with-interface D6:Ac:d1 name "|~dFo*-9" via-port "[h[a?X" block id equals-ordered { A5FF:* d9C4:* d93e:262D 017d:* Fa3D:* C245:F2D6 7c22:c885 } with-interface { E4:*:* eC:90:9a 79:57:Cf Ad:*:* fE:2e:3A } if !localtime(2:00) block id FC2A:fc1a name "t7;XHw+[" serial { ":yZ_=iA`" "G&t]D*Qj" "A[pb4&v|" "=*tl2#]6" "E[qo89KQ" "}J]_EsQk" } parent-hash "$oIha'+}" via-port { "[E3-p,Iz" "y%jM!IaQ" "5/4." "*j$OZyJo" } with-interface none-of { 4f:a1:7d de:*:* 2a:50:7A 06:BF:* D6:*:* 76:CB:e3 bB:*:* } hash { "Z*q4it!8" "8ZLct+~*" "P[^>T8V?" "xv`h?|{w" "%p=7/].P" "mDqnI1-k" "sRtPt:b" "}!s7ukY0" "q7yW-mP;" "yy_q6f>$" "W=Yu]8O7" } hash equals { "hi|{6=1'" "dLQ;-r=o" } parent-hash { "6hEH/~k3" "8A*CMnow" "9AMY,0BW" "Nmh-r #R" "Hr3 7-%X" "Xg-br3sO" "`pg@plOh" "1g2`GP*Q" } via-port "Si'[X:80" if false block name { "6irqmUO|" "wc2zD9zE" "YA6e,TvV" "P#GyJ{z;" "vEWJpA4D" "EPR[XX&w" } block name { "6N@c|yfs" "85;l0EN'" "zf2a6D4D" } id F666:7BB3 with-interface equals { 8e:*:* 42:*:* } parent-hash "la5Y~kCa" via-port equals { "ZYUd[o&<" "4mxQB ~q" } hash all-of { "`aTH'6,U" ".zi!rs@4" "+W+'pp+%" } block name "8sP5!q'n" id { c146:8950 88E7:* ac5f:* } hash equals-ordered { "fKjG%nI7" "R;h_K_JO" "_pTjwmyU" "Z]'z}q&v" "g6KP4I./" } block name "99" id { f7ad:* fDaF:* a5ae:b0EC af7A:d1F7 } if equals { true false !true false } block name "CpAt5Ay2" serial equals-ordered { "F`9{B=;p" } block name equals-ordered { "J~eG={i=" "bj/6G~S6" "+]3qNl&G" "A*]:O|Qx" ">pKayUO," "/[e*uMsP" "IsdXZR_i" "c.*~mB%s" } if random(0.4) block name equals-ordered { "N+#*FMv>" "XM@jR13G" "Q2gggu4D" "73[,G4pr" "htmp0n;y" } block name equals-ordered { ":rW~XH,e" "?qD M^By" "VV0JtdV4" "6n4Mu][+" "02%d8|]}" "/*sEX2g+" ".z1Eq'g6" } serial one-of { "^q~TNw9g" "viT|A&+:" "#_FK,oD}" "&~q?kBJe" } with-interface { db:3B:40 6F:2a:7a Cf:cD:bb 0B:9e:2a 98:Aa:* fB:*:* 1A:*:* f8:B9:* } via-port "5R;@ZFk#" hash "n75?R^Pj" if random(0.4) block name equals { "_qV8 T/;" "I{3^%: t" "!hmlB?~R" "M'JZ1/5w" "!'LF[=;7" } serial "3SF!lO:$" parent-hash "l#d+Rh-i" id 85cC:* block name "FVDdAU{7" with-interface 33:7a:* hash { "yLj2N2|!" "Pp/ [&j?" "O[@}^Gd" with-interface AE:c1:* if true block name "Mg=WgqmF" id { 9FED:* 3383:* 5bFc:* 83b3:79a7 45Cd:* } hash { "-*~qnBh<" "9k:>Jrv7" "@sLqxO6`" "vzL?1t|p" "M|n1{Jna" } via-port "bcd08y#^" with-interface 02:*:* block name none-of { ">M?`+X$C" ">i^b,U~%" "sY>xvTT0" "H^TOz]W;" "&>$YbViY" "gkK1S5rp" } id 22da:* parent-hash equals-ordered { "C|@zP8Z_" "#z]cv4xk" "%n|W`J?]" } with-interface 5B:Bd:* serial "C+`?Fz]k" via-port { "/fS9*4_j" "ev%;X+2B" "9GUN~7'<" "qsS+/q0J" "K/_>vPoF" } block name none-of { "NU{W;w`u" "$b[r3m8~" "f5t@ms#h" "/>AA~2=V" } if random(0.4) block name one-of { "AA-/&9$~" "bOp/li_$" "CfW:vfv4" "yS9:!IMO" "7IxD/:vz" } id { eb7B:* 3dd6:* A5E5:* Aacf:2d28 7d6A:c6a3 } hash { "C/inU2S}" "p^u6Z@P3" "f!G9*IfP" "zR|'8`;w" "+PAxJimJ" "5{XNx2oA" "xGCt;e5h" "=@LgMsm#" } parent-hash all-of { "fwFQ1DT5" "L%;jVz:{" } block name one-of { "^u[!p>QI" } parent-hash "f9b;ZhA9" if !localtime(2:00) block name { "/oP`X?*z" "_!X,AqnB" "T=16?BEd" } id none-of { 1dbd:* 1eCE:* fF9b:* 4C95:* faEE:Ddf2 b0dC:* e6Ec:E1c4 } via-port equals { " py~xw9g" "[j34#b.r" } parent-hash none-of { "H2SgFn F" "[%%nLycE" "#?1C[?Xs" "Veft}bxH" "!P<@,#pK" "|fa1}4#t" "N |^5wbY" "kM@>]21B" } with-interface C1:Ae:* hash "Q3^HT${I" block name "QAqob,a!" serial "rEw%U^w/" parent-hash "bDPkocYi" id equals-ordered { 0AD0:* 4C9A:* FafC:* } via-port { "q[B88NOc" "T=xNUK=g" "_o|al.T2" "l&_4,aPi" "Kw]7Qb.x" } if !false block name "r,,u!0{i" if true block name { "%:.rVab}" "]xBCyk}D" } with-interface 66:94:* hash all-of { "^$Bf&qU7" "o7Y^3$/R" "l`>[Pj3i" "ynJ9FJY&" "$d6G|Q'D" "@p%N " "TOMlmlNI" "Fb8m6I+Q" "H~:QL.UD" "Dpf#Pu!G" "/Lwj=Z#N" } id 4E5D:* with-interface 3A:C8:0f serial "FN*fZ;-#" via-port { "E,87V'+I" "sUy~uY:1" "]UlXaH7*" "t.HDA6Jf3X" } serial "VyFloU7r" id equals { b3b5:BcE6 15dC:600b B472:* b6Bc:* 2590:e9b6 9DEa:* } with-interface one-of { 7A:7F:3f a1:Ce:7b 36:99:fE fd:*:* 09:AB:* 34:35:14 0E:d9:8D E7:8d:* } block parent-hash all-of { "2^b>tMZ9" } hash { "B?hC,{Bj" "<.-E8DU-Y" "awZ`Ef}r" "J4Mu$G:s" "]O4a_6J>" } if rule-applied block parent-hash all-of { "b,3j{ppL" " A8Uwj$ZJYqNB" "|mc #!Y'" "pMoA'8Rl" "KCl=_M99" "w|5xT9it" } id { 7f3C:* fdcF:67FC f9D8:* } block parent-hash all-of { "J]:[6Jqx" } serial { "2|2<4JP5" "rLIqprTN" "-2q*d-j&" "E=^sZK:v" "Z%PAsTS/>Rb" ",m|Ey].r" "m>3^d|4%J" "YPS=~{vK" } id 6FFc:b1aE hash equals { "wi}|9GhL" "B{zbT|B}" "?>]]H6ap" " N:v*10/" } block parent-hash equals { "uJ^#2y6i" "Ff!laFJ0" "}f}h.g4X" "1MbV8da0" "C+8%?Q6U" "s1[lmY%#" } block parent-hash equals { "V vAP>Nk" } block parent-hash "ezm[2y!>" if !localtime(2:00) block parent-hash "fX@NNuz<" if random block parent-hash "hFVb=a]v" via-port "_>yes/3e" name "Fs:h_Dgi" if rule-evaluated block parent-hash "H/jAM?aA" id 2E41:7bb8 serial "@kx!V/0=" if all-of { true false !true false } block parent-hash "kA_-2C{P" id none-of { 7ed2:* D0a6:* 1CE2:6A3C } with-interface fc:9c:* block parent-hash "KB`ggh%$" name one-of { "0VHg Mj7" "CXJpN}&_" "78ZY[J,9" "S/fMOsBS" "i" "@~#eew$W" "9{I{]&AL" } via-port ">kGIuTly" with-interface none-of { fa:Ca:fb 5D:71:* cc:4F:* 9f:D3:* 0e:*:* 97:02:* F5:*:* d4:eD:6c } if !false block parent-hash "nNNAz.^`" block parent-hash none-of { "=p2'G%/R" "`rSM/{V41V" "'e=o-JZ6" "1N+cIu57" } via-port "SvFZ[vIF" id EAbA:b670 if localtime(1:00) block parent-hash none-of { "RjZ?hi>z" } block parent-hash none-of { "zYLz C[<" "F'#=,hSP" "I~m]3CL&" "{VYPWoaV" "0h7pXVvW" } hash all-of { "U>oPSzpi" ">Bw-q,r." " ~N4-u]'" "6f}{r9ac" "#>`{ou?2" "NmUv" "G[?4[80D" } if rule-evaluated block parent-hash one-of { "T}_IDn.B" "]u^-]`@2" ":VdFg}@k" "chNfa#4y" } via-port "f[e5Tgy " block parent-hash "?`^OyjQz" name none-of { "Grq=9g?N" "?`{W;u$1" "!:qHkOnE" "PoS;!L%4" "uknBuD.c" "$q,O|>nb" "7JiWxXz2" } via-port { "_:>SwR9G" "+4*n?JQu" } id b01c:* if allowed-matches(name "+c?MisE]") block parent-hash "|#q$o`;;" block parent-hash ";q#>P&gx" serial "PxV.Uk`&" hash "/hm>#_di" if !true block parent-hash "qV9zTUu'" via-port "#X1xQi w" id { CCE0:* bD2f:1c3C 5171:* 8c7f:FdC1 a6eB:* Ee29:* } serial "vP{R-v8n" with-interface equals { 9d:40:fc Fc:*:* cc:*:* BF:EC:1e a1:8E:* } block parent-hash "t5i40Mi5" via-port "v.|gmD$u" with-interface { A9:A9:F1 dd:*:* 71:6a:* } hash one-of { ",.`s6&B3" "g|1._Ad~" "r~&lp@I|" "czL_mWbB" "3m5HC^6F" "?{+PsB8#" "" " _?Fi$MY" "J5JaU|&" id EcEd:525f with-interface 3b:53:a6 block parent-hash "*[+*v?Qa" if rule-evaluated block parent-hash "XBI[m=}6" id A6Ce:Bb2C block parent-hash "@yxQxKg+" serial "0ArW{g%m" id EccD:* name none-of { ">H7VTb~G" "a^j3,$g9" } via-port ".74DS:u>" hash "{Y`7LS@F" block parent-hash "'>&Z7>LM" via-port "]=B#ZaTF" name equals-ordered { "M[~MU2xp" "~!F5:^my" "hAM!{1m4" } if rule-applied block serial "5k!NtdOw" parent-hash { "knBr`sDw" "M#p@X{n7" "-1!FSbvy" } with-interface F5:A7:81 hash none-of { "WgXXjR%0" ":yp4~W1i" "IN|/{}iZ" "@LF'@,f}" "|%fU_L:[" } block serial "7:cGHL-q" hash "36H6N7qN" via-port equals { "w|6+~n$~" "4HBa~Jc^" "3J#4Hr{A" "4uV?>m'R" "-vhhXm_4" "OF=srz=k" "t@Glk!9]" } id a3a8:61Cc if !localtime(2:00) block serial { "[A[%d}}I" "AsEQI#|A" "sO ,kKyx" ",pgym~+]" "c7~YSz8@" "w@%`=__`" "H`94zga~" } parent-hash { "}XqLyP56" "D;n@Ck5y" " fiyNEYZ" ",2E>IUxz" "wqK.BwsP" ">DX=NBX2" "+-Rl'G8u" "i2h&iQTC" } block serial all-of { "#c8.X:-Y" } id { 41Ed:d98B bdEc:3816 a310:* } if false block serial all-of { "!r]r9n%j" " q_j`lom" "0SWfwBi^" } with-interface { 0c:9d:d2 c4:8f:38 } block serial { " AU~L GJ" "w'HG$9lw" "!<@~jUnM" "e8{o-Gx5" "ZoCZc,*-" "_uk>L?J7" "xZS:xwZ_" } id 35aE:* via-port "HBAs5HUE" if equals-ordered { true false !true false } block serial { "BifnQB;f" "1EzqbCm-" "sr%T8ku1" "M1I{Kbbi" "`=vu' ]" } hash { "~ipRFqXt" "a7koW-?I" "bnc=Hq>[" "7hry-AQw" "Ja=L,,vN" } if !false block serial "Cpbo$~Wm" name none-of { "KY`5FjbW" } parent-hash "+#pSB|sv" if rule-applied block serial { "Dkms" "Ui'U-%F@" "2n$q;q$N" "g^:_0JFU" "{@$|DC:{" } block serial "`;!;DLHl" with-interface equals { D6:*:* 42:bD:* F3:Cf:0a DF:c1:9D e3:86:* 2E:CD:EC 9B:65:1c } hash { "_Hbk{9Gr" "cW;&v2*1" } id 347c:* name "uLRP|dS{" via-port "Md}pzTT?" parent-hash all-of { "Ckp2HGG^" "<1dTG{R4" "L+JGxo#g" "'GZ5;72<'" "SZ'9L|0+" "nb4f8RQz" "%+nj5uJs" "lH7mX[{B" } parent-hash none-of { "VR.!VZX:" "&7Tajs#j" } via-port "4+Ob__&2" hash equals-ordered { "f;W/ v{Q" "F>Q:t#.2" ",@%aQY_E" } id 8dfb:* block serial equals { "xWWz!iq-" } parent-hash { "Ub$=]95S" "mt&G6+Eu" } if true block serial { "EtM=.0H=" "7wvO_c>h" "RqHmhcsb" "" "MOp%AD]8" "y~*@-5&@" "j>?8YCa4" "[-X'%8?^" } id 8eBd:* with-interface F1:5c:* if true block serial "G7Hl0@@U" with-interface none-of { 3b:f5:* b7:*:* } hash "Vc0:K}4s" via-port equals-ordered { "5hp=l9_8" "% QvSSSf" ":,B~_>W/" "1n3XbOh3" "~Y'.ex'N" "vMR$&2!X" "DcB*rc}!" } id { 1f2A:* 00B2:* e0a5:4bF2 } name { "Oe8#Cxz[" "K^v%Z H%" "n;%%>%;5" "k>2buv{d_8S" "|DA`7z,{" "Q0m}qYqH" } block serial "KnLBtuVQ" hash "FiI:Bz}W" via-port one-of { "%S-b%9+;" "Dpg0#>Sa" "E$K*v%+E" "IJpS]k6q" } id all-of { aACF:* 90C5:* A7A8:ccC7 } name { "d!7:npy2" } with-interface { Dc:2C:8e 63:eE:* 9D:*:* 24:*:* } parent-hash "wW^-A|#2" if !localtime(2:00) block serial "l>00&hpe" name { "_XnAr}w=" " g!AX5y~" "4Z>eHm;^" } if false block serial "@mG|`A=;" with-interface { D6:*:* cA:BF:41 } hash equals { "Li_axYd9" } parent-hash "n4Sh7/rB" via-port "_TF++qc5" block serial "NM`pS}J," via-port "axRr3:6 " id eBC5:* with-interface { 8A:D9:ed D6:d1:58 } if false block serial none-of { "h-Dd;##S" "QCrcpQjW" "$?+ue*4n" "'cL*DpQ-" ">=|fzWe/" } with-interface 45:a4:* id equals-ordered { b4Fd:BE2f bADF:* dfB1:5Ca9 } if !false block serial none-of { "ss*lxBk8" "=!c'A[A " "' IYFYQ?" "`u+X*Qlq" "bf7iVpu]" "#}$%!hJM" "[OCDq**f" "[zrj/>9+" } parent-hash "e Dv9jX9" name { "#`^4g4K_" "0{15Sc;7" "7=w?`OZg" "k{pxJQE|" } id 1CA3:* via-port "@?r/_-H7" block serial { "nTNZzl6n" "71B>?fM-" } parent-hash "8*9yJk{3" via-port "c0tbr0|&" block serial "$-=Nza+3" name none-of { "30d9s1Dg" "N':gAJOd" "pf&ZKJ$a" } with-interface 8E:*:* hash { "Kjx&s,h4" "-pwN/r``" } via-port equals { "P>weG^H`" " J/$!?|2" "kBpu;493" "I:`pMk%x" "x+:H5M^m" "8k}A9.s." "L:[C$cTH" "Ss|=h1gp" } block serial { "O2J*vt@U" "Xxg6?Ht'" "<^JN5g?m" "KPb}83d>" "9Yzu^@QF" "QPFRo/e0" } parent-hash all-of { "2u!WdQ9d" "av2]',Yy" "*N;8S!f_" "N9yO&7F_" } if rule-applied block serial { "`q!QOU<," "T= L1xgN" } hash "QV4Uuq'L" name "BtA,$^P_" parent-hash { "%t{F, !g" "TZ!a&sG-" "~UfoGl#r" "Vr8/2" "c;bGTwYg" } block serial "s2Z~_#iZ" hash "3Bedsrzv" if false block serial "snK~dU2{" id { 0f5e:Eca7 90cF:* aAff:cDEb 1BEA:* 34ab:3BA2 e4C5:bF82 8B55:* E1Ea:2B40 } parent-hash "://Xl0 F" via-port "k%*vc#+d" hash none-of { "Nf3@+-.B" } name all-of { "vi3?1<5C" "[Zs%3'{l" "kRsA^@e$" "jreX %09" } with-interface E3:*:* block serial "s`Q4u%&?" if rule-applied block serial "SY}dZ1}R" block serial "u_&3&b2:" name equals { "/o5R>cVR" "cvf@{5=_" "FRz{FM2m" "oD<[]IWK" "BLPBm$KH" "wH##;BPs" "`np5?fe " "$Wgsg7m." } hash { "B~ib$R#P" "Q:PuxpS " "bmD{ Bnc" "%0PiV/~n" "8#%37{5Y" "K${[-h}Q" } parent-hash "2Oi{W{D+" id one-of { ce4E:* D90e:* cb7A:* D304:* DBc0:E21C 5635:dD4A } if rule-evaluated block serial "u%:ve#!R" name { "UkA,q gP" "@0OnrN3c" "X&p;CS|y" "~,giQ?QB" "~`BVQ^O$" } hash equals { "D?;Tl]_J" "/Jl,y@G " "s,}Y__1Y" "!FlBcp{i" "@4f;T#a'" } parent-hash "wT-L-=NE" block serial { "wc_5YL@~" } name equals { "WCpMtmIV" "|sS}Qkxw" } block serial ",@WJ;`;Q" with-interface equals { 5f:FC:* B9:aF:* 14:d5:* } block serial "z]2+_&LL" block via-port { "5 !K1-==" "*jn`b+LB" "$`Ues@P*" } hash { "T4/UgQMZ" "iW05a@lm" "6&|@Fm1E" "TkS~;Pg[" "!:5dX-Pm" "^CzASK^o" "%z`4" "lU?A9f<}" "1J`|uGKU" "KH3*zjhu" "eV@ 2K*k" "HOXUA%6<" } block via-port "78fe][qA" hash "e{A-Z^T|" name { "?2czF>QW" ",.4Bfl*m" "$tdEa~ev" } serial "?D51Ae'@" id fCdF:* parent-hash "$LD+}w`l" if !false block via-port { "7' ._x2S" "-s+cEk?X" "u_nn 7Qn" } with-interface { 2f:71:Aa 7a:eB:* 52:1d:* 1d:AB:* 1F:*:* 16:5C:48 } name "4}TCw0:^" if !true block via-port all-of { "IIJ_W:%" "^cw<3`ov" "xlBNXbrF" } parent-hash { "2Y3Ym>|I" ";L$-&U3^" } block via-port all-of { "YlI:D}r6" "qlv,DT?^" "aUt'`4oo" "I-Z{F%y/" } parent-hash equals-ordered { "*tmW,F=," "SIf]?V5k" "[@dCg f&" "'{'74Xd<" "p/VxfJ>j" "uiSH@o3^" "NORxWxcC" "T/z0rpS`" } with-interface Cf:7a:* block via-port "BE?i[yLS" block via-port { "!BWzM} Z" "$Rqc0on/" "ax%P!bsy" } parent-hash "l~%9d6~=" id equals { Ec8c:* E8B1:4F11 cEdE:* eD6D:* Bbb1:* } block via-port { "c%v x{w2" "I]Bqt^Qp" "c$y F_:R" "A4" "cXjmDFId" "0$<9Q3;!" "huaXz&Rj" } id all-of { 0CCa:25d2 c6E2:5B9c 699B:* ABC7:* } hash none-of { "qCDG|.!c" "*F/='Y}7" "[u1=P9iY" "KHg&fL'n" "RyOZxhti" "e0R V/c'" ">O 8+O*M" } block via-port "cX`c|1-J" name "{`8.Jg=y" if true block via-port "DLIukMxR" parent-hash equals { ":a+CUZHG" ",eGZK{5s" "f`>?TzN," "$GqQ6t{}" "]I_dTJ/o" "G8Z'}@=X" } name { ";i5hOE14" "7OX#}Ewl" "a$~BJ@GO" "A9ZZ=&=p" "Z'F0JZg/" "~nc>Y5[ " } serial "'$TaI/F " block via-port "-D^Y&axw" hash { "!-0_ZcyV" "xDdWv6Yk" "[*vXaN7*" "b:j[[`c1" "njTVUT&{" "_1OX ; U" } serial all-of { "G`}$C'6V" ".bl,>ZI*" "!+:xPC=P" "]v}j>KxA" "/wKPw?u}" "jV?yr0q!" "nNxp#Z,~" } id one-of { 2212:* BF1d:* cfC5:E9Ba FBCc:* b964:* 1B1b:ffCA } with-interface BE:7E:* if equals-ordered { true false !true false } block via-port { "!:,DZGae" "B=PI9ou;" "B_GCHKA@" "v_gKi+1>" "/-;54U:B" "+D_rvG>2" } id aa2c:955e name none-of { "0N@FwwnE" "u1g$Nwsi" "4@=@Ucbm" } block via-port "E8.Tq;%<" id { CDfD:ad9d B3a8:* 5E9b:A7e7 1cCb:* } hash "GKzYp{e{" parent-hash equals { "la8'so#b" } serial "w4[W|3q=" with-interface { 7B:*:* BD:*:* EF:*:* 62:*:* 75:B8:3B } name { "K$$r10V." "lEf^6<0N" "S]W-m-Ef" "O#E?L*.O" "D8!qvAY3" } if false block via-port { "eFNbse*f" ";YM:OHPa" } id 4ab6:* block via-port "g_54F !j" parent-hash "l H.2?NR" block via-port "h']48,_c" with-interface Db:*:* name "}`[=L6/Z" block via-port "KbX_Hib3" if true block via-port ">KeBB?~9" block via-port { "@$l~5]&i" "okMY~gz|" "uJ=:`4#/" "Tbd4tk@*" "a%BaM?#[" "Q3'=tU{F" } block via-port "lYgo0V-i" with-interface a4:6C:f0 serial "j,Go$M}X" parent-hash "_5*11g7g" id 01D1:* block via-port { "m`[7N-`>" "bWvd#kCF" "xLp qu&w" "Q_Cf4+MD" "n9X3dQxN" "=9NjE2nJ" "7mFzm6n_" "nD[fq@kZ" } name { "r5/FW`Bf" ".?l:5#s%" } serial "8u!SAX#[" parent-hash { "Ff%e^mN%" "gE'fl:,|" "IF%9Tb9O" ";m VCHt" " TuirsMZ" "g~?tLWKZ" } with-interface a3:8d:* id 2AA9:f295 block via-port "NGSav7D0" id cB95:99Ce if !true block via-port none-of { "o!Xn/sA?" "U^}l_$`?" } parent-hash "zrKp|0?V" serial { "|[[:VRFb" "#IA=Myg&" "ha9FbW&?" "SeB3CYXm" } with-interface { 07:*:* 83:e1:BC dA:*:* } block via-port none-of { "pgDBVQrE" "Jmbl_]" } parent-hash equals-ordered { "q_Whut;E" "f`M',oua" "qKo],I6Y" "fU!F'9u>" "{5 x]LDt" "{`;uC4~[" ",~zk|#zl" } serial "{]}WymuR" block via-port one-of { "*FWFX{J0" "Y>Ll09>Y" "9hnX8@6k" "yshm'r~N" } hash "#gYL&?I[" name one-of { "-i|.z`T" ",8W}YNwd" } with-interface FC:D0:0c parent-hash "W+{ef2tz" id { EdC9:* BB37:5D3e Ed2d:B077 9631:* EA0C:c146 e0b4:73E5 B22f:Efd9 77Ae:* } serial equals { "ZK@9x6N<" "}7ZbM!E#" "A,O.3%Gn" "%0Ti{l0L" ",T-AO?_?" } block via-port one-of { "Sc,B.qfh" "%L R~8N6" "r$-rC;~v" "yp[U~ /Y" ", ERO/cJ" "pN{Se]+6" } id 1739:* name "~5B}c8EA" with-interface 1B:0d:F7 serial "KX.te?$/" if rule-applied block via-port { ".^P:/EpE" "o;[LbPKD" "7H^Tn%84" "Zs VtIbi" "D6T%w}Q " "&g'L`Dpj" "ni}XBvS<" } parent-hash "o'>CI~Oa" serial "eqrAJ+E+" name one-of { "`zX02f&e" ">7^rmj:h" "LN+GDy>H" "2e74XFrX" ":jT3|Ni." "8T1y.V#a" "O&IUV,o:" "AaiziRVW" } block via-port { "rpT[fRm<" "o8Five`v" } hash all-of { "<$t25oR|" "/+ >vwv=" } parent-hash ":ORfv_2J" id one-of { 0a72:2cCE bfE4:* eB54:37A8 } with-interface Ca:78:* serial "l sRp5*m" name "c!*vZnWr" block via-port "R`Z`gX6i" parent-hash "= @pD7g*" with-interface 8c:80:52 id Bdd6:Ade3 block via-port "U>=| @=6" serial { "C;szU@6P" "NA,32MR:" "8m5}c:~p" ".UgZK{^3" "?3*t!j[1" "EgY]OrbQ" "hKd70&?u" } block via-port "UAH43man" parent-hash all-of { "A+VqoH" ":m'ymU[f" } with-interface equals-ordered { e3:4b:* ce:Cf:* 4D:*:* } name "CBsuMcGQ" hash equals-ordered { "gtlY7]U:" "x}u 7*[>" "IpTb9YWc" } block via-port { "vVuXkgvY" } hash equals { "+Xg7|nS?" "LBAh7[&Z" "0jBo=3Lf" "d,XM@ruj" } parent-hash none-of { "L;,RTXMG" "T%'R=E>V" } block via-port "w6a`xG_@" hash equals-ordered { "n*/}JO_W" "8Y2WK`kD" "?wpZ [mV" "y4:!MWqM" "ANbq$6v-" "LmXDIGJ9" "2mPA2Z|l" "6!M:LDz*" "hDM&i_h^" "LwU[z:Ol" } id { 0Ef7:* aFB2:* aaf5:aFd3 cE48:* 4419:CBce 92Ad:ec12 } hash one-of { "-A&SRAU " "p}Lv6~7!" "qE@ p7a$" } if !false block via-port { "ZB/]rEkt" "x-!F0S_$" } name "h4Ea!k`L" id { 00E5:* d33B:e9f7 568F:* } with-interface 6E:*:* parent-hash { "Rn.49Ml/" ".hM?Kl0!" ";>DagLEX" "qNireG/M" "wq']dhK9" "59QKT?8w" "^a}~Y~^e" } block via-port "ZqDuUpoG" serial "&D==,?!e" hash all-of { "TN5aEI7[" "SF5&ERkU" } with-interface 5e:*:* id all-of { dCe7:* 78Eb:D3D1 bbad:4B57 BD4b:8dd9 DC8D:BC9F 0Ea6:* EAd7:Eb2D f95e:e70B } name "5m!o~Xfc" } serial equals { "p#f_vo+#" "5.a`[rDI" "/@$V`L,`" "ZA?@;!K`" "<{Ov{x8c" "'ML0kxaG" ",di|TmXj" } via-port { "r3WLsN@ " "$O:K<+Oq" ":xICCvk_" "uooBkLi`" } parent-hash { "&xj!Qfun" } block with-interface 24:*:* via-port equals { "$XN`8p$r" "TqS8;!L6" "sw&v0?We" "6CK@#?u/" } serial equals { "r{JT!cVJ" "fq9dCeG9" "?.jmW=p2" "_Vv?2A-:" "!%Ud;e1T" } hash equals { "En,#'S~f" "UAsT?dU+" "^0+t$:ms" "56%n>n%w" "rpPp?7Mn" "@]`SAq7f" } id b8c6:* block with-interface 25:*:* parent-hash equals-ordered { "ht_Hm5eP" "e%n?q'iF" "Tua5=t1/" "ktRw_P'U" "6vr>j;iV" } serial { "`YyM?>fF" "o'K1ve1n" "f/[D;X$H" "VY_yn0G]" } block with-interface 3b:A9:BF id { 59a5:Cad7 B9A4:B28A eEb6:* } hash all-of { "1?X2u9A7" "_`]`neGo" "Q M{30d6" ">-pqob~!" "VzM,Y<-^" } serial ">4J~>=e4" name { "+Z%U,Y00" "NM{+o^}%" "T.9qaZ^A" "HJ-Q{6z[" "8c+uJ<=." "3/J][.8." } if localtime(1:00) block with-interface { 3c:*:* 19:DD:* aA:3c:12 20:EE:* B0:A5:96 d2:Ec:* 90:*:* } id 5c1e:baBF parent-hash { "eP%]m#5H" "*]o,:N3@" "#&BkVZ4L" "wBnmz=[U" } name { "_" "r5EX5>kH" "b|lqUXYfvcq" ".F0A*k41" "'r2h-dh6" "7h`f1-f7" } name "8G7kkhQ7" serial "OsNC2zYh" if equals-ordered { true false !true false } block with-interface 6d:*:* id 7FCb:* parent-hash { "BGqqqM56" "?dp[q72M" "SMeEnhAR" } hash equals-ordered { "LYHvjL^?" ",yi7>{K'" "m@>epG}]" "Z5VXM7q3" "8?V3/J@Sh" "d1!=aN:j" "u5oPoIU~" "PK~S_xcM" "tY-6>':e" "k_et|o@w" "4xam[7[2" "f:s$YH;H" } serial "v1zlks:D" id Efcc:bFEc via-port equals-ordered { "I`??fBQ2" "~ g|pv`I" "bIO,gl^/RbH" id AcCd:7CB5 via-port none-of { "n|0aM2`!" " iD/>]cC" } block with-interface a4:*:* id all-of { 1cdb:5E8a Ff2f:75dA A6EE:D743 } parent-hash one-of { "Pc}|020l" "'G@Jrnb8" "~v8C-Yz4" "9^$W0A8A" "V/E+]D[x" "3?>{VB,w" } via-port { "yX~x;K=|" } hash { "vJuCVhx<" "fP{Dp0Xt" } name "pUZ*qJUW" serial { "?Tl/5dt-" "I^lZgZHl" "0s5_XF%-" "4v$Q@8^`" "-X_,HHAc" "]&vYO P<" } block with-interface aE:7b:* name "|8#QiJ33" hash "D~U9`z:k" parent-hash "X<@j9O;%" serial all-of { "*%,Ky/HE" } via-port { "rl58j%kf" "{~@CDQB*" } block with-interface { AE:cE:* d9:3a:* 8E:*:* cb:eC:aE 95:*:* CD:4E:bC AF:7a:04 } hash "_CKMJ0]N" name equals { "Gop@bU;Q" "1_s;X2=|" "z&63>bW{" "Z {~TV!?" "LO%KQla3" "H`F0+|k{" } if rule-applied block with-interface all-of { 0e:1e:7c CA:Ad:* d3:75:BE Fc:*:* A7:C2:58 b4:23:df be:b3:* } id { fC57:* 58ae:9e5a 61d9:bfCC Eb22:* 7d29:89dA } serial "k]JqDsf>" via-port equals-ordered { "-.XB7dRR" "xG_Ccd/c" "LC!$Xgq*" "Y#,$uq;]" "MD@bdIg?" "%A^I5 s3" "Oq@7FSBo" "cFTQdt" serial "G!qbaP^{" if rule-applied block with-interface b6:AD:1C id { B3Ce:9CBD } parent-hash none-of { "HquSqjm^" "%zUK}a[&" "$Zi,1`Xo" "YZ0`2j/G" } via-port { "A/+1F$no" "w 9{C`hn" "o67!`!bx" "QK6uQ!;]" "1r7v]E|i" "Z%S*:#~3" "eK[84Jxa" ",tMvkD.E" } block with-interface bd:cc:* if !false block with-interface d7:F3:* hash "2D88zYyS" id { b5BD:* FAFa:8a31 bd0e:6EA4 8ffF:AbfF bFbe:* AAe5:A0fb 90A7:* } parent-hash equals { "d1MLIn+P" "t}pD*D'^" } via-port { "F.#ANH0I" "dI`AdJfx" "aWNs9!tI" "d`pqB@jU" } block with-interface e0:cc:66 hash "/olqC{fb" parent-hash { "dX%$0jUD" "[Bc6D>$_" "Y+;Ck0sY" ".MWzF/t." "$9h`HI7p" "D2Xqa.pQ" "D^4us:7&" "C4D5z}&*" } id 7C39:* if rule-applied block with-interface { E4:dE:* fE:EA:* } hash "Z$,WkT?t" name { "@zKN_{v~" "ww68=L]a" "/yR}Nx_Y" } id 995f:* if false block with-interface { e7:16:* 00:8c:* B7:*:* 96:85:B1 F3:DC:c7 8d:*:* 4D:FB:C1 f9:F6:* } block with-interface equals { D6:6b:* 5C:7d:d6 1A:A9:fd } id E24e:* name "ATnytMKm" serial "thT 8a>6" hash none-of { "l?//cX4|" "kJ3PKdA3" "h-xcKG{c" "'GyRKy05" } parent-hash "nLQ&6Z'C" block with-interface equals-ordered { 61:d4:0D f7:a4:* 5F:a8:* 10:BE:* 5F:6e:* B7:ea:* } id 7e3D:C64C hash one-of { "4S_>uLhN" "ymB40UjR" " [X^20f~" "DXY zCQ$" "ZkZIh0<7" "*R[^3%'=" "E#M&lB~a" } via-port { "C3{mIl4K" "]T%X~7Ny" } name { "MN4&f^:T" "nxc@Yu-+" "$.ucE&=x" "+Rd,6AJ%" "jpKp{93A" ">'|Ajd1x" "~/pN#L~a" } serial "2u{i/oM~" parent-hash "3E:mtsZ?" if false block with-interface equals-ordered { 78:e6:0c 6C:3C:1D 3d:*:* 6A:25:* F9:04:Ad } if rule-applied block with-interface fA:3e:* hash "AmTqP5 p" serial "[|toucRl" id 1C5e:363f name "05Q9Xl3c" parent-hash none-of { "ATrZW!5r" "V^" via-port "t72rZLXt" reject reject reject hash "[0D4_&K2" parent-hash { "P0L~#5M6" } reject hash "2-{,;c y" via-port { "*g=;-wyW" "d!+ySDV7" "+;!DYf`N" "Gk-HT-,}" } reject hash { "$9]ka$?6" "3rpd" "X<3c%D*e" "UB%S[so7" "Z}.[Q6WF" "1>hZhf]5" "<34Evd'X" } if allowed-matches(name "*[*x9]~u") reject hash "b0D'QA*e" id { 2aDc:A2Ba C8FB:fcEB EBBA:* 695C:f516 468b:* 5804:454D 1DC9:cbFF } serial { "3X: ,Cf!" "ugaG98K{" "Ezn~!j6`" "% Ues8z{" "[ZovP4^~" "lW$nec!U>" with-interface 0b:0A:* parent-hash "C?]%!-7<" if false reject hash "Bo2h^]Oz" if false reject hash { "@C|3,Ouw" "PBPB=,5p" "3,M=HXmp" "^d/Oc`]{" "sXO6hG'x" } reject hash "[}~e0hn0" reject hash equals { "1kh30%d[" "p1=De" "EV8^{G}v" } reject hash "-~>gG%fTv{:T*" "Z=&nbK?+" } if !localtime(2:00) reject hash "Gm`6pj&%" via-port "@-]2I=^g" id equals { 7DFC:ae9E 2171:a7A8 } parent-hash { "GKN!A_k'" "apUd'LSC" "4ekw`kiU" "~!wwwVYI" "?]=;<|l#" "jI$!aT/b" "A?2SM7|:" "a;`8kMK}" } reject hash { "I[PNT@Z~" "rsW97@.3" "?6=P@J'^" "j=;_bXLR" "->gZH*ra" "O]tZ5$$F" } id { 79E5:3eeC Fe67:fbB8 72C4:FD9A } parent-hash one-of { "T+2EUtG5" "ZK>VO'@Z" "ad7#,UQc" "N1}.@',O" "3>34^D{|" "@$F2%=kf" "7B/OD4/K" } via-port "$DUYR{`T" "6TMrB1hg" } reject hash "lT#?*;OP" with-interface 41:06:60 serial { "MMlyhV=s" } via-port equals { ":VQzu!nI" "BZ%+~>By" "&5bF,jcd" } id 52b4:0b4C name "%=IHTdHV" if localtime(1:00) reject hash "?[mV2hbt" via-port { "NTL#35VS" "GNF;i$Gc" "[Pc*YAv#" } with-interface 8B:AB:* parent-hash one-of { "8ev{?iL{" "z/nzXAyC" "o*xz=03E" "Y]%[`A61" } reject hash "N:E8h;Kj" with-interface { CB:11:c8 83:21:E3 2a:*:* FD:1d:8F } serial { "FWnuG'ZV" "M2/T-:We" "2kVF7G{H" } parent-hash "*F39Z}Cl" reject hash none-of { "CJ1Nz9Z{" "WcuHsk6>" "NpjWM.]7" "NkY:--> " "V5jH}mW-" "t.m;e<#X" "pMHOwS[;" "1E~~5{tc" } with-interface 4a:A5:* via-port "Z^6=5TWc" serial ",W%frw%#" name { "S#+wxp:M" "VYeg}Ha " "z3PF,:q:" "N@b}A>am" "St!$s@vI" "!*-!t!Dd" } reject hash none-of { "~m_rz19P" "J7K,'hSj" "n|#{gV7=" "`AB'I2Jc" } serial "R1GLA_n5" name { "p8rjMj/p" ";-Fu-,TR" "S;oHdGm:Eg" "3FikLCM=" "7=3FQZu?" "_a-Ztiry" "lQHw4oN6" "516SZiMV" } with-interface { 55:*:* bb:28:* } name none-of { "$}eZ+%-Q" "AlJ8CEZ!" "1M8nkB*|" } serial "@U_9bo:." if !true reject hash "U38UP9GX" with-interface 75:Be:79 name "m21T_Y_j" parent-hash "j{AjXFP-" if equals-ordered { true false !true false } reject hash "U lD+u:]" serial all-of { "Fb8b%OjY" } parent-hash "1b^k[@3v" name "1Wq*}{,J" via-port { "Nd[?'s8i" } with-interface c7:15:* id none-of { Ad7d:* } if false reject hash "Up*][U%n" with-interface bA:e3:* via-port { "@ApJ.7#w" "+gA:sEtD" "Ir}3O901" } id { c4Bc:dcBa 6B95:9eAE c314:* } name "Z/]z+HW&" serial "L=D9AEA=" reject hash "-XE`#cnz" parent-hash "chqw^{-s" serial "Z,JLN4a=" with-interface 58:3b:* id fb6d:* via-port "+EcI1:HO" name { "mVZvzunQ" "[Lbg9}A;" "Jzy5h}-]" "_K;gC -c" "fdP7{+IX" "O-$|L*o[" "_wv9$Eh3" } if false reject hash "*^xG]YbX" id equals-ordered { 2EBA:A9DF Af4f:66cf d37C:* A1E3:a938 eAbC:* 42A7:Cf26 92cC:bf9c } parent-hash "?I/^7:LM" name ".yZMM>NV" serial "7=1~1MLH" via-port "sv+L,vRL" with-interface none-of { 75:93:7B 5D:0A:* d1:*:* bD:*:* C2:*:* d1:c6:* 01:37:* 44:A0:* } if random reject hash "XYUYMU=z" if !true reject id 0F1B:* name { "#,U,0 *^" ",$1P Vnl" "r%qhbEFO" "h5N8f Vw" "*d-Q_uyi" ">hTH I E1 {" } via-port none-of { "`di7N>ib" "vL:^QSP~" "_Zns|#e<" "S!Cp*0~n" } reject id { 0fEE:* } serial "i516'{x;" via-port "nZCN'n_." name "lLSY}3#U" with-interface { 6B:D8:* } hash "]$t6GN5:" reject id 2aad:* with-interface { D2:*:* 94:D3:9a F3:F2:1A 0d:cE:d8 dE:Aa:* 5c:B4:bA 62:ED:* } parent-hash all-of { "qq=]MS0s" "x|iO,5Hd" "GTb10H--" "8K+a seT" "8O^G=NEj" "E<8[gIRD" "Qf ],4 }nW;" "=#rDr^{L" } reject id 3B2B:* via-port { "+s2n~GJW" "G.R23S~y" "i55Jl'0_" "Wl4L~IAG" ":,!KzKtD" "v~]+0kAj" } serial { "23WapeE6" "@DVJk/td" "G~DpkBu&" "bM<{pcd{" "a :KAV&$" "Nw[?+~dj" "vupgW]+3" "EFHrH*r^~io" name "MR|#3K1e" parent-hash all-of { "i,nW517[" "S/#8 d.7" ",czl7.$+" "$Hf~Duzd" "]7v&Evwq" "=SA-{ R;" } with-interface e6:*:* reject id { 3FfE:* E3E9:d174 dCa7:136F BC1a:* c21F:1c0c f060:* } if !false reject id { 49AD:* ec5f:5EB1 1A44:e4c4 afA4:8a4d af89:755E 0b63:* 47c9:E34F } serial "&iwWT|6x" with-interface CC:60:* via-port "#hlL8Q12" name none-of { "s}$OqHc&AB" name equals-ordered { "kIXbZ&Iv" "b%GDhUO " "uyF*6|c&" "ImC&Pt.K" } parent-hash all-of { "x25nCP=&" "b16r` -:" "*p}+KS`=" "sW21L0_N" "dk=q|XmO" "iC~C`dY " ":-vuH@+k" "@ &6Nr`K" } reject id { 92b0:* A9E4:43cF 09E8:* DFce:3a8A 4f5a:5EBb b5d6:* 8c9f:* } serial { "s~vn=?,Y" "fXV1gP'S" "dfjw;tkd" "}yiH]agp" "Yr=~E3a_" "L33Y3lBb" } name "Qr+W'o5@" with-interface equals-ordered { 38:*:* D0:A5:* A2:*:* 47:*:* } parent-hash { "1Tjf" } via-port { "iJ#[#f`T" "D1PIZjW6" "JX1ov!fr" "Qr.R`0Hc" "|oM@a,8U" "f-1~]lMw" "Hw2wlpKR" "e85}*T%." } parent-hash { "1Hw1mIX4" "5Ozd.v88" "0FkXsJ^B" "2c&>*dcz" ">9|dWE3%" } serial "2XEV7NhW" name { "ys;K%M!Y" "kv%{TNI1" "F@gO+~cM" } if true reject id all-of { 6f3e:4B62 7abc:7F67 6270:52B8 bEEB:14eb } if random(0.4) reject id all-of { AdF0:* aF48:6BB4 6437:* 6C06:9cf8 9d72:94cc afaE:* 0D5f:6f89 } serial equals { "t?@u8guJ" "3tlipcoe" "&%AzJBDr" "`K;/4B1`" } with-interface 8A:*:* via-port "8jom+v6k" hash all-of { "Z*HiOkgt" "s$$_,o:m" "Fe${.H,v" "2jRbyQk=" "_UMahp." } name "NdIzfn7p" if random(0.4) reject id B7a5:* via-port "8ij/qhi2" parent-hash "CPP6Sw3h" serial { "lx+VNll0" "%MKO_>R~" "~.yx/ri+" } with-interface equals { Ef:*:* } reject id BF5C:8CBD reject id { c291:* F3a3:* a6F7:a1cF ffF2:* } serial equals { "I?a3bI5l" } via-port one-of { "029&qKTb" "=EJ N$h;" "F2g6CjE&" "psu#e2-x" "i!NbSlDi" "eh9Z`x@I" "j_!jE+ku" } reject id c3cC:* hash all-of { "LE@#m=8^" "r. TLT~X" "lwHAY7FD" "x0A7@};4" "H:fBT5My" } name "~zx9Sr!2" with-interface equals-ordered { 6c:*:* f6:*:* e9:dE:ec 20:*:* } serial "[FG+Oqb9" parent-hash equals-ordered { "';?3}Ehp" "ALVSz7pU" ",$N5l:9T" "2LFU50s*" "?6Ht-3jA" "Vo.1@{1 " "2%7$o6um" } reject id C658:DC06 parent-hash none-of { "jT9W65}`" "Vdq]R$w|" "r=9cOI[4" "-;Ucr/<7" "u!}jK%zO" "@i /{qhA" "+c.n8C,<" "KPP}fiSt" } serial "LIX CA#3" name "AXI*a'!|" via-port { "D54{9Lr1" "w8^^9*b&" "FQ]@PUrG" "n~!sV_D5" "3*q.T,>B" "YRfS%0ii" "bX{lH=FP" } with-interface fE:28:aD reject id cEbB:* name "dA$k/Gfl" if !false reject id D858:* hash all-of { "wYj *H.i" "Kzl[m3p[" "=8z5EbX=" } serial "g>_?@dsqc" } if !false reject id { E9D1:F5FD } serial "" "X^6mK4x`" "'%@dOV#_" } hash "x0CHSDxC" if allowed-matches(name "K Gfi!1p") reject id { Eacc:* a6bb:* 5B7F:* E5aB:* d064:fA1D Eb2F:* d623:* E50c:DF47 } serial none-of { "hVmcqCF," "!P_+f]1c" "fdfng[,E" "*JznKWT " "^1}M%{M " } name "xg[a7_Z<" reject id fCf3:8e21 parent-hash { "7VK[#h5N" } with-interface 9f:*:* serial "jAdP:Z5g" hash "5&ptC#n;" reject id FD06:* with-interface 20:*:* serial none-of { "6PX4K?U2" "+8I+GUde" } parent-hash { "3E$DcA5>" "t+Dj2Qx*" ",Kh39ykT" "%od12 .e" "N;JUVP2{" "vjXMynPJ" "BsXh@WiA" "$!qK`.D<" } if rule-evaluated reject id none-of { Ac4c:531b 322B:Ddaa dBa8:* adB9:b737 94ca:52ee } parent-hash { "ldHR'Z{9" "oUXbhJ:7" "ASlMOo-@" "|B?=jfBQ" "bBT$CfOm" "L0s[L~xX" "ggfSi_u~" } name "]JA3! ~{" reject id none-of { CB8E:5F01 F0F8:7491 756E:* } name { "xH1K%16p" "f8IaYm:7" "qldMQwAy" "yURda{Yz" } serial all-of { "9`=C|qIb" "Z.P^*0fg" ":N=;w!CI" "N,9t//KC" "WEA%^|To" "28'p r'," } via-port { "$aLcV$yi" "};<{St]i" "9B+nCP-8" "nU|pJibH" "$+naTyL8" "g 3XTrU9" } hash "nfHI[N|D" reject id one-of { ad8f:2dEe 90D5:4110 3D25:b8DC f2ce:* 116A:* 2EAB:* D7AA:* } name "5=/x6jiG" with-interface 8C:4B:* via-port none-of { "l!y2V>o;" "L`Gm~U5s" "bPtmRur8" "Z W+_x^c" "6a+rBNV%" "AyDpi0g-" } hash "lHDzSn.c" serial { "BmG3_dJ-" "}^hWJ{?v" "w*$DF!FK" "kkQNPA`H" "SMt!`X#V" "9o7at*m=" } parent-hash "X`Xcsvb'" if true reject if false reject if !false reject if localtime(1:00) reject if !localtime(2:00) reject if random reject if random(0.4) reject if rule-applied reject if rule-evaluated reject if true reject if !true reject name { "0.3>p?[#" } id { dA10:* 08c9:7cE2 DA31:* bDA8:* a6A8:* 5aCC:* D55D:91Ff } via-port "w,1NnKf7" with-interface equals { d7:DC:* 81:*:* f1:fE:4e 5E:Ba:* 2C:*:* fa:22:94 30:3a:* 59:B5:6b } serial "YWz@`LrK" hash "NYe2I9QE" reject name " 5YsSERs" serial equals { "?knRo&X`" "7LCsKjVO" "rT9>5Afr" "?YNluTiT" } reject name { "@@6<:=:C" "}Xg~gi|L" "&KS`*XHb" "DFgIE-" via-port "vZPjD]1O" with-interface 92:cb:d5 serial equals { "wT$g3ei/" } parent-hash { "XfY8@wT0" "b4%O3xI$" "-ZUKNz" "_Fz4u7`L" "2/X@NSO0" "`]]k?|wv" "<%:W

Jye[U" "y5x#/sv4" " :/2Lz=P" "HzD8 ~:Y" "A[Tbwb,`" } reject name "/@jbkQD_" serial "w&''4D1I" id 1d0a:9c3d with-interface one-of { cE:*:* 8a:02:41 A5:8c:cb 51:*:* Fc:*:* b6:0b:* } parent-hash all-of { "n[BckQO." "2w=0/ %E" "}&/+j_Qx" "C 5/4{}p" "7<8+Z.Nx" } reject name "+ k@2AK[" hash "p]XAeB4<" serial { "t`4i#?@j" } id { d1E2:3f0c f9bb:eeF1 } with-interface 4F:24:C9 parent-hash { "rmn2uS`B" "7!>X-#t " "Q/z0$}y!" "n5q-UQSV" } via-port "T]5}gqCr" reject name { "K:bJ~pZN" "7/WAM$7U" "5Y@mWwK{" "?;~[$&2T" "_" "|2R`x9'L" "C}2lpXN*" "%t vMg^5" "-3,kbJn~" "YqeMJmK " "$utXt`4>" "`ItJ;%v-" } id { 7A72:A624 aebb:* B5E0:f82b af1B:* fbbC:* 6fdc:* } reject name "'*'ODy,m" if random reject name one-of { "A_!ageD6" "#dnn!;1C" } reject name one-of { "*%jBcE^$" "UQ>z9d`d" "oDjo`d_8" "5.aan,I-" "P|2agjJ]" "qWsJ`{/c" ";=6H[J8&" } if !localtime(2:00) reject name one-of { "MjwwJ2[#" " U+&#=;C" } parent-hash { "y{RP$j$>" "!~rML4GS" "Ll@k**[G" "lCOO]z.'" } serial "h~=Iooa]" if localtime(1:00) reject name one-of { "$nm%oD&`" "NHYqfUSX" "5fak#K,#" "Axm5~6Yd" "/+#>QCn!" "w.Wdv]d}" } parent-hash { "dv=6cauW" "&*zIIRMW" "]Cjp0TM@" "ufp8mYf4" "+b1B`Z6;" } serial none-of { ",s`4!EqI" "UM>7kns9" "!8SWI.9^" "xV4z*>#5" } hash "<8K22oJJ" with-interface Fd:6c:FA via-port { "{Eya!^r}" ":+R{W:4%" "%*pPgWF" "OR48bQGf" "1<}L[-r*" "X8?ntxcn" "u@s}<65M" "jRRI*o&#" } id all-of { eCE0:7baC 1EEd:aEBC } serial "Y=NJg9wI" parent-hash "X:;ybhwQ" hash "|mal.Sx&" via-port equals { "$_si#$^F" "sUaA>WLa3[z" if !false reject name "rEsKUes`" if !true reject name "u/VVdX-}" reject name "$:VLVUt1" hash "F2=1BmK#" parent-hash equals-ordered { "`0tMM5yI" "M82GhsG8" } with-interface 9D:ae:8b id equals-ordered { EbAf:* 6438:* b7BF:* 817f:f85d } via-port none-of { "*/!PBa&a" "&|BQ?*5x" } if random reject name ", W+>V+[" serial ";TRd,dg5" reject name { "X5Rn6eh4" "GC8|#lQr" } with-interface { Ad:9a:* } hash "|G" "_PzgYs6*" "STeHy+rkdJ!" "3Q+qNz5w" "w`aG'GI " "_-mIGw&." "n0;W1OF;" "b^M,y&qH" } reject parent-hash "0r_<@7i9" hash "1CV'OF~j" serial "d:ED>o!~" reject parent-hash "2wNrRzr6" serial "!>#bDOH}" id 1FEE:* via-port all-of { "ShfwRw0q" "3GG#ehwQ" "B- :G'E." "k_1]w1N^" } if rule-evaluated reject parent-hash "_7ZLxB6G" name "7WCR'X3y" hash equals { "@!=xWS7;" "`@{plKR|" "TVmxF59U" "*G359Ie*" "?s>qMjR{" "W|}.YuFC" "fVHHkcVn" } reject parent-hash "8t_CM>e^" with-interface fd:a3:7a serial { "Y;g+x~Mv" "4ZR6l?%4" "Lm4HGQNF" "{K[@b]SI" "QZp[3dMc" "Vu:m32:," "%*z5}OX" } reject parent-hash all-of { "P7]c0nNX" "3_&^#yEJ" } id f95f:50B3 name { "!LhZc2*;" "}T6nb%,[" } hash one-of { "lT^&hCCJ" "xrQ|dVvY1deR" id EA9f:* reject parent-hash equals { "=9b|uzS&" } hash "; G~.kY>" id { 27EA:88a8 b64B:* 7cD2:* 1F8f:67a5 } via-port { "PLh*QJxq" "Ie Lx3Bl" "pE}F,+&:" "M=7Ybu[}" "o/2j4D[1" "]Nxs]%/=" "Y4wX:AJG" } name "Kvvv/@aZ" serial "OTo[nEQG" if true reject parent-hash equals-ordered { "bOV/%R Y" "A4e6 Aw-" } id { e037:29cC fD17:9676 } if localtime(1:00) reject parent-hash equals { "oSq:n=w>" "f4r1=muK" "!K~XvSkO" "G^BHQRy " "Jg}IBh,g" "YLEJQAx5" } serial "3bLc{.ws" with-interface ba:8A:3d hash "+>YsE`n$" name "m>1hCH;*" via-port "Zu[~8Dp_" if !true reject parent-hash { "GOz5^lET" "^ D;G9;o" "i^b_jYaK" } id 2d0B:* name { "AO#w:4+@" "XqQ-a>Tb" "16j||Q@f" } if !false reject parent-hash { "H`HFW+Bq" "ld@SlY?7" } name equals { "&D9h-rx]" "I|w]WM!c" "D67/_fad" "ltD`@Z_EPLEx" id e776:b4de via-port "X=Z$q9QL" hash "d'K6!i9k" with-interface equals-ordered { B5:8a:* } reject parent-hash "~N%%gcbm" via-port "sO3#EYB-" serial all-of { "@B#>.>i_" "I+=9jDe2" } name "QV,I&YBX" id 8fD6:bB51 if random(0.4) reject parent-hash none-of { "=Gi[ M/H" } name { "<=%@z<8V" "SQ|DTt3Q" } serial none-of { "L cRz#a;" "+m`@ 1mE" "J.x0CTY6" "|w+9T]cW" "0e%t27<~" "W1TH{=>d" "1AuYe@#T" } id equals-ordered { bfAb:* a4Fc:DEDD 26b0:9B0B } if none-of { true false !true false } reject parent-hash "N|ZSy3;C" with-interface { 2D:eB:aC 69:*:* Da:*:* e1:*:* 8A:6d:* 37:Ca:1f 58:D4:D1 a6:*:* } via-port "$;E_qiz~" name "CCAi7r,%" reject parent-hash one-of { "J<$/a@lJ" "A2!r,IcW" "iyueSV0-" "P[MnB.!C" } hash "uUf0 z!k" serial all-of { "aA_A 7Y;" "1I*^KP'2" "1}yHe*@C" "v,Q|Du!v" "4|:$N$Pk" "Wj.W>4R," "}Jm5-dyo" } via-port none-of { "iZt@2Hu4" "XD4RoDKv" "VC&?CMr_" "e]deW#?c" "pyrMs&Tj" "+Gr{LmeV" "=VO,.SD1" } id all-of { CB9E:aa15 dAFd:* 3D0f:da06 8a84:a0AC 702E:0e84 } reject parent-hash ",OW@B=j+" with-interface 6c:6C:e4 hash "GWjH-J~~" serial "6T;9}=:3" name { "bS8ZZF$c" } via-port "QD_,gF5K" id Ced9:80A9 reject parent-hash { "P3c+rNLA" "%R176MB/" "M8b${|e~" "[[,mRM.s" "k|=QPF8'" "[[t?Vs}N" "}iEf8Y`A" "ezL~@?TT" } hash { "*b@P!A,8" "42?I^aRJ" } if !false reject parent-hash "Qt 6lmKA" hash "*<{Bo}+@" serial "O#BcnMLa" with-interface 04:c8:* if localtime(1:00) reject parent-hash "?@sIZG]s" serial "9j$ed:J^" if all-of { true false !true false } reject parent-hash { "s&wl/vew" "ti:p;+U<" "]+<_5~O*" "GCsP9^-a" "iN@5d]S2" } hash one-of { "[,PrhA#Tfe>Kn" reject parent-hash "tU/{gC,%" with-interface 50:*:* via-port "ZwF!e#Vv" hash all-of { "w1uq;#&e" "{Go-91~N" "XgqIqSt<" "Ob2Ja#Pw" "mpt8^~YW" "2|w}^!I," " WmzvZK3" "e''=/>,e" } if equals { true false !true false } reject parent-hash { "XPQ&H?/i" "4$0A}vu@" "-*'+,D`L" "UXt:R^PY" "nBZE_w!j" } name one-of { "J{TnYcN$" } serial none-of { "R'B]U?N_" } via-port all-of { "j!m}'mlg" "@Q[199]*" ".^&m|fFL" ";k`UMvqo" "5|m.2>S%" } with-interface bB:*:* if !true reject parent-hash { "xpt85li4" "5MbYU}#<" "fc'Lt|X:" "~#|7%brx" "9dubX5me" "7k|=2Udt" } reject serial "3*!TVEF." name { "=1tabA0C" "7]GQXA+G" "GOU$@B>?" "&&UpmWWP" "*mwY!8T2" "!xV1|PH=" "uma={s!9I2S_" id one-of { 4cBE:0AeA 8A63:4f7b 4204:1f52 CcB4:2bc0 56f3:* fa3b:65dA } via-port { "H,EGcl=1" ".}2_5+ru" "Mp7ZYx}'" "cD0{q*1O" "eaGU" reject serial "&4WC`L,g" name { "/u*lF3x+" "F'*6ZwZ~" "v`CLYgAq" "69}NC][]" ">US,9#n_" } parent-hash { "aPaU$#JJ" } with-interface { 1d:*:* 5F:3c:5b B6:d0:27 FF:eC:* C4:01:* CA:03:* 9e:d5:* f9:b4:* } hash { "Dj!q$aWH" "_Z^*&PkM" "Q68'a-PF" "h2y&o5.R" "f%Q7uFmY" } via-port { ">eqF'4zV" } id none-of { 3C9f:* } if none-of { true false !true false } reject serial { "4wu05cpJ" "&_w*2 =" "XcoX}[6S" "?v$E?48'" "kt[C*+G?" "]*/IY62," } reject serial { "7xIHQ&6k" "dkp95tZ>" } name "vxgJF1`8" with-interface { Cd:*:* } parent-hash "+K'Pc;v0" via-port { "$0=*6 1B" "a5GZ[]m!" "g?+vIX1T" "a3EEY'RX" ",$Wd<{g'" "$fP.:VqR" "z/;VL0Oy" "S|5qpw|E" } if true reject serial "7*z'Z'&G" via-port { "ab_6Y['}" "`8DE#Sni" "{eGE-8,o" "]umndJTy" "T_m!{eu~" } hash "dv01sV`4" name equals-ordered { "D=Kb&V8E" "3qbhv7:D" "qsKb3Q=v" "v3I,4_Bb" } id all-of { 85C3:Af6c c0ac:B772 6CAB:* } with-interface all-of { 20:*:* Dd:02:fF A1:ec:Fc d3:43:2d } reject serial "8NBn[Z5X" via-port "A[mPm{T?" with-interface { df:*:* 8E:46:* } hash "XaG2$9dw" name "O-~qONma" if !false reject serial "}9X:0,AO" hash equals { "?Rkyb7Gj" "`rdVxIPH" "!psLZYri" ",O'Dt]A2" "{x13ogap" } name none-of { "z.K9x_5t" } reject serial all-of { "6wUEMpXb" "jg]qSe*C" } reject serial equals { "8q*wl_7;" "#?Cz25l>" ",xX2#>^7|" name "C!&FSf[[" id one-of { 21E2:* 49fF:5365 ff8B:3B40 bF63:c127 F4b2:* } hash { "h.JdhBxY" "@Ao/K1WI" "0ZeybeL+" "`C6:E>k^" } parent-hash "~lhRb8yO" reject serial equals-ordered { "QyXLGQ[F" "G,5>pfG7" "-abZ?fQ&" "d5]{bX|!" } via-port one-of { ".SZx$,lo" "9ULx%gd/" } with-interface 39:*:* hash "e^1EyKo-" } hash none-of { "!>U%:4vW" "OrTvY# #" "-siS+*AY" "PHUKiMtB" "tQ~pe{8}" "W|*vBwhf" "TJP?D9LH" } name equals { "Q%xmbV44" "nD%v>O`&" "BM$RWJtk" "d?K~f'GX" "jiA6lJ&Y" } if !true reject serial equals { "YBM#3e+Y" "LW&++&`]" "6S0iF7d}" "Bn+QD_p>" "8GrJ'TDw" } id { dcb6:9e73 dEca:9a81 fbEe:* 3F7c:89fD eE3F:93b7 } parent-hash all-of { "qM^t^MMI" } if localtime(1:00) reject serial equals { "zYPQUS,t" ",8s@iV[+" "zv=|Ibee" "]wy @V@>" "ABe5y;Ne" } hash "&2S4+h7x" name "zg'o? l`" with-interface none-of { 11:*:* De:63:* bF:2C:88 bE:*:* e0:16:E6 67:F0:eC } parent-hash { "mLui`B66" } reject serial { "gXw/X>[Y" "j9NZiw 8" "bUuO>jOj" "%iY-U`j." "9:MoaC@T" "yM;^e&8e" "cB31QIrY" "B8@K" } hash equals { "9KbK7 n9" "7^Y}y[zC" "$~b2VKV6" "p5?:2;6^" "-E%Y/xS<" "gn& OydI" } id 0218:5aD0 with-interface equals-ordered { A1:FC:A7 b2:*:* } parent-hash { "{0d /DeV" "^M0h8rW+" } via-port "4|l" id Cc6C:* name ";F" "u&YS8Kp{" "eiqI#P{}" "ckmD~,eL" "b@BoOd16" "w`xS]Shd" } name { "]$6n&V}'" "e0ZX%H%n" "?w.GsXnD" "+@'hG y]" } via-port { "ooyc-XxV" "Ijg& $qk" "4yy K%Dd" } id d6Ed:E850 if !false reject serial "NU/;XmN<" hash "kcA,v-`r" name "L?Mjqz5*" if true reject serial one-of { "q%A%e6}A" "8j1jmnsY" "h_']MvKa" "Bj:D]^Z " } with-interface equals-ordered { b7:d2:dF } hash "Xte%iyb3" id one-of { bB8e:* d6cE:* a3B1:4aeB e3Dc:caBe A40D:* c828:* } if rule-evaluated reject serial "qm4,tfTk" name equals { "{cidNdy#" "^{W:5f$j" "zDsd@" "s#qz,9" parent-hash "qix@~0oi" reject serial "T7,F{/K/" name { "$V.[Az2C" ":2#a14H5" } hash { "f` >1Q/t" "+KS4`]@k" "[Q0VLrbo" "=GiN1}@N" "}-ZQIC8W" "q4xXjc$T" "}L_Lm_v6" "p=ETrlQ6" } via-port none-of { "&2k,G}2d" "I].&A+rN" } id 6AA2:* parent-hash { "OYDuGi8^" } with-interface 50:*:* if true reject serial "'Te}9S.5" if localtime(1:00) reject serial { "ULk+s2#t" ">H*AHgXC" "J]?wS*F_" "D`vhu%Uh" } parent-hash { "9KJ8-A*r" "01,=@zx^" "R$_Y}'e3" "{*^-a7hv" "xV,g2RF2" "830f-Hdp" } hash "mJSqiT#;" if !localtime(2:00) reject serial "UTk+Sla]" id DDF9:* via-port one-of { "M; ^=6Yc" " S|~g'1|" "0AKvgTcS" "fMzh8C#`" "uulT'}rx" "&Er" "n:w/i.N8" } name "|NzS@zhj" id aE53:91ca serial { "u4qBeA%N" "@}WuVN-E" "=8w.|e?g" "$];{w#1d" "&m:dk0OJ" "{[=b}%2h" } reject via-port "&6;Lp3Jr" hash { "19ue7ppW" "jPm_E9u[" "XHXbAQfh" } id 74Af:* name "#w%^nM29" serial "GGc-*I#H" if !false reject via-port "?7c*ChM~" hash { "#mcn/L%|" "#+R}c0_2" "BDDM6n|;" "@^|+S T1" "wF4#0qg/" "3]m?w!@4" } if false reject via-port all-of { "K0VqF+Gb" "3pC` uiR" "J9oQv@xj" "@a~]k`Bs" "L4p=hK,W" "v<^_@9pj" "0Qf!kw>O" "XL,e|w29" } serial "c@Mv@072" name equals { "QtCJ@G1X" "v%Zz];Nk" "OgDAzb;f" "QCD20FZf" "3Kc$hF`v" "V5eASmy`" "7[@?=n'1" "`8pM6g=2" } parent-hash "Y<./hNbL" hash { "0oAp/FC," "^B {c<9S" "QCZmbegC" "6V4Yqg;p" } id 29F2:* with-interface BC:*:* if random reject via-port all-of { "$xiRRuA0" "ucED~8D~" "5!3@6d/;" "A1G?#D%x" "_><84;Od" "L~|hS{ie" "Sbr{v=!h" } name { "PQ+BpVq3" "U+EGir[X" "tQqCvPJZ" "-@Wl6^2t" "e#EQ;%;V" "{6:06@~?" } serial "&IRo@|4y" id 73fA:* with-interface fC:02:Ba reject via-port "bD8Rd4h3" id FbB6:CFC2 with-interface { Df:F2:* c1:ca:* C9:dd:* F0:*:* aE:D8:* 3f:F2:cc } name { "BD]@?>Pe" "y06|$chx" "j5bwMTxB" "QxyDi6}7" "XOhlCYXh" } reject via-port "bGnHdw]w" hash "k$'d~z6n" reject via-port equals-ordered { "&=xQv@>T" } name "G:OIHDL%" reject via-port equals { "RcN0%qdv" "wL/s -2j" "m|pNyWw/" } serial " UhO;hcr" name "'a}h{Bq|" parent-hash one-of { "UMR~^Q%8" "{43&ERq@" "_v>]YJ>^" "RL$N9DPe" "ln;dlnX " "L~<]0Pt$" "5[d_kiJ0" "N8^t'%$J" } hash all-of { "y]8T!ZjI" "v/_QaO9g" "BmEU$o6g" "8luhi=k{" } if !true reject via-port { "%G]q99,m" "pS QkiA/" "Pw#,[*Jl" "t]/CPH.7" } hash { "K@Xx7_.6" } if !false reject via-port "HXNGe!~r" } name { "X[O61%i*" "}m?t*CL," } serial "&pwE EB3" hash "&VndDS!C" reject via-port { ":i0cIL'M" "*@I 6*m~" "yzmdhl,~" "~b!M|JFN" "l}k>O#<9" "Ir,692JX" } id all-of { 82C4:* } with-interface 12:2a:* parent-hash one-of { "rX_x8`=H" } name { "7WWdHd@." "*+BkA*_G" "[Qjw3%ke" "RBF;Ct9y" } hash "}Jss8/:[" if false reject via-port "I;9@" "RI=H7cEL" } reject via-port { "Kz#>Y7h&" "1H;f+x0J" "9yfE/aP?" "SVO/1vE'" "Dp>`bvY^" "HdZ=b8AR" } with-interface { df:59:* cb:C6:* fd:*:* bd:ee:15 F2:1b:77 5a:Ab:* d1:DD:69 00:dF:* } id equals { 9F95:979d } serial { "W,#1v9^L" "dK=I5w2~" "Xh51tX#Z" "W|SO^7p+" "q/$9M`&3" "L0egqhkc" "Q;ZhaO L" "1VT@_3+-" } name equals { "sLC_IeZ0" "uyDl3!'%" "Sj@8b~$X" "EXW*!-Kd" "_u8tM{0<" } parent-hash "W]_P!+7-" hash { "@2[K+BQL" " @/-L'=@" "A61T0=U4" "=_lLts/{" "XNSHKWn'" "|a{tACCh" } reject via-port { "lGGya;4 " "&O}+H*?3" ";zFFN-" hash "N{:t^rC~" id { bE28:* A1aa:* Cbc1:6130 5EB9:* } reject via-port none-of { "5Z|q{oD " "TIp&-R+I" "*j0:mqm{" "n[PSiWbK" "mh=#eyiR" "+rg&18WP" "}!oMK,tm" } hash "Yt]2`N1~" parent-hash "atg,JQY-" serial "uBEk@%#+" name "O*9.A-AW" with-interface equals { fC:D4:* 75:ee:05 93:*:* Ca:AA:BF 55:F8:7f 89:B3:* C4:0E:* } reject via-port none-of { "6$%l,XTW" "=9|vn?v<" "|G|z!gN," } hash { "PU$$Ze3@" "C!:Bp,Vy" "''@1lTHi" "1fdP-c<6" } id equals-ordered { 67b6:* aCfA:* edD3:* eB7c:f594 E08c:* 9B0F:* 667F:Fe05 } parent-hash { "bcLD0MZC" "wI>f;$" "eEZGDHwf" "4Q3sUS++" "wY,SpD,k" "Z}-o#?8r" "L0k}},Q`" } serial equals { "WeyWk$wd" "k3qK9#tf" "f.PzwCh1" } name none-of { "6/R~QS1A" "TC3J&| g" "BAXF!1H:" "ETwE?L4K" "a,XQ@mS5" "*M40BIUR" "]EU19Gp6" } with-interface equals-ordered { f0:6d:* EC:56:bC fF:90:* Bf:80:* 1F:e5:bb ce:*:* b7:72:* } if !false reject via-port "[nV2,'_]" name equals { "Giz|X=bX" "N`*1%<6c>" "4_Eo@!%4" } parent-hash one-of { "jx>bd$fq" "v'Mgl~j#" } reject via-port { "Xb," "A4v9y81 " "kL!93cbP" "ZEft4UJ>" } reject via-port "^q- .QhX" with-interface 9c:d3:52 name ">HR2>{#>" id { 524D:E4DA 9235:* 342d:* dFf8:dC1C b0a5:a3F6 52c2:* bDB6:* } parent-hash "VCxji7#0" serial ".-O35PI~" hash { "H/:8rNSr" "b=J@*vm%" } reject via-port "Q$q*" } name "fRz5|x=$" reject via-port "vh BXA=^`7" "ps4dan9w" "dH>d%U9K" } parent-hash none-of { "tJqRQ3bn" "dlw=m3u|" "n6$r?u]e" "bV9Q?EH]" ">FA" "s6+S2%l5" "E3pv/;BY" } via-port "*5:v~5i9" id one-of { 2C15:8aca E1d0:* 8e8f:eBAf } if false reject with-interface 11:*:* via-port "F>dN9k8u" id dd04:* serial equals-ordered { "8ceTmi`L" "U@?w]Bp&" } name equals { ">,7DlJUZ" "xg:B;try" "QnHe$K>[" "tq@1&:ZQ" "2bd6T5$R" "$hPfMM]-" } hash all-of { "bc&kA?os" "|ZYtEw{u" } parent-hash one-of { "2U=YXA{:" "c:Tm_#2S" "}z!w'1B/" "4ul%Cwk-" "O3>fc]{}" "v[m1e-Jh" " $|!r<:0" } reject with-interface 26:9E:* reject with-interface { 2a:08:04 f3:Da:* 75:*:* a5:99:Eb BF:62:5D } parent-hash "J-Okz#D8" name "[hEk%Lx@" serial { "&4Q_y:/T" "*4!n.F}n" "7he9Ds7-" "X-Q.5$Ex" "3G@Y~qU?" "MnBe" serial ".qUztFD?" reject with-interface 5d:*:* via-port "~E5V%!;e" if rule-applied reject with-interface { 61:*:* 05:*:* } hash equals-ordered { "pqA>L{h/" "waG&}3`T" "y?>'tXXX" ".8 R}D4V" } parent-hash one-of { "zse-_#V7" "@J5SFAYW" "LD$|4E h" "xO :4mfF" "9O7SIM@'" } id { 9ACC:* 5A63:* } via-port all-of { "V7U8B7{>" "wVJhb+ w" } name { "cGx&|$|E" "fn?$,61e" } serial "U|~BC`7z" reject with-interface { a1:*:* 03:3E:* d5:4C:* A0:1A:dD } id D0FF:E036 hash ",ILd,|,2" parent-hash "IdwSC*:W" via-port equals { "EQz-_|Vs" } serial { ",$m4~]*8" "LQ,IDL~3" "H/=1CmFZ" "DGnkBUU1" "@}mYr2O#" } name "Cyd!Va`b" if rule-evaluated reject with-interface aB:eF:c3 name "-w,Mcb$^" serial none-of { "X@%WOcGi" "UOz'%$kH" "4&4R.P`N" "N:Eq gX&" "O$^a$LeWOnXgR" } hash "0URbo;UI" if false reject with-interface c0:*:* id { 20Bc:* ddD2:0221 b26F:8AcF 5E66:* aEa2:FEe2 } serial { "`xT6]S2'" "f$v;>cT8" "fPhC>4vl" "a.Me#7j^" } via-port "UUj@H.3r" hash { " ?n6!6k/" "Z>{_S%GH" } parent-hash "*CKflJ>`" name none-of { "^$~7=7Lw" } reject with-interface CA:FF:* reject with-interface cC:e7:BE hash "qRY/7Nrk" id equals-ordered { BcdA:2171 898c:735D c70A:6aC8 aC5A:* } name { "UmIo`9:u" "PqvByT+l" "Q~s-+B6&" "|QY3b4ba" ",w&!Pk&-" } parent-hash "m&yOwhm+" serial all-of { "!7+ql}$F" "aU>u uoT" "dW9fQg&<" "!sZ.wN0L" ",bxT.~h<" "8I~,f q=" "iZ2^XbSk" } reject with-interface { CD:fE:* d5:6f:* } id { bCbF:* c04C:* DF52:Feeb Ec12:45De } serial equals-ordered { "U$@AJ5T^" "]CEwaZm1" "_#>'L8@3" } hash one-of { "obCl_1h*" "e|~iGd5I" "UkIf]O<@" "Uc;vK3W&" "XkVv'Kx!" "M'9Xp:kk" } parent-hash { "PmRYV5yf" "b1ae]ZLS" "<*#65Evo" "TJr#Z@&q" "K*uZHI,E" "^^6pBx3+" "cB~uUU>~" "L^U4+mV8" } reject with-interface { cE:6E:4D 8D:27:* 48:a5:* 4A:22:18 } hash "QO*BIH-E" via-port "YO[Rxo1n" reject with-interface d6:75:* serial "K6qOwgW0" name one-of { "nqK$62cR" } reject with-interface d6:*:* id 4320:* name "+@rSM,?:," "rwM*Ex|j" } id one-of { 028c:7202 B82E:* } if rule-evaluated reject with-interface equals { E6:4c:* 4F:8F:24 A8:c1:C8 5e:eB:Fb ED:*:* A1:3d:* fA:*:* } hash "rJjT-`yo" id 26a5:0e6F reject with-interface none-of { C8:3C:* 4b:*:* 5c:2e:4c 7f:*:* BA:F7:* d3:4D:cb } parent-hash none-of { ":m_H'h`:" } id all-of { ADc6:* 332d:* } via-port equals-ordered { "vHE?ZN;x" "Ga:kiC`N" "PlOjBwj0" } name "GQu. # # Authors: Daniel Kopecek # # Usage: test-rules.sh # test-rules.sh # if [ -z "$1" -o -z "$2" ]; then PARSER="$builddir/usbguard-rule-parser" DATADIR="$srcdir/src/Tests/Rules/" else USBGUARD="$1" DATADIR="$2" fi #TEMPDIR="$(mktemp -d --tmpdir usbguard-test-descriptor-parser.XXXXXX)" RETVAL=0 export IFS= echo echo "Parsing GOOD rules:" echo "###################" echo while read -r rule; do $PARSER "$rule" if [ $? -ne 0 ]; then echo "=============" echo "FAILED: $rule" echo "^^^^^^^^^^^^^" RETVAL=1 fi done <" echo " #endif" echo "--- snip ---" echo "to the beginning of the source file." echo exit 1 fi exit 0 # vim: set ts=2 sw=2 et usbguard-0.7.2+ds/src/Tests/Source/CheckScripts/public-without-build-config.sh000077500000000000000000000006131325273707200273420ustar00rootroot00000000000000#!/bin/bash # # check-path-include: src/Library/public/*.hpp # SOURCE_FILEPATH="$1" if grep -q '#[[:space:]]*include[[:space:]]*[<"][[:space:]]*build-config.h[[:space:]]*[">]' "$SOURCE_FILEPATH"; then echo echo "The public library header files should NOT depend on build-config.h." echo "Remove the #include directive." echo exit 1 fi exit 0 # vim: set ts=2 sw=2 et usbguard-0.7.2+ds/src/Tests/Source/CheckScripts/spell-check.rws000066400000000000000000000016071325273707200244170ustar00rootroot00000000000000personal_ws-1.1 en 0 ACL API AuditFilePath AUR autoconf automake backend Backend BadUSB basename BNF boolean CentOS CLI conf Copr Coverity dbus Deauthorize deauthorize deauthorizes devel DeviceManagerBackend discriminative DocToc EPEL filepath GID Github GPL GPLv groupname groupnames ImplicitPolicyTarget InsertedDevicePolicy IPC IPCAccessControlFiles IPCAllowedGroups IPCAllowedUsers iSerial joe json libcap libgcrypt libqb libseccomp libsodium localtime lockdown MERCHANTABILITY multi nroff pandoc PEGTL PID Precompiled PresentControllerPolicy PresentDevicePolicy protobuf README RestoreControllerDeviceState RHEL roff RuleFile RuleParser runtime seccomp spdlog src stdout stuge subclass subclasses subcommand subcommands submodules syscall syslog systemd UDev udev udevadm UID unconfigured untrusted usb USBGuard usbguard usbN username usernames whitelist Whitelisting whitelisting workflow Yubikey usbguard-0.7.2+ds/src/Tests/Source/CheckScripts/spell-check.sh000077500000000000000000000035231325273707200242200ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # ################## # # check-path-include: doc/*.md # check-path-include: README.md # check-path-exclude: doc/FOSDEM-2016/* # ################## ASPELL=$(which aspell) PANDOC=$(which pandoc) SOURCE_FILEPATH="$1" if [[ -z "$ASPELL" || -z "$PANDOC" ]]; then echo "Skipping test because some dependecies are missing" echo "ASPELL: $ASPELL" echo "PANDOC: $PANDOC" exit 77 fi EXTRA_DICTIONARY="./${SOURCE_ROOT}/src/Tests/Source/CheckScripts/spell-check.rws" PANDOC_OPTIONS="-t html" ASPELL_OPTIONS="-l en --add-filter=html -W 2 --add-extra-dicts=${EXTRA_DICTIONARY} --add-html-skip=code" retval=0 set -o pipefail export LANG="en_US.UTF-8" WORDS="$(${PANDOC} ${PANDOC_OPTIONS} "${SOURCE_FILEPATH}" | ${ASPELL} ${ASPELL_OPTIONS} list | sort | uniq -c)" if [[ -n "${WORDS}" ]]; then echo echo "ERROR: Found missspelled words in $(readlink -f "${SOURCE_FILEPATH}"):" echo "========================================" echo -e "${WORDS}" echo "========================================" echo "To whitelist a word, add it to this dictionary:" echo " $(readlink -f "${EXTRA_DICTIONARY}")" echo retval=1 fi exit ${retval} usbguard-0.7.2+ds/src/Tests/Source/CheckScripts/vim-modeline.sh000077500000000000000000000004421325273707200244100ustar00rootroot00000000000000#!/bin/bash # # check-path-include: *.cpp # check-path-include: *.hpp # check-path-include: *.c # check-path-include: *.h # check-path-exclude: src/ThirdParty/* # SOURCE_FILEPATH="$1" VIM_MODELINE="$(< "$SOURCE_ROOT"/scripts/modeline.vim)" grep -q " vim: $VIM_MODELINE" "$SOURCE_FILEPATH" usbguard-0.7.2+ds/src/Tests/Source/check-driver.sh000077500000000000000000000076351325273707200220170ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # # # This script looks for files that don't contain copyright infomation. # It does so very naively by searching for files that do not contain # "Copyright " in their contents. # ################## #set -x GLOB_INCLUDE=( *.[ch]pp *.[ch] *.am *.qrc *.sh *.md *.adoc ) GLOB_EXCLUDE=( *ThirdParty/* *build/* *m4/* ) ################## function __realpath () { path="$1" base="$2" abs_path=$(readlink -f "$path") if [[ -n "$2" ]]; then abs_base="$(readlink -f "$base")" abs_path="$(echo "$abs_path" | sed "s|^${abs_base}/\?||")" fi echo "$abs_path" } if [[ -z "${srcdir}" ]]; then echo "srcdir variable not set!" exit 1 fi PROJECT_ROOT="${abs_top_srcdir}" SOURCE_ROOT="${srcdir}" CHECK_SCRIPTS_DIR="${srcdir}/src/Tests/Source/CheckScripts/" for glob in ${GLOB_INCLUDE[*]}; do INCLUDE_ARGS+=" -o -path $glob" done for glob in ${GLOB_EXCLUDE[*]}; do EXCLUDE_ARGS+=" -o -path $glob" done FIND_ARGS="( -false $INCLUDE_ARGS ) -not ( -false $EXCLUDE_ARGS )" driver_retval=0 while read source_filepath; do source_relpath="$(__realpath "${source_filepath}" "${SOURCE_ROOT}")" failed_checks_output="File: ${source_relpath}\n" # debug_checks_output="File: ${source_relpath}\n" some_checks_failed=0 while read script_filepath; do path_include_match=0 path_include_found=0 path_exclude_match=0 path_exclude_found=0 # # Process check-path-exclude: # while read check_path_exclude; do path_exclude_found=1 if [[ $source_relpath = $check_path_exclude ]]; then path_exclude_match=1 break fi done<. # # Authors: Daniel Kopecek # # Tests the descriptor parser by parsing binary descriptor samples # and comparing the output with the expected output (files with .out # extension) # # Usage: test-descriptor-parser.sh # test-descriptor-parser.sh # if [ -z "$1" -o -z "$2" ]; then USBGUARD="$builddir/usbguard" DATADIR="$srcdir/src/Tests/USB/data/" else USBGUARD="$1" DATADIR="$2" fi TEMPDIR="$(mktemp -d --tmpdir usbguard-test-descriptor-parser.XXXXXX)" RETVAL=0 for sample in $DATADIR/*.bin; do OUTPUT_PATH="$TEMPDIR/$(basename -s .bin $sample).out" BINOUT_PATH="$DATADIR/$(basename -s .bin $sample).out" $USBGUARD read-descriptor "$sample" > "$OUTPUT_PATH" diff -u "$BINOUT_PATH" "$OUTPUT_PATH" if [ $? -ne 0 ]; then echo "FAILED: $sample" RETVAL=1 fi done if [ $RETVAL -eq 0 ]; then rm "$TEMPDIR"/*.out rmdir "$TEMPDIR" fi exit $RETVAL usbguard-0.7.2+ds/src/Tests/Unit/000077500000000000000000000000001325273707200165565ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Tests/Unit/test_Base64.cpp000066400000000000000000000073001325273707200213450ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include #include using namespace usbguard; TEST_CASE("Base64", "[Utility]") { SECTION("encoding/decoding empty value throws an exception") { std::string decoded; std::string encoded; REQUIRE_THROWS(encoded = base64Encode(decoded)); REQUIRE_THROWS(decoded = base64Decode(encoded)); } SECTION("encoded/decoded size estimation") { REQUIRE(base64EncodedSize(1) == 4); REQUIRE(base64EncodedSize(2) == 4); REQUIRE(base64EncodedSize(3) == 4); REQUIRE(base64EncodedSize(4) == 8); REQUIRE(base64EncodedSize(5) == 8); REQUIRE(base64EncodedSize(6) == 8); REQUIRE(base64DecodedSize(4) == 3); REQUIRE(base64DecodedSize(8) == 6); REQUIRE(base64DecodedSize(12) == 9); REQUIRE(base64DecodedSize(16) == 12); } SECTION("encoding and decoding") { std::vector> test_pairs = { { "a", "YQ==" }, { std::string("\x01", 1), "AQ==" }, { std::string("\x10", 1), "EA==" }, { "base64", "YmFzZTY0" }, { std::string("\x01\x23\x45\x67\x89", 5), "ASNFZ4k=" }, { "b", "Yg==" }, { "c", "Yw==" }, { "aa", "YWE=" }, { "ab", "YWI=" }, { "ba", "YmE=" }, { "bb", "YmI=" }, { "abc", "YWJj" }, { "bac", "YmFj" }, { "bca", "YmNh" }, { "cab", "Y2Fi" }, { "cba", "Y2Jh" }, { "A", "QQ==" }, { "Z", "Wg==" }, { "AA", "QUE=" }, { "AZ", "QVo=" }, { "ZZ", "Wlo=" }, { "/", "Lw==" }, { "//", "Ly8=" }, { "///", "Ly8v" }, { "+", "Kw==" }, { "++", "Kys=" }, { "+++", "Kysr" }, { std::string("\x00", 1), "AA==" }, { std::string("\xff", 1), "/w==" }, }; for (auto test_pair : test_pairs) { REQUIRE(test_pair.second == base64Encode(test_pair.first)); REQUIRE(test_pair.first == base64Decode(test_pair.second)); } } SECTION("decoding invalid inputs") { std::vector test_inputs = { { "Y=Q=" }, { "Y~g=" }, { ".Yw=" }, { "Y:E=" }, { "YWI:" }, { "YmVpc*Bv" }, { "cHdxbw@=" }, { "aX@3b2VyaQ==" }, { "cG9zb@tk" }, { "Zmxs;:pxOTIw" }, { "cHdXBy" }, { "<2l3cGVyaQ==" }, { ">nBvZXc=" }, { "c?93cm93aWVycA==" }, { "aTItNA=?" }, { "cG9?ZnNkb2lmd3BvZWly" }, { "cG9,,3Jw" }, { "b2l3,A==" }, { ",2Zzd2hyaTJndWdpdXBhW3B3cW9b" }, { "[1t3cHI=" }, { "]3B3Yw==" }, { "Ym[h" }, { "Y2F]" }, { "`2Jh" }, { "Q`==" }, { "Wg=`" }, { "QUE`" }, { "`Vo=" }, { "W_o=" }, { "L ==" }, { "Ly8 " }, { " y8v" }, { "K{}=" }, { "Kys{" }, { "Kys}" }, { "{w==" }, { "a" }, { "aa" }, { "aaa" }, { "bbbbb" }, { "bbbbbb" } }; for (auto test_input : test_inputs) { INFO("Testing input: " + test_input); REQUIRE_THROWS(base64Decode(test_input)); } } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_IPCServer_AccessControl.cpp000066400000000000000000000100631325273707200247450ustar00rootroot00000000000000// // Copyright (C) 2017 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/IPCServer.hpp" #include #include using namespace usbguard; TEST_CASE("IPCServer::AccessControl", "[Unit]") { SECTION("default constructed") { IPCServer::AccessControl ac; REQUIRE_THROWS(ac.hasPrivilege(IPCServer::AccessControl::Section::ALL, IPCServer::AccessControl::Privilege::LIST)); for (const auto& section : { IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Section::EXCEPTIONS }) { for (const auto& privilege : { IPCServer::AccessControl::Privilege::MODIFY, IPCServer::AccessControl::Privilege::LIST, IPCServer::AccessControl::Privilege::LISTEN }) { REQUIRE(!ac.hasPrivilege(section, privilege)); } } } SECTION("constructed") { IPCServer::AccessControl ac(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LIST); REQUIRE(ac.hasPrivilege(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LIST)); for (const auto& section : { IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Section::EXCEPTIONS }) { for (const auto& privilege : { IPCServer::AccessControl::Privilege::MODIFY, IPCServer::AccessControl::Privilege::LIST, IPCServer::AccessControl::Privilege::LISTEN }) { REQUIRE(!ac.hasPrivilege(section, privilege)); } } REQUIRE_NOTHROW(ac.clear()); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LIST)); } SECTION("parsed") { std::stringstream ss; ss << "Devices=list listen\n"; ss << "Policy=list modify\n"; IPCServer::AccessControl ac; REQUIRE_NOTHROW(ac.load(ss)); REQUIRE(ac.hasPrivilege(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LIST)); REQUIRE(ac.hasPrivilege(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::LISTEN)); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::DEVICES, IPCServer::AccessControl::Privilege::MODIFY)); REQUIRE(ac.hasPrivilege(IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::LIST)); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::LISTEN)); REQUIRE(ac.hasPrivilege(IPCServer::AccessControl::Section::POLICY, IPCServer::AccessControl::Privilege::MODIFY)); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Privilege::LIST)); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Privilege::LISTEN)); REQUIRE(!ac.hasPrivilege(IPCServer::AccessControl::Section::PARAMETERS, IPCServer::AccessControl::Privilege::MODIFY)); } SECTION("parse error") { std::stringstream ss; ss << "Devices=lisp drog listne\n"; ss << "Pulicy=list listen\n"; IPCServer::AccessControl ac; REQUIRE_THROWS(ac.load(ss)); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_Rule.cpp000066400000000000000000000044371325273707200212400ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/Rule.hpp" #include using namespace usbguard; TEST_CASE("Default constructed rule", "[Rule]") { Rule rule; SECTION("has default id") { REQUIRE(rule.getRuleID() == Rule::DefaultID); } SECTION("is implicit") { REQUIRE(rule.isImplicit()); } SECTION("has invalid target") { REQUIRE(rule.getTarget() == Rule::Target::Invalid); } SECTION("has empty attributes") { REQUIRE(rule.attributeDeviceID().empty()); REQUIRE(rule.attributeSerial().empty()); REQUIRE(rule.attributeName().empty()); REQUIRE(rule.attributeHash().empty()); REQUIRE(rule.attributeViaPort().empty()); REQUIRE(rule.attributeWithInterface().empty()); } SECTION("is not valid") { REQUIRE_FALSE(rule); } SECTION("cannot be converted to a string form unless forced to") { REQUIRE_THROWS(rule.toString()); REQUIRE_NOTHROW(rule.toString(/*invalid=*/true)); } } TEST_CASE("Target-only rule", "[RuleParser]") { Rule rule; SECTION("from/to string: allow") { REQUIRE_NOTHROW(rule = Rule::fromString("allow")); REQUIRE(rule.getTarget() == Rule::Target::Allow); REQUIRE(rule.toString() == "allow"); } SECTION("from/to string: block") { REQUIRE_NOTHROW(rule = Rule::fromString("block")); REQUIRE(rule.getTarget() == Rule::Target::Block); REQUIRE(rule.toString() == "block"); } SECTION("from/to string: reject") { REQUIRE_NOTHROW(rule = Rule::fromString("reject")); REQUIRE(rule.getTarget() == Rule::Target::Reject); REQUIRE(rule.toString() == "reject"); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_RuleAttribute_id.cpp000066400000000000000000000126431325273707200235760ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/Rule.hpp" #include using namespace usbguard; TEST_CASE("Parse rule with an id attribute", "[Parse]") { Rule rule; SECTION("old syntax") { REQUIRE_NOTHROW(rule = Rule::fromString("allow 1234:1234")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "1234"); REQUIRE_NOTHROW(rule = Rule::fromString("allow 1234:*")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow *:*")); REQUIRE(rule.getDeviceID().getVendorID() == "*"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow feab:cd05")); REQUIRE(rule.getDeviceID().getVendorID() == "feab"); REQUIRE(rule.getDeviceID().getProductID() == "cd05"); REQUIRE_NOTHROW(rule = Rule::fromString("allow 7896:*")); REQUIRE(rule.getDeviceID().getVendorID() == "7896"); REQUIRE(rule.getDeviceID().getProductID() == "*"); } SECTION("new syntax") { REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1234:1234")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "1234"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1234:*")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id *:*")); REQUIRE(rule.getDeviceID().getVendorID() == "*"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id feab:cd05")); REQUIRE(rule.getDeviceID().getVendorID() == "feab"); REQUIRE(rule.getDeviceID().getProductID() == "cd05"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id 7896:*")); REQUIRE(rule.getDeviceID().getVendorID() == "7896"); REQUIRE(rule.getDeviceID().getProductID() == "*"); } SECTION("set syntax") { REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { 1234:1234 }")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "1234"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { 1234:* }")); REQUIRE(rule.getDeviceID().getVendorID() == "1234"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { *:* }")); REQUIRE(rule.getDeviceID().getVendorID() == "*"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { feab:cd05 }")); REQUIRE(rule.getDeviceID().getVendorID() == "feab"); REQUIRE(rule.getDeviceID().getProductID() == "cd05"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { 7896:* }")); REQUIRE(rule.getDeviceID().getVendorID() == "7896"); REQUIRE(rule.getDeviceID().getProductID() == "*"); REQUIRE_NOTHROW(rule = Rule::fromString("allow id one-of { 1234:1234 abcd:effa aaaa:* }")); REQUIRE_THROWS(rule.getDeviceID().getVendorID()); REQUIRE_THROWS(rule.getDeviceID().getProductID()); REQUIRE(rule.attributeDeviceID().count() == 3); REQUIRE_THROWS(rule.attributeDeviceID().get()); REQUIRE(rule.attributeDeviceID().get(0).getVendorID() == "1234"); REQUIRE(rule.attributeDeviceID().get(0).getProductID() == "1234"); REQUIRE(rule.attributeDeviceID().get(1).getVendorID() == "abcd"); REQUIRE(rule.attributeDeviceID().get(1).getProductID() == "effa"); REQUIRE(rule.attributeDeviceID().get(2).getVendorID() == "aaaa"); REQUIRE(rule.attributeDeviceID().get(2).getProductID() == "*"); } } TEST_CASE("Match id attribute", "[Match]") { Rule device_rule = \ Rule::fromString("device id 1d6b:0002 serial \"dummy_hcd.0\" name \"Dummy host controller\" hash \"FSgk48/lKiTJWdqOqkHLuMQr155m+ux+ozIb17HHcKs=\" parent-hash \"zUhq0ExS41FTVEO5sce8eOOyMrPsfwQEeVz0kH6IAhc=\" via-port \"usb1\" with-interface 09:00:00"); Rule rule; SECTION("vendor and product") { REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1d6b:0002")); REQUIRE(rule.appliesTo(device_rule)); REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1d6b:0003")); REQUIRE(!rule.appliesTo(device_rule)); REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1d6a:0002")); REQUIRE(!rule.appliesTo(device_rule)); } SECTION("vendor only") { REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1d6b:*")); REQUIRE(rule.appliesTo(device_rule)); REQUIRE_NOTHROW(rule = Rule::fromString("allow id 1d6a:*")); REQUIRE(!rule.appliesTo(device_rule)); } SECTION("any") { REQUIRE_NOTHROW(rule = Rule::fromString("allow id *:*")); REQUIRE(rule.appliesTo(device_rule)); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_RuleParser.cpp000066400000000000000000000210241325273707200224040ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include "usbguard/Rule.hpp" #include using namespace usbguard; TEST_CASE("Non-printable characters in a rule string", "[RuleParser]") { Rule rule, rule_from; std::string rule_string; const uint8_t non_printable_cstr[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0xAA, 0xBB, 0xFF }; const size_t non_printable_size = sizeof non_printable_cstr; const std::string non_printable_string((const char*)non_printable_cstr, non_printable_size); SECTION("to/from string: allow serial \"\"") { rule.setTarget(Rule::Target::Allow); rule.setSerial(non_printable_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow serial \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow serial \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow name \"\"") { rule.setTarget(Rule::Target::Allow); rule.setName(non_printable_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow name \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow name \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow hash \"\"") { rule.setTarget(Rule::Target::Allow); rule.setHash(non_printable_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow hash \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow hash \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow via-port \"\"") { const std::vector one_non_printable_string = { non_printable_string }; rule.setTarget(Rule::Target::Allow); rule.attributeViaPort().set(one_non_printable_string, Rule::SetOperator::Equals); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow via-port \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow via-port \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow via-port { \"\" \"\" }") { const std::vector two_non_printable_strings = \ { non_printable_string, non_printable_string }; rule.setTarget(Rule::Target::Allow); rule.attributeViaPort().set(two_non_printable_strings, Rule::SetOperator::OneOf); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow via-port one-of { \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\" \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\" }"); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow via-port one-of { \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\" \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\xaa\\xbb\\xff\" }"); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } } TEST_CASE("Double quote and backslash characters in a rule string", "[RuleParser]") { Rule rule, rule_from; std::string rule_string; const std::string dqb_string("\" \\ \"\" \\\\ \\\" \"\\"); const std::string dqb_string_escaped("\\\" \\\\ \\\"\\\" \\\\\\\\ \\\\\\\" \\\"\\\\"); SECTION("to/from string: allow serial \"\"") { rule.setTarget(Rule::Target::Allow); rule.setSerial(dqb_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow serial \"" + dqb_string_escaped + "\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow serial \"" + dqb_string_escaped + "\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow name \"\"") { rule.setTarget(Rule::Target::Allow); rule.setName(dqb_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow name \"" + dqb_string_escaped + "\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow name \"" + dqb_string_escaped + "\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow hash \"\"") { rule.setTarget(Rule::Target::Allow); rule.setHash(dqb_string); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow hash \"" + dqb_string_escaped + "\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow hash \"" + dqb_string_escaped + "\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow via-port \"\"") { const std::vector one_dqb_string = { dqb_string }; rule.setTarget(Rule::Target::Allow); rule.attributeViaPort().set(one_dqb_string, Rule::SetOperator::Equals); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow via-port \"" + dqb_string_escaped + "\""); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow via-port \"" + dqb_string_escaped + "\""); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } SECTION("to/from string: allow via-port { \"\" \"\" }") { const std::vector two_dqb_strings = { dqb_string, dqb_string }; rule.setTarget(Rule::Target::Allow); rule.attributeViaPort().set(two_dqb_strings, Rule::SetOperator::OneOf); REQUIRE_NOTHROW(rule_string = rule.toString()); REQUIRE(rule_string == "allow via-port one-of { \"" + dqb_string_escaped + "\" \"" + dqb_string_escaped + "\" }"); REQUIRE_NOTHROW(rule_from = Rule::fromString(rule_string)); REQUIRE_NOTHROW(rule_string = rule_from.toString()); REQUIRE(rule_string == "allow via-port one-of { \"" + dqb_string_escaped + "\" \"" + dqb_string_escaped + "\" }"); REQUIRE(rule.appliesTo(rule_from)); REQUIRE(rule_from.appliesTo(rule)); REQUIRE(rule_from.getTarget() == Rule::Target::Allow); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_UEvent.cpp000066400000000000000000000045771325273707200215440ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include #include using namespace usbguard; TEST_CASE("Default constructed UEvent", "[UEvent]") { UEvent uevent; SECTION("empty") { REQUIRE_NOTHROW(uevent.getAttribute("KEY1")); REQUIRE(uevent.getAttribute("KEY1") == std::string()); REQUIRE_FALSE(uevent.hasAttribute("KEY1")); REQUIRE_FALSE(uevent.hasRequiredAttributes()); REQUIRE_NOTHROW(uevent.clear()); } SECTION("set/get attribute") { REQUIRE_NOTHROW(uevent.setAttribute("KEY1", "value1")); REQUIRE(uevent.getAttribute("KEY1") == "value1"); REQUIRE(uevent.hasAttribute("KEY1")); REQUIRE_FALSE(uevent.hasRequiredAttributes()); REQUIRE_NOTHROW(uevent.clear()); } SECTION("string serialization") { REQUIRE_THROWS(uevent.getHeaderLine()); REQUIRE_THROWS(uevent.toString()); } } TEST_CASE("UEvent with required attributes", "[UEvent]") { UEvent uevent; REQUIRE_NOTHROW(uevent.setAttribute("ACTION", "add")); REQUIRE_NOTHROW(uevent.setAttribute("DEVPATH", "/bus/usb/devices/usb1")); REQUIRE_NOTHROW(uevent.setAttribute("SUBSYSTEM", "usb_device")); SECTION("non-existing attribute") { REQUIRE_NOTHROW(uevent.getAttribute("KEY1")); REQUIRE(uevent.getAttribute("KEY1") == std::string()); REQUIRE_FALSE(uevent.hasAttribute("KEY1")); } SECTION("set/get attribute") { REQUIRE_NOTHROW(uevent.setAttribute("KEY1", "value1")); REQUIRE(uevent.getAttribute("KEY1") == "value1"); REQUIRE(uevent.hasAttribute("KEY1")); } SECTION("string serialization") { REQUIRE(uevent.hasRequiredAttributes()); REQUIRE_NOTHROW(uevent.getHeaderLine()); REQUIRE_NOTHROW(uevent.toString()); } } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_UEventParser.cpp000066400000000000000000000064271325273707200227150ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include #include using namespace usbguard; TEST_CASE("UEvent parsing", "[UEventParser]") { const char uevent_string[] = { 'a', 'd', 'd', '@', '/', 'd', 'e', 'v', 'i', 'c', 'e', 's', '/', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '/', 'd', 'u', 'm', 'm', 'y', '_', 'h', 'c', 'd', '.', '0', '/', 'u', 's', 'b', '1', 0x00, 'A', 'C', 'T', 'I', 'O', 'N', '=', 'a', 'd', 'd', 0x00, 'D', 'E', 'V', 'P', 'A', 'T', 'H', '=', '/', 'd', 'e', 'v', 'i', 'c', 'e', 's', '/', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '/', 'd', 'u', 'm', 'm', 'y', '_', 'h', 'c', 'd', '.', '0', '/', 'u', 's', 'b', '1', 0x00, 'S', 'U', 'B', 'S', 'Y', 'S', 'T', 'E', 'M', '=', 'u', 's', 'b', 0x00, 'M', 'A', 'J', 'O', 'R', '=', '1', '8', '9', 0x00, 'M', 'I', 'N', 'O', 'R', '=', '0', 0x00, 'D', 'E', 'V', 'N', 'A', 'M', 'E', '=', 'b', 'u', 's', '/', 'u', 's', 'b', '/', '0', '0', '1', '/', '0', '0', '1', 0x00, 'D', 'E', 'V', 'T', 'Y', 'P', 'E', '=', 'u', 's', 'b', '_', 'd', 'e', 'v', 'i', 'c', 'e', 0x00, 'D', 'R', 'I', 'V', 'E', 'R', '=', 'u', 's', 'b', 0x00, 'P', 'R', 'O', 'D', 'U', 'C', 'T', '=', '1', 'd', '6', 'b', '/', '2', '/', '4', '0', '1', 0x00, 'T', 'Y', 'P', 'E', '=', '9', '/', '0', '/', '1', 0x00, 'B', 'U', 'S', 'N', 'U', 'M', '=', '0', '0', '1', 0x00, 'D', 'E', 'V', 'N', 'U', 'M', '=', '0', '0', '1', 0x00, 'S', 'E', 'Q', 'N', 'U', 'M', '=', '1', '1', '1', '7', 0x00 }; const size_t uevent_strlen = sizeof uevent_string; UEvent uevent; REQUIRE_NOTHROW(uevent = UEvent::fromString(std::string(uevent_string, uevent_strlen), /*attributes_only=*/false, /*trace=*/true)); REQUIRE(uevent.hasRequiredAttributes()); REQUIRE(uevent.getAttribute("ACTION") == "add"); REQUIRE(uevent.getAttribute("DEVPATH") == "/devices/platform/dummy_hcd.0/usb1"); REQUIRE(uevent.getAttribute("SUBSYSTEM") == "usb"); REQUIRE(uevent.getAttribute("MAJOR") == "189"); REQUIRE(uevent.getAttribute("MINOR") == "0"); REQUIRE(uevent.getAttribute("DEVNAME") == "bus/usb/001/001"); REQUIRE(uevent.getAttribute("DEVTYPE") == "usb_device"); REQUIRE(uevent.getAttribute("DRIVER") == "usb"); REQUIRE(uevent.getAttribute("PRODUCT") == "1d6b/2/401"); REQUIRE(uevent.getAttribute("TYPE") == "9/0/1"); REQUIRE(uevent.getAttribute("BUSNUM") == "001"); REQUIRE(uevent.getAttribute("DEVNUM") == "001"); REQUIRE(uevent.getAttribute("SEQNUM") == "1117"); REQUIRE_NOTHROW(uevent.getHeaderLine()); REQUIRE_NOTHROW(uevent.toString()); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/Unit/test_Utility.cpp000066400000000000000000000032631325273707200217700ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #include #include using namespace usbguard; TEST_CASE("parentPath", "[Utility]") { REQUIRE(parentPath("/a/b/c/d") == "/a/b/c"); REQUIRE(parentPath("/a/b/c/d/") == "/a/b/c"); REQUIRE(parentPath("/a/b/c/d//") == "/a/b/c"); REQUIRE(parentPath("/a/b/c/d///") == "/a/b/c"); REQUIRE(parentPath("/a/parent/child") == "/a/parent"); REQUIRE(parentPath("/foo/bar") == "/foo"); REQUIRE(parentPath("/foo/bar/") == "/foo"); REQUIRE(parentPath("/foo/bar//") == "/foo"); REQUIRE(parentPath("/foo") == std::string()); REQUIRE(parentPath("/foo/") == std::string()); REQUIRE(parentPath("/") == std::string()); REQUIRE(parentPath("//") == std::string()); REQUIRE(parentPath("///") == std::string()); REQUIRE(parentPath("//foo") == std::string()); REQUIRE(parentPath("//foo//") == std::string()); REQUIRE(parentPath("") == std::string()); REQUIRE(parentPath(std::string()) == std::string()); } /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/UseCase/000077500000000000000000000000001325273707200171675ustar00rootroot00000000000000usbguard-0.7.2+ds/src/Tests/UseCase/000_executable.sh000077500000000000000000000021701325273707200222260ustar00rootroot00000000000000#!/bin/bash # # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # # Test whether the binaries are executable as expected (no linker errors, etc.) # source "${USBGUARD_TESTLIB_BASH}" || exit 129 schedule "${USBGUARD}" schedule "${USBGUARD}" :valgrind schedule "${USBGUARD_DAEMON} -h" schedule "${USBGUARD_DAEMON} -h" :valgrind [ -f "${USBGUARD_DBUS}" ] && schedule "${USBGUARD_DBUS} -h" [ -f "${USBGUARD_DBUS}" ] && schedule "${USBGUARD_DBUS} -h" :valgrind execute 10 usbguard-0.7.2+ds/src/Tests/UseCase/001_cli_policy.sh000077500000000000000000000044411325273707200222370ustar00rootroot00000000000000#!/bin/bash # # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # # Test whether the binaries are executable as expected (no linker errors, etc.) # source "${USBGUARD_TESTLIB_BASH}" || exit 129 # # Skip the test if the kernel doesn't export the USB # device directory. # [ -d "/sys/bus/usb/devices" ] || exit 77 #set -x # TODO? Move to testlib export USBGUARD_TESTLIB_TMPDIR="$(mktemp -d --tmpdir usbguard-test.XXXXXX)" export config_path="${USBGUARD_TESTLIB_TMPDIR}/daemon.conf" export policy_path="${USBGUARD_TESTLIB_TMPDIR}/policy.conf" function test_cli_policy() { set -e sleep 4 c=$(${USBGUARD} list-rules | wc -l) # TODO [ $c -eq 0 ] || return 1 ${USBGUARD} append-rule block c=$(${USBGUARD} list-rules | wc -l) # TODO [ $c -eq 1 ] || return 1 ${USBGUARD} remove-rule 1 c=$(${USBGUARD} list-rules | wc -l) # TODO [ $c -eq 0 ] || return 1 ${USBGUARD} generate-policy ${USBGUARD} generate-policy -p ${USBGUARD} generate-policy -P ${USBGUARD} generate-policy -t block ${USBGUARD} generate-policy -t allow ${USBGUARD} generate-policy -t reject ${USBGUARD} generate-policy -X ${USBGUARD} generate-policy -H ${USBGUARD} generate-policy -h set +e return 0 } cat > "$config_path" < "$policy_path" <. # # Authors: Daniel Kopecek # # Test whether the binaries are executable as expected (no linker errors, etc.) # source "${USBGUARD_TESTLIB_BASH}" || exit 129 # # Skip the test if the kernel doesn't export the USB # device directory. # [ -d "/sys/bus/usb/devices" ] || exit 77 #set -x # TODO? Move to testlib export USBGUARD_TESTLIB_TMPDIR="$(mktemp -d --tmpdir usbguard-test.XXXXXX)" export config_path="${USBGUARD_TESTLIB_TMPDIR}/daemon.conf" export policy_path="${USBGUARD_TESTLIB_TMPDIR}/policy.conf" function test_cli_devices() { set -e sleep 4 ${USBGUARD} list-devices ${USBGUARD} list-devices -a ${USBGUARD} list-devices -b local id="$(${USBGUARD} list-devices | sed -n 's|^\([0-9]\+\):.*serial "555666111".*$|\1|p')" if [ -z "$id" ]; then echo "Test error: Unable to find/parse device ID" exit 1 fi ${USBGUARD} block-device "$id" ${USBGUARD} allow-device "$id" ${USBGUARD} block-device "$id" ${USBGUARD} reject-device "$id" set +e return 0 } cat > "$config_path" < "$policy_path" <. # # Authors: Daniel Kopecek # # Test whether the binaries are executable as expected (no linker errors, etc.) # source "${USBGUARD_TESTLIB_BASH}" || exit 129 #set -x # TODO? Move to testlib export USBGUARD_TESTLIB_TMPDIR="$(mktemp -d --tmpdir usbguard-test.XXXXXX)" export config_path="${USBGUARD_TESTLIB_TMPDIR}/daemon.conf" export policy_path="${USBGUARD_TESTLIB_TMPDIR}/policy.conf" function test_cli_devices() { set -e sleep 4 ${USBGUARD} list-devices ${USBGUARD} list-devices -a ${USBGUARD} list-devices -b local id="$(${USBGUARD} list-devices | sed -n 's|^\([0-9]\+\):.*hash "FSgk48/lKiTJWdqOqkHLuMQr155m+ux+ozIb17HHcKs=".*$|\1|p')" if [ -z "$id" ]; then echo "Test error: Unable to find/parse device ID" exit 1 fi ${USBGUARD} block-device "$id" ${USBGUARD} allow-device "$id" ${USBGUARD} block-device "$id" set +e return 0 } cat > "$config_path" < "$policy_path" <. # # Authors: Jiri Vymazal # # Test whether the binaries are executable as expected (no linker errors, etc.) # source "${USBGUARD_TESTLIB_BASH}" || exit 129 # TODO? Move to testlib export USBGUARD_TESTLIB_TMPDIR="$(mktemp -d --tmpdir usbguard-test.XXXXXX)" export config_path="${USBGUARD_TESTLIB_TMPDIR}/daemon.conf" export pidfile_path="${USBGUARD_TESTLIB_TMPDIR}/usbguard.pid" export logfile="${USBGUARD_TESTLIB_TMPDIR}/daemon.log" function test_cli_daemonize() { sleep 5 if [ ! -f "$pidfile_path" ]; then echo "Test error: PID file for usbguard not present" exit 1 fi if [ ! `pgrep usbguard` == `cat $pidfile_path` ]; then echo "Test error: PID of usbguard daemon not present in PID file" exit 1 fi } cat > "$config_path" <qhƛsl{"nG۞}P;B!OU9|HCKaaN 2lMի;.ʂU[8a8';dL^Zkl/wGs|P Hdnr^Wk~< sPiDf#NR_zN o;2 c ~D2DPk*NDC{,zX G?d KY?Rnu\ѳZ#XK9d943#-H/Mu7W ܯ)Ѻ钰Oj4J!;VkޕV/qwҷe-} )gJrR )9tEf8זjʄ]O% ڃ!J]z+ kƝy Q5:Q!4Z L%.}}+XWX6.Q1T `8|^p,b[+cՙ6bQBkH\Y\ qÿcbC/k4&mj=i#8,rn@?4l˭#7/o2fHn\`9%yci59˱D Uԝ!ЧQ|#qQ1 0w?/+mi#dS%F!l'asjPXulc6߀wg{R;+C'p1ƘOAl[FмFnŊu!@M۶]:ث5E?ϱaBwl]׊%>;otKdd0TJן8 CjJ+ %wŮuF}a_ϯzL>Jz(\t?(a AuDoE2@l\P- ʭ\3h7g )%*6gW!~CP nMќ<F&_[. P^0 Wy!O#a ?D(ͺq3hs כ`͑(깜\K0]CN2[ r%69( @*n)aw$%6h*ʍKϸ[ J.?NUW%(h6NyVwD_Js ăUd-ELDu.tOeκ>UNCw,$g/fPℎeXfV.*I2(VC( #/#TGw|9Ѻ ?է*ǐ U޹AVi{Y )Ӊ NHv伩0Q(^jZK[$1x ڐr$E]>P f/LM: ցjdKX?7|m֨! \+ IV99e9TK,YؽnhtSL*(qK/+m6M<5C<%wњ Z|$釾7g c3m].CyKri1`7o^^$4GV,ZΧpdԢTt LFn:[{}$[꧹xg YcꤹS{:&"|uMJ(6!@aKP 1\ny*S s!.Mpr5撡ufAq5a! Rh5Q̘ Ks([+Vϼ4"gMݦ |O1EvFa9S xv q>nQ?I_ T^癮)XZV;dWߜ@oR=Z^_ЯwAX0ӻ3ɕUP:|OH m|]*n+&` fwo[EThTEiFd`yjJu z3-R\a VkF*֝;_\{G:=K@D҅ 5D%U7z:kI-;l<~ji6Ή="3KϱUGz*oI&㽅wqU\^zvil)3_Sl*x*a K)gp=rTK)S蠹tmd3r.&,2DԉjdNGrEwA'vg$FqE_z$#9YJ"X+/ߴ'}`}gAJ.mwrk=Rv܂V1}}#`~Mx| H|XTbP\]z<E,CH]T~V0@X.~π"kz$+ [zw)vSeo ]{4.d-ˤ+B7;>##ޤ$ ]㉈aҞt ?8\ݡ{\^fKd4S3 rQTCG"d*АP) 2/n:b]8L &fN MA¹j~s'y`ՃF-*/nzdf,N"qZ2r_w#i$ܕmʨ`PGA%P=]LwftGD^ZRl|Qj`v*S30:twG_U_K$=(jn_ܟ??x ʹtz4yB`O =":~W}[H,~y$bZ.*XJ`X׀%q Aex` jm7n s(iIR_M,M?'M*RlEiV~-|G)p!oc:˴ 8 ߊ3-;,}4чM0ю5 :x͒j"4Qʾ GpEbw%&l蹋TބRZ_-86=ۦ9KvHq 9i< rg0@9{mMx`z [x7+hjsJҀ@0p@aµzr%Y͉B܎Qye(&$}N2M|q,WХh+1s޾U3]ӍT '3=- .Irg;"Vߣ% Ӏ_6' -vu6?.'cm.ҔiKM_,3ہ HV?q7vZ/o+ÖπU po$`F8f?z-_}SËTpZ@_xNt%NnNڦӿ_W2-^ƝtwoeS`?*Aݳ6/EJ>.In.x- BtFrMTԃ+`1u*#[Xg).x nyŞBLnSVa1(7J Aa؅/fO3w!> C!ٗů4pILsy>r6t- C ˲^Ǝ# fJtA$4VC9':ҺEYEoCXw0 LDy$\mopK*㝳u0%yVﲵݮآ@8|NY4Mm4.#[^[ 0[!k!giWH% Qt5/HFoxN<-C#sE)/"<_͢:q+kFnk'toE%ɡA#{yh=;QώFyୠ_{:@'-aK(&1;u7v׊8Ŀ -m3KwVFjE %OKsG5 9ٺ 1}e.*Lm<]Bí= BjNŐUTCOW`/\$ H}td\5 ȵG@vbxE[\i==l^Iܳ־O}7|jb fVH7DuY6zx1Eg' E *FŔ][ ma]qyX :8ބgwPM{zbck0Q![*g!5L6[&,F?ڎ, 2Z6 1=g0eUS^2t&Plߥp!c&]7mULA /K+ i8Fj{ݛ`ۖ VۻɓΉ'I/«uG5^0Y ۝0}δ{^s1X/ -ݖȟ+g0*HE r  AVfqGYz`fT5F5Y ֢v+vnO,쟭Vfp7"&+Uwj̸tXd5]:KR>]FrlZgAz@\&ϗDk*YJd/JҸK:RӬ/ЂC1O_mujR^-?CT/ eBi"2`%9/oAv1 2rh#Si%~ED7*~6tYE/^@AѴ7X/nmFkNA 䶽.2ݑ>=Z$[#y(W]z#H'@U2&41=Y[)_ I9?R!9l|Ǧ`J BBfS=&j*rf1\TKd8fM"#Z;<2w>椯dkK4R-g:DsuP^*iZgݟ4}:ŀR̯ݭ$w`Y0?- yq:$icگ% SR$_ll:j"`ym|ݡŌ+gW3!>f=}Y22X48/oRbc>U@)ΟdKI *<7)P>țde?Cy~HTB#^|P61^5E_-qW% &@YZ'Z9i@%i]Y7klNHàcܜCu5vE}{o!.ecRڊȥ#sΑUff"P0-NJr3._ȁ2H]dA+ AD/Tp򼔓\'[+>?_3(@z6)ꥍVX.F3/1^}s!sqȴy*,,zČ=!pvJŠ|(Y LPo__^ր"Be](v D8huƕ[%Qų?`s W9!(^қUhE 0Ii)WqsK!A.1 l66<(ЬĘR91TeQҠ2jyqѾ$[I031 θCPKAR0e/alAf'gvCXN03E1M( ?E1Җ oF:~~K\Y|)]^DZt(N*jП'11 PrPrvL_{ToE' W$ET{Gx¸ ET6DO&d?3WY]i)Hu yH7?=~i[u WUF]4CɇGNQ:FV$${tS7e+shՋ tc?K>"nw0ّ-sD:0()Na@q`~q;>MvP>yNIgH۸ Q6 /J8V '},&؝P|TĻe]Qc(i a.o%od`ľ=n͘)A@#jMAP e2<;ɢ|*X{2GlGGL=&A cFcvfL"u;a\J8F\Zl=E~o]HG&5߶ M/:IhQ;95XٖgX8822Y6]-o Ґ=.^j/y' uBc]*:i٠.n1^˛ʿ)ob>PXDR6fk\+>$u)͞ BýL]o"ڤ&/Eh@>cMj;} -KZMwRK㭪C(ݱ J g{/MWVI26-[ ůq"ͻVegAӿ'KU`̳ K ?OGHqv'\E >SXG=3R\.Fits-̔9n}N!@Uĵ A9 Y6^63t鼳?IBynJbdV{gb۾Qm뚆(!^as"ü#8,?ཱིٞ5Ԓf;z\Nl|Q}3QK9;\HO8#;]ږnaLK67ǔrC72%~oMQ!ySOĠw)mMbۂXy˗ fU3$vb&Qjc mkjXWF1>ϤXx[;=/:v,f.J=M 9Sx"MNq'M(CKE3QX7r>&*hq c5KZHRL6| -@HVPo3ߠ&Z1is& l6ڡ8zl̺ ;PbEK 5.hB03|#7ѷrR#?M GOsg-z1uc.ՀVǬCK*)sбgYZusbguard-0.7.2+ds/src/Tests/bash-testlib.sh000077500000000000000000000136521325273707200205660ustar00rootroot00000000000000#!/bin/bash # # Copyright (C) 2016 Red Hat, 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 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 . # # Authors: Daniel Kopecek # # uncomment for debugging set -x COMMAND_QUEUE=() COMMAND_JOBID=() COMMAND_STATE=() COMMAND_SETUP=() COMMAND_OFILE=() function schedule() { local command="$1" local setup="$2" COMMAND_QUEUE[${#COMMAND_QUEUE[@]}]="$command" COMMAND_JOBID[${#COMMAND_JOBID[@]}]=0 COMMAND_STATE[${#COMMAND_STATE[@]}]=0 COMMAND_SETUP[${#COMMAND_SETUP[@]}]="$setup" COMMAND_OFILE[${#COMMAND_OFILE[@]}]="/dev/null" COMMAND_VFILE[${#COMMAND_VFILE[@]}]="/dev/null" } # # setup: :[:...] # # service ... indicates that the command starts a long # running service requiring an explicit # action/command to shutdown gracefully. # # sudo ... run via `sudo -n` # # fail ... non-zero command return code is required (expected) # # # state: # # 0 ... not started # 1 ... started # 2 ... failed # 3 ... finished # # # Handle child processes. Save exit code in COMMAND_ # function handle_SIGCHLD() { for j in $(jobs -n); do echo "Job: $j" done } function execute() { local timeout=${1:=30} local job_count=${#COMMAND_QUEUE[@]} local job_start=$(date +%s) local job_rc=0 local valgrind="" if [ -n "$USBGUARD_TESTS_VALGRIND" ]; then valgrind="$(which valgrind)" fi if [ "$USBGUARD_TESTS_VALGRIND" = "off" ]; then valgrind="" else valgrind="$USBGUARD_TESTS_VALGRIND" fi set +m # Setup SIGCHLD trap trap handle_SIGCHLD SIGCHLD # Execute commands in background for ((i = 0; i < $job_count; ++i)) { local setup="${COMMAND_SETUP[$i]}" local sudocmd="" local valgrindcmd="" local valgrindlog="" local valgrindenv="" if echo "$setup" | grep -q ':sudo'; then sudocmd="sudo -n -- " fi if test -n "$valgrind"; then if echo "$setup" | grep -q ':valgrind'; then valgrindlog="$(mktemp --tmpdir usbguard-test-${job_start}_job_${i}.XXXXX.vglog)" valgrindenv="env G_SLICE=always-malloc G_DEBUG=gc-friendly" valgrindcmd="$valgrindenv $valgrind --trace-children=yes --leak-check=full --show-leak-kinds=definite,possible --log-file=$valgrindlog" for supp in ${srcdir}/src/Tests/*.supp; do valgrindcmd="$valgrindcmd --suppressions=$supp " done valgrindcmd="$valgrindcmd -- " fi fi local command="$sudocmd $valgrindcmd ${COMMAND_QUEUE[$i]}" local logfile="$(mktemp --tmpdir usbguard-test-${job_start}_job_${i}.XXXXXX.log)" $command 2>&1 > "$logfile" & COMMAND_JOBID[$i]="$!" COMMAND_STATE[$i]="1" COMMAND_OFILE[$i]="$logfile" COMMAND_VFILE[$i]="$valgrindlog" } # Wait for jobs, check timeout while true; do local jobwait=no local joblist="$(jobs -lr)" local curtime="$(date +%s)" # # For each command in the queue: # 1) check whether it is still running # 2) if non-service commands are still running # for ((i = 0; i < $job_count; ++i)) do local jobid="${COMMAND_JOBID[$i]}" local setup="${COMMAND_SETUP[$i]}" # # Check whether the job is still running # if echo "$joblist" | grep -q "$jobid"; then if ! echo "$setup" | grep -q ":service"; then jobwait=yes fi fi done if [ "x$jobwait" = "xyes" ]; then # # Check test timeout # if (( (curtime - job_start) > timeout)); then break else sleep 1 fi else break fi done # # Cleanup jobs, stop service jobs # for ((i = 0; i < $job_count; ++i)) do local command="${COMMAND_QUEUE[$i]}" local jobid="${COMMAND_JOBID[$i]}" local setup="${COMMAND_SETUP[$i]}" local logfile="${COMMAND_OFILE[$i]}" local valgrindlog="${COMMAND_VFILE[$i]}" local sudocmd="" if echo "$setup" | grep -q ':sudo'; then sudocmd="sudo -n -- " fi if echo "$setup" | grep -q ":service"; then for p in $(pgrep -P "$jobid") "$jobid"; do $sudocmd kill -SIGTERM "$p" done local waittime=0 while true; do local joblist="$(jobs -lr)" if ! echo "$joblist" | grep -q "$jobid"; then wait "$jobid" if [ $? -ne 0 ]; then job_rc=1 fi rm -f "$logfile" break else sleep 1 waittime=$((waittime + 1)) if (( waittime > 10 )); then $sudocmd kill -SIGKILL "$jobid" wait "$jobid" job_rc=1 break fi fi done else wait "$jobid" if [ $? -ne 0 ]; then job_rc=1 else rm -f "$logfile" fi fi if test -n "$valgrind"; then if echo "$setup" | grep -q ":valgrind"; then # # Check valgrind results # if ! grep -q '^==\([0-9]*\)==.*no leaks are possible' "$valgrindlog"; then if [ "$(grep -c '^==\([0-9]*\)==.*lost: 0' "$valgrindlog")" -ne 3 ]; then job_rc=1 echo "============ VALGRIND ERROR ==============" echo "= Command: $command" echo "= Logfile: $valgrindlog" echo "--- snip ---- snip ---- snip ---- snip ---" cat "${valgrindlog}" echo "==========================================" fi fi fi fi done return $job_rc } usbguard-0.7.2+ds/src/Tests/custom.supp000066400000000000000000000003221325273707200200570ustar00rootroot00000000000000# # No Copyright # This file has been released into the public domain. # { Memcheck:Leak match-leak-kinds: possible ... obj:*glib-2.0* obj:*gobject-2.0* ... fun:call_init ... } usbguard-0.7.2+ds/src/Tests/main.cpp000066400000000000000000000014631325273707200172730ustar00rootroot00000000000000// // Copyright (C) 2016 Red Hat, 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 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 . // // Authors: Daniel Kopecek // #define CATCH_CONFIG_MAIN #include /* vim: set ts=2 sw=2 et */ usbguard-0.7.2+ds/src/Tests/test-driver000077500000000000000000000112331325273707200200350ustar00rootroot00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Print out the test suite log in case of a failure if test $estatus != 0; then sed -e "s|^|$log_file: |" $log_file fi # 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: usbguard-0.7.2+ds/src/astylerc000066400000000000000000000006111325273707200163040ustar00rootroot00000000000000--style=kr --indent=spaces=2 --indent-namespaces --indent-after-parens --indent-labels --indent-preproc-block --indent-preproc-define --indent-col1-comments --break-blocks --pad-comma --pad-header --delete-empty-lines --align-pointer=type --align-reference=type --break-closing-braces --break-one-line-headers --break-blocks --add-braces --convert-tabs --close-templates --max-code-length=128 usbguard-0.7.2+ds/src/build-config.h.in.in000066400000000000000000000220171325273707200202640ustar00rootroot00000000000000/* src/build-config.h.in.in. Generated from configure.ac by autoheader. */ /* Address Sanitizer is enabled */ #undef ASAN_ENABLED /* Binaries root directory */ #undef BINDIR /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Data directory */ #undef DATADIR /* Data root directory */ #undef DATAROOTDIR /* Documentation directory */ #undef DOCDIR /* Exec Prefix */ #undef EXEC_PREFIX /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Required GLib DBus API available */ #undef HAVE_DBUS /* Define to 1 if you have the declaration of `audit_encode_nv_string', and to 0 if you don't. */ #undef HAVE_DECL_AUDIT_ENCODE_NV_STRING /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_EXT_STDIO_FILEBUF_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* cap-ng API usable */ #undef HAVE_LIBCAPNG /* libgcrypt API available */ #undef HAVE_LIBGCRYPT /* libqb API available */ #undef HAVE_LIBQB /* libsodium API available */ #undef HAVE_LIBSODIUM /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_HI /* Linux Audit API available */ #undef HAVE_LINUX_AUDIT /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* 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_NETDB_H /* PEGTL version less than or equal to 1.3.1 */ #undef HAVE_PEGTL_LTE_1_3_1 /* Required PolicyKit modules available */ #undef HAVE_POLKIT /* Qt 4.x development files available */ #undef HAVE_QT4 /* Qt 5.x development files available */ #undef HAVE_QT5 /* 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 `regcomp' function. */ #undef HAVE_REGCOMP /* seccomp API usable */ #undef HAVE_SECCOMP /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* UEVENT netlink socket support */ #undef HAVE_UEVENT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Include directory */ #undef INCLUDEDIR /* Libexec directory */ #undef LIBEXECDIR /* Local state directory */ #undef LOCALSTATEDIR /* 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 /* Debug build disabled */ #undef NDEBUG /* 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 /* Prefix */ #undef PREFIX /* Disable asserts in the Quex generated lexer */ #undef QUEX_OPTION_ASSERTS_DISABLED /* System binaries root directory */ #undef SBINDIR /* Shared state directory */ #undef SHAREDSTATEDIR /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* System config root directory */ #undef SYSCONFDIR /* Enable systemd support int the project */ #undef SYSTEMD_SUPPORT_ENABLED /* Thread Sanitizer is enabled */ #undef TSAN_ENABLED /* Default USBGuard daemon config path */ #undef USBGUARD_DAEMON_CONF_PATH /* Use libsodium as crypto backend */ #undef USBGUARD_USE_LIBGCRYPT /* Use libsodium as crypto backend */ #undef USBGUARD_USE_LIBSODIUM /* Version number of package */ #undef VERSION /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* 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 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* 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 the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ #undef vfork usbguard-0.7.2+ds/usbguard-daemon.conf.in000066400000000000000000000115521325273707200203030ustar00rootroot00000000000000# # Rule set file path. # # The USBGuard daemon will use this file to load the policy # rule set from it and to write new rules received via the # IPC interface. # # RuleFile=/path/to/rules.conf # RuleFile=%sysconfdir%/usbguard/rules.conf # # Implicit policy target. # # How to treat devices that don't match any rule in the # policy. One of: # # * allow - authorize the device # * block - block the device # * reject - remove the device # ImplicitPolicyTarget=block # # Present device policy. # # How to treat devices that are already connected when the # daemon starts. One of: # # * allow - authorize every present device # * block - deauthorize every present device # * reject - remove every present device # * keep - just sync the internal state and leave it # * apply-policy - evaluate the ruleset for every present # device # PresentDevicePolicy=apply-policy # # Present controller policy. # # How to treat USB controllers that are already connected # when the daemon starts. One of: # # * allow - authorize every present device # * block - deauthorize every present device # * reject - remove every present device # * keep - just sync the internal state and leave it # * apply-policy - evaluate the ruleset for every present # device # PresentControllerPolicy=keep # # Inserted device policy. # # How to treat USB devices that are already connected # *after* the daemon starts. One of: # # * block - deauthorize every present device # * reject - remove every present device # * apply-policy - evaluate the ruleset for every present # device # InsertedDevicePolicy=apply-policy # # Restore controller device state. # # The USBGuard daemon modifies some attributes of controller # devices like the default authorization state of new child device # instances. Using this setting, you can controll whether the # daemon will try to restore the attribute values to the state # before modificaton on shutdown. # # SECURITY CONSIDERATIONS: If set to true, the USB authorization # policy could be bypassed by performing some sort of attack on the # daemon (via a local exploit or via a USB device) to make it shutdown # and restore to the operating-system default state (known to be permissive). # RestoreControllerDeviceState=false # # Device manager backend # # Which device manager backend implementation to use. One of: # # * uevent - Netlink based implementation which uses sysfs to scan for present # devices and an uevent netlink socket for receiving USB device # related events. # * dummy - A dummy device manager which simulates several devices and device # events. Useful for testing. # DeviceManagerBackend=uevent #!!! WARNING: It's good practice to set at least one of the !!! #!!! two options bellow. If none of them are set, !!! #!!! the daemon will accept IPC connections from !!! #!!! anyone, thus allowing anyone to modify the !!! #!!! rule set and (de)authorize USB devices. !!! # # Users allowed to use the IPC interface. # # A space delimited list of usernames that the daemon will # accept IPC connections from. # # IPCAllowedUsers=username1 username2 ... # IPCAllowedUsers=root # # Groups allowed to use the IPC interface. # # A space delimited list of groupnames that the daemon will # accept IPC connections from. # # IPCAllowedGroups=groupname1 groupname2 ... # IPCAllowedGroups= # # IPC access control definition files path. # # The files at this location will be interpreted by the daemon # as access control definition files. The (base)name of a file # should be in the form: # # [user][:] # # and should contain lines in the form: # #

=[privilege] ... # # This way each file defines who is able to connect to the IPC # bus and what privileges he has. # IPCAccessControlFiles=%sysconfdir%/usbguard/IPCAccessControl.d/ # # Generate device specific rules including the "via-port" # attribute. # # This option modifies the behavior of the allowDevice # action. When instructed to generate a permanent rule, # the action can generate a port specific rule. Because # some systems have unstable port numbering, the generated # rule might not match the device after rebooting the system. # # If set to false, the generated rule will still contain # the "parent-hash" attribute which also defines an association # to the parent device. See usbguard-rules.conf(5) for more # details. # DeviceRulesWithPort=false # # USBGuard Audit events log backend # # One of: # # * FileAudit - Log audit events into a file specified by # AuditFilePath setting (see below) # * LinuxAudit - Log audit events using the Linux Audit # subsystem (using audit_log_user_message) # AuditBackend=FileAudit # # USBGuard audit events log file path. # AuditFilePath=%localstatedir%/log/usbguard/usbguard-audit.logusbguard-0.7.2+ds/usbguard.service.in000066400000000000000000000004661325273707200175570ustar00rootroot00000000000000[Unit] Description=USBGuard daemon Wants=systemd-udevd.service local-fs.target Documentation=man:usbguard-daemon(8) [Service] Type=forking PIDFile=/var/run/usbguard.pid ExecStart=%sbindir%/usbguard-daemon -f -s -c %sysconfdir%/usbguard/usbguard-daemon.conf Restart=on-failure [Install] WantedBy=basic.target