pax_global_header00006660000000000000000000000064121660351350014514gustar00rootroot0000000000000052 comment=d2bb09dc8a835ba460a45bfba4a986de042b6e48 mcabber-0.10.2/000077500000000000000000000000001216603513500131675ustar00rootroot00000000000000mcabber-0.10.2/AUTHORS000066400000000000000000000035641216603513500142470ustar00rootroot00000000000000MCabber is maintained by Mikael Berthe Parts come from differents projects (the origin is mentioned in the source headers, usually). Thanks to the libjabber, cabber and centericq projects authors. Thanks to the Gaim project, and to all members of the Jabber community! Thanks to Michal Jeczalik Jr (aka salvador) and Philip M. White (aka pmw) for their help (documentation, suggestions, etc.). Thanks to hednod for hosting the mcabber wiki. Thanks to the following contributors: Reimar Döffinger Jefferson Ogata Sören Andersen Christof Meerwald Myhailo Danylenko Alexis Hildebrandt Frank Zschockelt (aka franky) Michael Scherer Oleg Nemanov (aka Lego_12239) Piotr Zielonka (aka entragian) Michal Vaner (aka vorner) Markus Hennecke Thorsten Glaser Maxim Vuets Jan Zachorowski (aka Hermitifier) Translators: FR Mikael Berthe PL Michal Jeczalik Jr (aka salvador) UK Myhailo Danylenko DE Frank Zschockelt NL Eric Hameleers RU Loenko Artyom (aka dive) IT Alessandro Dotti Contra CS "Vic" I'd like to thank the regular members of the mcabber MUC room for their ideas and suggestions: Wolfram, bb, MysticOne... Mikael ===== Here is the original acknowledgement from the cabber project: Special Thanks to: Daniel Borca (http://www.geocities.com/dborca). Many of the new code is his own work!!! Thanks Daniel!!! Thanks to: Abrililla (???) Gabber (http://gabber.sourceforge.net) Manolo Romero (cobreti@mundivia.es) NexusX (nexusx666@ajmacias.com) Pablo2000 (josepablosc@wanadoo.es) Pras (???) Ted (ted@php.net) Thomas Fischer (th.fischer@gmx.net) _Yed_ (#linux at irc-hispano) ZJoyKiller (#linux at irc-hispano) # vim: set encoding=utf-8: mcabber-0.10.2/COPYING000066400000000000000000000434211216603513500142260ustar00rootroot00000000000000Specific permission is granted for the GPLed code in this distribution to be linked to OpenSSL without invoking GPL clause 2(b). ---------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. mcabber-0.10.2/ChangeLog000066400000000000000000000670541216603513500147550ustar00rootroot00000000000000mcabber (0.10.2) * Update receipts handling according to recent XEP updates (Myhailo Danylenko) * Update and modularize the FIFO system (Myhailo Danylenko) * Modularize url_regex * [UI] Add readmark support - a line is displayed afer the last read message * New command /buffer readmark * Add command /iline clear_history * Add command /iline iline_insert (Hermitifier) * Add command /room setopt flag_joins (Hermitifier) * The command /say_to has a new option '-e' so that "\n" can be used * [MUC] Improve MUC support (Myhailo Danylenko) * [MUC] Add support for XEP-0249 / Direct MUC Invitations (Myhailo Danylenko) * [MUC] Refresh the roster when MUC bookmarks are received (Jan Zachorowski) * [MUC] preserve bookmark when updating a non-joined room (Jan Zachorowski) * [MUC] Fix bookmarks losing autojoin attribute (Hermitifier) * [MUC] Display real JIDs in non-anonymous rooms (Hermitifier) * [MUC] New option 'muc_bookmark_autoupdate' (Hermitifier) * [MUC] Fix whois / auto_whois * [UI] Remove deprecated invisible status * [UI] Go back to the first buddy with /roster next_unread when there are no more unread messages (Simon Jacquin) * [UI] Add option 'roster_no_leading_space' to remove the extra space before items in the roster (Simon Jacquin) * [UI] Allow to select which buddy resource messages go to (issue #55) with new commands /roster resource_lock|resource_unlock (Hermitifier) * [UI] Do not warn when the configuration file contains 256-color values * Add support for XEP-0115 Entity Capabilities, with offline cache (Hermitifier) * Fix segfault when spell checking is enabled and spell_lang is not set. * Fix "/rename -" (Hermitifier) * Do not add items to roster with commands /move and /rename (Hermitifier) * [UI] Handle the Enter key on Maemo systems (diSabler) * [UI] Add 'color_log' (text color in the log window) * [UI] Add 'color_readmark' (readmark color in chat buffers) * [UI] Use guards for colors (Myhailo Danylenko) * Update color themes in contrib directory * Documentation update * Many misc. bugfixes and minor improvements -- Mikael, 2012-12-02 mcabber (0.10.1) * Display a warning when the configuration file hasn't been updated * Display better messages when connecting to the XMPP server * [MUC] Do not block MUC private messages when 'block_unsubscribed' is set * [MUC] Fix handling of empty room topic * [MUC] Add caps to presence when joining a MUC room * New option 'completion_ignore_case' - completion is now case sensitive by default * Display module API information in the output of /version * Increase the number of available categories for completions * [Hooks] New "hook-subscription" hook, update to the message-in hooks (See ChangeLog.api) * Many misc. bugfixes * Minor documentation update -- Mikael, 2010-12-01 mcabber (0.10.0) * Switch to the Loudmouth library (franky) * Warning: 'username' has been replaced with 'jid' in the configuration file * MCabber can now do DNS SRV lookups * [UI] Buffers have priorities (and by default MUC rooms have a lower priority). The priority is used by mcabber to jump to the next unread buffer. * [UI] The attention sign (!) is displayed for urgent messages or when the user nickname is used in a MUC room (depending on the buffer priority) * [UI] Use locale to determine the online help language (Myhailo Danylenko) * [UI] Print list of options with "/set" (Myhailo Danylenko) * [UI] Fix iline word_upcase/word_downcase/word_capit commands * Add support for modules in mcabber (Myhailo Danylenko) * Sample "beep" module (Myhailo Danylenko) * Allow commands shading (Myhailo Danylenko) * Message Receipts (XEP-0184) support (franky) * Update of Entity Capabilities support (franky) * New command /request ping (Myhailo, Mikael) * Add libidn support * [MUC] Allow changing the nickname in MUC bookmarks (Myhailo Danylenko) * [MUC] A suffix (i.e. ":") can be appended to completed nicknames * Command "/source" now accepts a file pattern (Myhailo Danylenko) * Tracelog level can now be changed at runtime (Myhailo Danylenko) * Small vCard support improvements * Startup status can be set in the configuration file * Obsolete option 'hide_offline_buddies' has been removed * Obsolete XEP-0022 (Message Events) is now disabled by default * No suffix is displayed in the status bar after the 'info' value * Add Vim syntax file for mcabber history log files to contrib -- Mikael, 2010-04-11 mcabber (0.9.10) * Include Franky's mcabber user guide * Add option "use_mouse" (franky) * Reduce the CPU usage when the server is unreachable * Export the FIFO pipe name as an environment variable (Lukas Kuklinek) * Add support for spellchecking with Enchant (caolan) * Add --compact parameter to /room names (shizeeg) * Add count parameter to roster up/down command (knyar) * Misc. fixes and improvements -- Mikael, 2009-10-06 mcabber (0.9.9) * Fix uninitialized pointer (reported by T. Glaser) * Clean up FIFO on SIGTERM (T. Glaser) * New Czech translation * Update PL and NL help files -- Mikael, 2008-10-09 mcabber (0.9.8) * [UI] A new message flag (O) shows when OTR is used * [UI] For folded groups, the number of unfiltered contacts is displayed (franky) * MCabber adds a random resource suffix by default There is a new option 'disable_random_resource' to disable it. * New command: /buffer save (save the contents of a buffer to a file) * New command: /echo (display a message in the log window) * New option 'fifo_ignore' (Suggested by T. Glaser) * New option 'info' to display arbitrary strings in the status bar (franky) * New option 'iq_hide_requests' * New option 'url_regex' to extract URLs and display them in the log window (franky) * New pastebin/tiny-er event script (Alexander Clouter/Jamie Lentin) * /roster hide/toggle doesn't automatically enable chat mode anymore * '#' is displayed on the buddy status line when the current contact has unread messages (M. Vuets) * /room bookmark shows more information (autojoin, nick...) * [MUC] Nickname colors now depend on nicknames (M. Vuets) * [MUC] The topic can be cleared * [OTR] Fix JID case issue (franky) * More bugfixes and improvements (see detailed changelog) -- Mikael, 2008-10-05 mcabber (0.9.7) * Pressing enter when a group is selected will toggle the fold status * New option 'ignore_self_presence' * New option 'log_display_presence' * New option 'eventcmd_use_nickname' * New option 'statefile' to keep track of unread messages across restarts * New option to customize the away/notavail priority (Michael Gehring) * New external "UNREAD" event * Add FIFO named command pipe * New switches for /say_to: -q, -f * New command /status message (to only change the status description string) * Let /del remove a MUC entry from the roster * Allow more than the 16 default colors (mjs) * Randomize the default resource * Improve OTR support * Improve Remote Controlling Clients (XEP-0146) * Improve reading of history files * Fix compilation on systems which need -lcharset * Add optional SIGWINCH handler (Markus Hennecke) (improves resize events on OpenBSD) * Fixes from MirBSD (Thorsten Glaser) * Some more fixes and improvements (see detailed changelog) -- Mikael, 2008-04-17 mcabber (0.9.6) * Improve Cygwin support * Fix compilation on OpenBSD * [UI] New option 'escdelay' * [MUC] New command /room setopt * [MUC] More room settings are stored in the server private storage * [MUC] The command /room ban can be used with a nickname * [MUC] New rooms are automatically unlocked (suggested by M. Weiser) * A few misc. bugfixes -- Mikael, 2008-01-13 mcabber (0.9.5) * Implement internal hooks: post-connect, pre-disconnect * Extend command /source; any command can be used in a sourced file once mcabber is running * [OTR] New option 'otr' (to enable OTR support in the conf. file) * [OTR] Disable OTR encryption for non-user contacts * [SSL] Do not connect when the SSL settings can't be used * [MUC] Add "/room names --detail" * Add command /roster item_toggle_lock * A group name can be specified in the /group command * [UI] Remove the restriction on the message sizes for displaying incoming messages * History logfile: Use a special code (MI) for local MUC info messages * Usual misc. improvements and bugfixes * Update Polish translation -- Mikael, 2007-11-19 mcabber (0.9.4) * New mcabber command line option -V (displays the version) * MCabber can be linked against GnuTLS * Optional OTR support (Frank Zschockelt) New commands /otr and /otrpolicy * New command /room unban * New command /roster display to filter the contacts per status * New command /color (Michal 'vorner' Vaner) - Add configurable roster colors - Add configurable colors for info and incoming messages * MUC nickname coloring (vorner) * Add selectable time prefixes (vorner) * Implement /buffer close|purge [jid] * XEP-0203 - Delayed Delivery * Improve iq:last support (Michael Scherer) * Allow sending normal and headline messages (vorner) * Allow longer lines in config file * Fix proxy usage when SSL is disabled * Misc. bugfixes * New Italian translation (Alessandro Dotti Contra) * Update online documentation and translations -- Mikael, 2007-10-27 mcabber (0.9.3) * Enable gpg-agent again * Improve MUC nickname completion * Fix a roster bug when receiving a MUC invitation * Fix Aspell support on some systems * Update manpage and Polish translation -- Mikael, 2007-06-19 mcabber (0.9.2) * XEP-0115 - Entity Capabilities * "~" (HOME directory) is allowed in the configuration options * The key binding system is much more flexible (Oleg Nemanov) * New command "/source" to read a configuration file New commands "/iline", "/chat_disable" and "/screen_refresh" (Oleg Nemanov) * Aspell support (Piotr Zielonka) * mcabber will load symlinked histories only once, now (Frank Zschockelt) * Partial support for XEP-0146 [Remote Controlling Clients] (Michael Scherer) * Line highlighting in MUC rooms * Improve MUC nickname completion * /roster bookmark in the status buffer now shows all bookmarks * PGP encryption can be enforced with the "/pgp force" command * New options "muc_flag_joins", "buddy_me_fulljid" * New options for the command /room names: --short, --quiet * A UTF-8 bug with group names has been fixed (Myhailo Danylenko) * Fix a few odd command line behaviours (Oleg Nemanov) * Fix a segfault in XMPP Ping support (reported by univac) * Fix a small issue with Private Storage detection * Misc. bugfixes * A "mcabber.desktop" file is provided -- Mikael, 2007-06-12 mcabber (0.9.1) * The Ctrl-q binding isn't hardcoded anymore * Major memory management and speed improvement * New commands "/buffer close" and "/buffer close_all" * New options "cmdhistory_lines" and "max_history_blocks" * New option "logging_ignore_status" * Add a few event scripts (OSD and libnotify examples) * New events option "events_ignore_active_window" * Support for invitations to muc rooms (Michael Scherer) * Response to XMPP Ping (XEP-0199) (Michael Scherer) * Fix /say_to to contacts of a folded group (reported by Salvador) * Fix a bug in the history logging (incoming "/me " messages) (reported by Frank Zschockelt) * Fix a few memory leaks (Michael Scherer) * A few more misc. bug fixes and improvements * Rewritten mcwizz setup script (Mulander) * Add scripts to contrib: merge_history.py and filter_statusmsg.py (Frank Zschockelt) * help: Add Russian translation (Loenko Artyom) -- Mikael, 2007-02-10 mcabber (0.9.0) * Auto-reconnection after a network or server failure * XEP-0022/XEP-0085 - Events/ChatStates support, a.k.a. typing notifications (Alexis Hildebrandt, Mikael) New option "disable_chatstates" * XEP-0027 - Current Jabber OpenPGP Usage New options "pgp", "pgp_private_key" New command "/pgp" * XEP-0054 - VCard-temp (retrieval only) New command "/request vcard" * XEP-0048 - Bookmark Storage MCabber can auto-join bookmarked rooms New command "/room bookmark" * XEP-0012 - Last Activity New command "/request last" * XEP-0145 - Annotations New command "/roster note" * New commands /roster item_lock|item_unlock These commands allow us to lock a contact so that it stays visible in the roster (when offline contacts are hidden). * New commands /roster group_prev|group_next * New options "log_win_on_top" and "roster_win_on_right" * JID completion for hidden buddies/groups * MCabber answers IQ disco#info queries * Ctrl-d sends multi-line messages (same as /msay send) * help: Add Ukrainian translations (Myhailo Danylenko) * Configurable command character (Alexis Hildebrandt) * Fix unicode detection on BSD systems * Misc. bug fixes and improvements * Update documentation and translations -- Mikael, 2006-12-16 mcabber (0.8.3) * Fix truncation of UTF-8 buddy names in the roster (Myhailo Danylenko) * Fix SSL support on OS X (Alexis Hildebrandt) * Fix a freeze with some mistakes in the configuration file * Update the sample event script to be more portable * Fix some UTF-8 related issues * Fix permissions of help files * Correctly display the first message of a buffer (it wasn't wrapped) -- Mikael, 2006-11-16 mcabber (0.8.2) * Fix a freeze with UTF-8 locales Some commands were causing a freeze when there was a trailing space in the command line. * The current ssl_verify value is used in /connect (no need to restart mcabber) * System messages are not blocked anymore when the option "block_unsubscribed" is set * Do not enter chat mode after command "/del" or when somebody joins a room * Display mcabber version in the status window (when chat mode is disabled) (Suggested by pmw & hednod) * Small code cleanup and a few cosmetic changes -- Mikael, 2006-09-19 mcabber (0.8.1) * Fix a bug in key bindings (with special keys) * Fix a compilation issue on some systems (e.g. Slackware) -- Mikael, 2006-08-21 mcabber (0.8.0) * UTF-8 terminal support (Reimar Döffinger) * SSL server certificate verification (Jefferson Ogata) * CPU usage improvement (Christof Meerwald) * New configuration script, mcwizz.pl (Adam Wolk, Mateusz Karkula) -- Mikael, 2006-08-13 mcabber (0.7.8) * Fix a small issue in make install * help: Add French translations * help: Add Polish translations (Michal Jeczalik Jr/Daniel Czerniawski) -- Mikael, 2006-06-27 mcabber (0.7.7) * New "status" special buffer This buffer contains the log window data. * MCabber does not stop when there is no configuration file * New command "/help" (online help) * New command "/authorization request_unsubscribe" * New command "/msay toggle_verbatim" * New command "/buffer purge" * New commands "/buffer scroll_lock|scroll_unlock|scroll_toggle" * The commands /alias and /bind now list the defined aliases and key bindings * Groups can now be renamed * Fix a small buddylist bug when receiving a subscription request (the buddylist wasn't always refreshed) * Fix a bug (hang) in the input line * Display incomplete subscriptions in the roster * Remember the status message when a contact goes offline * Extand "/event" to allow a wildchar '*' * New option "block_unsubscribed" When set, messages from people who don't have a subscription to our presence updates are blocked. * New option "delete_on_reject" When set, people are automatically removed from the roster if their subscription request is rejected. * New option "max_history_age" * MUC: New option "muc_auto_whois" * MUC: MCabber can join password-protected chatrooms * MUC: Allow "/room join . [nick [pass]]" if the current item is a MUC room * MUC: Fix joining a room when the buddylist is empty * MUC: Try to work around some server and network issues * Ctrl-l now rereads color option values * Tab characters are expanded when the "verbatim multi-line mode" is enabled * Disable file permission checks on Cygwin * Improve logging (especially, XML data isn't truncated anymore) * Fix negative priority * Fix a few memory leaks * Other misc. bugfixes and improvements * Documentation updates -- Mikael, 2006-06-21 mcabber (0.7.6) * Initial Cygwin port (Soren Andersen) * Fix a segfault when mcabber is not connected to a Jabber server (reported by Mario Iseli) * Correctly restore term settings when interrupting the password query * Fix a small bug in the /request command (reported by pmw) * MUC: Fix "/room whois" with UTF-8 nickname * MUC: Fix completion for UTF-8 nicknames * Improve support for long messages * Add command "/msay toggle" * Allow messages with a subject (with /msay) * New option "log_display_sender" * Multi-line mode: Do not send empty messages * Update documentation -- Mikael, 2006-04-14 mcabber (0.7.5) * History files now use UTF-8 encoding See file "NEWS" for an example to convert existing log files * UI change: Add two status/info lines * Meta keys can be used (and bound to a command) * Add Ctrl-left/right to move 1 word backward/forward in the input line * Outgoing messages can be colorized * The color options names have changed, several colors have been added. Bright (bold) colors can be used for the text. A theme directory has been created. * New "/event" command. Subscription requests are not automatically accepted anymore. * New IQ system, for Jabber IQ request * Add "/request time|version" commands * Add "/roster hide|show|toggle" commands This allows having a full-width chat window. * Group names are now case sensitive * Add "--enable-hgcset" option to the ./configure script, for people using the Mercurial repository. If used, the /version command will display the Mercurial changeset. * We try to display as many roster items as possible in the buddylist * New "beep_on_message" option * New "eventcmd_checkstatus" option * New "roster_width" option * Improved English messages (thanks to Philip M. White) * Fix a small issue with resources containing uppercase chars in /status_to * Fix iq:time handling: really return UTC time when answering a request * Sync libjabber with upstream * A lot of small bugfixes * Documentation updates -- Mikael, 2006-04-03 mcabber (0.7.4) * Fix a segfault when reconnecting to the server or rejoining a room * Fix a segfault when a group and a contact have the same name -- Mikael, 2006-01-17 mcabber (0.7.3) * Fix a segfault when a resource contains non-representable chars * Fix an UTF-8 encoding issue when joining a room * Fix an eventcmd issue * Chat Mode is automatically enabled when some commands are entered ("/info", "/room names", "/room whois") * Messages can be sent to agents * The unread_message flags are not reset when the server connection is lost * MUC: server messages do not set the new_message flag anymore * New "load_muc_logs" option, logfiles are not loaded for MUC room by default * New "nickname" option, to set the default nickname in chatrooms * Add "/msay send_to" command * "/add" and "/status_to" can be used with special jid "." for the current selected buddy * Lots of misc. bugfixes * Documentation updates -- Mikael, 2006-01-12 mcabber (0.7.2) * Lots of internal changes (code cleanup) * Improved commands parsing Commands now handle correctly resources or nicknames containing whitespace * The roster is updated in real time when receiving an update from the server * "/info" shows subscriptions (none, from, to, both) * "/info" and "/room whois" show presence timestamp * Add "/authorization" command, to manage subscriptions * mcabber now answers IQ requests * The deprecated Agent list IQ request has been removed * Empty resources are displayed (do not use the arbitrary "default" string instead) * MUC: "/room topic" shows the current room topic * MUC: "/room nick" shows the current nickname * MUC: Add "/room kick", "/room ban", "/room whois" * MUC: Add "/room affil" and "/room role" * MUC: Add "/room destroy" * MUC: Display a message when somebody is kicked/banned from a room * MUC: Display a message (and the reason, if there is one) when a room has been destroyed * MUC: Multiple other fixes and improvements * Handle messages beginning with "/me " (it is replaced with the nickname) * New "/version" command * Documentation updates -- Mikael, 2005-12-19 mcabber (0.7.1) * New option 'buddy_format' to select the way buddies are displayed in the log window * New option 'show_status_in_buffer' to display status changes in the buffer (chat) window * The "/status" command has been improved -- its behaviour has changed, please read the manual page * The log window height can be set * Add "/buffer up" and "/buffer down" commands * The "/move" command does not jump to the body in the new group anymore * MUC: Nickname completion in a room * MUC: Improved "/room names" command * MUC: departure messages are displayed * MUC: mcabber now notices when it is ejected from a room * MUC: status is updated in chatrooms * External commands: the message body can be passed to the external command (see the sample configuration file and the sample eventcmd script) * UTF-8 conversion failures are written to the tracelog file (if enabled) * The resource priority can now be changed once connected * Fix a bug when moving a chatroom to another group (in the roster) * Minor cleanup (warnings, small memory leaks and compilation stuff) -- Mikael, 2005-11-26 mcabber (0.7.0) * mcabber should build on FreeBSD * New /rawxml command * New /status_to command * New /stay_to command * Multiple resources support The resources can be seen using the /info command * Initial Multi-User Chat support New /room command (invite, join, leave, names, nick, privmsg, remove, topic, unlock) * Warn the user when a message is received, which cannot be decoded (local charset unable to display some chars, for example) * Fix a bug when a buddy's name cannot be converted from utf-8 for being displayed in the roster (fall back to jid) * Fix: Status message is not lost anymore when using /move command * Add "/buffer %" and "/buffer date" * A few misc bugfixes * Update documentation -- Mikael, 2005-10-10 mcabber (0.6.8) * Proxy support (see updated mcabberrc sample file) * Better handling of server error codes/messages (we try to respect RFC3920) * A contact does not show up as "online" anymore when mcabber receives an error presence packet * Check the tracelog file actually belongs to the user, if logging is enabled * Fix a potential connection failure introduced in 0.6.7 -- Mikael, 2005-09-12 mcabber (0.6.7) * Allow a different server name than the jid domain name (which allows connecting to Google Talk). The libjabber patch (credited to Ian Johannesen) comes from centericq. * Reduce CPU consumption when mcabber is not connected to a Jabber server * Update libjabber (sync with upstream) * Fix a weird crash when trying to connect to a closed port * Display text messages corresponding to the Jabber server error codes * Display full dates in the trace logfile -- Mikael, 2005-09-02 mcabber (0.6.6) * Use Glib for UTF-8 conversions * A screen resize does not terminate auto-away * Ctrl-l does a full screen refresh * Ctrl-c is treated as a normal key; we're now using ncurses raw mode so it doesn't trigger a signal * Speed up history file loading -- Mikael, 2005-08-17 mcabber (0.6.5) * Add Debian directory for packaging, create an experimental package * Add a few external actions (MSG OUT, STATUS *) The contrib/eventcmd script has been updated * Use better messages for server connection states * [FIX] Fix a segfault when starting mcabber in a really small terminal * Fix some history log directory issues * - Check history directory permissions and configuration file permissions They are corrected automatically (to 700 and 600) - Warn when mcabber main directory ($HOME/.mcabber) has bad permissions * First Ctrl-c didn't really leave multi-line message mode! (merge issue) * Add "/buffer search_backward" and "/buffer search_forward", to search for a string in a buffer window * Add "/roster up" and "/roster down" commands * New logging system. The "debug" file has been replaced by a "trace file", and 2 levels are available. In level 1, the messages from the log window are written to te trace file. In level 2, debug messages and XML are written to the file. See the sample configuration file. * A few other internal changes and minor bugfixes -- Mikael, 2005-07-26 mcabber (0.6.4) * Configuration file format change (see NEWS file) Aliases & key bindings can be put in the config. file * Enable /set command * [FIX] Convert status messages to/from UTF-8 * The /status command can specify a status message * Display the buddy status message when a buddy connects/changes his status * New autoaway feature (see sample config. file) * New "/roster alternate". Jumps to the last buddy window left in chat mode * Handle "error" message type * One Ctrl-c does not terminate mcabber anymore (the 2nd Ctrl-c does), but leaves multi-line message mode and aborts current completion * Add a sample script to handle events (currently, it plays a sounds when a message is received) -- Mikael, 2005-07-20 mcabber (0.6.3) * Fix interactive password crash * Disable /set command (it is almost useless) -- Mikael, 2005-07-12 mcabber (0.6.2) * The history log file format has changed; the old log files written by mcabber < 0.6.1 are no longer supported and should be converted. Please see the NEWS file for the details. * New multi-line "verbatim" mode (/msay verbatim). In this mode, all commands but /msay are disabled, so that lines beginning with a slash can be sent * Ctrl-o (accept-line-and-down-history) has been added * Add "/roster search jid|name" to look for somebody in the current buddylist * Color configuration handling improvement NOTE: configuration file needs to be updated; see sample config. file! * Resource priority can be set (see sample config. file) * Status messages can be user-defined (see sample config. file) * mcabber now warns when logging is enabled and there is a write error while writing to log files * Remove busy/occupied status, which does not exist (it could be an alias for dnd) * The settings system has been rewritten * Fix segfault when the resource is not specified * New /alias command * New /bind command * Add /roster toggle_offline * Add /connect and /disconnect commands -- Mikael, 2005-07-11 mcabber (0.6.1) * Fix backspace handling (KEY_BACKSPACE isn't reliable) * Change logfile date format to iso8601 (more readable!) A script is available in contrib/ to convert the existing (old) logfiles MCabber will display a warning when parsing an old-style file * Implement Ctrl-q (jump to first/next unread message) * Implement initial support for multi-line messages (/msay command) * The /add command can now set the nickname * Display a warning when the locale is UTF-8 * Display log notice when sending a notification request message * Update INSTALL and mcabberrc.example files for better explanations * Comment out useless code (fix a compilation error with gcc 4) * Add Makefile for the doc subdir; the manpage will be installed now * Minor fixes -- Mikael, 2005-06-25 mcabber (0.6.0) Initial fork from cabber 0.5.0-test1 Lots of changes, here is a quick summary: * Use automake/autoconf * Switch to libjabber * SSL support with OpenSSL (should work with gnutls but I didn't succeed) * History scrolling and resizing * History logging (and reading) * Small manpage (AsciiDoc documentation) * Buddy groups implementation - fold/unfold groups - hide/show offline buddies * Commands, and command completion system * Hooks for external events (for ex. when receiving a message) -- Mikael, 2005-06-07 # vim:set fileencoding=utf-8: mcabber-0.10.2/ChangeLog.api000066400000000000000000000065241216603513500155200ustar00rootroot00000000000000dev (25) * Stable api 0.10.2:1 * Changeset 998feaa54ef0 * Add ut_unescape_tabs_cr() to utils.h -- Mikael Berthe, 2012-11-28 dev (24) * Changeset 0cb8ea02e472 * completion-sorting patch * Change compl_add_category() to accept flags arg * Define MCABBER_API_HAVE_COMPL_FLAGS -- Myhailo Danylenko, 2012-10-20 dev (23) * Changeset 8dc418af3e72 Add buddy_(get|set)activeresource() functions -- Hermitifier, 2012-03-01 dev (22) * Changeset a73ce708c2c9 Add xmpp_get_bookmark_autojoin() function -- Hermitifier, 2012-02-23 dev (21) * Changeset 51f032d5ca22 New and reworked caps_*() functions -- Hermitifier, 2011-10-03 dev (20) * Add cmd_set_safe() and cmd_is_safe() * Changeset dd65a18dc480 -- Mikael Berthe, 2011-03-27 dev (19) * cmd_add now returns gpointer id * cmd_del accepts gpointer id instead of command name * Min API 19 * Changeset ad77110343d6 -- Mikael Berthe, 2011-03-27 dev (18) * Changeset 6febc7d1f760 Add room setopt flag_joins * Changeset e6beab22099b Change prototype of xmpp_set_storage_bookmark() -- Mikael Berthe, 2011-03-26 dev (17) * Add NS_X_CONFERENCE (direct MUC invitations) -- Mikael Berthe, 2011-03-14 dev (16) * Stable api 0.10.1:1 * Add "error" argument to the message-in hooks * Changeset 3cabdacf58df -- Mikael Berthe, 2010-05-16 dev (15) * Add "hook-subscription" hook * Changeset 5d37cee8c6c6 -- Mikael Berthe, 2010-04-17 dev (14) * Add "delayed" argument to the message-in hooks * Changeset ea3f9b4f3558 -- Mikael Berthe, 2010-04-11 dev (13) * Stable api 0.10.0:1 * Rename jep00{22,85} to xep00{22,85} * Rename buddy_resource_jep{22,85}() to buddy_resource_xep{22,85}() * Changeset e45d13074721 -- Mikael Berthe, 2010-04-03 dev (12) * Add scr_getlogwinheight() * Changeset d13315366ba5 -- Mikael Berthe, 2010-03-24 dev (11) * s/MORE_HOOK/MORE_HANDLER/ in handler return code * Changeset 1c3efa9bc422 -- Mikael Berthe, 2010-03-22 dev (10) * Add "hook-unread-list-change" * Changeset 9daf6b3f30d6 -- Mikael Berthe, 2010-03-21 dev (9) * Add roster UI priority roster_setuiprio(), roster_getuiprio(), buddy_getuiprio(), scr_setattentionflag_if_needed() * Changeset b135572fcd26 -- Mikael Berthe, 2010-03-21 dev (8) * Changeset 47699a09ceb3 Rework the whole hook system. Hook handler API slightly modified. * Changeset 5e2db25fdb17 Rename "hook-message-in" to "hook-post-message-in" * Changeset 246c5d359c97 Add "hook-pre-message-in" Incoming messages can be filtered. -- Mikael Berthe, 2010-03-20 dev (7) * Add scr_gettextheight() * Changeset 6e0a8bfb3a01 -- Myhailo Danylenko, 2010-03-14 dev (6) * Add urgent flag to the hook-message-in hook * Changeset 1f913c92c9b2 -- Mikael Berthe, 2010-03-14 dev (5) * Add resource name to the hook-message-in hook * Changeset 5c043358ded0 -- Mikael Berthe, 2010-03-14 dev (4) * Big API cleanup (functions renamed) * Min API 4 * Changeset e4378fbab5d7 -- Mikael Berthe, 2010-03-14 dev (3) * settings_set_guard() returns success status and will refuse to replace an existing guard * Min API 3 * Changeset d80a9e32ab1a -- Myhailo Danylenko, 2010-03-13 dev (2) * Add api.h * Add scr_gettextwidth() (61f0482d3993) * Changeset e7ce50fe19a9 -- Myhailo Danylenko, 2010-03-13 dev (1) * Initial API version -- Myhailo Danylenko, 2010-03-13 mcabber-0.10.2/CodingStyle.txt000066400000000000000000000015631216603513500161610ustar00rootroot00000000000000This document describes the preferred coding style for the mcabber project. If you intend to patch and contribute to mcabber, please try to use the existing style, and read the following points. - Do not use tabs, use space characters; - Avoid trailing whitespace; - Avoid lines longer than 80 characters; - Indentation is 2 spaces (ok, maybe it isn't a good idea but it's the current style); - Put a space after non-functions statements (e.g. if, while...) - Put the opening brace last on the same line, and put the closing brace first except for functions, where the opening brace should be alone on a new line. Example: void example(void) { if (cond1) { do_a(); } else if (cond2) { do_b(); } else { do_c(); } if (error) exit(0); } - Look at existing code for rules not mentioned here. Mikael mcabber-0.10.2/INSTALL000066400000000000000000000413051216603513500142230ustar00rootroot00000000000000This file contains the generic instructions; the short version is: $ ./configure $ make ... and if you want to install the software: $ make install (If you don't want to install it, the "mcabber" binary lies in the mcabber/ directory after the build procedure) You will need the Loudmouth library, version >= 1.4.3 is recommended. We have a Loudmouth repository on github, if you want to have the latest features and bugfixes: MCabber needs ncurses and ncurses development packages to build correctly. For UTF-8 terminal support, use ncursesw instead. Note: On FreeBSD (and maybe other BSD systems as well), it is recommended that you install ncurses from ports before compiling mcabber. You should also export LDFLAGS='-L/usr/local/lib' before running mcabber's configure to ensure that mcabber uses the ncurses installed from ports. This is necessary as the version of ncurses included in the base system does not provide unicode support. If you want PGP support, install libgpgme (with dev package), version >= 1.0.0. You may want to have a look at the wiki: and if you're using the development version (from the repository): Please have a look at the README file before launching mcabber. Please send me a message (mcabber AT lilotux DOT net) if you have questions, suggestions or even patches... Our MUC room is there: Mikael Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. mcabber-0.10.2/Makefile.am000066400000000000000000000002221216603513500152170ustar00rootroot00000000000000SUBDIRS = mcabber doc modules ACLOCAL_AMFLAGS = -I macros if INSTALL_HEADERS pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mcabber.pc endif mcabber-0.10.2/Makefile.in000066400000000000000000000655561216603513500152550ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/mcabber.pc.in \ $(top_srcdir)/configure $(top_srcdir)/include/config.h.in \ AUTHORS COPYING ChangeLog INSTALL NEWS TODO config.guess \ config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = mcabber.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) 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__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 distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mcabber doc modules ACLOCAL_AMFLAGS = -I macros @INSTALL_HEADERS_TRUE@pkgconfigdir = $(libdir)/pkgconfig @INSTALL_HEADERS_TRUE@pkgconfig_DATA = mcabber.pc all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: 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): include/config.h: include/stamp-h2 @if test ! -f $@; then rm -f include/stamp-h2; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/stamp-h2; else :; fi include/stamp-h2: $(top_srcdir)/include/config.h.in $(top_builddir)/config.status @rm -f include/stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(top_srcdir)/include/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f include/stamp-h2 touch $@ distclean-hdr: -rm -f include/config.h include/stamp-h2 mcabber.pc: $(top_builddir)/config.status $(srcdir)/mcabber.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(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*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(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 \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(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__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-pkgconfigDATA # 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: mcabber-0.10.2/NEWS000066400000000000000000000056731216603513500137010ustar00rootroot00000000000000mcabber (0.10.2) * The FIFO and url_regex systems have been modularized. Load the appropriate modules if you want these features (the sample configuration file has been updated). -- Mikael, 2012-07-28 mcabber (0.10.0) * MCabber now uses the Loudmouth library (version 1.4.3 or greater). * The JID should be provided in the configuration file, the variable 'username' has been replaced with 'jid'. * The SSL/TLS-related options have changed; please check the new sample configuration file. * The UNREAD events now passes more data to the external script (including the number of buffers with the attention sign, the number of unread MUC buffers, and the number of unread MUC buffers with the attention sign). -- Mikael, 2010-04-11 mcabber (0.9.10) * The spell checking related options have changed, please check your configuration file. -- Mikael, 2009-10-11 mcabber (0.9.5) * The option 'otr' must now be set in the configuration file in order to be able to use the OTR (Off-The-Record messaging) support. -- Mikael, 2007-11-19 mcabber (0.9.4) * The option 'hide_offline_buddies' is deprecated, the new option roster_display_filter should be used instead. -- Mikael, 2007-10-27 mcabber (0.9.1) * The Ctrl-q binding is not hardcoded anymore and should be set in the configuration file. -- Mikael, 2007-02-10 mcabber (0.8.0) * Mcabber now does SSL server certificate verification, and it is enabled by default. You can disable the certificate verification with the 'ssl_verify' option. See the sample configuration file for details. -- Mikael, 2006-08-13 mcabber (0.7.5) * History log files are now stored using UTF-8 format. If you have enabled history logging, you need to convert your existing logfiles. For example, you can use the following command to convert all ISO-8859-15 files in directory $histodir to UTF-8: $ recode iso-8859-15..utf-8 $histodir/* (There are other tools: convmv, utrac...) * The names of the color options have changed, please check your configuration file if you have customized your colors. The sample config. file has been updated. -- Mikael, 2006-04-03 mcabber (0.6.5) * The "debug" option has been replaced with the tracelog_level and tracelog_file options. The sample config. file has been updated, so you should have a look at it if you want to use advanced logging. -- Mikael, 2005-07-25 mcabber (0.6.4) * The configuration file format has changed. Options need to be set using the "set" keywords. The sample config. file has been updated. -- Mikael, 2005-07-18 mcabber (0.6.2) * Support for old style (i.e. < 0.6.1) history logfiles has been removed. You can upgrade your logfiles with the script "contrib/conv_log_dates.pl" if you haven't already done it. * The colors option names have changed (and they aren't mandatory anymore). Please look at the sample config. file to update your mcabberrc. -- Mikael, 2005-07-11 mcabber-0.10.2/README000066400000000000000000000026621216603513500140550ustar00rootroot00000000000000 Hello, and thanks for trying mcabber. For installation instructions, have a look at the INSTALL file. A configuration file is necessary to start mcabber. Its name is $HOME/.mcabber/mcabberrc (or $HOME/.mcabberrc). A sample configuration file, "mcabberrc.example", is provided in this directory. Copy it and modify it to fit your needs. You can use mcabber "-f" option to specify another configuration file. * FEATURES This is an overview of mcabber Jabber features: XEP-0012 - Last Activity XEP-0022 - Message Events XEP-0027 - Current Jabber OpenPGP Usage XEP-0030 - Service Discovery (partial) XEP-0045 - Multi-User Chat XEP-0048 - Bookmark Storage XEP-0049 - Private XML Storage XEP-0054 - vcard-temp (retrieval only) XEP-0085 - Chat State Notifications XEP-0090 - Entity Time XEP-0091 - Delayed Delivery XEP-0092 - Software Version XEP-0115 - Entity Capabilities support XEP-0145 - Annotations XEP-0146 - Remote Controlling Clients (partial) XEP-0184 - Message Delivery Receipts XEP-0199 - XMPP Ping XEP-0202 - Entity Time XEP-0203 - Delayed Delivery XEP-0249 - Direct MUC Invitations (partial) This software is under development, please give me some feedback (and some patches if you can!). Or just tell me you're using it... ;-) There is a Mercurial repository on mcabber's website and a Jabber conference room: . Mikael mcabber-0.10.2/TODO000066400000000000000000000021371216603513500136620ustar00rootroot00000000000000 TODO: Please see the issue tracker for other features/bugs: http://bitbucket.org/McKael/mcabber-crew/issues/?status=new&status=open The following list isn't necessarily up-to-date: * Improve the completion system * Enable /roster search for offline (hidden) buddies (hidden groups, etc.) * Publish personal information (a module exists) * MUC: advanced settings for room creation * MUC: ignore patterns * "Offline roster" (when disconnected) * Maybe cache iq:version and show version in /info, if available * Sort roster by status * 2-levels roster display (jids, resources) * XEP-0186: Invisible * "Ignore list" (privacy lists) See XEP-0191: Simple Communications Blocking * Human-readable key binding config? * Possibility to hide log window(?) * Improve /info, esp. in MUC rooms * Data Forms (a module exists) * File transfer!! Cf. GSoC 2010: http://github.com/alkino/mcabber-jingle/ * Commands: - /roster enable|disable xml - /highlight nick - /info [jid] (request info to the server if the buddy is not in the roster) - /server register|unregister - /search |name (server search) mcabber-0.10.2/aclocal.m4000066400000000000000000002065651216603513500150450ustar00rootroot00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(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'.])]) # Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, dnl gthread, or gio is specified in MODULES, pass to pkg-config dnl AC_DEFUN([AM_PATH_GLIB_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; gio*) pkg_config_args="$pkg_config_args $module-2.0" ;; esac done PKG_PROG_PKG_CONFIG([0.16]) no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { unsigned int major, minor, micro; char *tmp_version; fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" GLIB_COMPILE_RESOURCES="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GOBJECT_QUERY) AC_SUBST(GLIB_MKENUMS) AC_SUBST(GLIB_COMPILE_RESOURCES) rm -f conf.glibtest ]) # gpgme.m4 - autoconf macro to detect GPGME. # Copyright (C) 2002, 2003, 2004 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This file 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. AC_DEFUN([_AM_PATH_GPGME_CONFIG], [ AC_ARG_WITH(gpgme-prefix, AC_HELP_STRING([--with-gpgme-prefix=PFX], [prefix where GPGME is installed (optional)]), gpgme_config_prefix="$withval", gpgme_config_prefix="") if test "x$gpgme_config_prefix" != x ; then GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config" fi AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no) if test "$GPGME_CONFIG" != "no" ; then gpgme_version=`$GPGME_CONFIG --version` fi gpgme_version_major=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` gpgme_version_minor=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` gpgme_version_micro=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` ]) dnl AM_PATH_GPGME([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_CFLAGS and GPGME_LIBS. dnl AC_DEFUN([AM_PATH_GPGME], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_CFLAGS=`$GPGME_CONFIG --cflags` GPGME_LIBS=`$GPGME_CONFIG --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_CFLAGS="" GPGME_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_CFLAGS) AC_SUBST(GPGME_LIBS) ]) dnl AM_PATH_GPGME_PTH([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_PTH_CFLAGS and GPGME_PTH_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_PTH], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME Pth - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then if `$GPGME_CONFIG --thread=pth 2> /dev/null` ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_PTH_CFLAGS=`$GPGME_CONFIG --thread=pth --cflags` GPGME_PTH_LIBS=`$GPGME_CONFIG --thread=pth --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_PTH_CFLAGS="" GPGME_PTH_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_PTH_CFLAGS) AC_SUBST(GPGME_PTH_LIBS) ]) dnl AM_PATH_GPGME_PTHREAD([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS dnl and GPGME_PTHREAD_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_PTHREAD], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags` GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_PTHREAD_CFLAGS="" GPGME_PTHREAD_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_PTHREAD_CFLAGS) AC_SUBST(GPGME_PTHREAD_LIBS) ]) dnl AM_PATH_GPGME_GLIB([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme-glib and define GPGME_GLIB_CFLAGS and GPGME_GLIB_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_GLIB], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags` GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_GLIB_CFLAGS="" GPGME_GLIB_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_GLIB_CFLAGS) AC_SUBST(GPGME_GLIB_LIBS) ]) dnl Autoconf macros for libgcrypt dnl Copyright (C) 2002, 2004 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_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]) if test x"$host" != x ; then 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 fi else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) ]) dnl dnl Off-the-Record Messaging library dnl Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov dnl dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of version 2.1 of the GNU Lesser General dnl Public License as published by the Free Software Foundation. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl AM_PATH_LIBOTR([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libotr, and define LIBOTR_CFLAGS and LIBOTR_LIBS as appropriate. dnl enables arguments --with-libotr-prefix= dnl --with-libotr-inc-prefix= dnl dnl You must already have found libgcrypt with AM_PATH_LIBGCRYPT dnl dnl Adapted from alsa.m4, originally by dnl Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela AC_DEFUN([AM_PATH_LIBOTR], [dnl Save the original CFLAGS, LDFLAGS, and LIBS libotr_save_CFLAGS="$CFLAGS" libotr_save_LDFLAGS="$LDFLAGS" libotr_save_LIBS="$LIBS" libotr_found=yes dnl dnl Get the cflags and libraries for libotr dnl AC_ARG_WITH(libotr-prefix, [ --with-libotr-prefix=PFX Prefix where libotr is installed(optional)], [libotr_prefix="$withval"], [libotr_prefix=""]) AC_ARG_WITH(libotr-inc-prefix, [ --with-libotr-inc-prefix=PFX Prefix where libotr includes are (optional)], [libotr_inc_prefix="$withval"], [libotr_inc_prefix=""]) dnl Add any special include directories AC_MSG_CHECKING(for libotr CFLAGS) if test "$libotr_inc_prefix" != "" ; then LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix" CFLAGS="$CFLAGS $LIBOTR_CFLAGS" fi AC_MSG_RESULT($LIBOTR_CFLAGS) dnl add any special lib dirs AC_MSG_CHECKING(for libotr LIBS) if test "$libotr_prefix" != "" ; then LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix" LDFLAGS="$LDFLAGS $LIBOTR_LIBS" fi dnl add the libotr library LIBOTR_LIBS="$LIBOTR_LIBS -lotr" LIBS="$LIBOTR_LIBS $LIBS" AC_MSG_RESULT($LIBOTR_LIBS) dnl Check for a working version of libotr that is of the right version. min_libotr_version=ifelse([$1], ,3.0.0,$1) no_libotr="" libotr_min_major_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` libotr_min_minor_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` libotr_min_sub_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_MSG_CHECKING(for libotr headers version $libotr_min_major_version.x >= $min_libotr_version) AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include #include ], [ # if(OTRL_VERSION_MAJOR != $libotr_min_major_version) # error not present # else # if(OTRL_VERSION_MINOR > $libotr_min_minor_version) exit(0); # else # if(OTRL_VERSION_MINOR < $libotr_min_minor_version) # error not present # endif # if(OTRL_VERSION_SUB < $libotr_min_sub_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libotr not found.)]) libotr_found=no] ) AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. AC_CHECK_LIB([otr], [otrl_message_receiving],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libotr was found.)]) libotr_found=no], $LIBGCRYPT_LIBS ) LDFLAGS="$libotr_save_LDFLAGS" LIBS="$libotr_save_LIBS" if test "x$libotr_found" = "xyes" ; then ifelse([$2], , :, [$2]) else LIBOTR_CFLAGS="" LIBOTR_LIBS="" ifelse([$3], , :, [$3]) fi dnl That should be it. Now just export our symbols: AC_SUBST(LIBOTR_CFLAGS) AC_SUBST(LIBOTR_LIBS) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- 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 ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # 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]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- 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 ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- 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 ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # 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 ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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.11' 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.11.6], [], [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.11.6])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, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl 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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. 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 8's {/usr,}/bin/sh. touch 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl 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 ]) 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, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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}" != 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, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # 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, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_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])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_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, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([macros/curslib.m4]) m4_include([macros/define_dir.m4]) m4_include([macros/libtool.m4]) m4_include([macros/ltoptions.m4]) m4_include([macros/ltsugar.m4]) m4_include([macros/ltversion.m4]) m4_include([macros/lt~obsolete.m4]) m4_include([macros/timezone.m4]) m4_include([macros/tm-gmtoff.m4]) mcabber-0.10.2/autogen.sh000077500000000000000000000001531216603513500151670ustar00rootroot00000000000000#! /bin/sh libtoolize --force --automake --copy aclocal -I macros/ autoheader autoconf automake -a --copy mcabber-0.10.2/config.guess000077500000000000000000001274321216603513500155200ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, 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 Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the 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=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # 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/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) 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 ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*: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-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; 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 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mcabber-0.10.2/config.sub000077500000000000000000001053271216603513500151620ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; 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 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | 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 ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | 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-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | 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-* \ | 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 ;; 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 ;; 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 ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-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 | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; 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* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 ;; 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: mcabber-0.10.2/configure000077500000000000000000020530771216603513500151140ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for mcabber 0.10.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: mcabber@lilotux.net 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='mcabber' PACKAGE_TARNAME='mcabber' PACKAGE_VERSION='0.10.2' PACKAGE_STRING='mcabber 0.10.2' PACKAGE_BUGREPORT='mcabber@lilotux.net' PACKAGE_URL='' ac_unique_file="mcabber" # 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 INSTALL_HEADERS_FALSE INSTALL_HEADERS_TRUE OTR_FALSE OTR_TRUE HGCSET_FALSE HGCSET_TRUE PKGLIB_DIR DATA_DIR ENCHANT_LIBS ENCHANT_CFLAGS LIBGCRYPT_LIBS LIBGCRYPT_CFLAGS LIBOTR_LIBS LIBOTR_CFLAGS LIBGCRYPT_CONFIG GPGME_LIBS GPGME_CFLAGS GPGME_CONFIG LIBIDN_LIBS LIBIDN_CFLAGS LOUDMOUTH_LIBS LOUDMOUTH_CFLAGS GLIB_COMPILE_RESOURCES GLIB_MKENUMS GOBJECT_QUERY GLIB_GENMARSHAL GLIB_LIBS GLIB_CFLAGS LIBOBJS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL 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_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_largefile enable_sigwinch enable_modules enable_glibtest with_libidn enable_gpgme with_gpgme_prefix enable_otr with_libgcrypt_prefix with_libotr_prefix with_libotr_inc_prefix enable_enchant enable_aspell enable_xep0022 enable_debug enable_hgcset ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LOUDMOUTH_CFLAGS LOUDMOUTH_LIBS LIBIDN_CFLAGS LIBIDN_LIBS ENCHANT_CFLAGS ENCHANT_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 mcabber 0.10.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/mcabber] --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 mcabber 0.10.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-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-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-sigwinch compile with SIGWINCH handler --disable-modules disable dynamic modules loading --disable-glibtest do not try to compile and run a test GLIB program --disable-gpgme disable GPGME support --enable-otr enable OTR (Off-the-Record) messaging support --enable-enchant enable enchant support --enable-aspell enable aspell support --enable-xep0022 enable obsolete Message Events (XEP-0022) --enable-debug add development compilation options --disable-hgcset do not use Mercurial changeset value 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-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-libidn=DIR Support IDN (needs GNU Libidn) --with-gpgme-prefix=PFX prefix where GPGME is installed (optional) --with-libgcrypt-prefix=PFX prefix where LIBGCRYPT is installed (optional) --with-libotr-prefix=PFX Prefix where libotr is installed(optional) --with-libotr-inc-prefix=PFX Prefix where libotr includes are (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor 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 LOUDMOUTH_CFLAGS C compiler flags for LOUDMOUTH, overriding pkg-config LOUDMOUTH_LIBS linker flags for LOUDMOUTH, overriding pkg-config LIBIDN_CFLAGS C compiler flags for LIBIDN, overriding pkg-config LIBIDN_LIBS linker flags for LIBIDN, overriding pkg-config ENCHANT_CFLAGS C compiler flags for ENCHANT, overriding pkg-config ENCHANT_LIBS linker flags for ENCHANT, 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 mcabber configure 0.10.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_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_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if 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_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.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_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------- ## ## Report this to mcabber@lilotux.net ## ## ---------------------------------- ##" ) | 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_c_check_header_mongrel # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $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_member # 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_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if 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_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type 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 mcabber $as_me 0.10.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 am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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; } # Just in case sleep 1 echo timestamp > conftest.file # 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 ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != 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; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$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 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='mcabber' VERSION='0.10.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ac_config_headers="$ac_config_headers mcabber/config.h" ac_config_headers="$ac_config_headers include/config.h" 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.2' macro_revision='1.3337' 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 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 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 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; 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"; 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 $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${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 "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 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 "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 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 "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${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 x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-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 "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ 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 $_lt_result -eq 0 && $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 "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${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 # 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 test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${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 "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${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 "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ 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 which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${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 x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${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 "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${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 "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes 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 "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${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 "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${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 "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # 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 "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # 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 "$lt_cv_prog_gnu_ld" = yes; 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 ;; # 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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # 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*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # 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 "$with_gnu_ld" = yes; 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=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # 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 "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${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 ;; *) 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 "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 8's {/usr,}/bin/sh. touch 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 if test "x$GCC" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 $as_echo_n "checking gcc version... " >&6; } gccver=$($CC -dumpversion) gccvermajor=$(echo $gccver | cut -d . -f1) gccverminor=$(echo $gccver | cut -d . -f2) gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccver" >&5 $as_echo "$gccver" >&6; } CFLAGS="$CFLAGS -Wall" if test x"$gccvermajor" = x"4" -a x"$gccverminor" = x"2"; then DBGCFLAGS="-fgnu89-inline" fi fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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 for ac_header in arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ stdlib.h string.h strings.h sys/socket.h sys/time.h \ syslog.h termios.h wchar.h wctype.h localcharset.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF else as_fn_error $? "Missing header file" "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include #include <$ac_cv_struct_tm> " if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 _ACEOF fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h else ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include " if test "x$ac_cv_have_decl_tzname" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME $ac_have_decl _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 $as_echo_n "checking for tzname... " >&6; } if ${ac_cv_var_tzname+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !HAVE_DECL_TZNAME extern char *tzname[]; #endif int main () { return tzname[0][0]; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_var_tzname=yes else ac_cv_var_tzname=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_var_tzname" >&5 $as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then $as_echo "#define HAVE_TZNAME 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone external" >&5 $as_echo_n "checking for timezone external... " >&6; } if ${mb_cv_var_timezone+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return (int)timezone; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : mb_cv_var_timezone=yes else mb_cv_var_timezone=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: $mb_cv_var_timezone" >&5 $as_echo "$mb_cv_var_timezone" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for altzone external" >&5 $as_echo_n "checking for altzone external... " >&6; } if ${mb_cv_var_altzone+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return (int)altzone; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : mb_cv_var_altzone=yes else mb_cv_var_altzone=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: $mb_cv_var_altzone" >&5 $as_echo "$mb_cv_var_altzone" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daylight external" >&5 $as_echo_n "checking for daylight external... " >&6; } if ${mb_cv_var_daylight+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return (int)daylight; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : mb_cv_var_daylight=yes else mb_cv_var_daylight=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: $mb_cv_var_daylight" >&5 $as_echo "$mb_cv_var_daylight" >&6; } if test $mb_cv_var_timezone = yes; then $as_echo "#define HAVE_TIMEZONE 1" >>confdefs.h fi if test $mb_cv_var_altzone = yes; then $as_echo "#define HAVE_ALTZONE 1" >>confdefs.h fi if test $mb_cv_var_daylight = yes; then $as_echo "#define HAVE_DAYLIGHT 1" >>confdefs.h fi # 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_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${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_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if ${ac_cv_lib_error_at_line+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = 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_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = 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_c_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_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=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_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in alarm arc4random bzero gethostbyname gethostname inet_ntoa \ isascii memmove memset modf select setlocale socket strcasecmp \ strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \ iswblank do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 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_fn_c_check_decl "$LINENO" "strptime" "ac_cv_have_decl_strptime" "#define _GNU_SOURCE #include " if test "x$ac_cv_have_decl_strptime" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRPTIME $ac_have_decl _ACEOF # Check for tm_gmtoff { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff in struct tm" >&5 $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; } if ${ac_cv_struct_tm_gmtoff+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { struct tm tm; tm.tm_gmtoff; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm_gmtoff=yes else ac_cv_struct_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm_gmtoff" >&5 $as_echo "$ac_cv_struct_tm_gmtoff" >&6; } if test "$ac_cv_struct_tm_gmtoff" = yes; then $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi # Check if we must provide a SIGWINCH handler # Check whether --enable-sigwinch was given. if test "${enable_sigwinch+set}" = set; then : enableval=$enable_sigwinch; with_sigwinch=$enableval else with_sigwinch=$with_ext_funcs fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sigwinch" >&5 $as_echo "$with_sigwinch" >&6; } if test "$with_sigwinch" = yes; then $as_echo "#define USE_SIGWINCH /**/" >>confdefs.h fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_charset in -lcharset" >&5 $as_echo_n "checking for locale_charset in -lcharset... " >&6; } if ${ac_cv_lib_charset_locale_charset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcharset $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 locale_charset (); int main () { return locale_charset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_charset_locale_charset=yes else ac_cv_lib_charset_locale_charset=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_charset_locale_charset" >&5 $as_echo "$ac_cv_lib_charset_locale_charset" >&6; } if test "x$ac_cv_lib_charset_locale_charset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCHARSET 1 _ACEOF LIBS="-lcharset $LIBS" fi ac_fn_c_check_func "$LINENO" "initscr" "ac_cv_func_initscr" if test "x$ac_cv_func_initscr" = xyes; then : else cf_ncurses="ncurses" for lib in ncursesw ncurses do as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_waddnwstr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for waddnwstr in -l$lib" >&5 $as_echo_n "checking for waddnwstr in -l$lib... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$lib $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 waddnwstr (); int main () { return waddnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cf_ncurses="$lib"; cf_ncurses_unicode="yes"; break fi done as_ac_Lib=`$as_echo "ac_cv_lib_$cf_ncurses''_initscr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -l$cf_ncurses" >&5 $as_echo_n "checking for initscr in -l$cf_ncurses... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_ncurses $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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : LIBS="$LIBS -l$cf_ncurses" if test "$cf_ncurses" = ncursesw; then for ac_header in ncursesw/ncurses.h ncursesw/panel.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 else for ac_header in ncurses.h panel.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 else as_fn_error $? "Missing header file" "$LINENO" 5 fi done fi done else for ac_header in ncurses/ncurses.h ncurses/panel.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 else for ac_header in ncurses.h panel.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 else as_fn_error $? "Missing header file" "$LINENO" 5 fi done fi done fi else ac_fn_c_check_func "$LINENO" "initscr" "ac_cv_func_initscr" if test "x$ac_cv_func_initscr" = xyes; then : else case $host_os in #(vi freebsd*) #(vi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -lmytinfo" >&5 $as_echo_n "checking for tgoto in -lmytinfo... " >&6; } if ${ac_cv_lib_mytinfo_tgoto+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $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 tgoto (); int main () { return tgoto (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mytinfo_tgoto=yes else ac_cv_lib_mytinfo_tgoto=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_mytinfo_tgoto" >&5 $as_echo "$ac_cv_lib_mytinfo_tgoto" >&6; } if test "x$ac_cv_lib_mytinfo_tgoto" = xyes; then : LIBS="-lmytinfo $LIBS" fi ;; hpux10.*|hpux11.*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcur_colr" >&5 $as_echo_n "checking for initscr in -lcur_colr... " >&6; } if ${ac_cv_lib_cur_colr_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcur_colr $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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cur_colr_initscr=yes else ac_cv_lib_cur_colr_initscr=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_cur_colr_initscr" >&5 $as_echo "$ac_cv_lib_cur_colr_initscr" >&6; } if test "x$ac_cv_lib_cur_colr_initscr" = xyes; then : LIBS="-lcur_colr $LIBS" CFLAGS="-I/usr/include/curses_colr $CFLAGS" ac_cv_func_initscr=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lHcurses" >&5 $as_echo_n "checking for initscr in -lHcurses... " >&6; } if ${ac_cv_lib_Hcurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lHcurses $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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Hcurses_initscr=yes else ac_cv_lib_Hcurses_initscr=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_Hcurses_initscr" >&5 $as_echo "$ac_cv_lib_Hcurses_initscr" >&6; } if test "x$ac_cv_lib_Hcurses_initscr" = xyes; then : # HP's header uses __HP_CURSES, but user claims _HP_CURSES. LIBS="-lHcurses $LIBS" CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS" ac_cv_func_initscr=yes fi fi ;; linux*) # Suse Linux does not follow /usr/lib convention LIBS="$LIBS -L/lib" ;; esac if test ".$With5lib" != ".no" ; then if test -d /usr/5lib ; then # SunOS 3.x or 4.x CPPFLAGS="$CPPFLAGS -I/usr/5include" LIBS="$LIBS -L/usr/5lib" fi fi if test ".$ac_cv_func_initscr" != .yes ; then cf_save_LIBS="$LIBS" cf_term_lib="" cf_curs_lib="" # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. ac_fn_c_check_func "$LINENO" "tgoto" "ac_cv_func_tgoto" if test "x$ac_cv_func_tgoto" = xyes; then : cf_term_lib=predefined else for cf_term_lib in termcap termlib unknown do as_ac_Lib=`$as_echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -l$cf_term_lib" >&5 $as_echo_n "checking for tgoto in -l$cf_term_lib... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_term_lib $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 tgoto (); int main () { return tgoto (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : break fi done fi # Check for library containing initscr test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown do as_ac_Lib=`$as_echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -l$cf_curs_lib" >&5 $as_echo_n "checking for initscr in -l$cf_curs_lib... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_curs_lib $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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : break fi done test $cf_curs_lib = unknown && as_fn_error $? "no curses library found" "$LINENO" 5 LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can link with $cf_curs_lib library" >&5 $as_echo_n "checking if we can link with $cf_curs_lib library... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${cf_cv_ncurses_header-curses.h}> int main () { initscr() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : cf_result=yes else cf_result=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cf_result" >&5 $as_echo "$cf_result" >&6; } test $cf_result = no && as_fn_error $? "Cannot link curses library" "$LINENO" 5 elif test "$cf_term_lib" != predefined ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 $as_echo_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${cf_cv_ncurses_header-curses.h}> int main () { initscr(); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : cf_result=no else LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${cf_cv_ncurses_header-curses.h}> int main () { initscr() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : cf_result=yes else cf_result=error fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cf_result" >&5 $as_echo "$cf_result" >&6; } fi fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_panel in -lpanelw" >&5 $as_echo_n "checking for new_panel in -lpanelw... " >&6; } if ${ac_cv_lib_panelw_new_panel+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpanelw $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 new_panel (); int main () { return new_panel (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_panelw_new_panel=yes else ac_cv_lib_panelw_new_panel=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_panelw_new_panel" >&5 $as_echo "$ac_cv_lib_panelw_new_panel" >&6; } if test "x$ac_cv_lib_panelw_new_panel" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPANELW 1 _ACEOF LIBS="-lpanelw $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_panel in -lpanel" >&5 $as_echo_n "checking for new_panel in -lpanel... " >&6; } if ${ac_cv_lib_panel_new_panel+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpanel $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 new_panel (); int main () { return new_panel (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_panel_new_panel=yes else ac_cv_lib_panel_new_panel=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_panel_new_panel" >&5 $as_echo "$ac_cv_lib_panel_new_panel" >&6; } if test "x$ac_cv_lib_panel_new_panel" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPANEL 1 _ACEOF LIBS="-lpanel $LIBS" fi fi if test x"$cf_ncurses_unicode" = x"yes"; then $as_echo "#define HAVE_UNICODE /**/" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your ncurses installation does not support unicode" >&5 $as_echo "$as_me: WARNING: Your ncurses installation does not support unicode" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESCDELAY variable" >&5 $as_echo_n "checking for ESCDELAY variable... " >&6; } if ${mc_cv_ncurses_escdelay+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int ESCDELAY; ESCDELAY = 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : mc_cv_ncurses_escdelay=yes else mc_cv_ncurses_escdelay=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: $mc_cv_ncurses_escdelay" >&5 $as_echo "$mc_cv_ncurses_escdelay" >&6; } if test "$mc_cv_ncurses_escdelay" = yes; then $as_echo "#define HAVE_ESCDELAY 1" >>confdefs.h fi # Check whether --enable-modules was given. if test "${enable_modules+set}" = set; then : enableval=$enable_modules; enable_modules=$enableval fi if test "x$enable_modules" != "xno"; then $as_echo "#define MODULES_ENABLE 1" >>confdefs.h gmodule_module=gmodule else gmodule_module='' fi # Check for glib # Check whether --enable-glibtest was given. if test "${enable_glibtest+set}" = set; then : enableval=$enable_glibtest; else enable_glibtest=yes fi pkg_config_args=glib-2.0 for module in . g_regex_new "$gmodule_module" do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; gio*) pkg_config_args="$pkg_config_args $module-2.0" ;; esac done 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.16 { $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 no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=2.14.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5 $as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { unsigned int major, minor, micro; char *tmp_version; fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_glib=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 $as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } $as_echo "#define HAVE_GLIB_REGEX 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" GLIB_COMPILE_RESOURCES="" # Check whether --enable-glibtest was given. if test "${enable_glibtest+set}" = set; then : enableval=$enable_glibtest; else enable_glibtest=yes fi pkg_config_args=glib-2.0 for module in . g_list_append do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; gio*) pkg_config_args="$pkg_config_args $module-2.0" ;; esac done 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.16 { $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 no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=2.0.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5 $as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { unsigned int major, minor, micro; char *tmp_version; fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_glib=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 $as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" GLIB_COMPILE_RESOURCES="" as_fn_error $? "glib is required" "$LINENO" 5 fi rm -f conf.glibtest fi rm -f conf.glibtest # Check for loudmouth pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOUDMOUTH" >&5 $as_echo_n "checking for LOUDMOUTH... " >&6; } if test -n "$LOUDMOUTH_CFLAGS"; then pkg_cv_LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"loudmouth-1.0 >= 1.4.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "loudmouth-1.0 >= 1.4.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LOUDMOUTH_CFLAGS=`$PKG_CONFIG --cflags "loudmouth-1.0 >= 1.4.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LOUDMOUTH_LIBS"; then pkg_cv_LOUDMOUTH_LIBS="$LOUDMOUTH_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"loudmouth-1.0 >= 1.4.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "loudmouth-1.0 >= 1.4.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LOUDMOUTH_LIBS=`$PKG_CONFIG --libs "loudmouth-1.0 >= 1.4.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LOUDMOUTH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "loudmouth-1.0 >= 1.4.2" 2>&1` else LOUDMOUTH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "loudmouth-1.0 >= 1.4.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LOUDMOUTH_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (loudmouth-1.0 >= 1.4.2) were not met: $LOUDMOUTH_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LOUDMOUTH_CFLAGS and LOUDMOUTH_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LOUDMOUTH_CFLAGS and LOUDMOUTH_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LOUDMOUTH_CFLAGS=$pkg_cv_LOUDMOUTH_CFLAGS LOUDMOUTH_LIBS=$pkg_cv_LOUDMOUTH_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check for libidn # Check whether --with-libidn was given. if test "${with_libidn+set}" = set; then : withval=$with_libidn; libidn=$withval else libidn=yes fi if test "$libidn" != "no" ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBIDN" >&5 $as_echo_n "checking for LIBIDN... " >&6; } if test -n "$LIBIDN_CFLAGS"; then pkg_cv_LIBIDN_CFLAGS="$LIBIDN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libidn >= 0.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libidn >= 0.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBIDN_CFLAGS=`$PKG_CONFIG --cflags "libidn >= 0.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBIDN_LIBS"; then pkg_cv_LIBIDN_LIBS="$LIBIDN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libidn >= 0.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libidn >= 0.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBIDN_LIBS=`$PKG_CONFIG --libs "libidn >= 0.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 LIBIDN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libidn >= 0.0.0" 2>&1` else LIBIDN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libidn >= 0.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBIDN_PKG_ERRORS" >&5 libidn=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } libidn=no else LIBIDN_CFLAGS=$pkg_cv_LIBIDN_CFLAGS LIBIDN_LIBS=$pkg_cv_LIBIDN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } libidn=yes fi if test "$libidn" != "yes" ; then libidn=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libidn not found" >&5 $as_echo "$as_me: WARNING: Libidn not found" >&2;} else libidn=yes $as_echo "#define HAVE_LIBIDN 1" >>confdefs.h fi fi # Check for gpgme # Check whether --enable-gpgme was given. if test "${enable_gpgme+set}" = set; then : enableval=$enable_gpgme; if test x"$enableval" = x"no"; then enable_gpgme=no fi fi if test x"${enable_gpgme}" != x"no"; then # Check whether --with-gpgme-prefix was given. if test "${with_gpgme_prefix+set}" = set; then : withval=$with_gpgme_prefix; gpgme_config_prefix="$withval" else gpgme_config_prefix="" fi if test "x$gpgme_config_prefix" != x ; then GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config" fi # Extract the first word of "gpgme-config", so it can be a program name with args. set dummy gpgme-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_GPGME_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GPGME_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GPGME_CONFIG="$GPGME_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_GPGME_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 test -z "$ac_cv_path_GPGME_CONFIG" && ac_cv_path_GPGME_CONFIG="no" ;; esac fi GPGME_CONFIG=$ac_cv_path_GPGME_CONFIG if test -n "$GPGME_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGME_CONFIG" >&5 $as_echo "$GPGME_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GPGME_CONFIG" != "no" ; then gpgme_version=`$GPGME_CONFIG --version` fi gpgme_version_major=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` gpgme_version_minor=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` gpgme_version_micro=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` tmp=1.0.0 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME - version >= $min_gpgme_version" >&5 $as_echo_n "checking for GPGME - version >= $min_gpgme_version... " >&6; } ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_CFLAGS=`$GPGME_CONFIG --cflags` GPGME_LIBS=`$GPGME_CONFIG --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_GPGME 1" >>confdefs.h else GPGME_CFLAGS="" GPGME_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi fi # Check for otr # Check whether --enable-otr was given. if test "${enable_otr+set}" = set; then : enableval=$enable_otr; enable_otr=$enableval else otr="" fi if test "x$enable_otr" = "xyes"; then # Look for libgcrypt and libotr # 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.2.2 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` libotr_save_CFLAGS="$CFLAGS" libotr_save_LDFLAGS="$LDFLAGS" libotr_save_LIBS="$LIBS" libotr_found=yes # Check whether --with-libotr-prefix was given. if test "${with_libotr_prefix+set}" = set; then : withval=$with_libotr_prefix; libotr_prefix="$withval" else libotr_prefix="" fi # Check whether --with-libotr-inc-prefix was given. if test "${with_libotr_inc_prefix+set}" = set; then : withval=$with_libotr_inc_prefix; libotr_inc_prefix="$withval" else libotr_inc_prefix="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr CFLAGS" >&5 $as_echo_n "checking for libotr CFLAGS... " >&6; } if test "$libotr_inc_prefix" != "" ; then LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix" CFLAGS="$CFLAGS $LIBOTR_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_CFLAGS" >&5 $as_echo "$LIBOTR_CFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr LIBS" >&5 $as_echo_n "checking for libotr LIBS... " >&6; } if test "$libotr_prefix" != "" ; then LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix" LDFLAGS="$LDFLAGS $LIBOTR_LIBS" fi LIBOTR_LIBS="$LIBOTR_LIBS -lotr" LIBS="$LIBOTR_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_LIBS" >&5 $as_echo "$LIBOTR_LIBS" >&6; } min_libotr_version=3.1.0 no_libotr="" libotr_min_major_version=`echo $min_libotr_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` libotr_min_minor_version=`echo $min_libotr_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` libotr_min_sub_version=`echo $min_libotr_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version" >&5 $as_echo_n "checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version... " >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { # if(OTRL_VERSION_MAJOR != $libotr_min_major_version) # error not present # else # if(OTRL_VERSION_MINOR > $libotr_min_minor_version) exit(0); # else # if(OTRL_VERSION_MINOR < $libotr_min_minor_version) # error not present # endif # if(OTRL_VERSION_SUB < $libotr_min_sub_version) # error not present # endif # endif # endif exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5 $as_echo "not present." >&6; } libotr_found=no 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for otrl_message_receiving in -lotr" >&5 $as_echo_n "checking for otrl_message_receiving in -lotr... " >&6; } if ${ac_cv_lib_otr_otrl_message_receiving+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lotr $LIBGCRYPT_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char otrl_message_receiving (); int main () { return otrl_message_receiving (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_otr_otrl_message_receiving=yes else ac_cv_lib_otr_otrl_message_receiving=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_otr_otrl_message_receiving" >&5 $as_echo "$ac_cv_lib_otr_otrl_message_receiving" >&6; } if test "x$ac_cv_lib_otr_otrl_message_receiving" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBOTR 1 _ACEOF LIBS="-lotr $LIBS" else libotr_found=no fi LDFLAGS="$libotr_save_LDFLAGS" LIBS="$libotr_save_LIBS" if test "x$libotr_found" = "xyes" ; then : else LIBOTR_CFLAGS="" LIBOTR_LIBS="" as_fn_error $? "libotr 3.1.0 or newer is required." "$LINENO" 5 fi if test x"$host" != x ; then 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 fi else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" as_fn_error $? "libgcrypt 1.2.2 or newer is required." "$LINENO" 5 fi fi # Check for Enchant stuff # Check whether --enable-enchant was given. if test "${enable_enchant+set}" = set; then : enableval=$enable_enchant; enable_enchant=$enableval else enchant="" fi # Check for Aspell stuff # Check whether --enable-aspell was given. if test "${enable_aspell+set}" = set; then : enableval=$enable_aspell; enable_aspell=$enableval else aspell="" fi if test "x$enable_enchant" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENCHANT" >&5 $as_echo_n "checking for ENCHANT... " >&6; } if test -n "$ENCHANT_CFLAGS"; then pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5 ($PKG_CONFIG --exists --print-errors "enchant") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$ENCHANT_LIBS"; then pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5 ($PKG_CONFIG --exists --print-errors "enchant") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 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 ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1` else ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ENCHANT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (enchant) were not met: $ENCHANT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables ENCHANT_CFLAGS and ENCHANT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables ENCHANT_CFLAGS and ENCHANT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else ENCHANT_CFLAGS=$pkg_cv_ENCHANT_CFLAGS ENCHANT_LIBS=$pkg_cv_ENCHANT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define WITH_ENCHANT 1" >>confdefs.h fi else if test "x$enable_aspell" = "xyes"; then for ac_header in aspell.h do : ac_fn_c_check_header_mongrel "$LINENO" "aspell.h" "ac_cv_header_aspell_h" "$ac_includes_default" if test "x$ac_cv_header_aspell_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ASPELL_H 1 _ACEOF have_aspell_includes=yes fi done if test "x$have_aspell_includes" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_aspell_config in -laspell" >&5 $as_echo_n "checking for new_aspell_config in -laspell... " >&6; } if ${ac_cv_lib_aspell_new_aspell_config+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laspell $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 new_aspell_config (); int main () { return new_aspell_config (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_aspell_new_aspell_config=yes else ac_cv_lib_aspell_new_aspell_config=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_aspell_new_aspell_config" >&5 $as_echo "$ac_cv_lib_aspell_new_aspell_config" >&6; } if test "x$ac_cv_lib_aspell_new_aspell_config" = xyes; then : have_aspell_libs=yes fi if test "x$have_aspell_libs" = "xyes"; then $as_echo "#define WITH_ASPELL 1" >>confdefs.h LIBS="$LIBS -laspell" else enable_aspell=no fi else enable_aspell=no fi fi fi # Export $datadir to the source tree. if test x"${datadir}" != x""; then prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix ac_define_dir=`eval echo $datadir` ac_define_dir=`eval echo $ac_define_dir` DATA_DIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DATA_DIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE fi # Export $libexecdir to the source tree prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix ac_define_dir=`eval echo $"${libdir}/${PACKAGE}"` ac_define_dir=`eval echo $ac_define_dir` PKGLIB_DIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define PKGLIB_DIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE # Check whether --enable-xep0022 was given. if test "${enable_xep0022+set}" = set; then : enableval=$enable_xep0022; xep0022=$enableval fi if test "${xep0022}" = "yes"; then $as_echo "#define XEP0022 1" >>confdefs.h fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; debug=$enableval else debug="" fi if test x"${debug}" = x"yes"; then cat >>confdefs.h <<_ACEOF #define ENABLE_DEBUG 1 _ACEOF if test "x$GCC" = "xyes"; then if test "$gccvernum" -ge "400"; then CFLAGS="$CFLAGS -Wextra" else CFLAGS="$CFLAGS -W" fi CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0" fi # gcc CFLAGS="$CFLAGS -g" else CFLAGS="-O2 $CFLAGS" fi # Check whether --enable-hgcset was given. if test "${enable_hgcset+set}" = set; then : enableval=$enable_hgcset; hgcset=$enableval else hgcset="yes" fi if test x$hgcset = xyes; then HGCSET_TRUE= HGCSET_FALSE='#' else HGCSET_TRUE='#' HGCSET_FALSE= fi if test "${hgcset}" = "yes"; then $as_echo "#define ENABLE_HGCSET 1" >>confdefs.h fi if test x$libotr_found = xyes; then OTR_TRUE= OTR_FALSE='#' else OTR_TRUE='#' OTR_FALSE= fi if test x$enable_modules != xno; then INSTALL_HEADERS_TRUE= INSTALL_HEADERS_FALSE='#' else INSTALL_HEADERS_TRUE='#' INSTALL_HEADERS_FALSE= fi # Prepare some config.h variables $as_echo "#define MCABBER_BRANCH \"0.10.2\"" >>confdefs.h $as_echo "#define MCABBER_VERSION \"0.10.2\"" >>confdefs.h # We need _GNU_SOURCE for strptime() and strcasestr() CFLAGS="$CFLAGS -D_GNU_SOURCE" ac_config_files="$ac_config_files mcabber/Makefile modules/Makefile modules/beep/Makefile modules/xttitle/Makefile modules/fifo/Makefile modules/urlregex/Makefile doc/Makefile doc/guide/Makefile doc/help/Makefile mcabber.pc Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # 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 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__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 "${HGCSET_TRUE}" && test -z "${HGCSET_FALSE}"; then as_fn_error $? "conditional \"HGCSET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OTR_TRUE}" && test -z "${OTR_FALSE}"; then as_fn_error $? "conditional \"OTR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_HEADERS_TRUE}" && test -z "${INSTALL_HEADERS_FALSE}"; then as_fn_error $? "conditional \"INSTALL_HEADERS\" 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 mcabber $as_me 0.10.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="\\ mcabber config.status 0.10.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"`' 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_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' 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_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_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; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "mcabber/config.h") CONFIG_HEADERS="$CONFIG_HEADERS mcabber/config.h" ;; "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "mcabber/Makefile") CONFIG_FILES="$CONFIG_FILES mcabber/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "modules/beep/Makefile") CONFIG_FILES="$CONFIG_FILES modules/beep/Makefile" ;; "modules/xttitle/Makefile") CONFIG_FILES="$CONFIG_FILES modules/xttitle/Makefile" ;; "modules/fifo/Makefile") CONFIG_FILES="$CONFIG_FILES modules/fifo/Makefile" ;; "modules/urlregex/Makefile") CONFIG_FILES="$CONFIG_FILES modules/urlregex/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/guide/Makefile") CONFIG_FILES="$CONFIG_FILES doc/guide/Makefile" ;; "doc/help/Makefile") CONFIG_FILES="$CONFIG_FILES doc/help/Makefile" ;; "mcabber.pc") CONFIG_FILES="$CONFIG_FILES mcabber.pc" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) 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"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # 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 # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 mcabber-0.10.2/configure.ac000066400000000000000000000220071216603513500154560ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([mcabber],[0.10.2],[mcabber@lilotux.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([mcabber]) AM_CONFIG_HEADER(mcabber/config.h) AC_CONFIG_HEADER(include/config.h) AC_PROG_LIBTOOL AC_PROG_RANLIB # Checks for programs. AC_PROG_CC AC_PROG_INSTALL if test "x$GCC" = "xyes"; then dnl Get gcc version AC_MSG_CHECKING([gcc version]) gccver=$($CC -dumpversion) gccvermajor=$(echo $gccver | cut -d . -f1) gccverminor=$(echo $gccver | cut -d . -f2) gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) AC_MSG_RESULT($gccver) CFLAGS="$CFLAGS -Wall" if test x"$gccvermajor" = x"4" -a x"$gccverminor" = x"2"; then DBGCFLAGS="-fgnu89-inline" fi fi AC_SYS_LARGEFILE PKG_PROG_PKG_CONFIG # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ stdlib.h string.h strings.h sys/socket.h sys/time.h \ syslog.h termios.h wchar.h wctype.h localcharset.h]) AC_CHECK_HEADERS([unistd.h], , AC_MSG_ERROR([Missing header file])) AC_VAR_TIMEZONE_EXTERNALS # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM # Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS([alarm arc4random bzero gethostbyname gethostname inet_ntoa \ isascii memmove memset modf select setlocale socket strcasecmp \ strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \ iswblank]) AC_CHECK_DECLS([strptime],,, [#define _GNU_SOURCE #include ]) # Check for tm_gmtoff MC_TM_GMTOFF # Check if we must provide a SIGWINCH handler AC_ARG_ENABLE(sigwinch, AC_HELP_STRING([--enable-sigwinch], [compile with SIGWINCH handler]), [with_sigwinch=$enableval], [with_sigwinch=$with_ext_funcs]) AC_MSG_RESULT($with_sigwinch) if test "$with_sigwinch" = yes; then AC_DEFINE([USE_SIGWINCH], [], [Provide own SIGWINCH handler]) fi # Checks for libraries. AC_CHECK_LIB(charset, locale_charset) AC_CHECK_FUNC(initscr,, [ cf_ncurses="ncurses" for lib in ncursesw ncurses do AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; cf_ncurses_unicode="yes"; break]) done AC_CHECK_LIB($cf_ncurses, initscr, [LIBS="$LIBS -l$cf_ncurses" if test "$cf_ncurses" = ncursesw; then AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/panel.h],, [AC_CHECK_HEADERS([ncurses.h panel.h],, AC_MSG_ERROR([Missing header file]))]) else AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],, [AC_CHECK_HEADERS([ncurses.h panel.h],, AC_MSG_ERROR([Missing header file]))]) fi ], [CF_CURSES_LIBS]) ]) AC_CHECK_LIB([panelw], [new_panel],, AC_CHECK_LIB([panel], [new_panel]) ) if test x"$cf_ncurses_unicode" = x"yes"; then AC_DEFINE([HAVE_UNICODE], [], [Define if ncurses have unicode support]) else AC_MSG_WARN([Your ncurses installation does not support unicode]) fi AC_CACHE_CHECK([for ESCDELAY variable], [mc_cv_ncurses_escdelay], [AC_TRY_LINK([], [ extern int ESCDELAY; ESCDELAY = 0; ], [mc_cv_ncurses_escdelay=yes], [mc_cv_ncurses_escdelay=no]) ]) if test "$mc_cv_ncurses_escdelay" = yes; then AC_DEFINE([HAVE_ESCDELAY], 1, [Define if ncurses has ESCDELAY variable]) fi AC_ARG_ENABLE(modules, AC_HELP_STRING([--disable-modules], [disable dynamic modules loading]), enable_modules=$enableval) if test "x$enable_modules" != "xno"; then AC_DEFINE(MODULES_ENABLE, 1, [Define if you want dynamic modules loading]) gmodule_module=gmodule else gmodule_module='' fi # Check for glib AM_PATH_GLIB_2_0(2.14.0, [AC_DEFINE([HAVE_GLIB_REGEX], 1, [Define if GLib has regex support])], [AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]), [g_list_append], ["$gmodule_module"])], [g_regex_new "$gmodule_module"]) # Check for loudmouth PKG_CHECK_MODULES(LOUDMOUTH, loudmouth-1.0 >= 1.4.2) # Check for libidn AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]], [Support IDN (needs GNU Libidn)]), libidn=$withval, libidn=yes) if test "$libidn" != "no" ; then PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no]) if test "$libidn" != "yes" ; then libidn=no AC_MSG_WARN([Libidn not found]) else libidn=yes AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you want Libidn.]) fi fi # Check for gpgme AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--disable-gpgme], [disable GPGME support]), [ if test x"$enableval" = x"no"; then enable_gpgme=no fi ]) if test x"${enable_gpgme}" != x"no"; then AM_PATH_GPGME(1.0.0, AC_DEFINE([HAVE_GPGME], 1, [Define if you use GPGME to support OpenPGP])) fi # Check for otr AC_ARG_ENABLE(otr, AC_HELP_STRING([--enable-otr], [enable OTR (Off-the-Record) messaging support]), enable_otr=$enableval, otr="") if test "x$enable_otr" = "xyes"; then # Look for libgcrypt and libotr AM_PATH_LIBGCRYPT(1.2.2, [ AM_PATH_LIBOTR(3.1.0, , AC_MSG_ERROR(libotr 3.1.0 or newer is required.)) ], AC_MSG_ERROR(libgcrypt 1.2.2 or newer is required.) ) fi # Check for Enchant stuff AC_ARG_ENABLE(enchant, AC_HELP_STRING([--enable-enchant], [enable enchant support]), enable_enchant=$enableval, enchant="") # Check for Aspell stuff AC_ARG_ENABLE(aspell, AC_HELP_STRING([--enable-aspell], [enable aspell support]), enable_aspell=$enableval, aspell="") if test "x$enable_enchant" = "xyes"; then PKG_CHECK_MODULES(ENCHANT, [enchant], AC_DEFINE(WITH_ENCHANT, 1, [Define if you want enchant support]) ) else if test "x$enable_aspell" = "xyes"; then AC_CHECK_HEADERS(aspell.h, [ have_aspell_includes=yes ]) if test "x$have_aspell_includes" = "xyes"; then AC_CHECK_LIB(aspell, new_aspell_config, [ have_aspell_libs=yes ]) if test "x$have_aspell_libs" = "xyes"; then AC_DEFINE([WITH_ASPELL], 1, [Define if you want aspell support]) LIBS="$LIBS -laspell" else enable_aspell=no fi else enable_aspell=no fi fi fi # Export $datadir to the source tree. if test x"${datadir}" != x""; then AC_DEFINE_DIR(DATA_DIR, datadir, [Data files directory]) fi # Export $libexecdir to the source tree AC_DEFINE_DIR(PKGLIB_DIR, "${libdir}/${PACKAGE}", [Modules directory]) AC_ARG_ENABLE(xep0022, AC_HELP_STRING([--enable-xep0022], [enable obsolete Message Events (XEP-0022)]), xep0022=$enableval) if test "${xep0022}" = "yes"; then AC_DEFINE([XEP0022], 1, [Define if you want obsolete Message Events]) fi AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [add development compilation options]), debug=$enableval, debug="") if test x"${debug}" = x"yes"; then AC_DEFINE_UNQUOTED([ENABLE_DEBUG],[1],[Devel compilation options]) if test "x$GCC" = "xyes"; then if test "$gccvernum" -ge "400"; then CFLAGS="$CFLAGS -Wextra" else CFLAGS="$CFLAGS -W" fi CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0" fi # gcc CFLAGS="$CFLAGS -g" else CFLAGS="-O2 $CFLAGS" fi AC_ARG_ENABLE(hgcset, AC_HELP_STRING([--disable-hgcset], [do not use Mercurial changeset value]), hgcset=$enableval, hgcset="yes") AM_CONDITIONAL(HGCSET, [test x$hgcset = xyes]) if test "${hgcset}" = "yes"; then AC_DEFINE([ENABLE_HGCSET], 1, [Use Mercurial changeset]) fi AM_CONDITIONAL([OTR], [test x$libotr_found = xyes]) AM_CONDITIONAL([INSTALL_HEADERS], [test x$enable_modules != xno]) # Prepare some config.h variables AC_DEFINE([MCABBER_BRANCH], "0.10.2", [Mcabber branch]) AC_DEFINE([MCABBER_VERSION], "AC_PACKAGE_VERSION", [Mcabber version string]) # We need _GNU_SOURCE for strptime() and strcasestr() CFLAGS="$CFLAGS -D_GNU_SOURCE" AC_CONFIG_FILES([mcabber/Makefile modules/Makefile modules/beep/Makefile modules/xttitle/Makefile modules/fifo/Makefile modules/urlregex/Makefile doc/Makefile doc/guide/Makefile doc/help/Makefile mcabber.pc Makefile]) AC_OUTPUT mcabber-0.10.2/contrib/000077500000000000000000000000001216603513500146275ustar00rootroot00000000000000mcabber-0.10.2/contrib/cicq2mcabber.pl000077500000000000000000000045741216603513500175160ustar00rootroot00000000000000#!/usr/bin/perl -w # # usage: cicq2mcabber.pl cicqhistoryfile > mcabberhistoryfile # Convert a centericq history file to mcabber format # # See histolog.c for the mcabber format. # # MiKael, 2005/05/05 use strict; my $line; my $inblock = 0; my %bdata = (); sub print_entry() { my ($type, $info, $date, $len, $data); return unless(defined $bdata{"msg"}); if ($bdata{"type"} eq "MSG") { $type = "M"; if ($bdata{"inout"} eq "OUT") { $info = "S"; } elsif ($bdata{"inout"} eq "IN") { $info = "R"; } else { print STDERR "Neither IN nor OUT!?\n"; return; } } else { print STDERR "Data type not handled.\n"; return; } $date = $bdata{"timestamp"}; $len = $bdata{"nb"}; $data = $bdata{"msg"}; # Date conversion to iso8601 my ($ss,$mm,$hh,$DD,$MM,$YYYY) = gmtime($date); $date = sprintf "%04d%02d%02dT%02d:%02d:%02dZ", $YYYY+1900, $MM+1,$DD,$hh,$mm,$ss; printf("%s%s %18.18s %03d %s", $type, $info, $date, $len, $data); } while ($line = <>) { chomp $line; # The separator is ^L ; I use substr to exclude the EOL if ($line eq " ") { print_entry() if ($inblock); # reset data for new block %bdata = (); $inblock = 1; next; } # Skip garbage or unrecognized stuff... if (!$inblock) { print STDERR "Skipping line\n"; next; } # 1 IN/OUT line unless (exists $bdata{"inout"}) { if (($line eq "IN") || ($line eq "OUT")) { $bdata{"inout"} = $line; } else { print STDERR "No IN/OUT information ($line)!\n"; $inblock = 0; } next; } # 1 type line (MSG...) unless (exists $bdata{"type"}) { # We don't handle NOTE and AUTH yet. if ($line eq "MSG") { $bdata{"type"} = $line; } else { print STDERR "Not a MSG type ($line)\n"; $inblock = 0; } next; } # 2 date lines unless (exists $bdata{"timestamp"}) { $bdata{"timestamp"} = $line; last unless defined ($line = <>); chomp $line; $bdata{"timestamp2"} = $line; if (! $bdata{"timestamp2"} eq $bdata{"timestamp2"}) { print STDERR "Timestamps differ...\n"; } next; } # ... The message itself $line =~ s/ $//; if (exists $bdata{"msg"}) { $bdata{"msg"} .= $line."\n"; $bdata{"nb"}++; } else { $bdata{"msg"} = $line."\n"; $bdata{"nb"} = 0; } } print_entry() if ($inblock); # vim:set sw=2 sts=2 et si cinoptions="": mcabber-0.10.2/contrib/events/000077500000000000000000000000001216603513500161335ustar00rootroot00000000000000mcabber-0.10.2/contrib/events/eventcmd000077500000000000000000000026551216603513500176760ustar00rootroot00000000000000#! /bin/sh # # Sample events script for mcabber # Plays a sound when receiving a message # # To use this script, set the "events_command" option to the path of # the script (see the mcabberrc.example file for an example) # # MiKael, 2005-07-15 # The following sound comes with the gtkboard package, # you can modify this line to play another one... CMD_MSG_IN="/usr/bin/play /usr/share/sounds/gtkboard/machine_move.ogg" event=$1 arg1=$2 arg2=$3 filename=$4 # Note that the 4th argument is only provided for incoming messages # and when 'event_log_files' is set. if [ $event = "MSG" ]; then case "$arg1" in IN) # Incoming message from buddy $arg2 $CMD_MSG_IN > /dev/null 2>&1 if [ -n "$filename" -a -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi ;; MUC) # Groupchat message in room $arg2 if [ -n "$filename" -a -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi ;; OUT) # Outgoing message for buddy $arg2 ;; esac elif [ $event = "STATUS" ]; then # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) echo > /dev/null elif [ $event = "UNREAD" ]; then # $arg1 contains 4 numbers separated with space chars: # Nr of unread buffers, nr of unread buffers with attention sign, # nr of MUC unread buffers, nr of MUC unread buffers with attention sign. echo > /dev/null fi mcabber-0.10.2/contrib/events/eventcmd.osd000077500000000000000000000024041216603513500204520ustar00rootroot00000000000000#! /bin/sh # # Sample events script for mcabber # Use OSD to display events on the user's desktop # # To use this script, set the "events_command" option to the path of # the script (see the mcabberrc.example file for an example) # # MiKael, 2006-01-07 XOSD_CMD_PIPE='osd_cat --pos=bottom --align=center --delay=4 --color=magenta --font=-*-courier-*-*-*-*-14-*-*-*-*-*-iso8859-15' event=$1 arg1=$2 arg2=$3 filename=$4 # Note that the 4th argument is only provided for incoming messages # and when 'event_log_files' is set. if [ $event = "MSG" ]; then case "$arg1" in IN) # Incoming message from buddy $arg2 echo "You have an IM from <$arg2>" | $XOSD_CMD_PIPE > /dev/null 2>&1 if [ -n "$filename" -a -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi ;; MUC) # Groupchat message in room $arg2 if [ -n "$filename" && -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi ;; OUT) # Outgoing message for buddy $arg2 ;; esac elif [ $event = "STATUS" ]; then # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) echo "<$arg2> has changed status to: [$arg1]" | $XOSD_CMD_PIPE > /dev/null 2>&1 echo > /dev/null fi mcabber-0.10.2/contrib/events/eventcmd.pastebin000077500000000000000000000033211216603513500214710ustar00rootroot00000000000000#!/bin/sh # # event_command url handling script for mcabber # by # * Alexander Clouter # * Jamie Lentin # # For tinyurl'ing (sending tinyurl's of URL's sent to you # resent as a headline to yourself) you set your *own* # jabber id for 'me' and it's probably best leaving # 'tinyurltrigger' unless you know what you are doing. # # For pastebin support (dumping the URL as an HTML anchor # into a local file that could be exported by a webserver # or as a file a web-browser can open) tinker with the # pastebin lines. # # If you want to disable a one of the facilities, just # comment out the pair of variables you do not want. # #set -x ## configuration # tinyurl'ifier me=jim@jabber.li tinyurltrigger=24 # pastebin support pastebin_file=~/bitbucket/stuff/pastebin.html pastebin_line_count=10 # Don't do 'owt unless recieving a message [ x$1 != xMSG ] && exit 0 [ x$2 != xIN ] && exit 0 jid=$3 # do nothing if it's from self [ "$jid" == "$me" ] && exit 0 # If receiving a message, scan for links url=$(cat "$4" | awk 'BEGIN { RS="( |\n|\t)+"; FS=""; } /(https?|ftp):\/\// { print $1 }') if [ -n "$url" ]; then date=$(/bin/date) if [ -n "$me" -a ${#url} -ge $tinyurltrigger ]; then tinyurl=`wget -q -O - http://tinyurl.com/api-create.php?url="$url"` echo "say_to -q -h $me <= $jid $url" > ~/.mcabber/mcabber.fifo echo "say_to -q -h $me $tinyurl" > ~/.mcabber/mcabber.fifo fi if [ -n "$pastebin_file" ]; then if [ ! -f "$pastebin_file" ]; then touch "$pastebin_file" fi sed -i -e :a -e '$q;N;11,$D;ba' "$pastebin_file" printf '%s (%s): %s
\n' "$date" "$jid" "$url" "$url" >> $pastebin_file fi fi [ -n "$4" ] && rm "$4" exit 0 mcabber-0.10.2/contrib/events/mcnotify.py000077500000000000000000000024431216603513500203430ustar00rootroot00000000000000#!/usr/bin/python # Version 0.05 # # Copyright (C) 2007 Adam Wolk "Mulander" # Slightly updated by Mikael Berthe # # To use this script, set the "events_command" option to the path of # the script (see the mcabberrc.example file for an example) # # This script is provided under the terms of the GNU General Public License, # see the file COPYING in the root mcabber source directory. # import sys #CMD_MSG_IN="/usr/bin/play /home/mulander/sound/machine_move.ogg" CMD_MSG_IN="" SHORT_NICK=True if len(sys.argv) == 5: event,arg1,arg2,filename = sys.argv[1:5] else: event,arg1,arg2 = sys.argv[1:4] filename = None if event == 'MSG' and arg1 == 'IN': import pynotify,os,locale encoding = (locale.getdefaultlocale())[1] msg = 'sent you a message.' if SHORT_NICK and '@' in arg2: arg2 = arg2[0:arg2.index('@')] if filename is not None: f = file(filename) msg = f.read() pynotify.init('mcnotify') msgbox = pynotify.Notification(unicode(arg2, encoding),unicode(msg, encoding)) msgbox.set_timeout(3000) msgbox.set_urgency(pynotify.URGENCY_LOW) msgbox.show() if (CMD_MSG_IN): os.system(CMD_MSG_IN + '> /dev/null 2>&1') if filename is not None and os.path.exists(filename): os.remove(filename) pynotify.uninit() # vim:set noet sts=8 sw=8: mcabber-0.10.2/contrib/filter_statusmsg.py000077500000000000000000000011371216603513500206050ustar00rootroot00000000000000#!/usr/bin/env python # This script can be used to delete status messages from history files. # # If you want to clean all histories from status messages: # $ for i in ~/.mcabber/histo/*; do if [[ ! -h $i ]]; then ./filter_statusmsg.py $i > foo; mv foo $i; fi; done # # Frank Zschockelt, 05.01.2007 import sys if(len(sys.argv) != 2): print "usage:",sys.argv[0],"history > history_without_status" sys.exit(0) file=open(sys.argv[1], "r") lines=file.readlines() file.close() i=0 while(i histA+B" sys.exit(0) file=open(sys.argv[1], "r") linesA=file.readlines() file.close() file=open(sys.argv[2], "r") linesB=file.readlines() file.close() i=j=0 while(i " URL: Included in mcabber source package " Last Change: 2010-04-02 " Save this file as ~/.vim/syntax/mcabber_log.vim " (and copy the ftdetect file as well) " " Logfile format: " TT YYYYmmddTHH:MM:SSZ nnn Text (this line and the nnn following lines) " TT is the data type " 'YYYYmmddTHH:MM:SSZ' is a timestamp " " XXX Please help me to improve this syntax script! if exists("b:current_syntax") finish endif " All lines (except text continuation lines) contain the date and nnn syn cluster mcabberlogEntry contains=mcabberlogDate,mcabberlognlines syn region mcabberlogStatusLine \ start="^S[OFDNAI_] \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" \ contains=mcabberlogStatus,@mcabberlogEntry syn region mcabberlogMessageLineInfo \ start="^MI \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" \ contains=mcabberlogMsgInfo,@mcabberlogEntry syn region mcabberlogMessageLineIn \ start="^MR \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" \ contains=mcabberlogMsgIn,@mcabberlogEntry syn region mcabberlogMessageLineOut \ start="^MS \d\{8\}T\d\d:\d\d:\d\dZ \d\d\d " \ end="\(\_^[MS][RSIOFDNAI_] \d\{8}T.\{8}Z \d\d\d \|\%$\)\@=" \ contains=mcabberlogMsgOut,@mcabberlogEntry syn match mcabberlogDate "\d\{8\}T\d\d:\d\d:\d\dZ" contained \ contains=mcabberlogDateChar nextgroup=mcabberlognlines syn match mcabberlogDateChar /[TZ]/ contained syn match mcabberlogStatus "^S[OFDNAI_]" \ contained skipwhite nextgroup=@mcabberlogStatusLine syn match mcabberlogMsgIn "^MR" contained skipwhite \ nextgroup=@mcabberlogMessageLine syn match mcabberlogMsgOut "^MS" contained skipwhite \ nextgroup=@mcabberlogMessageLine syn match mcabberlogMsgInfo "^MI" contained skipwhite \ nextgroup=@mcabberlogMessageLine syn match mcabberlognlines "\<\d\{3\}\>" contained command -nargs=+ HiLink hi def link HiLink mcabberlogStatus PreProc HiLink mcabberlogMessageLineIn Keyword HiLink mcabberlogMsgIn Keyword HiLink mcabberlogMessageLineOut Function HiLink mcabberlogMsgOut Function HiLink mcabberlogMsgInfo String HiLink mcabberlogMessageLineInfo String HiLink mcabberlogDate SpecialChar HiLink mcabberlogDateChar Normal HiLink mcabberlognlines Normal HiLink mcabberlogStatusLine Comment delcommand HiLink let b:current_syntax = "mcabber_log" mcabber-0.10.2/debian/000077500000000000000000000000001216603513500144115ustar00rootroot00000000000000mcabber-0.10.2/debian/README.source000066400000000000000000000003371216603513500165730ustar00rootroot00000000000000This package uses dpatch to manage all modifications to the upstream source. If you are unfamilar with how dpatch works you can find a quick reference included with dpatch in the file /usr/share/doc/dpatch/README.source.gz mcabber-0.10.2/debian/changelog000066400000000000000000000141641216603513500162710ustar00rootroot00000000000000mcabber (0.10.1-4) unstable; urgency=low * Integrated patch from upstream VCS fixing segmentation fault when using aspell (Closes: #572623) * Upgrade to Standards-Version 3.9.4 no changes needed -- Franziska Lichtblau Sat, 24 Nov 2012 11:04:41 +0100 mcabber (0.10.1-3) unstable; urgency=low * Added patch for storing passwords to MUCs in bookmarks. Thanks to Nico Golde for the patch. (Closes: #650632) * Updated german and english help output for the new /room command * Overtook maintainership (Franziska Lichtblau) thanks to Mario Iseli for the work done so far * Removed Gerfried Fuchs from Uploaders - thanks for your work * Upgrade to Standards-Version 3.9.3 no changes needed * Added hardening flags to debian/rules * Added build-dependency to dpkg-dev (>= 1.16.1~) due to importing debian buildflags * Added source format 3.0 (quilt) - removed build-dependency to quilt and dh_quilt_pach, dh_quilt_unpatch from debian/rules -- Franziska Lichtblau Sat, 16 Jun 2012 15:34:56 +0200 mcabber (0.10.1-2) unstable; urgency=low [ Franziska Lichtblau ] * Added Franziska Lichtblau to Uploaders * Added contrib-folder with useful scripts to /usr/share/doc/mcabber/examples/ (Closes: #596060) * Fixed lintian warnings (debian-rules-missing-recommended-target build-arch) + (debian-rules-missing-recommended-target build-indep): added build-arch + build-indep target * Upgrade to Standards-Verions 3.9.2, no changes needed [ Gerfried Fuchs ] * Added Vcs-* fields to debian/control. -- Gerfried Fuchs Thu, 18 Aug 2011 16:45:27 +0200 mcabber (0.10.1-1.1) unstable; urgency=low * Non-maintainer upload. * Don't ship .la files (Closes: #622447). -- Luk Claes Sat, 25 Jun 2011 16:19:57 +0200 mcabber (0.10.1-1) unstable; urgency=low * New upstream bugfix release. * Bump to Standards-Version 3.9.1. * Add libasyncns-dev to Build-Depends so it doesn't FTBFS, loudmouth doesn't use embedded version anymore. -- Gerfried Fuchs Sun, 05 Dec 2010 11:57:25 +0100 mcabber (0.10.0-1) unstable; urgency=low * New upstream release, requiring now libloudmouth1-dev. * Fix typo in changelog. * Add ${misc:Depends} to Depends of the package. * Bump to Standards-Version 3.8.4. * Updated Homepage URL in control, watch and copyright files. * Enhanced package description with Upstream input. * Updated copyright information with Upstream input. * Remove dpatch handling, patch not needed anymore. -- Gerfried Fuchs Tue, 13 Apr 2010 07:55:17 +0200 mcabber (0.9.10-1) unstable; urgency=low * New upstream release: - fixes FTBFS problem (closes: #546681) - reduces CPU usage on reconnect troubles (closes: #510545) * Adding myself to Uploaders. * Bump Standards-Version to 3.8.3. * Raise debhelper and compat to 7, use dh_prep instead of dh_clean -k. * Switched README.source from the full text to a reference to the file included with the dpatch package. * Updated copyright information slightly in debian/copyright. * Remove duplication of Section and Priority in binary package control file stanca. * Fix config.{sub,guess} handling. -- Gerfried Fuchs Thu, 08 Oct 2009 19:37:25 +0200 mcabber (0.9.9-0.1) unstable; urgency=low * Non-maintainer upload. * New upstream release. * Build-Depends changes: added libgcrypt11-dev (closes: #497384), versioned dependency on libotr2-dev (closes: #510200) -- Gerfried Fuchs Wed, 18 Feb 2009 21:44:27 +0100 mcabber (0.9.7-0.1) unstable; urgency=low * Non-maintainer upload. * New upstream release, which includes: - using stat instead of lstat for permission check (closes: #475182) * Fix watchfile to watch only for numbered versions (closes: #479601) * Updated Standards-Version to 3.8.0: - Added README.source quick introduction on dpatch usage. -- Gerfried Fuchs Wed, 16 Jul 2008 17:51:43 +0200 mcabber (0.9.5-1.1) unstable; urgency=low * Non-maintainer upload. * --enable-otr and add Build-Depends libotr2-dev (Closes: #453729). * Add Build-Depends on libaspell-dev to make --enable-aspell actually work (Closes: #461977). -- Gerfried Fuchs Tue, 22 Jan 2008 15:59:24 +0100 mcabber (0.9.5-1) unstable; urgency=low * New upstream release. * New maintainer E-Mail address. * Added Homepage field to debian/control. * Fix debian-rules-ignores-make-clean-error by checking if the file exists if the file exists.. -- Mario Iseli Tue, 20 Nov 2007 13:47:26 +0100 mcabber (0.9.3-1) unstable; urgency=low * New upstream release. * Updated the manpage patch. * Added --enable-aspell and --enable-gpgme to the call of configure. -- Mario Iseli Wed, 20 Jun 2007 17:27:50 +0100 mcabber (0.9.1-1) unstable; urgency=low * New upstream release (Closes: #420065). * Added build-dependency on libgpgme-dev to enable GPG support. * Added build-dependency on dpatch and added a first patch in debian/patches to fix the manpage. -- Mario Iseli Thu, 19 Apr 2007 21:02:12 +0200 mcabber (0.8.3-1) unstable; urgency=low * New upstream release -- Mario Iseli Sun, 19 Nov 2006 14:13:06 +0100 mcabber (0.8.2-2) unstable; urgency=low * Added support for Unicode (linked against linbcursesw5) * Depend now on libncursesw5 * Build-Depend now on linbcursesw5-dev -- Mario Iseli Wed, 11 Oct 2006 23:02:51 +0200 mcabber (0.8.2-1) unstable; urgency=low * New upstream release -- Mario Iseli Sat, 23 Sep 2006 11:36:18 +0200 mcabber (0.8.1-1) unstable; urgency=medium * New upstream release -- Mario Iseli Mon, 21 Aug 2006 23:25:51 +0200 mcabber (0.8.0-1) unstable; urgency=low * New upstream release -- Mario Iseli Mon, 14 Aug 2006 19:39:56 +0200 mcabber (0.7.8-1) unstab le; urgency=low * Initial release Closes: #362617 -- Mario Iseli Sat, 08 Jul 2006 00:43:32 +0200 mcabber-0.10.2/debian/compat000066400000000000000000000000021216603513500156070ustar00rootroot000000000000007 mcabber-0.10.2/debian/control000066400000000000000000000014211216603513500160120ustar00rootroot00000000000000Source: mcabber Section: net Priority: optional Maintainer: Franziska Lichtblau Build-Depends: debhelper (>= 7), autotools-dev, dpkg-dev (>= 1.16.1~), libglib2.0-dev, libncursesw5-dev, libssl-dev, libgpgme11-dev, libotr2-dev (>= 3.1.0), libgcrypt11-dev, libaspell-dev, libloudmouth1-dev, libasyncns-dev Homepage: http://www.mcabber.com/ Standards-Version: 3.9.3 Vcs-Browser: http://git.deb.at/w/pkg/mcabber.git Vcs-Git: git://git.deb.at/pkg/mcabber.git Package: mcabber Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: small Jabber (XMPP) console client MCabber is a Jabber (XMPP) text-mode client, which includes features such as SASL support, history logging, commands completion, dynamic modules and external actions triggers. mcabber-0.10.2/debian/copyright000066400000000000000000000032671216603513500163540ustar00rootroot00000000000000This package was debianized by Mario Iseli on Sat, 08 Jul 2006 01:02:41 +0200. It was downloaded from Copyright Holders: Mikael Berthe Konstantin Klyagin Peter Deutsch Panos Tsirigotis The Jabber Team http://jabber.org/ Tha Apache Group Thomas Muldowney Ryan Eatmon Robert Norris Jeremie Miller Daniel Borca James Clark Free Software Foundation, Inc. Massachusetts Institute of Technology See also: /usr/share/doc/mcabber/AUTHORS License Copyright (C) 2005-2010 Mikael Berthe This package is free software; you can redistribute it and/or modify it under the terms of the 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 package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Mikael Berthe has added an exception to the license which allows linking with OpenSSL. On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2', later versions can be found in the same directory. mcabber-0.10.2/debian/dirs000066400000000000000000000000101216603513500152640ustar00rootroot00000000000000usr/bin mcabber-0.10.2/debian/docs000066400000000000000000000000241216603513500152600ustar00rootroot00000000000000AUTHORS README TODO mcabber-0.10.2/debian/examples000066400000000000000000000000331216603513500161460ustar00rootroot00000000000000mcabberrc.example contrib/ mcabber-0.10.2/debian/menu000066400000000000000000000001721216603513500153000ustar00rootroot00000000000000?package(mcabber):needs="text" section="Applications/Network/Communication"\ title="mcabber" command="/usr/bin/mcabber" mcabber-0.10.2/debian/patches/000077500000000000000000000000001216603513500160405ustar00rootroot00000000000000mcabber-0.10.2/debian/patches/mcabber_bookmark_password.patch000066400000000000000000000146721216603513500242750ustar00rootroot00000000000000This patch adds support for storing passwords to a MUC (patch by Nico Golde ) and documents the new feature in the /help command for the /room command. (help files patched by Franziska Lichtblau ) diff -Nurad mcabber-0.10.1/mcabber/commands.c mcabber-0.10.1.new/mcabber/commands.c --- mcabber-0.10.1/mcabber/commands.c 2010-12-01 21:51:20.000000000 +0100 +++ mcabber-0.10.1.new/mcabber/commands.c 2012-06-17 14:08:06.647247157 +0200 @@ -2918,7 +2918,7 @@ static void room_bookmark(gpointer bud, char *arg) { const char *roomid; - const char *name = NULL, *nick = NULL; + const char *name = NULL, *nick = NULL, *passwd = NULL; char *tmpnick = NULL; enum room_autowhois autowhois = 0; enum room_printstatus printstatus = 0; @@ -2931,7 +2931,8 @@ char **paramlst; char **pp; - paramlst = split_arg(arg, 3, 0); // At most 3 parameters + paramlst = split_arg(arg, 4, 0); // At most 4 parameters + for (pp = paramlst; *pp; pp++) { if (!strcasecmp(*pp, "add")) action = bm_add; @@ -2943,9 +2944,11 @@ autojoin = 1; else if (!strcmp(*pp, "-")) nick_set = 1; - else { + else if(nick_set == 0){ nick_set = 1; nick = tmpnick = to_utf8 (*pp); + } else if(nick_set == 1){ + passwd = to_utf8(*pp); } } free_arg_lst(paramlst); @@ -2961,7 +2964,7 @@ autowhois = buddy_getautowhois(bud); } - xmpp_set_storage_bookmark(roomid, name, nick, NULL, autojoin, + xmpp_set_storage_bookmark(roomid, name, nick, passwd, autojoin, printstatus, autowhois); g_free (tmpnick); } @@ -2988,11 +2991,15 @@ (bm_elt->autojoin ? '*' : ' '), bm_elt->roomjid); if (bm_elt->nick) g_string_append_printf(sbuf, " (%s)", bm_elt->nick); + if (bm_elt->passwd) + /* replace password for security reasons */ + g_string_append_printf(sbuf, " (*****)"); if (bm_elt->name) g_string_append_printf(sbuf, " %s", bm_elt->name); g_free(bm_elt->roomjid); g_free(bm_elt->name); g_free(bm_elt->nick); + g_free(bm_elt->passwd); g_free(bm_elt); scr_WriteIncomingMessage(NULL, sbuf->str, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); diff -Nurad mcabber-0.10.1/mcabber/xmpp.c mcabber-0.10.1.new/mcabber/xmpp.c --- mcabber-0.10.1/mcabber/xmpp.c 2010-12-01 21:51:21.000000000 +0100 +++ mcabber-0.10.1.new/mcabber/xmpp.c 2012-06-17 14:08:06.647247157 +0200 @@ -2083,7 +2083,7 @@ // If the node is a conference item, let's add the note to our list. if (x->name && !strcmp(x->name, "conference")) { struct bookmark *bm_elt; - const char *autojoin, *name, *nick; + const char *autojoin, *name, *nick, *passwd; const char *fjid = lm_message_node_get_attribute(x, "jid"); if (!fjid) continue; @@ -2092,10 +2092,13 @@ autojoin = lm_message_node_get_attribute(x, "autojoin"); nick = lm_message_node_get_child_value(x, "nick"); name = lm_message_node_get_attribute(x, "name"); + passwd = lm_message_node_get_child_value(x, "password"); if (autojoin && !strcmp(autojoin, "1")) bm_elt->autojoin = 1; if (nick) bm_elt->nick = g_strdup(nick); + if (nick) + bm_elt->passwd = g_strdup(passwd); if (name) bm_elt->name = g_strdup(name); sl_bookmarks = g_slist_append(sl_bookmarks, bm_elt); diff -Nurad mcabber-0.10.1/mcabber/xmpp.h mcabber-0.10.1.new/mcabber/xmpp.h --- mcabber-0.10.1/mcabber/xmpp.h 2010-12-01 21:51:21.000000000 +0100 +++ mcabber-0.10.1.new/mcabber/xmpp.h 2012-06-17 14:08:06.647247157 +0200 @@ -24,6 +24,7 @@ gchar *roomjid; gchar *name; gchar *nick; + gchar *passwd; guint autojoin; /* enum room_printstatus pstatus; */ /* enum room_autowhois awhois; */ diff -Nurad mcabber-0.10.1/doc/help/en/hlp_room.txt mcabber-0.10.1.new/hlp_room.txt --- mcabber-0.10.1/doc/help/en/hlp_room.txt 2012-06-16 14:00:24.678230334 +0200 +++ hlp_room.txt 2012-06-17 14:59:41.579532275 +0200 @@ -2,7 +2,7 @@ /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois [value] - /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] + /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] [password] The 'room' command handles Multi-User Chat room actions. @@ -44,7 +44,8 @@ For print_status, the possible values are "default", "none", "in_and_out", "all". For auto_whois, the possible values are "default", "off", "on". When the value is "default", the options muc_print_status / muc_auto_whois is used. -/room bookmark [add|del] [-autojoin|+autojoin] [-|nick] - Add, remove or update a bookmark (default is add). +/room bookmark [add|del] [-autojoin|+autojoin] [-|nick] [password] + Add, remove or update a bookmark (default is add) and optionally store a + password for entering the MUC. If autojoin is set, mcabber will automatically join the MUC room when it connects to the server. To see the list of bookmarks, use /room bookmark in the status buffer. diff -Nurad mcabber-0.10.1/doc/help/de/hlp_room.txt mcabber-0.10.1.new/hlp_room.txt --- mcabber/doc/help/de/hlp_room.txt 2012-06-16 14:00:24.678230334 +0200 +++ hlp_room.txt 2012-06-17 15:18:01.872988505 +0200 @@ -2,7 +2,7 @@ /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois [wert] - /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] + /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] [password] Der "room" Befehl umfasst die Multi-User Chat (kurz MUC) Befehle. @@ -44,7 +44,8 @@ Für "print_status" sind folgende Werte möglich: "default", "none", "in_and_out", "all". Bei "auto_whois" sind die Werte "default", "off" und "on" gültig. Wenn man die Einstellungen auf "default" setzt, so werden die Optionen muc_print_status / muc_auto_whois benutzt. -/room bookmark [add|del] [-autojoin|+autojoin] [-|nick] - Zum Hinzufügen, Löschen und Ändern von Raum-Bookmarks. +/room bookmark [add|del] [-autojoin|+autojoin] [-|nick] [password] + Zum Hinzufügen, Löschen und Ändern von Raum-Bookmarks und optionalen + Speichern eines Passworts eines MUCs. Wenn autojoin gesetzt ist, wird mcabber nach dem verbinden zum Server diesen MUC automatisch betreten. Um die Liste der Bookmarks zu sehen, benutze "/room bookmark", bei ausgewähltem Status Buffer. mcabber-0.10.2/debian/patches/mcabber_fix_aspell.patch000066400000000000000000000030311216603513500226570ustar00rootroot00000000000000Patch imported from upstream vcs (http://mcabber.com/hg/index.cgi/raw-rev/db8ec238cd2c) - originally created by Mikael Berthe . Fix segfault when spell checking is enabled and spell_lang is not set. --- a/mcabber/screen.c +++ b/mcabber/screen.c @@ -43,10 +43,10 @@ #ifdef WITH_ENCHANT # include -#endif - -#ifdef WITH_ASPELL -# include +#else +# ifdef WITH_ASPELL +# include +# endif #endif #include "screen.h" @@ -4146,9 +4146,6 @@ spell_checker = NULL; spell_broker = NULL; } - - spell_broker = enchant_broker_init(); - spell_checker = enchant_broker_request_dict(spell_broker, spell_lang); #endif #ifdef WITH_ASPELL if (spell_checker) { @@ -4157,9 +4154,23 @@ spell_checker = NULL; spell_config = NULL; } +#endif + if (!spell_lang) { // Cannot initialize: language not specified + scr_LogPrint(LPRINT_LOGNORM, "Error: Cannot initialize spell checker, language not specified."); + scr_LogPrint(LPRINT_LOGNORM, "Please set the 'spell_lang' variable."); + return; + } + +#ifdef WITH_ENCHANT + spell_broker = enchant_broker_init(); + spell_checker = enchant_broker_request_dict(spell_broker, spell_lang); +#endif + +#ifdef WITH_ASPELL spell_config = new_aspell_config(); - aspell_config_replace(spell_config, "encoding", spell_encoding); + if (spell_encoding) + aspell_config_replace(spell_config, "encoding", spell_encoding); aspell_config_replace(spell_config, "lang", spell_lang); possible_err = new_aspell_speller(spell_config); mcabber-0.10.2/debian/patches/series000066400000000000000000000000711216603513500172530ustar00rootroot00000000000000mcabber_fix_aspell.patch mcabber_bookmark_password.patch mcabber-0.10.2/debian/rules000077500000000000000000000030261216603513500154720ustar00rootroot00000000000000#!/usr/bin/make -f #export DH_VERBOSE=1 export DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS += -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif config.status: dh_testdir cp -f /usr/share/misc/config.sub config.sub cp -f /usr/share/misc/config.guess config.guess CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-gpgme --enable-aspell --enable-otr --enable-modules build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: config.status dh_testdir $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp [ ! -f Makefile ] || $(MAKE) distclean rm -f config.sub config.guess dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/mcabber rm `find $(CURDIR)/debian/mcabber -name '*.la'` binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs dh_installexamples dh_installmenu dh_installman dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install mcabber-0.10.2/debian/source/000077500000000000000000000000001216603513500157115ustar00rootroot00000000000000mcabber-0.10.2/debian/source/format000066400000000000000000000000141216603513500171170ustar00rootroot000000000000003.0 (quilt) mcabber-0.10.2/debian/watch000066400000000000000000000001031216603513500154340ustar00rootroot00000000000000version=3 http://www.mcabber.com/files/mcabber-([0-9.]+)\.tar\.bz2 mcabber-0.10.2/depcomp000077500000000000000000000506431216603513500145540ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 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 # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi 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 informations. 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. 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. 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$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 # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then 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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then 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 -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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" = 0; then : else 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" 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" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "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" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "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: mcabber-0.10.2/doc/000077500000000000000000000000001216603513500137345ustar00rootroot00000000000000mcabber-0.10.2/doc/HOWTO_modules.txt000066400000000000000000000605541216603513500171370ustar00rootroot00000000000000 =========================================== Mcabber module writing brief howto =========================================== To obtain information on module mcabber uses struct module_info_t, that module should provide in public variable with name info_. If the module name contains any extra symbols except [a-z0-9_] they should be replaced with '_'. ------------------------------------------------------------------------ #include typedef void (*module_init_t)(void); typedef void (*module_uninit_t)(void); typedef struct module_info_struct module_info_t; struct module_info_struct { const gchar *branch; guint api; const gchar *version; const gchar *description; const gchar **requires; module_init_t init; module_uninit_t uninit; module_info_t *next; }; ------------------------------------------------------------------------ Callbacks init and uninit will be called after module and its dependencies loading. 'requires' can contain a NULL-terminated list of module names, that should be loaded before this. 'branch' and 'api' are required and should contain mcabber branch and api version, that this module is designed to work with. For these values see ChangeLog.api. 'version' and 'description' fields are optional and just provide user with additional information about the module. 'description' field can contain newlines. The 'next' field can contain pointer to the next struct with another branch of mcabber, if your module can work with multiple branches. To load modules, mcabber uses glib's GModule, thus, in your module you can also use functions ------------------------------------------------------------------------ #include #include const gchar* g_module_check_init (GModule *module); void g_module_unload (GModule *module); ------------------------------------------------------------------------ to do something before any version/dependency check is performed when your module is loaded/unloaded. On success g_module_check_init should return NULL, and error message otherwise. As module is loaded, you can use mcabber functions, declared in mcabber's header files (though you should consider, that they may change their calling conventions some day). I will not explain them all, there are too much of them, but will provide description for those, provided especially for module writers. ------------------------------------------------------------------------ #include const gchar *module_load (const gchar *name, gboolean manual, gboolean force); const gchar *module_unload (const gchar *name, gboolean manual, gboolean force); ------------------------------------------------------------------------ These functions load and unload modules respectively. You can use them to handle optional dependencies. What happens, when module is loaded: - check if module is present, and if present just increase it's reference count - load .so via glib (and call g_module_check_init, if present) - check for information structure presence - find suitable branch and check api version compatibility - load modules, that this module requires (note, that dependency problems will be reported as error invariably, force flag have no effect on this check) - module placed into a list of modules - module init routine is called And when unloaded: - check if module is present - decrease reference count, if it is not zero, return - run module uninit routine - unload modules, that were loaded as dependencies for this one - remove from modules list They return error message or NULL in case of success. 'manual' flag indicates, that module will be loaded by direct user request. It serves the purpose of tracking user and automatic references (user can have only one). 'force' flag on module loading causes mcabber to ignore most of the loading errors. On unload it forces unloading even if reference count is not zero. ------------------------------------------------------------------------ #include void cmd_add (const char *name, const char *help, guint flags1, guint flags2, void (*f)(char*), gpointer userdata); void cmd_del (const char *name); ------------------------------------------------------------------------ These two functions are provided to declare mcabber commands, offered by your module. - name is a command name. - help is a short description of your command, however for now it is not used at all and can be omitted. - flags are completion identifiers for first and second command arguments, for list of built-in completions, see compl.h. You can declare your own completion lists, using functions from compl.h, described later. - f is a user-provided callback function, that will be called upon executing mcabber command. If you will provide non-NULL userdata, function must be of type void (*f) (char *commandline, gpointer userdata). - userdata is a pointer to data, transparently passed to callback. See f description. ------------------------------------------------------------------------ #include guint compl_new_category (void); void compl_del_category (guint id); void compl_add_category_word (guint categ, const char *command); void compl_del_category_word (guint categ, const char *word); GSList *compl_get_category_list (guint cat_flags, guint *dynlist); ------------------------------------------------------------------------ These functions allow you to define and manage word lists for completion categories, used by your commands. First you need to obtain handle for completion type, that you later will supply as flags, when declaring your commands. For that use function compl_new_category. It returns new category id, or zero if mcabber runs out of completion ids (for now there are only 32 ids available, and 20 of them are already used for builtin commands). compl_del_category allows you to delete user-defined category, deleting all words in it too. Now, that you have a completion category, you can at any time add or delete words from its completion list. To do that, use the functions compl_add_category_word and compl_del_category_word. You can obtain current contents of category by using gompl_get_category_list. If after execution dynlist is TRUE, you should free obtained list of words (both, words and list). ------------------------------------------------------------------------ #include typedef struct { const char *name; const char *value; } hk_arg_t; typedef guint (*hk_handler_t) (const gchar *hookname, hk_arg_t *args, gpointer userdata); guint hk_add_handler (hk_handler_t handler, const gchar *hookname, gint priority, gpointer userdata); void hk_del_handler (const gchar *hookname, guint hid); ------------------------------------------------------------------------ These functions allow your module to react to events, such as incoming and outgoing messages, buddy status changes and server connection establishment or breakup. The hookname string specifies the events the handler wants to subscribe to. The available strings can be found in hooks.h. The hk_add_handler() function will return a handler id which you will use to remove the handler with hk_del_handler(). Args argument is a list of hk_arg_t structures, terminated by structure, whose name field is set to NULL. Your handler should return one of the values in the hk_handler_result enum (see hooks.h), usually HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS so that other handlers can be triggers as well. A handler can determine which event has occured by checking the hookname argument (a same hook handler can subscribe to several events by using hk_add_handler() several times). Currently the following events exist: - hook-pre-message-in (HOOK_PRE_MESSAGE_IN) with parameters * jid - sender of the incoming message * resource - resource of the incoming message * message - message body, converted to locale charset * groupchat - ("true" or "false") * delayed - message timestamp (ISO-8601 string) or empty string if the message wasn't delayed * error - "true" if this is an error message - hook-post-message-in (HOOK_POST_MESSAGE_IN) with parameters * jid - sender of the incoming message * resource - resource of the incoming message * message - message body, converted to locale charset * groupchat - ("true" or "false") * attention - In a MUC message, true if you've been highlighted In a regular message, true if the sender has requested your attention (only implemented for MUC currently) * delayed - message timestamp (ISO-8601 string) or empty string if the message wasn't delayed * error - "true" if this is an error message - hook-message-out (HOOK_MESSAGE_OUT) with parameters * jid - recipient of the outgoing message * message - message body, converted to locale charset - hook-status-change (HOOK_STATUS_CHANGE) with parameters * jid - buddy, whose status has changed * resource - resource, whose status has changed * old_status - old status of the buddy, one-char string, representing mcabber status letter - one of 'ofdna?_'. * new_status - new buddy status. Same as above. * message - new status message. Old one should still be available to module as the current buddy's message. - hook-my-status-change (HOOK_MY_STATUS_CHANGE) with parameters * new_status - user's new status, see hook-status-change. Old one should still be available as the current status of the user. * message - new status message - hook-post-connect (HOOK_POST_CONNECT) with no parameters - hook-pre-disconnect (HOOK_PRE_DISCONNECT) with no parameters - hook-unread-list-change (HOOK_UNREAD_LIST_CHANGE) * unread - number of buffers with the pending message flag (#) * attention - number of non-MUC buffers with the attention sign (!) * muc_unread - number of MUC buffers with the unread message flag * muc_attention - number of MUC buffers with the attention sign - hook-subscription (HOOK_SUBSCRIPTION) * type - the type of the subscription message received. Can be one of subscribe, unsubscribe, subscribed, unsubscribed. * jid - sender of the incoming subscription message * message - optional message sent with the request ------------------------------------------------------------------------ #include void xmpp_add_feature (const char *xmlns); void xmpp_del_feature (const char *xmlns); ------------------------------------------------------------------------ These functions may be useful, if your module implements some additional functionality to mcabber, that should be advertised in a client's discovery features list. ===================== Example: hello ===================== Now, let's write a simple module, called "hello", that will do no more than just print something on loading and unloading. ------------------------------------------------------------------------ #include #include /* We will use scr_log_print() mcabber function, that does mcabber's messages output */ #include /* Print something on module loading */ const gchar* g_module_check_init(GModule *module) { scr_log_print(LPRINT_NORMAL, "Hello, World!"); return NULL; } /* ... and unloading */ void g_module_unload(GModule *module) { scr_log_print(LPRINT_NORMAL, "Bye, World!"); } /* The End */ ------------------------------------------------------------------------ Now, compile this file (hello.c) with libtool --mode=compile gcc `pkg-config --cflags glib-2.0 \ gmodule-2.0 mcabber` -c hello.c libtool --mode=link gcc -module -rpath /usr/lib/mcabber/ \ `pkg-config --libs glib-2.0 gmodule-2.0 mcabber` \ -o libhello.la hello.lo (you should substitute /usr/lib/mcabber to the directory where your modules are located) and then install obtained module with libtool --mode=install install libhello.la \ /usr/lib/mcabber/libhello.la Note that you most likely need not run suggested by libtool finish action, as we're working with module object, not system- wide library, but maybe some systems require that. Now, set modules_dir mcabber variable to point to your modules directory, and try to run /module -f load hello. If all goes well, you should see in status buffer message "Hello World!" (as well as some complaints, as we forced module loading). Now unload module by running command /module unload hello, that should bring up message "Bye, World!". That's it, you just created very simple dynamically loadable mcabber module. But, as you noticed, it needs force to be loaded. Now, let's add the information structure that mcabber wants. ========================== Example: info struct ========================== ------------------------------------------------------------------------ #include /* module_info_t definition */ #include /* Print something on module loading */ void hello_init(void) { scr_log_print(LPRINT_NORMAL, "Hello, World!"); } /* ... and unloading */ void hello_uninit(void) { scr_log_print(LPRINT_NORMAL, "Bye, World!"); } module_info_t info_hello = { .branch = "dev", .api = 1, .version = "0.0.1", .description = "Hello world module\n" " (as well as bye world module)", .requires = NULL, .init = hello_init, .uninit = hello_uninit, .next = NULL, }; /* The End */ ------------------------------------------------------------------------ Here we still do not use glib nor gmodule, so, we can omit them in compilation lines: libtool --mode=compile gcc `pkg-config --cflags mcabber` \ -c hello.c libtool --mode=link gcc -module -rpath /usr/lib/mcabber/ \ `pkg-config --libs mcabber` -o libhello.la hello.lo Again compile it, copy, and try to load, now without -f flag. As you may notice, when loading previous example, mcabber first printed "Hello, World!", and only then complaint about module not having information struct. That's because g_module_check_init is called right after module loading, before mcabber even has a chance to look at module, while .init from info struct is called afterwards by mcabber itself. You can try to introduce some error (e.g. too high or missing target mcabber version) and see the difference. ======================= Example: command ======================= Now, let's allow our module to do some real work. ------------------------------------------------------------------------ #include #include #include /* Handler for command */ void do_hello(char *args) { /* args contains command line with command * name and any spaces after it stripped */ scr_log_print(LPRINT_NORMAL, "Hello, %s!", *args != '\0' ? args : "World"); } /* Register command */ void hello_init(void) { cmd_add("hello", "", 0, 0, do_hello, NULL); } /* Unregister command */ void hello_uninit(void) { cmd_del("hello"); } module_info_t hello_info = { .branch = "dev", .api = 1, .version = "0.0.2", .description = "Hello world module\n" " Provides command /hello", .requires = NULL, .init = hello_init, .uninit = hello_uninit, .next = NULL, } /* The End */ ------------------------------------------------------------------------ Now, compile it and try to load and run /hello with some arguments. Note, that we used one-argument version of command handler, as we have specified no userdata. ========================== Example: completion ========================== Now let's investigate how to provide custom completion to your commands. You can as well use built-in completions, their IDs are listed in compl.h. ------------------------------------------------------------------------ #include #include #include #include static guint hello_cid = 0; /* hello command handler */ void do_hello(char *args) { /* If argument is provided, add it to * completions list. */ if (hello_cid && *args != '\0') compl_add_category_word(hello_cid, args); scr_log_print(LPRINT_NORMAL, "Hello, %s!", *args != '\0' ? args : "World"); } /* Initialization */ void hello_init(void) { /* Obtain handle for our completion * category */ hello_cid = compl_new_category(); if (hello_cid) /* Add known default word to * completion list */ compl_add_category_word(hello_cid, "World"); cmd_add("hello", "", hello_cid, 0, do_hello, NULL); } /* Deinitialization */ void hello_uninit(void) { /* Give back category handle */ if (hello_cid) compl_del_category(hello_cid); cmd_del("hello"); } module_info_t hello_info = { .branch = "dev", .api = 1, .version = "0.0.3", .description = "Hello world module" " Provides command /hello with completion", .requires = NULL, .init = hello_init, .uninit = hello_uninit, .next = NULL, } /* The End */ ------------------------------------------------------------------------ Now you can use completion for hello command. Note, that this code have some serious simplifications, made for simplicity reasons. For now, compl_add_category_word does not checks, if word already exists in completions list (although it is marked as TODO, so, some day it will), so, we should check it ourselves. ===================== Example: hooks ===================== Now let's implement our own beeper. Why may anyone wish to do this? I am not satisfied with default mcabber's builtin beeper flexibility. I wanted beeping on any MUC conference message, not just the ones directed to me. ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include static guint beep_cid = 0; /* Command completion category id */ static guint beep_hid = 0; /* Hook handler id */ /* Event handler */ static guint beep_hh(const gchar *hookname, hk_arg_t *args, gpointer userdata) { /* Check if beeping is enabled */ if (settings_opt_get_int("beep_enable")) scr_Beep(); /* *BEEP*! */ return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } /* beep command handler */ static void do_beep(char *args) { /* Check arguments, and if recognized, * set mcabber option accordingly */ if (!strcmp(args, "enable") || !strcmp(args, "on") || !strcmp(args, "yes") || !strcmp(args, "1")) settings_set(SETTINGS_TYPE_OPTION, "beep_enable", "1"); else if (!strcmp(args, "disable") || !strcmp(args, "off") || !strcmp(args, "no") || !strcmp(args, "0")) settings_set(SETTINGS_TYPE_OPTION, "beep_enable", "0"); /* Output current state, either if state is * changed and if argument is not recognized */ if (settings_opt_get_int("beep_enable")) scr_log_print(LPRINT_NORMAL, "Beep on messages is enabled"); else scr_log_print(LPRINT_NORMAL, "Beep on messages is disabled"); } /* Initialization */ static void beep_init (void) { /* Create completions */ beep_cid = compl_new_category(); if (beep_cid) { compl_add_category_word(beep_cid, "enable"); compl_add_category_word(beep_cid, "disable"); } /* Add command */ cmd_add("beep", "", beep_cid, 0, do_beep, NULL); /* Add handler * We are only interested in incoming message events */ beep_hid = hk_add_handler(beep_hh, HOOK_POST_MESSAGE_IN, G_PRIORITY_DEFAULT_IDLE, NULL); } /* Deinitialization */ void beep_uninit(void) { /* Unregister event handler */ hk_del_handler(HOOK_POST_MESSAGE_IN, beep_hid); /* Unregister command */ cmd_del("beep"); /* Give back completion handle */ if (beep_cid) compl_del_category(beep_cid); } module_info_t beep_info = { .branch = "dev", .api = 1, .version = "0.0.1", .description = "Simple beeper module\n" " Recognizes option beep_enable\n" " Provides command /beep", .requires = NULL, .init = beep_init, .uninit = beep_uninit, .next = NULL, } /* The End */ ------------------------------------------------------------------------ If you use CMake (as do I), corresponding CMakeLists.txt snippet: ------------------------------------------------------------------------ cmake_minimum_required(VERSION 2.6) project(beep C) find_package(PkgConfig REQUIRED) pkg_check_modules(MCABBER REQUIRED mcabber) # this one should be before any target definitions link_directories(${MCABBER_LIBRARY_DIRS}) add_library(beep MODULE beep.c) include_directories(SYSTEM ${MCABBER_INCLUDE_DIRS}) target_link_libraries(beep ${MCABBER_LIBRARIES) include_directories(${beep_SOURCE_DIR} ${beep_BINARY_DIR}) install(TARGETS beep DESTINATION lib/mcabber) ------------------------------------------------------------------------ =========================== Example: dependencies =========================== I will not provide here a complete example of two modules, one of which depends on other, only some use cases. Info struct for module, that depends on two other modules: ------------------------------------------------------------------------ #include const gchar *a_deps[] = { "b", "c", NULL }; module_info_t info_a = { .branch = "dev", .api = 1, .version = NULL, .description = NULL, .requires = a_deps, .init = a_init, .uninit = a_uninit, .next = NULL, }; ------------------------------------------------------------------------ If your module needs to "authenticate" mcabber version too, this can be done in g_module_check_init: ------------------------------------------------------------------------ #include #include #include #include const gchar *g_module_check_init (GModule *module) { char *ver = mcabber_version (); // ver now contains version in format // X.X.X[-xxx][ (XXXXXXXXXXXXX)] const gchar *branch = mcabber_branch; guint api = mcabber_api_version; const gchar *error = NULL; if (...) error = "Incompatible mcabber version"; g_free (ver); return error; } ------------------------------------------------------------------------ Also you can use glib check_init routine to modify module information, that will be checked by mcabber, e.g. if you want your module to always pass mcabber version check, you can assign branch information, obtained from mcabber_... variables to corresponding fields in your struct. Or you can modify your module's dependencies, though direct module_load() will have the same effect, and can be used for optional dependencies, that your module can still work without. Note: remember, that g_module_check_init will be always called, even if later the module will not pass checks, thus: - do not use functions from other modules there; - provide g_module_unload to undo anything, check_init has done. ============== Further ============== As mcabber now uses glib mainloop, you can use glib's event sources, for example, fifo reading already uses GIOChannels for non-blocking IO. You can extend XMPP part of mcabber functionality by providing lm message handlers with high priority and allowing unhandled by your handler messages be taken care by mcabber's handlers on normal priority level. This is where you may need to modify set of advertised supported disco features. Many useful examples can be found in my modules, that can be found at http://isbear.unixzone.org.ua/source. If you think, that your module needs to change something, hardcoded in current implementation - feel free to mail me or join mcabber's MUC room and discuss it - for now we have only implemented things, that we have found necessary for our own modules. Also I am not native English speaker, so, if you find some errors or non-natural constructs in this howto, please, inform me (I will be glad, if you also provide a more suitable version of text in question). -- Myhailo Danylenko -- mailto:isbear@ukrpost.net -- xmpp:isbear@unixzone.org.ua -- Sat, 27 Mar 2010 13:30:00 +0100 mcabber-0.10.2/doc/Makefile.am000066400000000000000000000000771216603513500157740ustar00rootroot00000000000000man_MANS = mcabber.1 EXTRA_DIST = $(man_MANS) SUBDIRS = help mcabber-0.10.2/doc/Makefile.in000066400000000000000000000534671216603513500160200ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = mcabber.1 EXTRA_DIST = $(man_MANS) SUBDIRS = help all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-man \ uninstall-man1 # 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: mcabber-0.10.2/doc/README_PGP.txt000066400000000000000000000037101216603513500161410ustar00rootroot00000000000000 MCabber OpenPGP support This files explains how to use PGP support in mcabber. Please note that you need libgpgme > 1.0.0 (for example, libgpgme11 in Debian) on your system. ## Enabling OpenPGP support ## In the configuration file, enable pgp and set pgp_private_key to your key id. Your key id can be found with the following command: % gpg --list-keys --keyid-format long your_name Example (in $HOME/.mcabber/mcabberrc): set pgp = 1 set pgp_private_key = "E3E6A9C1A6A013D3" ## Encrypting messages ## Now when you start mcabber, it should ask for your passphrase (unless you put it in your configuration file or you use gpg-agent). If you want to know if a contact is using PGP, select the contact and use the command /info. If (s)he is, it should display something like: PGP key id: E2C4C9A1601A5A4 Last PGP signature: unknown The signature is "unknown", because we don't have the contact's key. We could get it with gpg, for example: % gpg --recv-keys E2C4C9A1601A5A4 Then, wait for the next presence message. If the contact has your key and you have their key, you should have bidirectional encrypted messages. ## Per-contact settings ## You can provide a PGP key to be used for a given Jabber user or disable PGP on a per-account basis, using the command /pgp. If you provide a KeyId for a contact, it will be compared to the key the contact uses to sign their presence/messages and it will be used for all outgoing encrypted messages (by default, mcabber will use the contact signature's key). Example: /pgp disable foo@bar.org (disables encryption of messages sent to foo@bar.org) /pgp setkey bar@foo.net C9940A9BB0B92210 (set the encryption key for bar@foo.net and warn if this contact doesn't use this key for their signatures) /pgp info (show the PGP settings we've set for the currently selected contact) Try "/help pgp" for a usage description. The command /pgp can be used in the configuration file (without the leading /). mcabber-0.10.2/doc/build000077500000000000000000000003351216603513500147620ustar00rootroot00000000000000#! /bin/sh set -e -x asciidoc -b css -d manpage mcabber.1.txt asciidoc -b docbook -d manpage mcabber.1.txt mv mcabber.1 mcabber.1.before xmlto man mcabber.1.xml mv mcabber.1 mcabber.1.new mv mcabber.1.before mcabber.1 mcabber-0.10.2/doc/guide/000077500000000000000000000000001216603513500150315ustar00rootroot00000000000000mcabber-0.10.2/doc/guide/Makefile.am000066400000000000000000000005321216603513500170650ustar00rootroot00000000000000 guide: cd $(srcdir) && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide BIBINPUTS=$(srcdir) bibtex guide cd $(srcdir) && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide clean-guide: rm -f *.aux *.blg *.dvi *.toc *.out *.bbl *.log *.pdf mcabber-0.10.2/doc/guide/Makefile.in000066400000000000000000000265501216603513500171060ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/guide DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/guide/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/guide/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am guide: cd $(srcdir) && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide BIBINPUTS=$(srcdir) bibtex guide cd $(srcdir) && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide && \ pdflatex -output-directory=$(abs_top_builddir)/doc/guide guide clean-guide: rm -f *.aux *.blg *.dvi *.toc *.out *.bbl *.log *.pdf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcabber-0.10.2/doc/guide/guide.bib000066400000000000000000000037511216603513500166120ustar00rootroot00000000000000@inproceedings{otr, author = "Nikita Borisov and Ian Goldberg and Eric Brewer", title = "Off-the-Record Communication, or, Why Not To Use PGP", booktitle = "Proceedings of the 2004 ACM Workshop on Privacy in the Electronic Society.", year = "2004", publisher = "ACM", note = "\url{http://www.cypherpunks.ca/otr/otr-wpes.pdf}" } @manual{xep27, author = "Thomas Muldowney", title = "XEP-0027: Current Jabber OpenPGP Usage", organization = "XMPP Standards Foundation", year = "1999-2006", note = "\url{http://www.xmpp.org/extensions/xep-0027.html}" } @manual{xep45, author = "Peter Saint-Andre", title = "XEP-0045: Multi-User Chat", organization = "XMPP Standards Foundation", year = "1999-2008", note = "\url{http://www.xmpp.org/extensions/xep-0045.html}" } @misc{libotr, title ="Off-the-Record Messaging", author = "Ian Goldberg and Chris Alexander and Nikita Borisov", note ="\url{http://www.cypherpunks.ca/otr/}" } @misc{samplerc, title = "Sample configuration file for mcabber", note = "\url{http://www.lilotux.net/~mikael/mcabber/hg/?raw-file/tip/mcabber/mcabberrc.example}" } @misc{mcabber, title = "Mcabber", author = "Mikael Berthe", note = "\url{http://www.lilotux.net/~mikael/mcabber/}" } @misc{jabber, title = "Jabber/XMPP Protocols", author = "XMPP Standards Foundation", note = "\url{http://www.xmpp.org/protocols/}" } @inproceedings{smp, author = "Chris Alexander and Ian Goldberg", title = "Improved User Authentication in Off-The-Record Messaging", booktitle = "Proceedings of the 2007 ACM workshop on Privacy in electronic society", year = "2007", publisher = "ACM", note = "\url{http://www.cypherpunks.ca/~iang/pubs/impauth.pdf}" } @misc{centericq, title = "CenterICQ", author = "Konstantin Klyagin", note = "\url{http://thekonst.net/en/centericq}" } @misc{centerim, title = "CenterIM", note = "\url{http://www.centerim.org}" } mcabber-0.10.2/doc/guide/guide.png000066400000000000000000000176441216603513500166500ustar00rootroot00000000000000PNG  IHDRW<bbKGD pHYs  ~tIME-6"1IDATxkFR-b\bqlQUea;7~ ~x,t|S=5dU۪R,3li^k>Dž(֤2okַ6@#xD%zX-+Ԏ9d(a(,CeMk{,hUU5%0/ۻ=A5tUS4k0šTM*"mP֮U[/_*01>.l!zQa~\=fW]nҠ3%~aSXgaC &TlxMdx@ȿc/nƂ] ͧ}k`NҶ>%zE8 Hޗ {WJ8&iSV^Erd\ɞ.̢h/`5>Yq:5~8A3. T#dPb5` cis /'䫴sk9e 8` 5>eBY.bvqt!H9h p"$n}xY}꯱A;H~ȾǢb^'H>bq6f3Tp4eڹZBĶ"mP֞SzwWD\7WImA[c-Z7Y[[\.R^yDž(֤2ooCo3 {'M:-m.TbA3*xKFe1XǃϹp}sj*ʾV)ɒ^,5Yljdž%E1Wv`ҙHP;.Y[lr:%`ƴ;N?*HAe#ă.,x94V[{N9̓Gn!YZU5BX) 5T=sdrCyAcpApmo6>ijulu48,#e}Mikۋn`JEEQ9AGݦIp& ]fyw.v1 : R{xt.[Hε\h~*<q䗏-š74in^]"Ts&)T~hjO9g zŅ0Rν)_ګƀK[UYX (*H9{cd b &6 QѴϢͫzg?r_1o2-oBN\Ws8L!PIݧ'!{q Ki˼] |^ErJ w :Thy*]:%WoYJ/Teh{8t&ڶ;˞ Ks ~ɃU} gN!{uqC\/ND,}mO/~WtiǝyqMrJ} /1̥a*(PQu8mz:= XŎ*<:!Ѵ!Z7M39R;k۞#4έ`*#*ĎIS RLEr[0S4[|[P>#;Kim4ޗڐ *XF(il41ՖEMA XTtbDU(̠7#ȗک kv;];" E J< kDKfۦ\\:ݫA>D4m]2鴃qN&# `]a ;V`.{!ߙ0?Sq]2{5pKŎoD>6K옽&NF@A+xuJ7WvqL+G4N}tl`$F# o%dπh}qg`~+_141* [^4Oܔ7t>=FN`ӎ`n vh.ד E9?GӺ[0kI-dVsj;DPTyX _ zI}^LNjkJg`2@;zC›#$t&z]Wŕj֔~A` l%uF"! (# J+bka@/4[ĎYzx  *x1BT 4 RϔͺJ*ڌzܑߩ['.hoIA) `a;G@ڹbq}v@INh|N 6[pk;h yӉ7mb ̮Y[Ԩ(O&]* ̱:ꋅFa:}b*n,x-r!5ݘ2*:m56VLf v*t!G Gۂ[e5[^Dm @,Ž9"Lߟ :`ghXrЛ~cx=e.6̫%R,Y#UV(ȋwԑd뭭v@mXi^!]>Q$ `AYS6ZnЦM`=[=XlSbd*!6`t0˺4[NjzI5;?tA+0h 2Ѵ hڹE F v'V*4x+l7i_yEHi@7K>:Ewjem-Ѵ)lg(VW#ѴPMhOe1~J -X6˶Y,VD4m'x4IlVi<8i7 a :6$nk iv_xA}8l@ :R_ĕv4 }#udTCU5vߩP׈:Ffm)'%::%>=#)$[;DPTy4,LJZR[b ыwT^Wd ꣟Mez1˔l`u Θ۰2}f#,*h9O O8J7%rؐaTsJr}fyΖe @1P,B0Ƽ􋔙Blҏ2][+"xZ2bǬ~^U pz1ޛV 4L }RyvN }Жvo*PAIZڃ\kÂq X"-:(ljz-T52JmL;`}8 VA:ѴM][1# )vU֐(xhAb*!Y1 `[Ѐ!Fv琈 vQqZH&]U,$` [pD-E_QcvxD~DG ]\ `VqYE'>xDvbVsUDӖ#_; -YM;N#=Mثq'5l ֲ[][ޤ1؂7Ѵ>̭:5 Ѵ߶g؂}iR]:aAIŃ' 6S}n`ZVp*?)aON.D]H;(y7\ipU_Uf1?CfBGoI\6YIfS*k}ӏ­=eh̞zi70`~Q,yC-e4p]5{Y5Oǔ}%0(*vōt>d,|%v)S'gחKs B_L^<=׊a3= }*)H;r;,rr)^\׺IEqӬ(N̫pU`S Q`NY5\Y s-n9AU r-r^/+lŽ*JU8_MUKUzѯ ^S}Pw+gJ}hBJMEb.˪O~З`vH9&o1P[02k;s=1q.B`Uv栫q'=.Jk,ӖRVdŃA\qQ=reS.qpݱpnA1nZ# vrfGG 0ϳ (ܿ0|8!2ԋrX;i Um˩`;eܞZiD&PcQ.4{y\4twh'#. I' 8ycqˑCsӚBk gTuɽiw :izCD2JmaUm=V?}ִA5 wG8ef[.rg-W*C1]dD6F;H5PkuiI[lKZll[{~_q'Z=piNshڍѼM5%CqD(k_4vi-wb13sv4ehڎhmyj4Q74 m| !^JiZ誉X2g7v\MdM[M[F]k%+w{SD \FAbbݡګ2>-WKo 썽JثG9k=%e+g_۰$Ѵ;_r^&n4m_Z%xCc L)i 8紘2(Lo",,ǐ1P8KJ[0+b[2B;w` H]{3f|y,1>s_5/uцzCÄEپjk݋tE,C?} ^qՇo?a-~A:`rRH`cx򌖸9b2m nm: jo!USķ_1{g2?KJf2ٮ&pId tv*f.A¦F[<8 kצ,6^s'gחK(=+f¹ bX^tSSyf6^K2+Ɨ݇bը;MsQeh'wFsF(rOzRSQm4sCq2nfׯLJhX%+ػG0=Jw(`$GR|<_k}2ɵB)k˴dŃ=gEHO )|O0zqWz>km|`1gp 0ZnQí}d] /+Q* xS(wP/=Qf'1x <ߤ!~%8Byw?zv?'?ܧp lAOk b5MT0ɮy%WgOB! x &uNFPAT@PAT@PAL?c8$^OIENDB`mcabber-0.10.2/doc/guide/guide.tex000066400000000000000000000377131216603513500166630ustar00rootroot00000000000000\documentclass[12pt,oneside,a4]{book} \usepackage{hyperref} \usepackage{float} \usepackage{listings} \usepackage{graphicx} \usepackage{multirow} \title{Mcabber User Guide} \author{franky} \begin{document} \maketitle \tableofcontents \chapter*{Introduction} This guide was written for users who are new to mcabber\cite{mcabber} which is a small command line client for the Jabber (XMPP) protocol\cite{jabber} as an introduction. This introduction may become a comprehensive guide to every aspect of mcabber later, but the first versions should only be regarded as an overview of all features. Feel free to bug me with corrections of spelling errors or with contributions to the content. \paragraph{Conventions used in this guide:\\} \begin{tabular}{ c p{10cm} } \verb+/command+ & This is a command for mcabber which can only be executed during runtime.\\ \verb+command+ & A command for mcabber which can be given in the configuration file, too.\\ \verb+$command+ & The \$-sign precedes shell commands.\\ \textit{variable} & This is a variable which can be set in the configuration file or during runtime. \\ \end{tabular} \chapter{Basic Usage} After installing mcabber, you should create a configuration file first.\\ The easiest way of doing this is to copy the sample configuration file\cite{samplerc} to \~{}/.mcabber/mcabberrc. Then, you only have to change the variable \textit{jid} before you can, finally, start mcabber. When the Login is successful, mcabber might look similar to the following screenshot:\\ \begin{figure}[h!] \centering \includegraphics[scale=0.8]{guide} \caption{screenshot of mcabber} \label{fig:screenshot} \end{figure} The screen is divided into 4 regions: The roster(sometimes called buddy list) in the upper left, the chat window/buffer in the upper right, the input line at the bottom and the log window above the input line. Those two blue lines which are below and above the log window are status lines. The lower one displays the general mcabber status and the upper line the status of the selected contact. The screenshot shows mcabber in "chat mode" which can be entered by pressing enter or sending a message when a contact is selected. Leaving chatmode is done by pressing Esc. To move between your contacts, you can use the buttons Pg Up/Pg Down. If you look at the roster of the screenshot, you will notice that the contact "loic" is marked red. That's the default for the "unread" color, so "loic" sent a message to you, but you have not read it, yet. Moving by pressing Pg Down would need 6 key presses, so it might be faster to use \verb+/roster unread_next+ to quickly jump to the next unread buffer. Which brings us to the interface of mcabber. Since mcabber has only one input line, there has to be some way of distinguishing mcabber commands from normal text messages. As you might have guessed already, all mcabber commands start with a slash, while any other line which you have entered will be sent as a message to the selected buddy. You won't find a complete list of all commands here, since mcabber has already got a great help system. It's at your fingertips when you enter \verb+/help+. Furthermore, you can choose the language of the help system by setting \textit{lang} to de, en, fr, it, nl, pl, ru or uk. \section{Multi-user Chat} Jabber offers more than other one-on-one chats. There is an extension\cite{xep45} which adds many-to-many chat, very similar to systems like IRC. Mcabber can participate through the command \verb+/room+. If you happen to find big rooms, you should play a bit with \verb+/color muc+ to make the conversation more readable. Last but not least, you might be interested in the channel mcabber@conf.lilotux.net as a new mcabber user. Feel free to drop by and tell us about your experiences with mcabber or this guide! \section{Transports} Transports, also known as Gateways, are Jabber server components which are used for translating your Jabber messages for proprietary networks like ICQ, AIM or MSN. At the time of writing, mcabber can't register transports, but, if you've registered a transport with another client, you'll be able to use them within mcabber. Transports are, basically, just another contact on your roster. Thus, using transports is done by sending your status, maybe explicitly with \verb+/status_to+. \section{Symbols} Most users may be puzzled when they see all those different characters in the roster, the status bar and in the chat window for the first time. Some of those symbols might be obvious, but others aren't descriptive at all. So, here is a list of all characters and their meanings, structured per window where they were taken from. \\ \begin{tabular}{c c} \begin{tabular}{|c | l|} \hline \multicolumn{2}{|c|}{Roster}\\ \hline Symbols & Rosteritem \\ \hline \verb+---+ & unfolded Group \\ \verb-+++- & folded Group \\ \hline \verb+[ ]+ & buddy or chat room(MUC) \\ \verb+{ }+ & buddy who can't see your status \\ \verb- + - & buddy is typing \\ \verb+ . + & buddy stopped typing \\ \verb+ _ + & buddy status: offline \\ \verb+ o + & buddy status: online \\ \verb+ a + & buddy status: away \\ \verb+ d + & buddy status: do not disturb \\ \verb+ n + & buddy status: not available\\ \verb+ f + & buddy status: free for chat \\ \verb+ ? + & buddy status unknown \\ \verb+ x + & muc status: not connected \\ \verb+ C + & muc status: connected \\ \hline \end{tabular} & \begin{tabular}{|c | l|} \hline \multicolumn{2}{|c|}{Chat Window} \\ \hline Symbols & Meaning \\ \hline \verb+-->+ & sent message \\ \verb+<==+ & received message \\ \verb+~+ & message was encrypted with GPG\\ \verb+O+ & message was encrypted with OTR\\ \verb+***+ & info message \\ \verb+#<#+ & error message \\ \hline %\end{tabular} %\begin{tabular}{|c | l|} % \hline \multicolumn{2}{|c|}{Upper Status Line} \\ \hline Symbols & Meaning \\ \hline \verb+~+ & chat mode enabled \\ \verb+*+ & buffer is scroll-locked \\ \verb+[C]+ & chatstate: composing \\ \verb+[A]+ & chatstate: active \\ \verb+[I]+ & chatstate: inactive \\ \verb+[P]+ & chatstate: paused \\ \verb+[G]+ & chatstate: gone \\ \hline \end{tabular} \end{tabular} \chapter{Logging} Some people write their diaries to remember special moments. Others merely save their chat logs, which are often full of personal details, too. Of course, mcabber can keep your chat history and fortunately, the format of these logs is easy enough to read with your favourite text editor. Moreover, searching is possible with standard unix tools like \verb+$grep+. \section{Enable Logging} To enable logging, you'll have to add some lines to your configuration file: \begin{lstlisting} set logging = 1 set load_logs = 1 \end{lstlisting} Those variables tell mcabber to log the chat history and to load old logs when you restart it. Please note that there are a lot of other variables affecting logging. You can e.g. choose whether you want to log Multi-user Chats(\textit{log\_muc\_conf}) or whether you want to log status changes(\textit{logging\_ignore\_status}). You'll find them all in the sample configuration file\cite{samplerc} if you search for "History Logging". \section{Grouping logs} If you know other instant messengers, you might be used to a concept called "metacontacts". They can be used to group users, which have multiple representations in your roster (e.g. because they have work and home accounts). Unfortunately, mcabber doesn't support metacontacts yet, but at least you can group the history of different contacts together. This basically works by merging those histories and then creating a symlink frome one to the other. Here's an example with the histories of foo\_work@jabber.org ond foo\_home@jabber.org: \begin{lstlisting} $ cd ~/.mcabber/histo/ $ merge_history.py foo_work@jabber.org foo_home@jabber.org > foo $ mv foo foo_home@jabber.org $ rm foo_work@jabber.org $ ln -sf foo_home@jabber.org foo_work@jabber.org \end{lstlisting} The script merge\_history.py is included in the mcabber tarball. \section{Converting centerim logs} You've got old centericq\cite{centericq} or centerim\cite{centerim} logs and want to keep them in mcabber? There's a script called cicq2mcabber.pl in the contrib directory of the mcabber tarball which can be used to do that. Now you only have to figure out where exactly centerim saves the history of a particular contact(somewhere under \~{}/.centerim/), convert this file to the mcabber history format and save it to \~{}/.mcabber/histo/ with the Jabber ID as the filename. \chapter{Scripting} This chapter will introduce you to the scripting facilities of mcabber. \section{Aliases} Aliases are used to map complex commands to a word. \verb+/roster search+ is one of the commands worth remapping because it will be used every day. If you want to remap it to \verb+/rs+, issue the command \verb+alias rs = roster search+. \section{Internal Hooks} Internal Hooks can be used to let mcabber execute commands when a special event occurs. At the time of this writing, only 2 hooks were defined: \begin{itemize} \item \textit{hook-post-connect} \item \textit{hook-pre-disconnect} \end{itemize} The time of the execution is self-explaining, just set those variables to the command you want to execute. \section{External scripts} Mcabber will execute the external script specified in the variable \textit{events\_command} whenever a new message is received. It will be called at least with 3 parameters: \begin{enumerate} \item MSG or STATUS \item IN, OUT or MUC if the first argument was MSG or one character of "\_OFDNAI" if the first argument was STATUS \item The JID which triggered the event \item (optional) filename of the file which contains the message body \end{enumerate} If you need the message body for your event script, you'll have to set the option \textit{event\_log\_files} to 1. The script has to delete that file after it processed it. To execute mcabber commands, you'll have to compile mcabber with FIFO support(\verb+$./configure --enable-fifo+). Then activate it by setting the variable \textit{fifo\_name} to the filename of the fifo in your config file. There will be some verbose debug output in the logging window if you don't set the variable \textit{fifo\_hide\_output} to 1.\\ There is another variable which might be interesting for the developer of external scripts. If \textit{statefile} is set to a filename, mcabber saves the JIDs of all unread buffers to that file, one per line. \chapter{Encryption} Encryption is one of the greatest advantages of Jabber compared to similar "legacy" networks like ICQ, MSN, AIM, etc. With encryption, you'll be able to communicate in hostile network environments with a clear conscience, because almost nobody will be able to spy on you. Practically, every connection which is established when using the Jabber protocol could be encrypted. First of all, you can connect to your Jabber server via ssl, which will prevent anyone between you and the server from sniffing your plaintext messages or your password. In mcabber you could enable this feature by adding \begin{lstlisting} set ssl = 1 set ssl_verify = -1 \end{lstlisting} to your configuration file. The next step is server to server encryption, which you can't control, unless you're the admin of your server. So, theoretically it would be possible to spy between Jabber servers, or maybe your buddy doesn't use an ssl connection. Of course, if you are truly paranoid, you won't trust the server admins but only your buddy. So, to encrypt messages between you and your buddy, end-to-end encryption can be used. There are two protocols for accomplishing this: The first one is OpenPGP/GnuPG, which is a semi standard\cite{xep27} in the Jabber world. The other protocol is Off-the-Record(OTR) Messaging, which was designed by cryptographers Ian Goldberg and Nikita Borisov\cite{otr}. Although OTR isn't a standard, a lot of developers have implemented it for their instant messaging clients. The main reason might be the availability of libotr\cite{libotr}, an open-source library from the authors of OTR which does all the hard work. GnuPG is considered to be more mature, but it also has a major drawback: You can't encrypt messages between Jabber and legacy networks. Because naturally, the clients of other networks won't support Jabber extensions. OTR can fill that gap, because it only uses the message body as an envelope for the whole protocol. I will now describe in detail how to use both protocols with mcabber. \section{OpenPGP} First of all, I'm assuming that you've already generated a gnupg key which you want to use to encrypt Jabber messages. If you haven't done this before, go to \url{http://gnupg.org/documentation/} first. Using PGP encryption with mcabber should be straight-forward, but you have to restart mcabber for configuring it. To enable PGP for mcabber, you must add two lines to your configuration file: \begin{lstlisting} set pgp = 1 set pgp_private_key = 23DEADBEEFDEAD42 \end{lstlisting} The first one enables OpenPGP and the second line tells mcabber which PGP key it should use. If you didn't notice: This hexadecimal number is the last characters of your PGP key fingerprint, get it with \verb+gpg --fingerprint+\verb+ --list-secret-keys+. If you have no problems writing your passphrase to your hard disk, you could also set the variable \textit{pgp\_passphrase} in your config file. Otherwise mcabber will ask you for your passphrase at every start-up. From now on, mcabber will magically use PGP encryption whenever it can. Basically this works because presence messages of users using PGP are signed with their key. If you happen to have a contact whose Jabber client doesn't conform to that part of the standard, you can manually give mcabber their key fingerprint: \begin{lstlisting} pgp setkey foo@bar.net D9940C9BB1B92310 \end{lstlisting} \section{OTR} Enabling OTR in mcabber works in almost the same manner as PGP. But instead of generating your encryption key by hand, mcabber will create one for you when it starts. This might take some time and you can speed it up by generating randomness by typing, moving the mouse, writing to hard disk etc. But first of all, you must add the following lines to your configuration file and restart mcabber: \begin{lstlisting} set otr = 1 otrpolicy default manual \end{lstlisting} The first line is analogous to PGP. The second one gives the OTR subsystem the hint that you want to be able to start encrypted OTR channels manually(by issuing \verb+/otr start+). If you want that they are also "magically" started, you should change \verb+manual+ to \verb+opportunistic+. The opportunistic mode adds some whitespace characters to the first message sent to a buddy. So, his client can find those characters and establish an OTR channel. Please note that "establishing" the channel could take some time, depending on the delay of exchanging messages between both ends. (For the technically inclined: Four messages have to be sent before the channel is fully established. The whole protocol is described in detail at \url{http://www.cypherpunks.ca/otr/Protocol-v2-3.1.0.html}) Keep in mind that an established channel with a buddy isn't per se secure. It could be possible that you become a victim of a Man-in-the-middle attack. To make it secure, you'll have to exchange the fingerprints of the keys through a trusted medium (telephone, in person, etc). You can see your own fingerprint by using the command \verb+/otr key+ and the fingerprint of your chat buddy by \verb+/otr fingerprint+. Check \verb+/help otr+ to find out how to trust the fingerprint now. There is even another way for exchanging fingerprints: The Socialist Millionaires' Protocol\cite{smp}. It's basically a cryptographic secure way for two parties with the secret information x and y to check whether x==y without revealing any information about the secrets. Unfortunately there aren't many clients supporting that feature yet. In mcabber it is mapped to the commands \verb+/otr smpq bob@foo.net your_secret+ for the initiating party and \verb+/otr smpr alice@foo.net your_secret+ for the answering party. If both parties supply the same secret, the fingerprints can be marked trusted. \bibliographystyle{plain} \bibliography{guide} \end{document} mcabber-0.10.2/doc/help/000077500000000000000000000000001216603513500146645ustar00rootroot00000000000000mcabber-0.10.2/doc/help/Makefile.am000066400000000000000000000004731216603513500167240ustar00rootroot00000000000000helpdir = $(datadir)/mcabber/help install-data-local: $(INSTALL) -d $(DESTDIR)$(datadir)/mcabber/help for lang in en cs de fr it nl pl ru uk; do \ $(INSTALL) -d $(DESTDIR)$(datadir)/mcabber/help/$$lang; \ $(INSTALL) -m 0644 $(srcdir)/$$lang/* \ $(DESTDIR)$(datadir)/mcabber/help/$$lang; \ done mcabber-0.10.2/doc/help/Makefile.in000066400000000000000000000265571216603513500167500ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/help DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ helpdir = $(datadir)/mcabber/help all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/help/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/help/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am install-data-local: $(INSTALL) -d $(DESTDIR)$(datadir)/mcabber/help for lang in en cs de fr it nl pl ru uk; do \ $(INSTALL) -d $(DESTDIR)$(datadir)/mcabber/help/$$lang; \ $(INSTALL) -m 0644 $(srcdir)/$$lang/* \ $(DESTDIR)$(datadir)/mcabber/help/$$lang; \ done # 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: mcabber-0.10.2/doc/help/cs/000077500000000000000000000000001216603513500152715ustar00rootroot00000000000000mcabber-0.10.2/doc/help/cs/hlp.txt000066400000000000000000000006061216603513500166170ustar00rootroot00000000000000 /HELP [příkaz|+téma] Zobrazí nápovědu k příkazu nebo tématu. Dostupné příkazy jsou: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/cs/hlp_add.txt000066400000000000000000000010011216603513500174150ustar00rootroot00000000000000 /ADD [jid [přezdívka]] Přidá uživatele 'jid' do seznamu kontaktů (rosteru) do výchozí skupiny a pošle oznámení o přidání danému uživateli. Není-li zadána 'přezdívka', použije se 'jid' jako jméno kontaktu. Není-li zadáno ani 'jid' (nebo je-li zadán prázdný řetězec "") nebo je-li jako 'jid' znak '.', pracuje se s aktuálním kontaktem. /add [jid [přezdívka]] Přidá do seznamu kontaktů uživatele 'jid' se jménem 'přezdívka'. Příklad: "/add pepa@jabber.server.cz Pepa" mcabber-0.10.2/doc/help/cs/hlp_alias.txt000066400000000000000000000007261216603513500177730ustar00rootroot00000000000000 /ALIAS [název [= příkazová_řádka]] Umožní přidávat zkrácené zástupce (aliasy) pro zjednodušení zadávání složitejších příkazů. /alias Zobrazí přehled aktuálně definovaných aliasů. /alias název Vypíše hodnotu aliasu s názvem 'název'. /alias název= Vymaže alias s názvem 'název'. /alias název = příkazová_řádka Nastaví alias s názvem 'název' na hodnotu 'příkazová_řádka'. Příklad: "/alias away = status away" mcabber-0.10.2/doc/help/cs/hlp_authorization.txt000066400000000000000000000013211216603513500215720ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Slouží k řízení oprávnění k zobrazování stavu. Umožní požádat o autorizaci ostatní kontakty a dovolí řídit, kdo bude autorizován. Není-li zadáno 'jid', použije se aktuálně zvolený uživatel. /authorization allow Povolí kontaktu získávat informace o vašem stavu (autorizuje ho). /authorization cancel Znemožní kontaktu získávat informace o vašem stavu (neautorizuje ho). /authorization request Požádá o možnost zobrazování stavu daného kontaktu (požádá o autorizaci). /authorization request_unsubscribe Požádá o zrušení možnosti zobrazování stavu daného kontaktu (odvolá požadavek na autorizaci). mcabber-0.10.2/doc/help/cs/hlp_bind.txt000066400000000000000000000015131216603513500176110ustar00rootroot00000000000000 /BIND [kód_klávesy [= příkazový_řádek]] Sváže příkaz s klávesou s kódem 'kód_klávesy'. Pro zjištění, které klávesy nejsou zatím použity, stačí stisknout zkoumanou klávesu a podívat se do stavového okna. Například "Unknown key=265" znamená, že je možno svázat nějaký příkaz s klávesou #265. /bind Zobrazí přehled aktuálních vazeb. /bind kód_klávesy Vypíše příkazový řádek svázaný s danou klávesou. /bind kód_klávesy= Odstraní vazbu klávesy s kódem 'kód_klávesy'. /bind kód_klávesy = příkazový_řádek Sváže 'příkazový_řádek' s klávesou s kódem 'kód_klávesy'. Příklad: "/bind 265 = status away" (265 je kód pro klávesu F1). Poznámka: Kódy kláves se mohou lišit v závislosti na konfiguraci ncurses. Tip: Místo příkazů je možno použít i aliasy. mcabber-0.10.2/doc/help/cs/hlp_buffer.txt000066400000000000000000000031611216603513500201470ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save jméno_souboru Slouží k manipulaci se záznamem historie rozhovoru. Např. k vyhledávání textu, vymazání obsahu atd. /buffer clear Vymaže obsah okna rozhovoru. /buffer close [jid] Smaže celý záznam historie a zavře okno rozhovoru. /buffer close_all Smaže záznamy historie všech rozhovorů a zavře všechna okna. /buffer purge [jid] Vymaže obsah okna rozhovoru i celý záznam historie. /buffer list Zobrazí přehled záznamů rozhovorů s jejich délkou (řádky/bloky). /buffer top Přesune se na začátek záznamu rozhovoru. /buffer bottom Přesune se na konec záznamu rozhovoru. /buffer up [n] Přesune se o [n] řádků nahoru (výchozí: polovina obrazovky). /buffer down [n] Přesune se o [n] řádků dolů (výchozí: polovina obrazovky). /buffer date [datum] Přesune se na první řádek po datu [datum] (formát: "RRRR-mm-dd"). /buffer % n Přesune se na procentuální pozici n%. /buffer readmark Jump to the readmark (first unread line), if there is one /buffer search_backward text Vyhledá text [text] v záznamu rozhovoru (zpětně). /buffer search_forward text Vyhledá text [text] v záznamu rozhovoru (dopředně). /buffer scroll_lock Zamezí posouvání záznamu. /buffer scroll_unlock Povolí posouvání záznamu. /buffer scroll_toggle Přepíná mezi zapnutím a vypnutím posouvání záznamu. /buffer save jméno_souboru Uloží obsah záznamu historie rozhovoru do souboru s názvem 'jméno_souboru'. mcabber-0.10.2/doc/help/cs/hlp_chat_disable.txt000066400000000000000000000002421216603513500212750ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Přepne se z módu rozhovoru. S parametrem '--show-roster' zruší i celoobrazovkový mód a zobrazí seznam kontaktů (roster). mcabber-0.10.2/doc/help/cs/hlp_clear.txt000066400000000000000000000001301216603513500177550ustar00rootroot00000000000000 /CLEAR Vymaže obsah okna rozhovoru. Jedná se vlastně o alias pro "/buffer clear". mcabber-0.10.2/doc/help/cs/hlp_color.txt000066400000000000000000000040051216603513500200120ustar00rootroot00000000000000 /COLOR roster (zkrácené_stavy maska (barva|-)|clear) /COLOR mucnick přezdívka (barva|-) /COLOR muc (jid|.|*) [on|preset|off|-] Umožní dynamicky nastavovat barvy v programu. /color roster clear Odstraní všechna pravidla pro nastavení barev v seznamu kontaktů (rosteru). Všechny položky budou mít výchozí barvu. /color roster zkrácené_stavy maska barva Nastaví pravidlo pro barvu (nebo ho přepíše, pokud již existuje). 'zkrácené_stavy' je řetězec obsahující všechny požadované stavy, které má pravidlo zpracovávat (např. 'ofdna'), nebo znak '*' pro libovolný stav položky seznamu kontaktů. 'maska' je maska obsahující divoké znaky aplikovaná na 'jid' (např. 'mikael*') a 'barva' je požadovaná barva (např. 'red'). Je-li místo barvy znak '-', pravidlo se odstraní. Vyhovuje-li více než jedno pravidlo, použije se barva z posledního vytvořeného (nikoliv přepsaného) pravidla. /color mucnick přezdívka (barva|-) Označí účastníka konference se jménem 'přezdívka' pro obarvování barvou 'barva'. Pokud místnost používá obarvování, tato barva bude použita. Je-li jako barva použit znak '-', bude barva vybrána automaticky, nikoliv však v režimu 'preset' (viz dále), ale zůstane stále stejná v režimu 'on'. /color muc (jid|.|*) [on|preset|off|-] Nastaví režim obarvování účastníků v konferenční místnosti (MUC). Je-li uvedeno 'jid' (nebo znak '.' znamenající aktuálně vybranou položku), režim se bude týkat jen dané místnosti. Při použití znaku '*' se bude nastavení aplikovat pro všechny místnosti mimo těch, které byly nastaveny pomocí jejich 'jid'. Režim 'on' obarvuje všechny přezdívky účastníků, 'preset' jen ty ručně nastavené příkazem "/color mucnick" a 'off' obarvováví vypne. Není-li režim uveden, je výchozím režim 'on'. Režim '-' odstraní obarvování daného 'jid', takže se použije globální nastavení. Globální nastavení nelze odstranit. Výchozí globální nastavení obarvování je 'off'. mcabber-0.10.2/doc/help/cs/hlp_connect.txt000066400000000000000000000000611216603513500203230ustar00rootroot00000000000000 /CONNECT Naváže spojení s Jabber serverem. mcabber-0.10.2/doc/help/cs/hlp_del.txt000066400000000000000000000002331216603513500174370ustar00rootroot00000000000000 /DEL Smaže aktuální kontakt ze seznamu kontaktů (rosteru) a zruší povolení oznamování o stavu daného kontaktu (autorizaci) na obou stranách. mcabber-0.10.2/doc/help/cs/hlp_disconnect.txt000066400000000000000000000002761216603513500210330ustar00rootroot00000000000000 /DISCONNECT Ukončí spojení s Jabber serverem. Poznámka: Seznam kontaktů (roster) je přístupný pouze v době, kdy je spojení aktivní. Po odpojení od serveru je proto prázdný. mcabber-0.10.2/doc/help/cs/hlp_echo.txt000066400000000000000000000000741216603513500176140ustar00rootroot00000000000000 /ECHO zpráva Zobrazí text 'zpráva' v stavovém okně. mcabber-0.10.2/doc/help/cs/hlp_event.txt000066400000000000000000000012631216603513500200200ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject /EVENT list Rozhodne, co dělat s nevyřízenou událostí (např. žádostí o autorizaci). Je-li první parametr znak '*', zpracuje příkaz všechny události ve frontě. Parametry specifické pro danou událost se interpretují událost od události. Podchycen je případ odmítnutí pozvání do místnosti. Parametr je pak interpretován jako důvod odmítnutí. /event #N|* accept Přijme událost číslo #N resp. všechny události. /event #N|* ignore Ignoruje událost číslo #N resp. všechny události. /event #N|* reject Zamítne událost číslo #N resp. všechny události. /event list Zobrazí přehled nevyřízených událostí. mcabber-0.10.2/doc/help/cs/hlp_group.txt000066400000000000000000000006311216603513500200310ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [skupina] Změní aktuální pohled na skupinu kontaktů. /group fold [skupina] Sbalí aktuální resp. uvedenou skupinu v seznamu kontaktů (rosteru). /group unfold [skupina] Rozbalí aktuální resp. uvedenou skupinu v seznamu kontaktů (rosteru). /group toggle [skupina] Přepne pohled (sbaleno/rozbaleno) u aktuální resp. uvedené skupiny v seznamu kontaktů (rosteru). mcabber-0.10.2/doc/help/cs/hlp_help.txt000066400000000000000000000001431216603513500176230ustar00rootroot00000000000000 /HELP [příkaz|+téma] Zobrazí nápovědu k příkazu nebo tématu. Příklad: "/help buffer" mcabber-0.10.2/doc/help/cs/hlp_iline.txt000066400000000000000000000051171216603513500200010ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Zpracovává příkazy týkající se vstupního příkazového řádku. /iline fchar Posune se na následující znak. /iline bchar Posune se na předchozí znak. /iline char_fdel Smaže znak pod kurzorem. /iline char_bdel Smaže předchozí znak. /iline char_swap Přehodí znaky. /iline fword Posune kurzor na konec aktuálního nebo dalšího slova. /iline bword Posune kurzor zpět na začátek aktuálního nebo předchozího slova. /iline word_bdel Smaže slovo od pozice kurzoru po jeho začátek. /iline word_fdel Smaže slovo od pozice kurzoru po jeho konec. /iline word_upcase Převede slovo od pozice kurzoru po jeho konec na velká písmena. /iline word_downcase Převede slovo od pozice kurzoru po jeho konec na malá písmena. /iline word_capit Nastaví znak na pozici kurzoru na velké písmeno a další písmena do konce slova na malá. /iline hist_beginning_search_bwd Vyhledá zpětně v historii příkazů řádek začínající aktuálním řádkem až po pozici kurzoru (ponechá kurzor na původní pozici). /iline hist_beginning_search_fwd Vyhledá dopředně v historii příkazů řádek začínající aktuálním řádkem až po pozici kurzoru (ponechá kurzor na původní pozici). /iline hist_prev Posune se na předchozí řádek v historii příkazů. /iline hist_next Posune se na následující řádek v historii příkazů. /iline iline_start Přejde na začátek příkazového řádku. /iline iline_end Přejde na konec příkazového řádku. /iline iline_fdel Smaže vše od pozice kurzoru do konce řádku. /iline iline_bdel Smaže vše od začátku řádku do pozice kurzoru. /iline iline_accept Akceptuje řádek. /iline iline_accept_down_hist Akceptuje řádek a vloží následující řádek z historie příkazů na vstupní řádek. /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). /iline clear_history Clear the command line history /iline compl_do Doplní aktuální slovo na příkazovém řádku. /iline compl_cancel Zruší doplňování. /iline send_multiline Pošle/ukončí víceřádkovou zprávu. mcabber-0.10.2/doc/help/cs/hlp_info.txt000066400000000000000000000003131216603513500176250ustar00rootroot00000000000000 /INFO Zobrazí informace o vybrané položce (uživatel, agent, skupina...). U uživatelů se zobrazí zdroje (resources) s uvedením stavu, priority a stavové zprávy (pokud je) u každého z nich. mcabber-0.10.2/doc/help/cs/hlp_module.txt000066400000000000000000000011631216603513500201630ustar00rootroot00000000000000 /MODULE load|unload [-f] modul /MODULE info modul /MODULE [list] Nahraje, uvolní z paměti nebo ukáže informace o modulu. /module load [-f] modul Nahraje do paměti daný modul. Při použití parametru -f je většina chybových hlášení ignorována. /module unload [-f] modul Uvolní z paměti daný modul. Poznámka: Parametr -f neodstraní závislosti na daném modulu! /module info modul Zobrazí dostupné informace o daném modulu. /module [list] Vypíše přehled modulů ve formátu: [jméno modulu] [počet referancí] ([ručně/automaticky nahraný]) [další informace jako verze nebo závislosti] mcabber-0.10.2/doc/help/cs/hlp_move.txt000066400000000000000000000004301216603513500176400ustar00rootroot00000000000000 /MOVE [skupina] Přesune aktuální kontakt do požadované skupiny. Není-li skupina zadána, přesune se kontakt do výchozí skupiny. Pokud skupina neexistuje, automaticky se založí. Tip: V módu rozhovoru lze použít "/roster alternate" pro skok na přesunutý kontakt. mcabber-0.10.2/doc/help/cs/hlp_msay.txt000066400000000000000000000026741216603513500176570ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Pošle víceřádkovou zprávu. Pro posílání zpráv s více řádky se používá víceřádkový režim. Ve víceřádkovém režimu je každý řádek (mimo příkazových řádků) napsasný do vstupního řádku přidán do víceřádkové zprávy. Až je zpráva připravena, odešle se vybranému kontaktu pomocí příkazu "/msay send". Parametr 'begin' zapíná víceřádkový režim a dovoluje zadat i předmět (subject) zprávy. Parametr 'verbatim' zakáže příkazy, takže je možné zadávat řádky začínající lomítkem. Pouze příkaz "/msay" (s parametrem 'send' nebo 'abort') může být použit pro ukončení tohoto režimu. Tip: Parametr 'toggle' může být svázán s klávesou pro rychlé přepínání víceřádkového režimu (například "/bind M13 = msay toggle" pro přepínání pomocí kombinace Meta+Enter). /msay begin [předmět] Vstoupí do víceřádkového režimu. /msay verbatim Vstoupí do doslovného víceřádkového režimu. /msay send [-n|-h] Pošle aktuální víceřádkovou zprávu aktuálně zvolenému kontaktu. /msay send_to [-n|-h] jid Pošle aktuální víceřádkovou zprávu kontaktu 'jid'. /msay toggle|toggle_verbatim Přepne do/z víceřádkového režimu (begin/send). /msay abort Ukončí víceřádkový režim bez odeslání zprávy. Parametry '-n' a '-h' mění typ zprávy na normální (normal) nebo nadpis (headline). mcabber-0.10.2/doc/help/cs/hlp_otr.txt000066400000000000000000000022351216603513500175030ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] tajemství /OTR smpa [jid] Slouží pro řízení OTR (Off-The-Record messaging, šifrovaná komunikace). Jako 'jid' je možno použít znak '.' pro aktuálně zvolený kontakt. /otr key Zobrazí otisk (fingerprint) vašeho soukromého klíče ve stavovém okně. /otr start [jid] Otevře OTR kanál pro zadaný kontakt 'jid' resp. pro aktuálně zvolený kontakt. /otr stop [jid] Zavře OTR kanál pro zadaný kontakt 'jid' resp. pro aktuálně zvolený kontakt. /otr info [jid] Zobrazí aktuální stav OTR pro zadaný kontakt 'jid' resp. pro aktuálně zvolený kontakt. /otr fingerprint [jid [fpr]] Zobrazí aktivní otisk OTR kanálu. Je-li zadán otisk místo 'fpr', otisk se stane důvěryhodným. Je-li místo 'fpr' jiný nepravý řetězec, otisk ztratí důvěryhodnost. /otr smpq [jid] tajemství Zahájí Socialist Millionaires Protocol s heslem 'tajemství' a zvoleným uživatelem 'jid'. /otr smpr [jid] tajemství Odpoví na zahájení uživateli 'jid' heslem 'tajemství'. /otr smpa [jid] Ukončí běžící Socialist Millionaires Protocol s uživatelem 'jid'. mcabber-0.10.2/doc/help/cs/hlp_otrpolicy.txt000066400000000000000000000023651216603513500207270ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Slouží pro řízení politik (zásad) OTR (Off-The-Record messaging, šifrovaná komunikace). Jako 'jid' je možno použít znak '.' pro aktuálně zvolený kontakt. /otrpolicy Zorazí všechny OTR politiky ve stavovém okně. /otrpolicy (default|jid) (plain|manual|opportunistic|always) Nastaví výchozí politiku nebo politiku pro daného uživatele 'jid'. 'plain' by se neměla používat, neboť neumožuje přijímat a odesílat žádné OTR šifrované zprávy. Při nastavení 'manual' musí jedna nebo druhá strana zahájit OTR šifrování ručně (tj. pomocí "/otr start"). Volba 'opportunistic' to udělá sama tím, že pošle speciální sekvenci bílých znaků na konci nezašifrovaných zpráv, takže druhá strana pozná, že má používat OTR. První zpráva jde vždy nezašifrovaná. Při 'always' jdou všechny zprávy šifrovaně. Při pokusu o odeslání první nezašifrované zprávy se program pokusí vytvořit OTR kanál. Po obdržení informace o vytvoření kanálu je nutno zprávu znovu poslat. Při obdržení nezašifrované zprávy během nastavení politiky na 'always' je možno zprávu přečíst, ale není uložena do historie rozhovoru. mcabber-0.10.2/doc/help/cs/hlp_pgp.txt000066400000000000000000000021451216603513500174650ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [klíč]] Slouží k nastavení šifrování pomocí PGP (Pretty Good Privacy). PGP šifrování se nepoužije, není-li detekována podpora PGP na druhé straně, i když je příkazem povoleno. Šifrování je možno vynutit parametrem 'force'. Jako 'jid' je možno použít znak '.' pro aktuálně zvolený kontakt. /pgp enable [jid] Povolí PGP šifrování pro kontakt 'jid' resp. pro aktuálně zvolený kontakt. /pgp disable [jid] Zakáže PGP šifrování pro kontakt 'jid' resp. pro aktuálně zvolený kontakt. /pgp [+|-]force [jid] Vynutí PGP šifrování i pro zprávy offline a vždy předpokládá, že příjemce podporuje PGP. Pokud nemůže být zpráva zašifrována (chybějící klíč nebo id klíče), zpráva se vůbec neodešle. Tato volba je ignorována, je-li podpora PGP vypnuta. /pgp info [jid] Zobrazí aktuální nastavení PGP pro kontakt 'jid' resp. pro aktuálně zvolený kontakt. /pgp setkey [jid [klíč]] Nastaví PGP klíč pro šifrování zpráv s kontaktem 'jid'. Není-li klíč zadán, aktuální klíč se vymaže. mcabber-0.10.2/doc/help/cs/hlp_quit.txt000066400000000000000000000000661216603513500176610ustar00rootroot00000000000000 /QUIT Zavře všechna spojení a ukončí program. mcabber-0.10.2/doc/help/cs/hlp_rawxml.txt000066400000000000000000000004601216603513500202070ustar00rootroot00000000000000 /RAWXML send řetězec Pošle 'řetězec' (v holém XML formátu) Jabber serveru. Neprovádí žádné kontroly řetězce. POZOR! Používejte tuto funkci, jen když víte, co děláte, jinak můžete způsobit přerušení spojení. Příklad: "/rawxml send away" mcabber-0.10.2/doc/help/cs/hlp_rename.txt000066400000000000000000000002671216603513500201510ustar00rootroot00000000000000 /RENAME jméno Přejmenuje aktuálního uživatele nebo skupinu na 'jméno'. Je-li 'jméno' znak '-', dané jméno se odstraní ze seznamu kontaktů (rosteru) a zobrazí se 'jid'. mcabber-0.10.2/doc/help/cs/hlp_request.txt000066400000000000000000000010741216603513500203670ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Pošle "IQ" žádost kontaktu 'jid' resp. aktuálně zvolenému kontaktu a zobrazí výsledek. Není-li zadán zdroj (resource) u jid, pošle se žádost všem známým zdrojům tohoto kontaktu. /request last Požádá o poslední informaci (obvykle čas zahálení (idle)). /request ping Požádá o odezvu. Je třeba použít úplné JID, neboť odezvu na holé JID odesílá server. /request time Požádá o časové razítko. /request vcard Požádá o vizitku (vCard). /request version Požádá o verzi klienta. mcabber-0.10.2/doc/help/cs/hlp_room.txt000066400000000000000000000067661216603513500176700ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [hodnota] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Slouží pro správu konferenčních místností MUC (Multi-User Chat). /room join [místnost [přezdívka [heslo]]] Vstoupí do místnosti se zvolenou přezdívkou. Není-li přezdívka zadána (nebo je-li zadán prázdný řetězec ""), použije se volba 'nickname' z konfiguračního souboru. Je-li aktuálně zvolená položka rozpoznána jako místnost, může být použita místo jména místnosti zkrácená volba '.'. Pro vstup do chráněných místností může být zadáno heslo. Obsahuje-li přezdívka mezery, je nutno použít uvozovky. /room leave [zpráva] Opustí aktuální místnost se zprávou na odchod. /room names [--detail|--short|--quiet|--compact] Zobrazí seznam uživatelů v aktuální místnosti (podrobně/zkráceně/stručně). /room nick nová_přezdívka Změní vlastní přezdívku v aktuální místnosti na jinou. /room privmsg jméno zpráva Pošle soukromou zprávu uživateli 'jméno'. /room remove Odstraní aktuální místnost ze seznamu kontaktů (rosteru). Místnost je nutné předtím opustit. /room topic -|nový_předmět Nastaví nový předmět pro aktuální místnost. Je-li zadán znak '-', předmět se vymaže. /room unlock Odemkne aktuální místnost (může provést pouze vlastník). /room destroy [důvod] Zničí aktuální místnost s možností udání důvodu (opatrně!). /room whois jméno Zobrazí MUC informace o uživateli 'jméno'. /room ban jid [důvod] Zakáže přístup uživateli 'jid' do aktuální místnosti s možností udání důvodu. /room unban jid Zruší blokování přístupu do aktuální místnosti uživateli 'jid'. /room invite jid [důvod] Pozve uživatele 'jid' do aktuální místnosti s možností udání důvodu. /room kick jméno [důvod] Vyhodí (vykopne) uživatele 'jméno' z aktuální místnosti s možností udání důvodu. /room role jid role [důvod] Změní roli uživateli 'jid'. Role může být 'none' (žádná), 'visitor' (návštěvník), 'participant' (účastník) nebo 'moderator' (moderátor). /room affil jid vztah [důvod] Změní uživateli 'jid' vztah k místnosti. Vztah může být 'none' (žádný), 'member' (člen), 'admin' (správce) nebo 'owner' (vlastník). /room setopt print_status|auto_whois|flag_joins [hodnota] Změní nastavení pro aktuální místnost. Parametr 'print_status' definující, jaké změny stavů v místnosti se vypisují, má možnosti 'default' (výchozí), 'none' (žádné), 'in_and_out' (vstupy a výstupy z místnosti) nebo 'all' (všechny včetně změn stavů uživatelů). Parametr 'auto_whois' definující, zda se při vstupu uživatele provede příkaz "/room whois" pro zobrazení informací o uživateli, má možnosti 'default' (výchozí), 'off' (vypnuto) nebo 'on' (zapnuto). For flag_joins, the possible values are "default", "none", "joins", "all". Pokud je hodnota 'default' (výchozí), použije se nastavení 'muc_print_status'/'muc_auto_whois'/'muc_flag_joins' z konfiguračního souboru. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Přidá ('add'), odstraní ('del') nebo zaktualizuje záložku. Výchozí je akce 'add'. Je-li nastaven parametr 'autojoin', dojde k automatickému vstupu do místnosti po připojení k serveru. K zobrazení přehledu záložek slouží příkaz "/room bookmark" spuštěný ve stavovém okně. mcabber-0.10.2/doc/help/cs/hlp_roster.txt000066400000000000000000000056401216603513500202200ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search co /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Slouží k manipulaci se seznamem kontaktů (rosterem). /roster bottom Přesune se na spodek seznamu kontaktů. /roster top Přesune se na vršek seznamu kontaktů. /roster up [n] Posune se nahoru v seznamu kontaktů. /roster down [n] Posune se dolů v seznamu kontaktů. /roster group_prev Přesune se na předchozí skupinu. /roster group_next Přesune se na následující skupinu. /roster alternate Přesune se na alternující kontakt. Alternující kontakt je ten naposledy opuštěný při režimu rozhovoru. Příkaz je vhodné použít po příkazu "/roster unread_next" (Ctrl+q). /roster unread_first Přesune se na první kontakt s nepřečtenou zprávou. /roster unread_next Přesune se na následující kontakt s nepřečtenou zprávou. /roster search co Vyhledá kontakt se jménem nebo jid obsahující řetězec 'co' (pouze v zobrazovaném seznamu kontaktů). /roster display [maska] Zobrazí nebo nastaví filtr pro seznam kontaktů. 'maska' by měla obsahovat písmena stavů, které se mají zobrazovat. Možnosti jsou [o]nline, [f]ree_for_chat (volně k dispozici), [d]o_not_disturb (nevyrušovat), [n]ot_available (nepřítomen), [a]way (na chvíli pryč) a [_]offline (vypnuto nebo neviditelný). Například 'ofdna' zobrazí pouze připojené kontakty. Znak '*' může být použit pro zobrazení všech kontaktů. /roster hide_offline Skryje uživatele ve stavu offline (to samé jako "/roster display ofdna"). /roster show_offline Zobrazí i uživatele ve stavu offline (to samé jako "/roster display ofdna_"). /roster toggle_offline Přepíná zobrazení uživatelů ve stavu offline (skrývá/zobrazuje). /roster item_lock [jid] Zamkne položku v seznamu kontaktů, že zůstává zobrazena bez ohledu na stav. /roster item_unlock [jid] Zruší zámek u položky v seznamu kontaktů. /roster item_toggle_lock [jid] Přepíná zámek u položky v seznamu kontaktů (zamyká/odemyká). /roster hide Skryje seznam kontaktů (zobrazí okno rozhovoru na plnou šířku). /roster show Zobrazí seznam kontaktů. /roster toggle Přepíná zobrazení seznamu kontaktů (skrývá/zobrazuje). /roster note [-|text] Nastaví, aktualizuje nebo vymaže poznámku. Není-li zadán 'text', zobrazí se aktuální poznámka k položce. Při spuštění ve stavovém okně se zobrazí všechny poznámky. Je-li místo textu znak '-', poznámka se vymaže. /roster resource_lock [full jid|resource] Set active resource for a buddy in roster. Accepts special jid "./resource" for current buddy, or just a resource name. /roster resource_unlock [jid] Unset active resource for a buddy. Accepts special jid "." for current buddy. mcabber-0.10.2/doc/help/cs/hlp_say.txt000066400000000000000000000005171216603513500174740ustar00rootroot00000000000000 /SAY [-n|-h|--] text Pošle zprávu s obsahem 'text' aktuálně vybranému kontaktu. Slouží například pro posílání zprávy začínající na lomítko. Parametry '-n' a '-h' mění typ zprávy na normální (normal) nebo nadpis (headline). Parametr '--' se použije při odesílání zprávy začínající na "-n" nebo "-h". mcabber-0.10.2/doc/help/cs/hlp_say_to.txt000066400000000000000000000015121216603513500201720ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f soubor] jid text Pošle zprávu s obsahem 'text' kontaktu 'jid'. Příkaz nenastavuje výchozí zdroj (resource) pro kontakt, proto pro posílání více zpráv na určitý zdroj je nutno použít pokaždé "/say_to". Parametry '-n' a '-h' mění typ zprávy na normální (normal) nebo nadpis (headline). Parametr '--' se použije při odesílání zprávy začínající na "-n" nebo "-h". Parametr '-q' způsobí, že se zpráva odešle na pozadí a neprojeví se v aktivním okně. The option "-e" enables interpretation of the strings "\n" and "\t". This flag has no effect if the text comes from a file with option "-f". Při použití parametru '-f' následovaném jménem textového souboru se odešle zpráva obsahující text ze souboru (a v tom případě parametr 'text' za 'jid' nemá význam). mcabber-0.10.2/doc/help/cs/hlp_screen_refresh.txt000066400000000000000000000003111216603513500216650ustar00rootroot00000000000000 /SCREEN_REFRESH Překreslí obrazovku programu (Ctrl+l). Tip: Příkaz je vhodné použít po příkazech měnících vzhled obrazovky jako jsou "/set roster_width" nebo "/set log_win_height" apod. mcabber-0.10.2/doc/help/cs/hlp_set.txt000066400000000000000000000003171216603513500174710ustar00rootroot00000000000000 /SET [volba [= hodnota]] Zobrazí nebo nastaví hodnotu pro danou volbu. Volby odpovídají položkám v konfiguračním souboru. Bez parametru vypíše přehled všech voleb s příslušnými hodnotami. mcabber-0.10.2/doc/help/cs/hlp_source.txt000066400000000000000000000001521216603513500201730ustar00rootroot00000000000000 /SOURCE maska Načte kounfigurační soubory, které odpovídají dané masce (v abecedním pořadí). mcabber-0.10.2/doc/help/cs/hlp_status.txt000066400000000000000000000014251216603513500202220ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|stavová_zpráva]] /STATUS message -|stavová_zpráva Zobrazí nebo nastaví aktuální stav. Stav může nabývat hodnot 'online' (přítomen), 'avail' (k dispozici), 'free' (svolný k rozhovoru), 'dnd' (nevyrušovat), 'notavail' (nedostupný), 'away' (na chvíli pryč). Není-li stav zadán, zobrazí se aktuální stav.. Je-li 'stavová_zpráva' zadána, přepíše výchozí proměnnou 'message*' z konfiguračního souboru. Není-li příslušná proměnná 'message*' nastavena a 'stavová_zpráva' nebyla zadána, stávající stavová zpráva se zachová. Je-li jako 'stavová_zpráva' znak '-', aktuální stavová zpráva se vymaže. Příkazem "/status message" se stavová zpráva zaktualizuje, ale stav zůstane nedotčen. mcabber-0.10.2/doc/help/cs/hlp_status_to.txt000066400000000000000000000007551216603513500207310ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [stavová_zpráva] /STATUS_TO jid message stavová_zpráva Pošle požadovaný stav kontaktu 'jid'. Podrobnosti viz nápověda k příkazu "/status". Je-li jako 'jid' znak '.', použije se aktuálně zvolený kontakt. Poznámka: Tento stav se přepíše nejbližším následujícím příkazem "/status" i automatickou změnou stavu při nečinnosti (auto-away). Tip: 'jid' může obsahovat i zdroj (resource) (tj. jméno@server/zdroj). mcabber-0.10.2/doc/help/cs/hlp_version.txt000066400000000000000000000000451216603513500203610ustar00rootroot00000000000000 /VERSION Zobrazí verzi programu. mcabber-0.10.2/doc/help/de/000077500000000000000000000000001216603513500152545ustar00rootroot00000000000000mcabber-0.10.2/doc/help/de/hlp.txt000066400000000000000000000007001216603513500165750ustar00rootroot00000000000000 /HELP [command|+topic] Zeigt die Hilfe zu einem Befehl oder ein Thema an. Wenn kein Argument gegeben ist, wird diese Hilfe angezeigt. Verfügbare Befehle: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/de/hlp_add.txt000066400000000000000000000007061216603513500174130ustar00rootroot00000000000000 /ADD [jid [nickname]] Fügt die Jabber ID "jid" zu deinem Roster (in der Standardgruppe) hinzu und schickt gleichzeitig eine Benachrichtigungsanfrage an den User. Wenn kein Nickname angegeben wurde, wird die jid benutzt. Wenn die auch fehlt, wird der momentan ausgewählte User aus dem Roster zur Standardgruppe hinzugefügt. /add [jid [nickname]] Füge "jid" als "nickname" zu deinem Roster hinzu. Beispiel: "/add jemand@jabber.server.com Jemand" mcabber-0.10.2/doc/help/de/hlp_alias.txt000066400000000000000000000006441216603513500177550ustar00rootroot00000000000000 /ALIAS [name [= befehlszeile]] Dieser Befehl lässt dich Aliase erstellen, um anspruchsvolle Befehle durch Einfachere zu ersetzen. Du kannst die Aliase wie folgt verwalten: /alias Alle definierten Aliase anzeigen /alias name Wert des Alias "name" anzeigen /alias name= Alias "name" zurücksetzen /alias name = befehlszeile Alias "name" auf den Wert "befehlszeile" setzen Beispiel: "/alias binweg = status away" mcabber-0.10.2/doc/help/de/hlp_authorization.txt000066400000000000000000000012761216603513500215660ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Dieser Befehl verwaltet Presence Benachrichtigungen. Man kann diese bei Anderen erbitten. Weiterhin kann man kontrollieren wer die eigenen Benachrichtigungen bekommt. Wenn keine JID angegeben wurde, wird der gerade ausgewählte Buddy benutzt. /authorization allow Erlaubt dem Buddy deine Presence Benachrichtigungen zu bekommen /authorization cancel Stoppt die Presence Benachrichtigungen für diesen Buddy /authorization request Fragt bei dem Buddy an, ob man seine Presence Benachrichtigungen bekommen darf /authorization request_unsubscribe Höfliche Anfrage, dass man die Presence Benachrichtigungen nicht mehr bekommen will ;] mcabber-0.10.2/doc/help/de/hlp_bind.txt000066400000000000000000000014501216603513500175740ustar00rootroot00000000000000 /BIND [keycode [= command line]] Den Befehl "command line" auf die Taste mit dem keycode legen. Um herauszufinden, ob eine bestimmte Taste noch nicht belegt ist, drücke diese und schaue in das Logfenster. "Unknow key=256" bedeutet dann, dass du irgendeinen Befehl auf die Taste mit dem keycode 265 legen kannst. /bind Zeigt alle Tastaturkürzel an /bind keycode Zeigt den Befehl fuer die Taste mit dem keycode an /bind keycode= Entkürzelt die Taste mit dem angegebenen keycode /bind keycode = command line Legt den Befehl "command line" auf die Taste mit diesem keycode Beispiel: "/bind 265 = status away" (265 ist F1). Beachte das Tastencodes, je nach ncurses Konfiguration, unterschiedlich sein können. Und natürlich können anstatt direkten Befehlen auch Aliase auf Tasten gelegt werden. :] mcabber-0.10.2/doc/help/de/hlp_buffer.txt000066400000000000000000000033271216603513500201360ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save filename Befehl um den Puffer für den momentan ausgewählten Buddy zu verändern. Man kann zum Beispiel suchen, das Chatfenster leeren, usw... /buffer clear Leere das gerade offene Chatfenster /buffer close [jid] Leert den Inhalt des Puffers und schließt das momentan geöffnete Chatfenster /buffer close_all Leert alle Chatpuffer und schließt alle Chatfenster /buffer purge [jid] Leere das Chatfenster und lösche den Inhalt des Chatpuffers /buffer list Zeigt eine Liste der existierende Puffer und deren Länge(Zeilen/Blöcke) an. /buffer top Springe zum Anfang des momentanen Chat Puffers /buffer bottom Springe zu dem Ende des momentanen Chat Puffers /buffer up [n] Scrollt den Puffer um n Zeilen hoch. Gibt man keine Zahl an, scrollt er um einen halben Bildschirm /buffer down [n] Scrollt den Puffer um n Zeilen runter. Gibt man keine Zahl an, scrollt er um einen halben Bildschirm /buffer date [date] Springe zu der ersten Zeile nach dem Datum, welches im Format "JJJJ-mm-tt" anstatt [date] angegeben werden muss /buffer % n Springe zur Position "n" im Chatpuffer /buffer readmark Springe zur Lesemarkierung (erste ungelesene Zeile), wenn es eine gibt /buffer search_backward text Suche rückwärts im Puffer nach "text" /buffer search_forward text Suche vorwärts im Puffer nach "text" /buffer scroll_lock Scrollen des Puffers blockieren /buffer scroll_unlock Scrollen des Puffers erlauben /buffer scroll_toggle Scrollen des Puffers ein-/ausschalten /buffer save filename Speichert den Inhalt des aktuellen Puffers in der Datei "filename" mcabber-0.10.2/doc/help/de/hlp_chat_disable.txt000066400000000000000000000001621216603513500212610ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Den Chatmodus verlassen. Mit --show-roster" wird der Vollbildmodus unterdrückt. mcabber-0.10.2/doc/help/de/hlp_clear.txt000066400000000000000000000001401216603513500177410ustar00rootroot00000000000000 /CLEAR Dieser Befehl ist nur ein Alias für "/buffer clear" und leert damit das Chatfenster. mcabber-0.10.2/doc/help/de/hlp_color.txt000066400000000000000000000035471216603513500200070ustar00rootroot00000000000000 /COLOR roster (status wildcard (color|-)|clear) /COLOR mucnick nick (color|-) /COLOR muc (jid|.|*) [on|preset|off|-] Der 'color' Befehl macht es möglich dynamisch Farben des Rosters zu verändern. /color roster clear Löscht alle definierten Farbregeln, sodass die Standardfarben wieder benutzt werden. /color roster status wildcard color Setzt eine Farbregel, bzw. überschreibt eine, wenn sie schon existierte. "status" ist ein String der alle Status angibt, auf welche diese Regel zutreffen soll (oder "*" für jeden möglichen Status). Mit Wildcards kann man festlegen auf welche JIDs diese Regel angewendet werden soll. "color" muss durch die gewünschte Farbe ersetzt werden. Wenn für color "-" eingesetzt wird, wird die Regel gelöscht. Wenn mehr als eine Regel zutrifft, wird die Farbe von der zuletzt erschaffenen Regel benutzt. /color mucnick nick (color|-) Setzt dem MUC Nicknamen die übergebene Farbe. Diese wird allerdings nur benutzt, wenn für den MUC auch Farben angeschalten sind. Wenn anstatt einer Farbe "-" angegeben wird, wird die Farbe automatisch gewählt, wobei diese nur benutzt wird, wenn der Farbmodus des MUC auf "on" gesetzt ist. /color muc (jid|.|*) [on|preset|off|-] Setzt den MUC Farbenmodus. Wenn eine JID angegeben wird, dann wird der Modus nur für diesen MUC gesetzt. Anstatt einer JID kann auch . für den gerade ausgewählten oder * für alle MUCs(außer die, die einen eigenen Modus haben) angegeben werden. Durch den Modus "on" werden alle Nicks eingefärbt, durch "preset" nur die, die davor explizit per /color mucnick gesetzt wurden und "off" schaltet dieses Feature ganz aus. Wenn hier nichts angegeben wurde, wird der Modus auf "on" gesetzt. Um den Modus zu entfernen, gibt man "-" an. Dadurch wird dann der Globale auf diesen MUC angewendet, welchen man nicht entfernen kann. Standardmäßig ist der globale Modus "off". mcabber-0.10.2/doc/help/de/hlp_connect.txt000066400000000000000000000000701216603513500203060ustar00rootroot00000000000000 /CONNECT Eine Verbindung zum Jabber Server aufbauen. mcabber-0.10.2/doc/help/de/hlp_del.txt000066400000000000000000000002221216603513500174200ustar00rootroot00000000000000 /DEL Löscht den gerade ausgewählten Buddy vom Roster. Außerdem werden die automatischen Presence Benachrichtigungen vom/zum Buddy gestoppt. mcabber-0.10.2/doc/help/de/hlp_disconnect.txt000066400000000000000000000003371216603513500210140ustar00rootroot00000000000000 /DISCONNECT Die Verbindung zum Jabber Server trennen. Denke daran, dass der Roster nur verfügbar ist wenn man mit dem Jabber Server verbunden ist. Somit ist die Buddyliste auch leer, wenn man sich beim Server abmeldet. mcabber-0.10.2/doc/help/de/hlp_echo.txt000066400000000000000000000000671216603513500176010ustar00rootroot00000000000000 /ECHO message Gibt "message" in dem Logfenster aus. mcabber-0.10.2/doc/help/de/hlp_event.txt000066400000000000000000000014751216603513500200100ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [Ereignis spezifische Parameter] /EVENT list Sagt mcabber was mit den wartenden Ereignissen passieren soll. Wenn der erste Parameter * ist, dann wird der Befehl auf alle wartenden Ereignisse angewendet. Ereignis spezifische Parameter werden je nach dem zugrundeliegenden Event behandelt. Bisher wird dieser nur beim Ablehnen von MUC-Einladungen berücksichtigt: Hier wird der Parameter als Grund der Ablehnung gesendet. /event #N|* accept [Ereignis spezifische Parameter] Ereignis #N/alle Ereignisse werden angenommen /event #N|* ignore [Ereignis spezifische Parameter] Ereignis #N/alle Ereignisse werden ignoriert /event #N|* reject [Ereignis spezifische Parameter] Ereignis mit der Nummer #N/alle Ereignisse werden abgelehnt /event list Zeigt alle noch nicht behandelten Ereignisse an mcabber-0.10.2/doc/help/de/hlp_group.txt000066400000000000000000000004651216603513500200210ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] Dieser Befehl verändert die Anzeige der gerade ausgewählten Gruppe /group fold [groupname] Verstecke die gerade ausgewählte Gruppe /group unfold [groupname] Die Gruppen-Ansicht aufklappen /group toggle [groupname] Verstecken/Aufklappen der ausgewählten Gruppe mcabber-0.10.2/doc/help/de/hlp_help.txt000066400000000000000000000001661216603513500176130ustar00rootroot00000000000000 /HELP [befehl|+thema] Zeige die Hilfe fuer den Befehl "befehl" oder das Thema "thema" an. Beispiel: "/help buffer" mcabber-0.10.2/doc/help/de/hlp_iline.txt000066400000000000000000000050511216603513500177610ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Befehle für die Eingabezeile /iline fchar Zum nächsten Zeichen bewegen /iline bchar Zum vorherigen Zeichen bewegen /iline char_fdel Das Zeichen unter dem Cursor löschen /iline char_bdel Das Zeichen vor dem Cursor löschen /iline char_swap Zeichen vertauschen /iline fword Den Cursor bis zum Ende des ersten Wortes von rechts bewegen /iline bword Den Cursor an den Anfang des ersten Wortes von links setzen /iline word_bdel Die Zeichen des Wortes von der Cursor Position bis zum Anfang löschen /iline word_fdel Die Zeichen des Wortes von der Cursor Position bis zum Ende löschen /iline word_upcase Die Zeichen des Wortes von der Cursor Position bis zum Ende groß machen /iline word_downcase Die Zeichen des Wortes von der Cursor Position bis zum Ende klein machen /iline word_capit Den ersten Buchstaben des Wortes unter dem Cursor groß, den Rest der Buchstaben klein machen /iline hist_beginning_search_bwd In der Historie rückwärts nach dem schon eingegebenen Anfang suchen (Der Cursor bleibt dabei an der gleichen Stelle) /iline hist_beginning_search_fwd In der Historie vorwärts nach dem schon eingegebenen Anfang suchen (Der Cursor bleibt dabei an der gleichen Stelle) /iline hist_prev Vorherige Zeile der History /iline hist_next Nächste Zeile der History /iline iline_start Der Cursor springt an den Anfang der Eingabezeile /iline iline_end Der Cursor springt an das Ende der Eingabezeile /iline iline_fdel Alle Zeichen vom Cursor bis zum Ende der Zeile löschen /iline iline_bdel Alle Zeichen vom Cursor bis zum Beginn der Zeile löschen /iline iline_accept Zeile akzeptieren /iline iline_accept_down_hist Zeile akzeptieren und die nächste Zeile aus der History in die Eingabezeile schreiben /iline iline_insert text Fügt Text in der Eingabezeile an der aktuellen Position ein. Anführungszeichen müssen escaped werden. Der Bildschirm wird nicht aktualisiert (siehe /screen_refresh) /iline clear_history Löscht die Befehlshistorie Clear the command line history /iline compl_do Das derzeitig ausgewählte Wort vervollständigen /iline compl_cancel Vervollständigen abbrechen /iline send_multiline Eine mehrzeilige Nachricht senden mcabber-0.10.2/doc/help/de/hlp_info.txt000066400000000000000000000003341216603513500176130ustar00rootroot00000000000000 /INFO Zeige Informationen über den ausgewählten Eintrag an (User, Agent, Gruppe). Bei Usern werden die Ressourcen mit dem Status, der Priorität und der Statusmeldung (wenn vorhanden) von jeder Ressource angezeigt. mcabber-0.10.2/doc/help/de/hlp_module.txt000066400000000000000000000012051216603513500201430ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Ein Modul laden, entladen oder Informationen darüber anzeigen. /module load [-f] module Läd das angegebene Modul. Wenn -f benutzt wird, so werden die meisten Fehler beim Laden des Moduls ignoriert. /module unload [-f] module Entläd das angegebene Modul. Wenn -f angegeben wird, so werden abhängige Module nicht entladen! /module info module Zeigt Informationen über dieses Modul an. /module [list] Auflistung aller Module in dem Format: [Modulname] [Referenzzähler] ([Manuell/Automatisch geladen]) [weitere Informationen, wie die Version oder Abhängigkeiten] mcabber-0.10.2/doc/help/de/hlp_move.txt000066400000000000000000000005501216603513500176260ustar00rootroot00000000000000 /MOVE [groupname] Verschiebt den ausgewählten Buddy zu der Gruppe "groupname". Wenn keine Gruppe angegeben wurde, wird der Buddy zur Standardgruppe verschoben. Wenn die Gruppe "groupname" nicht existiert, wird sie erst erschaffen. Tipp: Wenn der Chatmodus aktiviert ist, kannst du "/roster alternate" benutzen um zu dem gerade bewegten Buddy zu springen. mcabber-0.10.2/doc/help/de/hlp_msay.txt000066400000000000000000000025371216603513500176400ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Eine mehrzeilige Nachricht verschicken. Um eine einzelne Nachricht mit mehreren Zeilen zu verschicken, sollte dieser Modus verwendet werden. In diesem Modus wird jede Zeile (außer Befehlszeilen), die in der Eingabezeile eingegeben wurden, zu der Nachricht hinzugefügt. Sobald die Nachricht fertig ist, kann sie zu dem gerade ausgewählten Buddy durch "/msay send" geschickt werden. Der "begin" Unterbefehl startet den Mehrzeilen-Modus. Es ist sogar möglich einen Betreff zu setzen. Anstatt "begin" kann man auch "verbatim" benutzen, wobei verbatim auch Zeilen mit einem / am Anfang zulässt. Nur der "/msay send/abort" Befehl führt zum Abbruch von diesem Modus. Der "toggle" Unterbefehl kann auf eine Taste gelegt werden, um den Mehrzeilen-Modus schnell zu benutzen(z.B. "/bind M13 = msay toggle" um per Meta-Enter zu wechseln). /msay begin [subject] Mehrzeilen-Modus starten /msay verbatim Mehrzeilen-Modus mit der Möglichkeit / am Zeilenanfang zu verwenden /msay send [-n|-h] Sendet die eingegebene mehrzeilige Nachricht an den Buddy /msay send_to [-n|-h] jid Sendet die eingegebene mehrzeilige Nachricht an die übergebene "jid" /msay toggle|toggle_verbatim Wechsel der Modi (sozusagen "/msay begin|send" im Wechsel) /msay abort Den Mehrzeilen-Modus, ohne die Nachricht abzuschicken, verlassen mcabber-0.10.2/doc/help/de/hlp_otr.txt000066400000000000000000000022231216603513500174630ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Man kann auch "." anstatt einer jid benutzen, wenn man den gerade ausgewählten Buddy meint. /otr key Zeigt den Fingerprint deines privaten Schlüssels im Status Buffer an. /otr start [jid] Öffnet einen OTR Kanal zu der angegebenen JID(oder dem gerade ausgewähltem Buddy). /otr stop [jid] Schliesst einen OTR Kanal zu der angegebenen JID(oder dem gerade ausgewähltem Buddy). /otr info [jid] Zeigt den aktuellen OTR Status für die angegebene JID(oder dem gerade ausgewähltem Buddy) an. /otr fingerprint [jid [fpr]] Zeigt den Fingerprint eines aufgebauten Kanals an. Um dem Schlüssel des Users zu vertrauen, muss man den Fingerprint explizit anstatt "fpr" angeben. Wenn man dem Schlüssel nicht mehr vertrauen will, muss man anstatt "fpr" irgendetwas anderes als den Fingerprint angeben. /otr smpq [jid] geheimnis Startet das Socialist Millionaires Protocol mit dem angegebenen Geheimnis und dem Buddy. /otr smpr [jid] geheimnis Beantwortet eine SMP Anfrage mit dem Geheimnis. /otr smpa [jid] Bricht das Socialist Millionaires Protocol ab. mcabber-0.10.2/doc/help/de/hlp_otrpolicy.txt000066400000000000000000000025421216603513500207070ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Man kann auch "." anstatt einer jid benutzen, wenn man den gerade ausgewählten Buddy meint. /otrpolicy Zeigt die Verhalten von OTR im Status Buffer an. /otrpolicy (default|jid) (plain|manual|opportunistic|always) Setzt entweder das Standardverhalten oder das Verhalten für die gegebene JID. "plain" sollte eigentlich nie benutzt werden, weil man damit nicht mehr in der Lage ist, OTR verschlüsselte Nachrichten zu senden oder zu empfangen. Wenn man das Verhalten auf "manual" setzt, musst man selbst oder der Chatpartner den OTR Kanal per Hand aufmachen(z.B. mit /otr start). "opportunistic" macht das selbstständig, indem die erste gesendete Nachricht noch eine spezielle Sequenz von Leerzeichen und Tabs angehangen bekommt. So weiss der andere OTR fähige Client sofort, dass man OTR benutzen will. Zu beachten ist aber, dass die erste Nachricht immer unverschlüsselt sein wird. Mit "always" wird keine Nachricht mehr im Klartext geschickt. Sobald man die erste Nachricht verschicken will, wird mcabber versuchen einen OTR Kanal aufzubauen. Sollte man in der Zeit noch mehr Messages schicken, muss man sie evt. noch einmal senden. Wenn man eine unverschluesselte Nachricht in diesem Modus bekommt, so kann man die Nachricht zwar lesen, sie wird aber nicht in der History gespeichert. mcabber-0.10.2/doc/help/de/hlp_pgp.txt000066400000000000000000000024021216603513500174440ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [key]] Dieser Befehl verändert die PGP Einstellung für die übergebene JID (oder den gerade aktiven Buddy). Bitte beachte, dass PGP Verschlüsselung _nicht_ benutzt wird, wenn der andere kein PGP unterstützt, selbst wenn PGP mit diesem Befehl eingeschaltet wurde. Man kann die Verschlüsselung allerdings durch "force" erzwingen. /pgp disable [jid] Schaltet PGP Verschlüsselung für die jid aus (oder dem gerade aktiven Buddy) /pgp enable [jid] Schaltet PGP Verschlüsselung für die jid ein (oder dem gerade aktiven Buddy) /pgp [+|-]force [jid] PGP Verschlüsselung erzwingen, selbst bei offline Nachrichten. Es wird ausserdem angenommen, dass alle Buddies PGP benutzen. Wenn eine Nachricht nicht verschlüsselt werden kann, weil zum Beispiel der Schlüssel für den Buddy fehlt, wird die Nachricht überhaupt nicht gesendet. Diese Option wird ignoriert, wenn PGP deaktiviert ist. /pgp info [jid] Zeige die momentanen PGP-Einstellungen für die jid /pgp setkey [jid [key]] Setzt den PGP Schlüssel, der für diese jid benutzt werden soll. Wenn kein Schlüssel angegeben wird, wird der Aktuelle nicht mehr benutzt. Man kann auch "." anstatt einer jid benutzen, wenn man den gerade ausgewählten Buddy meint. mcabber-0.10.2/doc/help/de/hlp_quit.txt000066400000000000000000000001101216603513500176320ustar00rootroot00000000000000 /QUIT Dieser Befehl schliesst alle Verbindungen und beendet mcabber. mcabber-0.10.2/doc/help/de/hlp_rawxml.txt000066400000000000000000000004001216603513500201640ustar00rootroot00000000000000 /RAWXML send string Schickt "string" (raw XML) zu dem Jabber Server. Es wird keinerlei Überprüfung vorgenommen. ACHTUNG! Benutz diesen Befehl nur, wenn du wirklich weisst, was du tust. Beispiel: "/rawxml send away" mcabber-0.10.2/doc/help/de/hlp_rename.txt000066400000000000000000000003441216603513500201300ustar00rootroot00000000000000 /RENAME name Setzt den Namen des gerade ausgewählten Buddys bzw. der ausgewählten Gruppe auf "name". Wenn "name" - ist, so wird der Name vom Roster entfernt (mcabber wird in diesem Falle die JID bzw. den username anzeigen) mcabber-0.10.2/doc/help/de/hlp_request.txt000066400000000000000000000011131216603513500203440ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Sendet spezielle Anfragen an den Buddy oder zu dem spezifizierten Jabber User. Wenn die Ressource nicht von dieser jid angeboten wird, wird mcabber die Anfrage an alle bekannten Ressourcen des Benutzers schicken. /request last "letzte" Information abfragen (meist nur die Idlezeit) /request ping XMPP Ping senden. Die jid sollte die Ressource beinhalten, sonst wird der Ping vom Server beantwortet. /request time Zeit vom Kontakt abfragen /request vcard VCard abfragen /request version Version von der Software des Kontaktes abfragen mcabber-0.10.2/doc/help/de/hlp_room.txt000066400000000000000000000050771216603513500176450ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [wert] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Der "room" Befehl umfasst die Multi-User Chat (kurz MUC) Befehle. /room join [room [nick [pass]]] Betrete den Raum "room" mit dem Nickname "nick". Wenn kein Nickname angegeben wurde, wird die "nickname" Option aus der Konfigurationsdatei benutzt. Das optionale Passwort kann für geschützte Chaträume angegeben werden. Verwende Anführungszeichen, wenn dein Nickname Leerzeichen enthält! /room leave [message] Verlässt den aktuellen Chatraum /room names [--detail|--short|--quiet|--compact] Zeigt die Teilnehmer des aktuellen Chatraumes an /room nick newnick Setzt deinen Nickname auf "newnick" /room privmsg nick msg Schickt die private Nachricht "msg" an "nick" /room remove Löscht diesen Raum vom Roster, sofern du ihn davor verlassen hast /room topic -|newtopic Setzt das Thema auf "newtopic" (mit "-" wird das Thema gelöscht) /room unlock Entfernt das Passwort bei einem geschütztem Raum(wenn du der Besitzer bist) /room destroy [reason] Zerstört den Raum (vorsichtig damit umgehen ;)) /room whois nick Zeigt Infos über "nick" bzgl. des MUC an /room ban jid [grund] Verbannt die JID mit einem (optionalem) Grund /room unban jid Entbanne die JID für den aktiven Raum /room invite jid [grund] Lädt die jid [mit einem Grund] in den gerade aktiven MUC ein /room kick nick [grund] Wirft den User "nick" aus dem Raum /room role jid rolle [grund] Ändert die Rolle der jid (rolle kann "none", "visitor", "participant" oder "moderator" sein) /room affil jid zugeh [grund] Ändert die Zugehörigkeit der jid zum Raum. (zugeh kann "none", "member", "admin" oder "owner" sein) /room setopt print_status|auto_whois|flag_joins [wert] Ändert die Einstellungen für den aktuellen MUC. Für "print_status" sind folgende Werte möglich: "default", "none", "in_and_out", "all". Bei "auto_whois" sind die Werte "default", "off" und "on" gültig. Für "flag_joins" sind folgende Werte möglich: "default", "none", "joins", "all". Wenn man die Einstellungen auf "default" setzt, so werden die Optionen muc_print_status / muc_auto_whois / muc_flag_joins benutzt. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Zum Hinzufügen, Löschen und Ändern von Raum-Bookmarks. Wenn autojoin gesetzt ist, wird mcabber nach dem verbinden zum Server diesen MUC automatisch betreten. Um die Liste der Bookmarks zu sehen, benutze "/room bookmark", bei ausgewähltem Status Buffer. mcabber-0.10.2/doc/help/de/hlp_roster.txt000066400000000000000000000054011216603513500201760ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Mit diesem Befehl kann man den Roster/die Buddyliste bearbeiten. Hier die möglichen Parameter: /roster bottom Springe zum Ende der Liste /roster top Springe an den Anfang von der Liste /roster up/down [n] Nach oben bzw. unten navigieren (um n Zeilen) /roster group_prev Vorherige Gruppe auswählen /roster group_next Nächste Gruppe auswählen /roster alternate Zu dem Kontakt springen, mit dem man zuletzt gesprochen hat. Dieser Befehl ist besonders nützlich, nachdem man Befehle wie "/roster unread_next" (strg+q) benutzt hat. /roster unread_first Die erste ungelesene Nachricht öffnen /roster unread_next Die nächste ungelesene Nachricht öffnen /roster search bud Jemanden auf dem Roster suchen, der "bud" im Namen oder der jid hat (durchsucht nur die angezeigten Buddies) /roster display [maske] Mit diesem Befehl kann man festlegen, welche Buddies angezeigt werden sollen. Als Maske werden die Buchstaben fuer die Statusse benutzt. ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). Mit der Maske "ofdna" werden alle Buddies angezeigt, die gerade online sind. Um alle Buddies anzuzeigen kann man auch das Kürzel "*" statt ofdna_ benutzen. Gibt man keine Maske an, wird die aktuelle Maske im Status Buffer angezeigt. /roster hide_offline Alle Buddies die offline sind verstecken /roster show_offline Auch Buddies die offline sind anzeigen /roster toggle_offline Wechsel zw. Anzeigen/Verstecken der Buddies die offline sind (standardmäßig auf F5) /roster item_lock [jid] Anzeige von dem Buddy mit der jid sichern, sodass man ihn immer sieht, egal wie sein Status ist /roster item_unlock [jid] "/roster item_lock" rückgängig machen /roster item_toggle_lock [jid] /roster hide Den Roster verstecken, sodass das Chatfenster die ganze Breite bekommt /roster show Den Roster wieder anzeigen /roster toggle Roster anzeigen/verstecken im Wechsel (standardmäßig auch auf F12) /roster note [-|text] Eine Notiz "text" zu dem aktuellen Eintrag im Roster hinzufügen. Dieser wird angezeigt, wenn gerade kein Chat mit demjenigen läuft. Alle Notizen werden im Status Puffer angezeigt. Um die Notiz zu löschen setzt man den Text auf "-". /roster resource_lock [full jid|resource] Setzt die aktive Resource für den Buddy im Roster. Akzeptiert "./resource" für den ausgewählten Buddy oder auch nur einen Resource Bezeichner. /roster resource_unlock [jid] Löscht die aktive Resource für den Buddy. Akzeptiert "." für den ausgewählten Buddy. mcabber-0.10.2/doc/help/de/hlp_say.txt000066400000000000000000000007301216603513500174540ustar00rootroot00000000000000 /SAY [-n|-h|--] text Sendet den "text" zu dem gerade ausgewählten Buddy. Dieser Befehl kann unter Umständen nützlich sein, z.B. wenn man dem User Nachrichten schicken will, die mit einem / beginnen. Mit den Schaltern -n und -h kann man den Typ der Nachricht setzen(normal und headline). Wenn man mal eine Nachricht mit -n oder -h am Anfang verschicken will, kann man auch "--" als Flag benutzen, damit mcabber die Nachricht mit dem Nachrichtentyp "chat" verschickt. mcabber-0.10.2/doc/help/de/hlp_say_to.txt000066400000000000000000000015251216603513500201610ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f file] jid text Sendet die Nachricht "text" zu der jid. Beachte bitte, dass du die vollständige JID mit Resource angeben musst, wenn du genau festlegen willst, wohin die Nachricht gesendet werden soll. Du kannst zum abkürzen der vollständigen JID bei dem gerade ausgewählten Kontakt auch den Befehl /say_to ./resoucename benutzen. Mit den Schaltern -n und -h kann man den Typ der Nachricht setzen(normal und headline). "--" kann benutzt werden um Nachrichten die mit -n oder -h beginnen zu versenden. Um eine Nachricht im Hintergrund zu versenden, kann man den Schalter -q benutzen. Die Option "-e" aktiviert die Interpretation der Zeichenketten "\n" und "\t". Allerdings nicht, wenn der Text aus einer Datei durch die Option "-f" kommt. Mit -f kann man eine Textdatei angeben, aus der die Nachricht ausgelesen wird. mcabber-0.10.2/doc/help/de/hlp_screen_refresh.txt000066400000000000000000000000721216603513500216540ustar00rootroot00000000000000 /SCREEN_REFRESH Die Anzeige von mcabber aktualisieren. mcabber-0.10.2/doc/help/de/hlp_set.txt000066400000000000000000000002411216603513500174500ustar00rootroot00000000000000 /SET [option [= value]] Zeit die Variable "option" an, bzw. setzt sie auf "value". Ohne Parameter werden alle gesetzten Optionen mit ihren Werten ausgegeben. mcabber-0.10.2/doc/help/de/hlp_source.txt000066400000000000000000000001421216603513500201550ustar00rootroot00000000000000 /SOURCE pattern Alle Konfigurationsdateien laden, welche auf das glob Muster "pattern" passen. mcabber-0.10.2/doc/help/de/hlp_status.txt000066400000000000000000000012261216603513500202040ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|StatusMessage]] /STATUS message -|StatusMessage Zeigt den aktuellen Status an, bzw. setzt ihn. Wenn kein Status angegeben wurde, wird der aktuelle Status angezeigt. Wenn eine Statusmeldung angegeben wurde, überschreibt diese die message* Variablen, welche in der Konfigurationsdatei gesetzt werden können. Wenn keine passende message* Variable gesetzt ist und keine Statusmeldung angegeben wurde, behält mcabber die momentane Statusmeldung. Wenn die Statusmeldung "-" ist, wird die gerade Aktuelle gelöscht. Wenn nur die Statusmeldung verändert werden soll, so kann auch "/status message" benutzt werden. mcabber-0.10.2/doc/help/de/hlp_status_to.txt000066400000000000000000000006521216603513500207100ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [StatusMessage] /STATUS_TO jid message StatusMessage Sendet den angegebenen Status zu der jid. Wenn der aktuell ausgewählte Buddy gemeint ist, kann auch "." als jid benutzt werden. Beachte, dass der Status durch weitere /status Befehle überschrieben wird. Auch, wenn man das auto-away Feature benutzt! Denk auch daran, dass du in der jid eine Ressource angeben kannst. mcabber-0.10.2/doc/help/de/hlp_version.txt000066400000000000000000000000651216603513500203460ustar00rootroot00000000000000 /VERSION Zeigt die verwendete mcabber Version an. mcabber-0.10.2/doc/help/en/000077500000000000000000000000001216603513500152665ustar00rootroot00000000000000mcabber-0.10.2/doc/help/en/hlp.txt000066400000000000000000000006721216603513500166170ustar00rootroot00000000000000 /HELP [command|+topic] Display some help about a command or a topic. If no argument provided a usage of this command is printed. Available commands: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/en/hlp_add.txt000066400000000000000000000005771216603513500174330ustar00rootroot00000000000000 /ADD [jid [nickname]] Add the "jid" Jabber user to our roster (default group), and send a notification request to this buddy. If no nickname is specified, the jid is used. If no jid (or an empty string "") is provided or if jid is ".", the current buddy is used. /add [jid [nickname]] Add to our roster "jid" as "nickname" Example: "/add somebody@jabber.server.com Somebody" mcabber-0.10.2/doc/help/en/hlp_alias.txt000066400000000000000000000006221216603513500177630ustar00rootroot00000000000000 /ALIAS [name [= command line]] This command let you to add aliases which can simplify sophisticated commands. You can manage your aliases by: /alias Print list of currently defined aliases /alias name Print the value of alias called "name" /alias name= Unset alias called "name" /alias name = command line Set alias called "name" with value "command line" Example: "/alias away = status away" mcabber-0.10.2/doc/help/en/hlp_authorization.txt000066400000000000000000000011771216603513500216000ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] This command manages presence subscriptions: it allows you to request presence subscriptions from others on your roster, and allows you to control who receives your presence notifications. If no JID is provided, the currently-selected buddy is used. /authorization allow Allow the buddy to receive your presence updates /authorization cancel Cancel the buddy's subscription to your presence updates /authorization request Request a subscription to the buddy's presence updates /authorization request_unsubscribe Request unsubscription from the buddy's presence updates mcabber-0.10.2/doc/help/en/hlp_bind.txt000066400000000000000000000012311216603513500176030ustar00rootroot00000000000000 /BIND [keycode [= command line]] Bind the command to the key given as "keycode". To examine which keys are currently not used look at `mcabber` log window and press examined key. For example: "Unknown key=265" means that you can bind some command to key #265. /bind Display list of current bindings /bind keycode Display the command line bound to this key /bind keycode= Unbind key with code "keycode" /bind keycode = command line Bind "command line" to the key with code "keycode" Example: "/bind 265 = status away" (265 is F1). Note: keycodes can be different depending on your ncurses configuration. Tip: aliases also can be used instead of commands. mcabber-0.10.2/doc/help/en/hlp_buffer.txt000066400000000000000000000031531216603513500201450ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save filename Buddy's buffer manipulation command. E.g. you can search through buffer for "text", clear chat window etc. /buffer clear Clear the current buddy chat window /buffer close [jid] Empty all contents of the buffer and close the current buddy chat window /buffer close_all Empty all contents of the chat buffers and close the chat windows /buffer purge [jid] Clear the current buddy chat window and empty all contents of the chat buffer /buffer list Display the list of existing buffers, with their length (lines/blocks) /buffer top Jump to the top of the current buddy chat buffer /buffer bottom Jump to the bottom of the current buddy chat buffer /buffer up [n] Scroll the buffer up [n] lines (default: half a screen) /buffer down [n] Scroll the buffer down [n] lines (default: half a screen) /buffer date [date] Jump to the first line after the specified [date] in the chat buffer (date format: "YYYY-mm-dd") /buffer % n Jump to position %n of the buddy chat buffer /buffer readmark Jump to the readmark (first unread line), if there is one /buffer search_backward text Search for [text] in the current buddy chat buffer /buffer search_forward text Search for [text] in the current buddy chat buffer /buffer scroll_lock Lock buffer scrolling /buffer scroll_unlock Unlock buffer scrolling /buffer scroll_toggle Toggle buffer scrolling (lock/unlock) /buffer save filename Save the contents of the current buffer to the file "filename" mcabber-0.10.2/doc/help/en/hlp_chat_disable.txt000066400000000000000000000001561216603513500212760ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Disable chat mode. With --show-roster, the fullscreen mode will be disabled. mcabber-0.10.2/doc/help/en/hlp_clear.txt000066400000000000000000000001531216603513500177570ustar00rootroot00000000000000 /CLEAR This command is actually an alias for "/buffer clear". It clears the current buddy chat window. mcabber-0.10.2/doc/help/en/hlp_color.txt000066400000000000000000000030731216603513500200130ustar00rootroot00000000000000 /COLOR roster (status wildcard (color|-)|clear) /COLOR mucnick nick (color|-) /COLOR muc (jid|.|*) [on|preset|off|-] The 'color' command allows setting dynamic color properties of the screen. /color roster clear Remove all color rules for the roster. All roster items will get its default color. /color roster status wildcard color Set a color rule (or overwrite, if it already exists). The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK. Wildcard is the file-matching wildcard that will be applied to JID. Color is the wanted color. If color is -, the rule is removed. If more than one rule matches, the color from the last created (not overwritten) is used. /color mucnick nick (color|-) Marks the nick to be colored by given color. If a MUC has colored nicks, this one will be used. If color is -, the color is marked as chosen automatically, which means it will not be used in 'preset' coloring mode, but will stay the same in 'on' coloring mode. /color muc (jid|.|*) [on|preset|off|-] Sets a MUC nick coloring mode. If a jid (. means currently selected jid) is provided, the mode will apply to this specific MUC. If * is used, it will be applied to all MUCs, except the ones set by their jid. Mode 'on' colors all nicks, 'preset' only the ones manually set by /color mucnick command and 'off' colors none. If not specified, defaults to 'on'. Mode '-' removes the mode from given JID, which means the global one will apply. You can not remove the global mode. Default global coloring mode is 'off'. mcabber-0.10.2/doc/help/en/hlp_connect.txt000066400000000000000000000000671216603513500203260ustar00rootroot00000000000000 /CONNECT Establish connection to the Jabber server. mcabber-0.10.2/doc/help/en/hlp_del.txt000066400000000000000000000001731216603513500174370ustar00rootroot00000000000000 /DEL Delete the current buddy from our roster, unsubscribe from its presence notification and unsubscribe it from ours. mcabber-0.10.2/doc/help/en/hlp_disconnect.txt000066400000000000000000000002731216603513500210250ustar00rootroot00000000000000 /DISCONNECT Terminate the connection to the Jabber server. Note: the roster is only available when the connection to the server is active, so the buddylist is empty when disconnected. mcabber-0.10.2/doc/help/en/hlp_echo.txt000066400000000000000000000000661216603513500176120ustar00rootroot00000000000000 /ECHO message Display "message" in the log window. mcabber-0.10.2/doc/help/en/hlp_event.txt000066400000000000000000000013101216603513500200060ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [event-specific arguments] /EVENT list Tell mcabber what to do about pending events. If the first parameter is '*', the command will apply to all queued events. Event-specific arguments will be interpreted on event-to event basis. The only built-in case, when argument is used is MUC invitation reject - argument, if present, will be interpreted as reject reason. /event #N|* accept [event-specific arguments] Event number #N/All events will be accepted /event #N|* ignore [event-specific arguments] Event number #N/All events will be ignored /event #N|* reject [event-specific arguments] Event number #N/All events will be rejected /event list List all pending events mcabber-0.10.2/doc/help/en/hlp_group.txt000066400000000000000000000005421216603513500200270ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] This command changes the current group display. /group fold [groupname] Fold (shrink) the current/specified group tree in the roster /group unfold [groupname] Unfold (expand) the current/specified group tree in the roster /group toggle [groupname] Toggle the state (fold/unfold) of the current/specified tree mcabber-0.10.2/doc/help/en/hlp_help.txt000066400000000000000000000001471216603513500176240ustar00rootroot00000000000000 /HELP [command|+topic] Display help for command "command" or topic "topic". Example: "/help buffer" mcabber-0.10.2/doc/help/en/hlp_iline.txt000066400000000000000000000045671216603513500200060ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Input line commands /iline fchar Move to the next letter /iline bchar Move to the previous letter /iline char_fdel Delete the letter at cursor position /iline char_bdel Delete the letter before cursor position /iline char_swap Transpose chars /iline fword Move the cursor forward to the end of the current or next word /iline bword Move the cursor back to the start of the current or previous word /iline word_bdel Delete the word from cursor position to its start /iline word_fdel Delete the word from cursor position to its end /iline word_upcase Convert the word from cursor position to its end to upper case /iline word_downcase Convert the word from cursor position to its end to down case /iline word_capit Capitalize the word from cursor position to its end /iline hist_beginning_search_bwd Search backward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) /iline hist_beginning_search_fwd Search forward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) /iline hist_prev Previous line of input line history /iline hist_next Next line of input line history /iline iline_start Go to the beginning of the input line /iline iline_end Go to the end of the input line /iline iline_fdel Delete from the cursor to the end of line /iline iline_bdel Delete from beginning of the line to the cursor /iline iline_accept Accept line /iline iline_accept_down_hist Accept line and put the next history line in the input line /iline iline_insert text Insert some text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). /iline clear_history Clear the command line history /iline compl_do Complete current word, in the input line /iline compl_cancel Cancel completion /iline send_multiline Send/terminate a multi-line message mcabber-0.10.2/doc/help/en/hlp_info.txt000066400000000000000000000002661216603513500176310ustar00rootroot00000000000000 /INFO Display info on the selected entry (user, agent, group...). For users, resources are displayed with the status, priority and status message (if available) of each resource. mcabber-0.10.2/doc/help/en/hlp_module.txt000066400000000000000000000011041216603513500201530ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Load, unload or show info on module. /module load [-f] module Loads specified module. If -f flag is specified, most of module loading errors will be ignored. /module unload [-f] module Unloads specified module. Note: The force flag will not remove any dependency on this module! /module info module Shows available information about this module. /module [list] Lists modules in a format: [modulename] [reference count] ([Manually/Automatically loaded]) [any extra info, like version or dependencies] mcabber-0.10.2/doc/help/en/hlp_move.txt000066400000000000000000000004421216603513500176400ustar00rootroot00000000000000 /MOVE [groupname] Move the current buddy to the requested group. If no group is specified, then the buddy is moved to the default group. If the group "groupname" doesn't exist, it is created. Tip: if the chatmode is enabled, you can use "/roster alternate" to jump to the moved buddy. mcabber-0.10.2/doc/help/en/hlp_msay.txt000066400000000000000000000025441216603513500176500ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Send a multi-line message. To write a single message with several lines, the 'multi-line mode' should be used. In multi-line mode, each line (except command lines) typed in the input line will be added to the multi-line message. Once the message is finished, it can be sent to the current selected buddy with the "/msay send" command. The 'begin' subcommand enables multi-line mode. Note that it allows a message subject to be specified. The 'verbatim' multi-line mode disables commands, so that it is possible to enter lines starting with a slash. Only the "/msay" command (with send or abort parameters) can be used to exit verbatim mode. The 'toggle' subcommand can be bound to a key to use the multi-line mode quickly (for example, "bind M13 = msay toggle" to switch using the Meta-Enter combination). /msay begin [subject] Enter multi-line mode /msay verbatim Enter verbatim multi-line mode /msay send [-n|-h] Send the current multi-line message to the currently selected buddy /msay send_to [-n|-h] jid Send the current multi-line message to "jid" /msay toggle|toggle_verbatim Switch to/from multi-line mode (begin/send) /msay abort Leave multi-line mode without sending the message The -n or -h flags turn the message to "normal" or "headline" accordingly, as opposed to default "chat" message. mcabber-0.10.2/doc/help/en/hlp_otr.txt000066400000000000000000000020261216603513500174760ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] You can use the shortcut-jid "." for the currently selected contact. /otr key Print the fingerprint of your private key to the Status Buffer /otr start [jid] Open an OTR channel to the specified jid (or the currently selected contact) /otr stop [jid] Close the OTR channel to the specified jid (or the currently selected contact) /otr info [jid] Show current OTR status for the specified jid (or the currently selected contact) /otr fingerprint [jid [fpr]] Show the active fingerprint of an OTR channel. If the fingerprint is provided instead of "fpr", the fingerprint will become trusted. If you replace "fpr" by some bogus string the fingerprint will loose the trusted status. /otr smpq [jid] secret Initiate the Socialist Millionaires Protocol with the secret and the buddy /otr smpr [jid] secret Respond to the Initiation of the jid with the secret /otr smpa [jid] Abort the running Socialist Millionaires Protocol mcabber-0.10.2/doc/help/en/hlp_otrpolicy.txt000066400000000000000000000023371216603513500207230ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) You can use the shortcut-jid "." for the currently selected contact. /otrpolicy Prints all OTR policies to the status buffer /otrpolicy (default|jid) (plain|manual|opportunistic|always) Sets either the default policy or the policy for the given jid The plain policy should never be used, because you won't be able to receive or send any OTR encrypted messages. If you set the policy to manual, you or your chat partner have to start the OTR encryption by hand (e.g. with /otr start). The policy "opportunistic" does that itself by sending a special whitespace-sequence at the end of unencrypted messages. So the other OTR-enabled chat client knows, that you want to use OTR. Note that the first message will always be unencryted, if you use this policy. With the policy "always" no message will be sent in plain text. If you try to sent the first message unencrypted, mcabber will try to establish an OTR channel. Please resend your message, when you get the information that the channel was established. If someone sends you plaintext messages while the policy is set to "always", you'll be able to read the message but it won't be saved to the history. mcabber-0.10.2/doc/help/en/hlp_pgp.txt000066400000000000000000000020431216603513500174570ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [key]] This command manipulates PGP settings for the specified jid (by default the currently selected contact). Please note that PGP encryption won't be used if no remote PGP support is detected, even if PGP is enabled with this command. You can force PGP encryption with the "force" subcommand. /pgp disable [jid] Disable PGP encryption for jid (or the currently selected contact) /pgp enable [jid] Enable PGP encryption for jid (or the currently selected contact) /pgp [+|-]force [jid] Enforce PGP encryption, even for offline messages, and always assume the recipient has PGP support. If a message can't be encrypted (missing key or key id), the messages won't be sent at all. This option is ignored when PGP is disabled. /pgp info [jid] Show current PGP settings for the contact /pgp setkey [jid [key]] Set the PGP key to be used to encrypt message for this contact. If no key is provided, the current key is erased. You can use the shortcut-jid "." for the currently selected contact. mcabber-0.10.2/doc/help/en/hlp_quit.txt000066400000000000000000000000771216603513500176600ustar00rootroot00000000000000 /QUIT This command closes all connections and quit mcabber. mcabber-0.10.2/doc/help/en/hlp_rawxml.txt000066400000000000000000000004231216603513500202030ustar00rootroot00000000000000 /RAWXML send string Send "string" (raw XML format) to the Jabber server. No check is done on the string provided. BEWARE! Use this only if you know what you are doing, or you could terminate the connection. Example: "/rawxml send away" mcabber-0.10.2/doc/help/en/hlp_rename.txt000066400000000000000000000002541216603513500201420ustar00rootroot00000000000000 /RENAME name Rename the current buddy or group to the given "name". If "name" is -, the name is removed from the roster (and mcabber will display the JID or username). mcabber-0.10.2/doc/help/en/hlp_request.txt000066400000000000000000000011011216603513500203530ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Send a "IQ" query to the current buddy, or to the specified Jabber user. If the resource is not provided with the jid, mcabber will send the query to all known resources for this user. /request last Request "last" information (usually idle time) /request ping Send an XMPP Ping request. Note that you should use the full JID since a ping sent to a bare JID will be handled by the server. /request time Request time from the buddy /request vcard Request VCard from the buddy /request version Request version from the buddy mcabber-0.10.2/doc/help/en/hlp_room.txt000066400000000000000000000046651216603513500176610ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [value] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] The 'room' command handles Multi-User Chat room actions. /room join [room [nick [pass]]] Join "room", using "nick" as nickname. If no nickname is provided (or if it is an empty string), the "nickname" option value is used (see sample configuration file). If the currently selected entry is correctly recognized as a room by mcabber, the shortcut "." can be used instead of the full room id. A password can be provided to enter protected rooms. If your nickname contains space characters, use quotes. /room leave [message] Leave the current room /room names [--detail|--short|--quiet|--compact] Display members of the current room /room nick newnick Change your nickname in the current room /room privmsg nick msg Send private message "msg" to "nick" /room remove Remove the current room from the roster (you must have left this room before) /room topic -|newtopic Set topic for current room (The topic is cleared if newtopic is "-") /room unlock Unlock current room (if you are the owner) /room destroy [reason] Destroy the current room (use with care!) /room whois nick Display MUC information about "nick" /room ban jid [reason] Ban jid from the current room /room unban jid Unban jid from the current room /room invite jid [reason] Invite jid to the current room /room kick nick [reason] Kick "nick" from the current room /room role jid role [reason] Change jid's role (role can be "none", "visitor", "participant", "moderator") /room affil jid affil [reason] Change jid's affiliation (affil can be "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [value] Change settings for the current room For print_status, the possible values are "default", "none", "in_and_out", "all". For auto_whois, the possible values are "default", "off", "on". For flag_joins, the possible values are "default", "none", "joins", "all". When the value is "default", the options muc_print_status / muc_auto_whois / muc_flag_joins is used. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Add, remove or update a bookmark (default is add). If autojoin is set, mcabber will automatically join the MUC room when it connects to the server. To see the list of bookmarks, use /room bookmark in the status buffer. mcabber-0.10.2/doc/help/en/hlp_roster.txt000066400000000000000000000046761216603513500202250ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock The 'roster' command manipulates the roster/buddylist. Here are the available parameters: /roster bottom Jump to the bottom of the roster /roster top Jump to the top of the roster /roster up [n] Move up [n lines] in the roster /roster down [n] Move down [n lines] in the roster /roster group_prev Jump to the previous group in the roster /roster group_next Jump to the next group in the roster /roster alternate Jump to alternate buddy. The "alternate" buddy is the last buddy left while being in chat mode. This command is thus especially useful after commands like "/roster unread_next" (Ctrl-q). /roster unread_first Jump to the first unread message /roster unread_next Jump to the next unread message /roster search bud Search for a buddy with a name or jid containing "bud" (only in the displayed buddylist) /roster display [mask] See or update the roster filter. The mask should contain the shortcut letters of the status you want to see ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). For example "ofdna" to display only connected buddies. "*" can be used as a shortcut to display all contacts. /roster hide_offline Hide offline buddies (same as /roster display ofdna) /roster show_offline Show offline buddies (same as /roster display ofdna_) /roster toggle_offline Toggle display of offline buddies /roster item_lock [jid] Lock the roster item so it remains visible regardless of its status /roster item_unlock [jid] Undo the effects of item_lock /roster item_toggle_lock [jid] Invert the current lock flag /roster hide Hide roster (full-width chat window) /roster show Show roster /roster toggle Toggle roster visibility /roster note [-|text] Set/update/delete an annotation. If there is no text, the current item's annotation is displayed -- if you are in the status buffer, all notes are displayed. If text is "-", the note is erased. /roster resource_lock [full jid|resource] Set active resource for a buddy in roster. Accepts special jid "./resource" for current buddy, or just a resource name. /roster resource_unlock [jid] Unset active resource for a buddy. Accepts special jid "." for current buddy. mcabber-0.10.2/doc/help/en/hlp_say.txt000066400000000000000000000004541216603513500174710ustar00rootroot00000000000000 /SAY [-n|-h|--] text Send the "text" message to the currently selected buddy. It can be useful if you want to send a message beginning with a slash, for example. The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat message beginning with -n or -h. mcabber-0.10.2/doc/help/en/hlp_say_to.txt000066400000000000000000000015441216603513500201740ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f file] jid text Send the "text" message to the specified jid. Please note that you will have to use a full jid with a resource identifier if you want to specify exactly where the message should go. You can send a message to a specific resource of the currently selected contact by using /say_to ./resourcename message. The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat messages beginning with -n or -h. When "-q" is used, the message will be sent in the background and will not change the current active window. The option "-e" enables interpretation of the strings "\n" and "\t". This flag has no effect if the text comes from a file with option "-f". A text file can be provided with the "-f" switch (in which case there's no need to pass a text argument after the jid, of course). mcabber-0.10.2/doc/help/en/hlp_screen_refresh.txt000066400000000000000000000000571216603513500216710ustar00rootroot00000000000000 /SCREEN_REFRESH Refresh the mcabber screen. mcabber-0.10.2/doc/help/en/hlp_set.txt000066400000000000000000000002001216603513500174550ustar00rootroot00000000000000 /SET [option [= value]] Display or set an option value. Without arguments prints a list of all set options with their values mcabber-0.10.2/doc/help/en/hlp_source.txt000066400000000000000000000001451216603513500201720ustar00rootroot00000000000000 /SOURCE pattern Read configuration files, that match glob pattern (sorted in alphabetical order). mcabber-0.10.2/doc/help/en/hlp_status.txt000066400000000000000000000011131216603513500202110ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|StatusMessage]] /STATUS message -|StatusMessage Show or set the current status. If no status is specified, display the current status. If a status message is specified, it will overrride the message* variables (these variables can be set in the configuration file). If no relevant message* variable is set and no status message provided, the current status message is kept. If StatusMessage is "-", the current status message is cleared. With the "/status message" command, mcabber will update the message while preserving the status. mcabber-0.10.2/doc/help/en/hlp_status_to.txt000066400000000000000000000006561216603513500207260ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [StatusMessage] /STATUS_TO jid message StatusMessage Send the requested status to the specified Jabber user. If the specified jid is ".", the current buddy is used. Note: this status will be overridden by subsequent "/status" commands. If you are using the auto-away feature, the status will overridden too. Note: The jid can include a resource (i.e. user@server/resource). mcabber-0.10.2/doc/help/en/hlp_version.txt000066400000000000000000000000601216603513500203530ustar00rootroot00000000000000 /VERSION Display current version of mcabber. mcabber-0.10.2/doc/help/fr/000077500000000000000000000000001216603513500152735ustar00rootroot00000000000000mcabber-0.10.2/doc/help/fr/hlp.txt000066400000000000000000000006271216603513500166240ustar00rootroot00000000000000 /HELP [commande|+sujet] Affiche de l'aide sur la commande ou le sujet demandé. Les commandes disponibles sont : add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/fr/hlp_add.txt000066400000000000000000000007051216603513500174310ustar00rootroot00000000000000 /ADD [jid [surnom]] Ajoute l'utilisateur Jabber "jid" au roster (dans le groupe par défaut), et envoie une demande d'inscription à cette personne. Si aucun "surnom" n'est spécifié, le jid est utilisé. Si le jid n'est pas donné (ou si c'est une chaîne vide "") ou si le jid est ".", le contact sélectionné est utilisé. /add [jid [surnom]] Ajoute "jid" au roster avec le surnom "surnom" Exemple: "/add somebody@jabber.server.com Somebody" mcabber-0.10.2/doc/help/fr/hlp_alias.txt000066400000000000000000000007011216603513500177660ustar00rootroot00000000000000 /ALIAS [name [= command line]] Cette commande permet de créer des alias afin de simplifier des commandes longues ou complexes. Les alias sont gérés à l'aide des commandes suivantes : /alias Affiche la liste des alias existants /alias name Affiche la definition de l'alias "name" /alias name= Efface l'alias "name" /alias name = command line Définit un alias "name" avec la chaîne "command line" Exemple: "/alias absent = status away" mcabber-0.10.2/doc/help/fr/hlp_authorization.txt000066400000000000000000000013541216603513500216020ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Cette commande gère les abonnements aux notifications de présence : elle vous permet de demander la notification de présence d'utilisateurs Jabber, et vous permet de contrôler qui peut recevoir vos changements d'état. Si le JID n'est pas spécifié, le contact sélectionné est utilisé. /authorization allow Autorise le contact à recevoir vos notifications de présence /authorization cancel Supprime l'abonnement du contact à vos notifications de présence /authorization request Envoie une demande d'abonnement aux notifications de présence du contact /authorization request_unsubscribe Envoie une demande de désabonnement aux notifications de présence du contact mcabber-0.10.2/doc/help/fr/hlp_bind.txt000066400000000000000000000013761216603513500176220ustar00rootroot00000000000000 /BIND [keycode [= command line]] Cette commande permet de gérer les raccourcis clavier. Pour trouver le code d'une touche non-utilisée, pressez la touche en question et regardez la fenêtre de logs de mcabber. Par exemple: "Unknown key=265" signifie que la touche de code 265 (F1 en général) est disponible. /bind Affiche la liste des raccourcis existants /bind keycode Affiche la commande associée à la touche spécifiée /bind keycode= Supprime le raccourci de la touche spécifiée /bind keycode = command line Associe "command line" à la touche de code "keycode" Exemple : "/bind 265 = status away" (265 est F1). Remarque : les codes peuvent différer en fonction de l'installation ncurses. Astuce : des alias peuvent également être utilisés. mcabber-0.10.2/doc/help/fr/hlp_buffer.txt000066400000000000000000000033431216603513500201530ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save filename Cette commande permet de gérer les tampons de discussions avec les différents contacts. Par exemple vous pouvez rechercher un texte, effacer la fenêtre de discussion, etc. /buffer clear Efface la fenêtre du contact sélectionné /buffer close [jid] Ferme la fenêtre du contact sélectionné après avoir vidé le contenu du tampon associé /buffer close_all Ferme les fenêtres de tous les contacts après avoir vidé le contenu des tampons associés /buffer purge [jid] Efface la fenêtre du contact sélectionné et vide le contenu du tampon associé /buffer list Affiche la liste des tampons existants, avec leur taille (lignes/blocs) /buffer top Va au début du tampon /buffer bottom Va à la fin du tampon /buffer up [n] Défile vers le haut de [n] lignes (par défaut un demi écran) /buffer down [n] Défile vers le bas de [n] lignes (par défaut un demi écran) /buffer date [date] Va à la première ligne après la [date] dans le tampon actuel (format: "aaaa-mm-jj") /buffer % n Va à la position n% du tampon /buffer readmark Va à la "readmark" (première ligne non lue), si la marque existe /buffer search_backward texte Cherche "texte" dans le tampon courant, vers le haut /buffer search_forward texte Cherche "texte" dans le tampon courant, vers le bas /buffer scroll_lock Verrouille le défilement de ce tampon /buffer scroll_unlock Déverrouille le défilement de ce tampon /buffer scroll_toggle Bascule (inverse) le verrouillage de ce tampon /buffer save filename Enregistre le contenu du tampon courant dans le fichier filename mcabber-0.10.2/doc/help/fr/hlp_chat_disable.txt000066400000000000000000000002451216603513500213020ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Cette commande permet de désactiver le mode « discussion ». Avec l'option --show-roster, le mode plein écran est désactivé. mcabber-0.10.2/doc/help/fr/hlp_clear.txt000066400000000000000000000001771216603513500177720ustar00rootroot00000000000000 /CLEAR Cette commande est en réalité un alias pour "/buffer clear". Elle efface la fenêtre de discussion sélectionnée. mcabber-0.10.2/doc/help/fr/hlp_color.txt000066400000000000000000000040471216603513500200220ustar00rootroot00000000000000 /COLOR roster (état joker (couleur|-)|clear) /COLOR mucnick nick (couleur|-) /COLOR muc (jid|.|*) [on|preset|off|-] Cette commande permet de configurer des couleurs dynamiques. /color roster clear Supprime toutes les règles de couleurs du roster. Tous les éléments du roster auront leur couleur par défaut. /color roster état joker couleur Définit (ou bien redéfinit) une règle de couleur. "état" est une chaîne contenant tous les états pour lesquels la règle doit s'appliquer, ou bien * si la règle doit s'appliquer quel que soit l'état. "joker" est un motif (comme pour les filtres de fichiers) qui sera appliqué au JID. "couleur" est la couleur désirée. Si la couleur est -, la règle est supprimée. Lorsque plusieurs règles s'appliquent, la couleur de la dernière règle créée (pas redéfinie...) est utilisée. /color mucnick nick (couleur|-) Indique que le pseudonyme "nick" doit être affiché avec la couleur précisée. Si la coloration des pseudos est activée dans un salon MUC, cette couleur sera utilisée. Si la couleur est "-", la couleur sera marquée comme automatique (ce qui signifie qu'il n'y aura pas de coloration si le mode est "preset", mais la couleur sera conservée si le mode est "on"). /color muc (jid|.|*) [on|preset|off|-] Configure le mode de coloration des pseudonymes de salon(s) MUC. Si un JID est précisé ("." étant le JID de l'élément sélectionné), le mode sera appliqué au salon sélectionné. Si * est utilisé, le mode sera appliqué pour toutes les conférences, à l'exception de celles configurées par leur JID (on parlera de mode global). Avec le mode est "on", tous les pseudonymes sont colorés. Avec le mode "preset", seuls les pseudonymes précisés avec la commande /color mucnick sont colorés. Avec le mode "off", la coloration est désactivée. S'il n'est pas précisé, le mode sera mis à "on". Le mode "-" supprime le mode configuré pour le JID précisé (et donc le mode global sera utilisé). Le mode global ne peut pas être supprimé. Le mode global par défaut est "off". mcabber-0.10.2/doc/help/fr/hlp_connect.txt000066400000000000000000000001041216603513500203230ustar00rootroot00000000000000 /CONNECT Cette commande établit la connexion au serveur Jabber. mcabber-0.10.2/doc/help/fr/hlp_del.txt000066400000000000000000000002311216603513500174370ustar00rootroot00000000000000 /DEL Supprime le contact sélectionné du roster, supprime notre abonnement à ses notifications de présence et supprime son abonnement aux nôtres. mcabber-0.10.2/doc/help/fr/hlp_disconnect.txt000066400000000000000000000003021216603513500210230ustar00rootroot00000000000000 /DISCONNECT Ferme la connexion au serveur Jabber. Remarque : le roster n'est disponible que lorsque la connexion au serveur estactive, donc la liste de contacts est vide après déconnexion. mcabber-0.10.2/doc/help/fr/hlp_echo.txt000066400000000000000000000000741216603513500176160ustar00rootroot00000000000000 /ECHO message Affiche "message" dans la fenêtre de log. mcabber-0.10.2/doc/help/fr/hlp_event.txt000066400000000000000000000013261216603513500200220ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [arguments] /EVENT list Cette commande permet de gérer les "événements" en attente. Si le premier paramètre est '*', la commande sera appliquée à tous les événements en attente. Les arguments dépendent de l'événement en question. Lorsque l'événement est une invitation MUC, l'argument éventuel sera utilisé comme le motif du rejet. (C'est le seul cas où un argument est utilisé actuellement.) /event #N|* accept [arg] Accepter l'événement #N / tous les événements /event #N|* ignore [arg] Ignorer l'événement #N / tous les événements /event #N|* reject [arg] Rejeter l'événement #N / tous les événements /event list Afficher les événements en attente mcabber-0.10.2/doc/help/fr/hlp_group.txt000066400000000000000000000005311216603513500200320ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] Cette commande permet de modifier l'affichage des groupes. /group fold [groupname] Plie (cache) l'arborescence du groupe sélectionné /group unfold [groupname] Déplie (montre) l'arborescence du groupe sélectionné /group toggle [groupname] Inverse l'état (plié/déplié) du groupe sélectionné mcabber-0.10.2/doc/help/fr/hlp_help.txt000066400000000000000000000001541216603513500176270ustar00rootroot00000000000000 /HELP [cmd|+sujet] Affiche l'aide sur la commande "cmd" ou sur le sujet "sujet". Exemple: "/help buffer" mcabber-0.10.2/doc/help/fr/hlp_iline.txt000066400000000000000000000054531216603513500200060ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Cette commande permet de manipuler la ligne de commandes. En général elle sera utilisée par l'intermédiaire de la commande "bind". /iline fchar Aller au caractère suivant /iline bchar Aller au caractère précédent /iline char_fdel Supprimer le caractère situé sous le curseur /iline char_bdel Supprimer le caractère précédant le curseur /iline char_swap Échanger les deux caractères (sous/avant le curseur) /iline fword Avancer le curseur jusqu'à la fin du mot (ou du prochain mot) /iline bword Reculer le curseur jusqu'au début du mot (ou du mot précédent) /iline word_bdel Effacer le début du mot jusqu'au curseur /iline word_fdel Effacer la fin du mot depuis le curseur /iline word_upcase Convertir la fin du mot en majuscules depuis le curseur /iline word_downcase Convertir la fin du mot en minuscules depuis le curseur /iline word_capit Mettre une lettre capitale sous le curseur (ou au prochain mot) et la fin du mot en minuscules /iline hist_beginning_search_bwd Chercher la ligne précédente de l'historique ligne de commande commençant comme la ligne actuelle jusqu'au curseur (le curseur est laissé à la même position) /iline hist_beginning_search_fwd Chercher la ligne suivante de l'historique ligne de commande commençant comme la ligne actuelle jusqu'au curseur (le curseur est laissé à la même position) /iline hist_prev Charger la ligne précédente de l'historique ligne de commande /iline hist_next Charger la ligne suivante de l'historique ligne de commande /iline iline_start Aller au début de la ligne de commande /iline iline_end Aller à la fin de la ligne de commande /iline iline_fdel Effacer la fin de la ligne de commande depuis le curseur /iline iline_bdel Effacer le début de la ligne de commande jusqu'au curseur /iline iline_accept Accepter/valider la ligne de commande /iline iline_accept_down_hist Accepter/valider la ligne de commande et charger la ligne suivante de l'historique ligne de commande /iline iline_insert texte Insérer le texte dans la ligne de commande, à la position du curseur. Notez que les guillemets doivent être protégés (\"), et que l'écran n'est pas rafraîchi (cf. /screen_refresh). /iline clear_history Efface l'historique de la ligne de commande /iline compl_do Compléter le mot actuel dans la ligne de commande /iline compl_cancel Annuler le complètement du mot /iline send_multiline Envoyer le message multi-lignes mcabber-0.10.2/doc/help/fr/hlp_info.txt000066400000000000000000000003531216603513500176330ustar00rootroot00000000000000 /INFO Affiche des informations sur l'élément sélectionné (contact, agent, groupe...). Pour les utilisateurs, les ressources sont affichées avec l'état (status), la priorité et le message d'état (s'il existe) correspondants. mcabber-0.10.2/doc/help/fr/hlp_module.txt000066400000000000000000000013311216603513500201620ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Charge, décharge ou affiche les informations concernant un module. /module load [-f] module Charge le module spécifié. Si l'option -f est donnée, la plupart des erreurs seront ignorées lors du chargement du module. /module unload [-f] module Décharge le module spécifié. Note : l'option force (-f) ne retirera pas les modules dépendant de ce celui-là ! /module info module Affiche les informations disponibles à propos de ce module. /module [list] Liste les modules au format suivant : [nom module] [compteur références] ([chargé Manuellement/Automatiquement]) [informations supplémentaires, telles que la version ou les dépendances] mcabber-0.10.2/doc/help/fr/hlp_move.txt000066400000000000000000000005751216603513500176540ustar00rootroot00000000000000 /MOVE [groupname] Déplace le contact sélectionné vers le groupe spécifié. Si aucun groupe n'est donné, le contact est déplacé vers le groupe par défaut. Si le groupe "groupname" n'existe pas, il est créé. Astuce : si le mode discussion (chatmode) est activé, vous pouvez utiliser "/roster alternate" pour vous positionner sur le contact que vous venez de déplacer. mcabber-0.10.2/doc/help/fr/hlp_msay.txt000066400000000000000000000026771216603513500176640ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Cette commande permet d'envoyer des messages multi-lignes. Pour écrire un message contenant plusieurs lignes, il faut activer le mode 'multi-lignes'. Dans ce mode, chaque ligne (à l'exception des lignes de commandes) entrée dans la barre de saisie sera ajoutée au message multi-lignes. Lorsque le message est prêt, il peut être envoyé au contact sélectionné à l'aide de la commande "/msay send". Astuce : la sous-commande 'toggle' peut être affectée à une touche pour utiliser le mode multi-lignes rapidement (par exemple, "bind M13 = msay toggle" pour basculer à l'aide de la combinaison Meta-Entrée). /msay begin [sujet] Active le mode multi-lignes. Il est possible de spécifier un sujet. /msay verbatim Active le mode multi-lignes "verbatim". Ce mode désactive les commandes, ce qui permet de saisir des lignes commençant par un '/'. Seule la commande "/msay" (avec les paramètres "send" ou "abort") peut-être utilisée pour quitter le mode verbatim. /msay send [-n|-h] Envoie le message multi-lignes au contact sélectionné /msay send_to [-n|-h] jid Envoie le message multi-lignes à "jid" /msay toggle|toggle_verbatim Bascule le mode multi-lignes (begin/send) /msay abort Abandonne le mode multi-lignes sans envoyer le message L'option "-n" permet d'envoyer un message de type "normal", et l'option "-h" un message de type "headline", au lieu du type par défaut "chat". mcabber-0.10.2/doc/help/fr/hlp_otr.txt000066400000000000000000000021331216603513500175020ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [empreinte]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Cette commande permet de gérer les sessions OTR (Off-The-Record). Vous pouvez utiliser le raccourci "." pour indiquer le JID du contact sélectionné. /otr key Affiche l'emprunte de votre clé privée /otr start [jid] Ouvre une session OTR avec le JID précisé (ou le contact sélectionné) /otr stop [jid] Ferme la session OTR avec le JID précisé (ou le contact sélectionné) /otr info [jid] Affiche les informations OTR concernant le JID précisé (ou le contact sélectionné) /otr fingerprint [jid [empreinte]] Affiche l'empreinte actuelle d'une session OTR. Si une empreinte est fournie, la session sera considérée comme sécurisée si et seulement si les deux empreintes correspondent. /otr smpq [jid] secret Initie le "Socialist Millionaires Protocol" avec JID en utilisant la chaîne "secret" /otr smpr [jid] secret Répond à la demande SMP de l'utilisateur JID en utilisant la chaîne "secret" /otr smpa [jid] Abandonne le "Socialist Millionaires Protocol" en cours mcabber-0.10.2/doc/help/fr/hlp_otrpolicy.txt000066400000000000000000000030061216603513500207220ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Cette commande permet de visualiser et définir les règles (politiques) d'utilisation du protocole OTR (Off-The-Record). Vous pouvez utiliser le raccourci "." pour indiquer le JID du contact sélectionné. /otrpolicy Affiche toutes les politiques OTR dans la fenêtre status. /otrpolicy (default|jid) (plain|manual|opportunistic|always) Définit soit la politique par défaut, soit la politique concernant le JID sélectionné La polique "plain" ne devrait pas être utilisée, les messages sont envoyés et reçus sans les chiffrer/déchiffrer. Si vous mettez la politique "manual", vous ou votre correspondant aurez à démarrer la session OTR à la main (par exemple avec /otr start). La politique "opportunistic" permet de le faire automatiquement, en envoyant une séquence spéciale d'espaces à la fin des messages non chiffrés. De cette façon, l'autre client Jabber avec support OTR sait que vous voulez utiliser OTR. Notez bien que le premier message sera toujours transmis en clair avec cette méthode. Avec la politique "always", les messages ne seront jamais transmis en clair. Si vous essayez d'envoyer un message non chiffré, mcabber essaiera d'ouvrir une session OTR. Essayez de réenvoyer ce message lorsque vous aurez la confirmation que la session a bien été ouverte. Si quelqu'un vous envoie des messages non chiffrés alors que la polique est "always", vous pourrez lire ce message mais il ne sera pas sauvé dans les archives. mcabber-0.10.2/doc/help/fr/hlp_pgp.txt000066400000000000000000000023741216603513500174730ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [clé]] Cette commande permet de manipuler les paramètres PGP pour le contact jid (s'il n'est pas précisé, c'est le contact sélectionné). Veuillez noter que le chiffrement PGP ne sera pas utilisé si le support de PGP n'est pas détecté chez le client distant (i.e. le contact), même si vous activez PGP avec cette commande. Vous pouvez forcer le chiffrement PGP avec "/pgp force". /pgp disable [jid] Désactive le chiffrement PGP pour jid (ou le contact sélectionné) /pgp enable [jid] Active le chiffrement PGP pour jid (ou le contact sélectionné) /pgp [+|-]force [jid] Force le chiffrement PGP, y compris lorsque le contact est déconnecté, en supposant toujours que le destinataire peut lire les messages chiffrés avec PGP. Lorsqu'un message ne peut pas être chiffré (clé ou keyid manquant), il ne sera pas envoyé. Cette option est ignorée quand PGP est désactivé. /pgp info [jid] Affiche les paramètres PGP du contact /pgp setkey [jid [key]] Sélectionne la clé PGP à utiliser pour chiffrer les messages pour ce contact. Si aucune clé n'est précisée, la clé actuellement sélectionnée est effacée. Vous pouvez utiliser le raccourci "." pour désigner le contact sélectionné. mcabber-0.10.2/doc/help/fr/hlp_quit.txt000066400000000000000000000001111216603513500176520ustar00rootroot00000000000000 /QUIT Cette commande ferme la connexion au serveur et quitte mcabber. mcabber-0.10.2/doc/help/fr/hlp_rawxml.txt000066400000000000000000000005051216603513500202110ustar00rootroot00000000000000 /RAWXML send string Envoie la chaîne "string" (format XML brut) au serveur Jabber. Aucune validation n'est effectuée sur la chaîne envoyée. ATTENTION! N'utilisez cette commande que si vous savez ce que vous faites, vous risquez de rompre la connexion. Exemple : "/rawxml send away" mcabber-0.10.2/doc/help/fr/hlp_rename.txt000066400000000000000000000003021216603513500201410ustar00rootroot00000000000000 /RENAME nom Renomme le contact/groupe sélectionné avec le "nom" spécifié. Si le nom est «-», le nom est supprimé du roster (et mcabber affichera le JID ou le nom d'utilisateur). mcabber-0.10.2/doc/help/fr/hlp_request.txt000066400000000000000000000012701216603513500203670ustar00rootroot00000000000000 /REQUEST last|time|vcard|version [jid] Envoie une requête Jabber "IQ" au jid spécifié, ou au contact sélectionné. Si la ressource Jabber n'est pas précisée avec le jid, mcabber enverra la requête à toutes les ressources connues de cet utilisateur. /request last Envoie une demande de type "last" (c-à-d. en général la durée d'inactivité) /request ping Envoie une requête de Ping XMPP. Notez qu'il faut utiliser un "Full JID" car un ping envoyé à un bare JID (sans ressource) sera traité par le serveur. /request time Demande l'heure du contact /request vcard Demande la carte de visite (VCard) du contact /request version Demande la version du client Jabber du contact mcabber-0.10.2/doc/help/fr/hlp_room.txt000066400000000000000000000055201216603513500176550ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [valeur] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Cette commande permet de gérer les salons de discussions MUC (Multi-User Chat). /room join [room [pseudo [pass]]] Joint le salon "room", en utilisant le pseudonyme "pseudo". Si le pseudo n'est pas spécifié (ou si c'est une chaîne vide), la valeur de l'option "nickname" est utilisée (cf. exemple de fichier de configuration). Si l'élément de la liste de contacts actuellement sélectionné est considéré comme un salon par mcabber, le raccourci "." peut être utilisé au lieu de l'identifiant complet du salon. Un mot de passe optionnel "pass" peut être fourni. Si votre pseudonyme contient des espaces, utilisez des guillemets. /room leave [message] Quitte le salon sélectionné /room names [--detail|--short|--quiet|--compact] Affiche les membres du salon /room nick nouveau_pseudo Change votre pseudonyme dans le salon /room privmsg pseudo msg Envoie un message privé "msg" au membre "pseudo" /room remove Supprime le salon sélectionné du roster (il faut avoir quitté ce salon d'abord) /room topic nouveau_sujet Change le sujet du salon de discussion (Si nouveau_sujet est «-», le sujet est effacé) /room unlock Déverrouille le salon sélectionné (si vous en êtes le propriétaire) /room destroy [raison] Détruit le salon sélectionné (faites attention !) /room whois pseudo Affiche les informations MUC sur "pseudo" /room ban jid [raison] Bannit l'utilisateur jid du salon /room unban jid Supprime le ban sur l'utilisateur jid dans le salon /room invite jid [raison] Invite l'utilisateur jid dans le salon /room kick pseudo [raison] Chasse le membre "pseudo" du salon /room role jid role [raison] Change le rôle de jid (role peut être "none", "visitor", "participant", "moderator") /room affil jid affil [raison] Change l'affiliation de jid (affil peut être "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [valeur] Change certains paramètres du salon sélectionné Pour print_status, les valeurs possibles sont "default", "none", "in_and_out", "all". Pour auto_whois, les valeurs possibles sont "default", "off", "on". Pour flag_joins, les valeurs possibles sont "default", "none", "joins", "all". Si la valeur est "default", la configuration utilisée sera celle des options muc_print_status, muc_auto_whois et muc_flag_joins. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Ajoute, supprime ou met à jour le signet (par défaut, ajoute). Si "autojoin" est activé, mcabber entrera automatiquement dans la salle de conférence après s'être connecté au serveur. Pour visualiser la liste des signets, tapez /room bookmark dans la fenêtre d'état (status). mcabber-0.10.2/doc/help/fr/hlp_roster.txt000066400000000000000000000053341216603513500202220ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Cette commande permet de manipuler le roster (liste de contacts). /roster bottom Va à la fin de la liste de contact /roster top Va au début de la liste de contact /roster up [n] Monte [de n lignes] dans le roster /roster down [n] Descend [de n lignes] dans le roster /roster group_prev Va au groupe précédent in the roster /roster group_next Va au groupe suivant in the roster /roster alternate Va au contact alternatif. Ce contact "alternatif" est le dernier contact quitté tout en étant en mode discussion (chat mode). Cette commande est donc particulièrement utile après des commandes comme "/roster unread_next" (Ctrl-q). /roster unread_first Va au premier message non lu /roster unread_next Va au prochain message non lu /roster search bud Cherche un contact dont le nom ou le jid contient "bud" (seulement dans les contacts affichés) /roster display [masque] Affiche ou met à jour le filtre du roster. Le masque doit contenir les lettres-raccourcis des états que vous voulez voir affichés ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). Par exemple "ofdna" pour n'afficher que les contacts connectés. "*" peut être utilisé comme raccourci pour afficher tous les contacts. /roster hide_offline Cache les contacts non connectés /roster show_offline Affiche les contacts non connectés /roster toggle_offline Inverse l'affichage des contacts non connectés /roster item_lock [jid] Affiche le contact dans le roster, même s'il est déconnecté /roster item_unlock [jid] Annule l'effet de /roster item_lock /roster item_toggle_lock [jid] Inverse le verrou (lock) /roster hide Cache le roster (fenêtre de discussion en pleine largeur) /roster show Affiche le roster /roster toggle Inverse l'affichage du roster (hide/show) /roster note [-|texte] Ajoute, modifie ou supprime une annotation. Si le texte n'est pas précisé, l'annotation actuelle de l'élément sélectionné est affichée -- si vous êtes dans la fenêtre d'état (status), toutes les notes seront affichées. Si le texte est "-", l'annotation est supprimée. /roster resource_lock [full jid|resource] Définit la ressource active pour un contact donné du roster. Il est possible d'utiliser la syntaxe "./resource" pour le contact courant, ou bien uniquement un nom de ressource. /roster resource_unlock [jid] Initialise la ressource active pour un contact. Il est possible d'utiliser "." pour le contact sélectionné. mcabber-0.10.2/doc/help/fr/hlp_say.txt000066400000000000000000000005401216603513500174720ustar00rootroot00000000000000 /SAY [-n|-h|--] texte Envoie le message "texte" au contact sélectionné. Par exemple, cela peut être utile pour envoyer un message commençant par un '/'. L'option "-n" permet d'envoyer un message de type "normal", et l'option "-h" un message de type "headline". Il est possible d'utiliser "--" pour envoyer des messages commençant par -n ou -h. mcabber-0.10.2/doc/help/fr/hlp_say_to.txt000066400000000000000000000013611216603513500201760ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f fichier] jid texte Envoie le message "texte" à l'utilisateur "jid". Notez que vous devrez utiliser un JID complet (avec identifiant de ressource) si vous désirez préciser où le message doit arriver exactement. Vous pouvez envoyer un message à une ressource spécifique du contact sélectionné en faisant /say_to ./resource message. Lorsque "-q" est utilisé, le message sera envoyé en arrière plan et la fenêtre active sera conservée. L'option "-e" permet l'interprétation des chaînes spéciales "\n" et "\t". Cette option est inopérante si le texte est issu d'un fichier via l'option "-f". Un fichier texte peut être fourni avec l'option "-f" (auquel cas il est inutile de préciser le paramètre texte). mcabber-0.10.2/doc/help/fr/hlp_screen_refresh.txt000066400000000000000000000000641216603513500216740ustar00rootroot00000000000000 /SCREEN_REFRESH Rafraîchit l'écran de mcabber. mcabber-0.10.2/doc/help/fr/hlp_set.txt000066400000000000000000000002001216603513500174620ustar00rootroot00000000000000 /SET [option [= valeur]] Affiche ou définit une option. En l'absence d'option, affiche toutes les options et leurs valeurs. mcabber-0.10.2/doc/help/fr/hlp_source.txt000066400000000000000000000002601216603513500201750ustar00rootroot00000000000000 /SOURCE fichier Cette commande permet de lire un fichier de configuration. Il est possible d'utiliser un motif, auquel cas les fichiers sont lus dans l'ordre alphabétique. mcabber-0.10.2/doc/help/fr/hlp_status.txt000066400000000000000000000011531216603513500202220ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|StatusMessage]] /STATUS message -|StatusMessage Affiche ou définit l'état actuel. Si aucun état n'est précisé, affiche l'état courant. Si un message d'état est spécifié, il outrepassera les variables message* (définies dans le fichier de configuration). Si aucune variable message* adéquate n'est définie et aucun message d'état n'est fourni, le message d'état actuel est conservé. Si "StatusMessage" est "-", le message d'état actuel est effacé. Avec la commande "/status message", le message d'état est changé tout en préservant l'état actuel. mcabber-0.10.2/doc/help/fr/hlp_status_to.txt000066400000000000000000000007061216603513500207270ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [StatusMessage] /STATUS_TO jid message StatusMessage Envoie l'état demandé à "jid". Si le jid fourni est ".", le contact sélectionné est utilisé. Remarque : cet état sera modifié par les commandes "/status" ultérieures. Si vous utilisez l'option d'absence automatique (auto-away), l'état sera modifié également. Remarque : Le jid peut contenir une ressource (i.e. user@server/resource). mcabber-0.10.2/doc/help/fr/hlp_version.txt000066400000000000000000000000531216603513500203620ustar00rootroot00000000000000 /VERSION Affiche la version de mcabber. mcabber-0.10.2/doc/help/it/000077500000000000000000000000001216603513500153005ustar00rootroot00000000000000mcabber-0.10.2/doc/help/it/hlp.txt000066400000000000000000000007531216603513500166310ustar00rootroot00000000000000 /HELP [comando|+argomento] Mostra l'help relativo a comando o ad argomento. Se non viene specificato alcun argomento, viene visualizzato l'utilizzo del comando corrente. I comandi disponibili sono: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/it/hlp_add.txt000066400000000000000000000007041216603513500174350ustar00rootroot00000000000000 /ADD [jid [nickname]] Aggiunge il nickname "jid" al roster (nel gruppo di default), ed invia una richiesta di notifica a questo contatto. Se non viene specificato alcun nickname, viene usato il jid. Se non viene fornito alcun jid (oppure viene fornita una stringa nulla ""), o il jid è ".", viene utilizzato il contatto corrente. /add [jid [nickname]] Aggiunge al roster "jid" come "nickname" Esempio: "/add somebody@jabber.server.com Somebody" mcabber-0.10.2/doc/help/it/hlp_alias.txt000066400000000000000000000007021216603513500177740ustar00rootroot00000000000000 /ALIAS [nome [= comando]] Questo comando consente di definire alias che possono semplificare l'uso di comandi sofisticati. Gli alias possono essere gestiti come segue: /alias Stampa la lista degli alias attualmente definiti /alias nome Stampa il valore dell'alias definito da "nome" /alias nome= Cancella l'alias chiamato "nome" /alias nome = comando Definisce l'alias "nome" associandolo a "comando" Esempio: "/alias assente = status away" mcabber-0.10.2/doc/help/it/hlp_authorization.txt000066400000000000000000000014171216603513500216070ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Questo comando gestisce la sottoscrizione delle presenze: ti consente di richiedere la sottoscrizione delle presenze altrui al tuo roster, e ti consente di controllare chi riceve la notifica della tua presenza. Se non viene specificato nessun JID viene utilizzato il contatto correntemente selezionato. /authorization allow Permette al contatto di ricevere gli aggiornamenti della tua presenza /authorization cancel Elimina la sottoscrizione del contatto agli aggiornamenti della tua presenza /authorization request Richiede la sottoscrizione agli aggiornamenti della presenza del contatto /authorization request_unsubscribe Richiede di cancellare la sottoscrizione agli aggiornamenti della presenza del contatto mcabber-0.10.2/doc/help/it/hlp_bind.txt000066400000000000000000000014141216603513500176200ustar00rootroot00000000000000 /BIND [keycode [= commando]] Collega il comando al tasto specificato da "keycode". Per verificare quali tasti siano non utlizzati al momento basta guardare alla finestra di log di mcabber e premere i tasti desiderati. Per esempio: "Unknown key=265" significa che è possibile assegnare un comando al tasto #265. /bind Mostra la lista dei collegamenti attivi /bind keycode Mostra il comando associato al tasto specificato da keycode /bind keycode= Cancella il comando associato al tasto "keycode" /bind keycode = commando Associa "comando" al tasto con codice "keycode" Esempio: "/bind 265 = status away" (265 è F1). Nota: i keycode possono essere diversi a seconda della configurazione delle ncurses. Suggerimento: al posto dei comandi si possono usare anche gli alias. mcabber-0.10.2/doc/help/it/hlp_buffer.txt000066400000000000000000000036511216603513500201620ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save Comandi per la manipolazione del buffer del contatto. Per esempio, è possibile cercare nel buffer la parola "text", pulire la finestra della chat etc. /buffer clear Pulisce la finestra di chat del contatto corrente /buffer close [jid] Svuota tutti contenuti presenti nel buffer e chiude la finestra di chat del contatto corrente (o del contatto identificato da jid) /buffer close_all Svuota tutti i contenuti presenti in tutti i buffer e chiude le finestre di chat /buffer purge [jid] Pulisce la finestra di chat del contatto corrente - o del contatto identificato da jid - e svuota tutti i contenuti del buffer /buffer list Mostra la lista dei buffer esistenti, inclusa la loro lunghezza (linee/blocchi) /buffer top Salta all'inizio del buffer di chat del contatto corrente /buffer bottom Salta alla fine del buffer di chat del contatto corrente /buffer up [n] Fa scorrere indietro il buffer di [n] linee (default: metà schermo) /buffer down [n] Fa scorrere avanti il buffer di [n] linee (default: metà schermo) /buffer date [data] Salta alla prima linea successiva alla [data] specificata nel buffer di chat (formato della data: "YYYY-mm-dd") /buffer % n Salta alla posizione %n del buffer di chat corrente /buffer readmark Jump to the readmark (first unread line), if there is one /buffer search_backward [testo] Ricerca all'indietro [testo] nel buffer di chat del contatto corrente /buffer search_forward [testo] Ricerca in avanti [testo] nel buffer di chat del contatto corrente /buffer scroll_lock Blocca lo scorrimento del buffer /buffer scroll_unlock Sblocca lo scorrimento del buffer /buffer scroll_toggle Cambia la modalità di scorrimento del buffer (bloccato/sbloccato) /buffer save file Salva il contenuto del buffer corrente in mcabber-0.10.2/doc/help/it/hlp_chat_disable.txt000066400000000000000000000002211216603513500213010ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Disabilita la modalità chat Con l'opzione --show-roster viene disabiltata la visualizzazione a schermo intero. mcabber-0.10.2/doc/help/it/hlp_clear.txt000066400000000000000000000001651216603513500177740ustar00rootroot00000000000000 /CLEAR Questo comando è di fatto un alias per "/buffer clear". Svuota la finestra di chat del contatto corrente. mcabber-0.10.2/doc/help/it/hlp_color.txt000066400000000000000000000035071216603513500200270ustar00rootroot00000000000000 /COLOR roster (status wildcard (colore|-)|clear) /COLOR mucnick nick (colore|-) /COLOR muc (jid|.|*) [on|preset|off|-] Il comando 'color' consente di impostare dinamicamente i colori dello schermo. /color roster clear Rimuove tutte le regole relative ai colori dal roster. Tutti gli elementi del roster verranno visualizzati con i colori di default. /color roster status wildcard colore Imposta una regola colore (o la sostituisce nel caso esista già). Lo stato è una stringa che contiene tutti gli stati che gli elementi del roster devono assumere per soddisfare la regola, oppure * se vanno bene tutti gli stati. Wildcard viene applicata a JID; colore e` il colore desiderato. Se colore è -, la regola viene rimossa. Se più di una regola è soddisfatta, viene utilizzato il colore dell'ultima regola creata (non sovrascritta). /color mucnick nick (colore|-) Colora il nick con il colore scelto. Se una MUC utilizza nick colorati, verranno usati questi ultimi. Se colore è -, il colore viene selezionato automaticamente, il che significa che non verrà utilizzata nel modo 'preset', ma rimarrà inalterato in modalità 'on'. /color muc (jid|.|*) [on|preset|off|-] Imposta una modalità di colorazione dei nick. Se un jid (ovvero il jid correntemente selezionato) viene specificato, la modalità si applicherà alla MUC prescelta. Se viene utilizzato *, la modalità si applicherà a tutte le MUC, escluse quelle impostate tramite il proprio jid. Il modo 'on' colora tutti i nick, 'preset' solamente quelli impostati manualmente con il comando /color mucnick e off non ne colora nessuno. Il default è 'on'. Il modo '-' rimuove la modalità per il JID specificato, il che significa che verranno utilizzati i colori impostati globalmente. I colori impostati globalmente non possono essere rimossi. Il default della colorazione globale è 'off'. mcabber-0.10.2/doc/help/it/hlp_connect.txt000066400000000000000000000000751216603513500203370ustar00rootroot00000000000000 /CONNECT Stabilisce una connessione con il server Jabber. mcabber-0.10.2/doc/help/it/hlp_del.txt000066400000000000000000000002011216603513500174410ustar00rootroot00000000000000 /DEL Elimina il contatto corrente dal roster, cancellando la sottoscrizione alle reciproche notifiche della propria presenza. mcabber-0.10.2/doc/help/it/hlp_disconnect.txt000066400000000000000000000003041216603513500210320ustar00rootroot00000000000000 /DISCONNECT Termina la connessione con il serve Jabber. Nota: il roster è disponibile soltanto quando la connessione è attiva, quindi la lista dei contatti è vuota quando si è disconnessi. mcabber-0.10.2/doc/help/it/hlp_echo.txt000066400000000000000000000000751216603513500176240ustar00rootroot00000000000000 /ECHO messaggio Mostra "messaggio" nella finestra di log. mcabber-0.10.2/doc/help/it/hlp_event.txt000066400000000000000000000012721216603513500200270ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [parametri dipendenti dall'evento] /EVENT list Istruisce mcabber su cosa fare per gli eventi in attesa. Se il primo parametro è '*', il comando verrà eseguito su tutti gli eventi in attesa. I parametri dipendenti dall'evento vengono interpretati a seconda dell'evento. L'unico caso predefinito di ha quando il parametro è un rifiuto di invito ad una MUC - il parametro, se presente, verrà interpretato come il motivo del rifiuto. /event #N|* accept L'evento numero #N/All verrà accettato /event #N|* ignore L'evento numero #N/All verrà ignorato /event #N|* reject L'evento numero #N/All verrà rifiutato /event list Elenca tutti gli eventi in attesa mcabber-0.10.2/doc/help/it/hlp_group.txt000066400000000000000000000005311216603513500200370ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [gruppo] Questo comando cambia la visualizzazione del gruppo corrente o del gruppo specificato come parametro. /group fold [gruppo] Chiude (collassa) il gruppo nel roster /group unfold [gruppo] Apre (espande) il gruppo nel roster /group toggle [gruppo] Cambia lo stato (collassato/espanso) del gruppo nel roster mcabber-0.10.2/doc/help/it/hlp_help.txt000066400000000000000000000001731216603513500176350ustar00rootroot00000000000000 /HELP [comando|+argomento] Visualizza l'help per il comando "comando" o l'argomento "argomento" Esempio: "/help buffer" mcabber-0.10.2/doc/help/it/hlp_iline.txt000066400000000000000000000050541216603513500200100ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Comandi disponibili: /iline fchar Spostati alla lettera successiva /iline bchar Spostati alla lettera precedente /iline char_fdel Cancella la lettera alla posizione del cursore /iline char_bdel Cancella la lettera prima della posizione del cursore /iline char_swap Scambia i caratteri /iline fword Sposta il cursore in avanti fino al termine delle parola prossima o corrente /iline bword Sposta il cursore indietro all'inizio della parola precedente o corrente /iline word_bdel Cancella la parola dall'inizio alla posizione del cursore /iline word_fdel Canella la parola dalla posizione del cursore alla fine /iline word_upcase Converti in maiuscolo la parola dalla posizione del cursore alla fine /iline word_downcase Converti in minuscolo la parola dalla posizione del cursore alla fine /iline word_capit Converti in maiuscolo la parola dalla posizione del cursore alla fine /iline hist_beginning_search_bwd Cerca all'indietro nella history una riga che cominci con la linea corrente fino alla posizione del cursore (lasciando il cursore nella posizione originale) /iline hist_beginning_search_fwd Cerca in avanti nella history una riga che cominci con la linea corrente fino alla posizione del cursore (lasciando il cursore nella posizione originale) /iline hist_prev La riga precedente nella history /iline hist_next La riga successiva nella history /iline iline_start Vai all'inizio della riga di input /iline iline_end Vai alla fine della riga di input /iline iline_fdel Cancella dal cursore alla fine della riga /iline iline_bdel Cancella dall'inizio della riga fino alla posizione del cursore /iline iline_accept Accetta la linea /iline iline_accept_down_hist Accetta la linea ad inserisci la prossima linea della history nella riga di input /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). /iline clear_history Clear the command line history /iline compl_do Completa la parola corrente nella riga di input /iline compl_cancel Cancella il completamento /iline send_multiline Invia/termina un messaggio multi-linea mcabber-0.10.2/doc/help/it/hlp_info.txt000066400000000000000000000002771216603513500176450ustar00rootroot00000000000000 /INFO Visualizza le informazione per l'entry selezionata (utente, agente, gruppo...). Per gli utenti vengono visualizzati lo stato, la priorità ed il messaggio di stato (se disponibile). mcabber-0.10.2/doc/help/it/hlp_module.txt000066400000000000000000000012621216603513500201720ustar00rootroot00000000000000 /MODULE load|unload [-f] modulo /MODULE info modulo /MODULE [list] Carica, scarica o mostra le informazioni disponibili per un modulo. /module load [-f] modulo Carica il modulo specificato. Se viene specificato il flag -f, la maggior parte degli errori in fase di caricamento del modulo viene ignorata. /module unload [-f] modulo Scarica il modulo specificato. Nota: il flag -f non rimuove nessun modulo dipendente da ! /module info modulo Mostra le informazioni disponibili del modulo. /module [list] Elenca i moduli nel formato: [nome modulo] [conteggio dei riferimenti] ([caricati manualmente/automaticamente)] [informazioni supplementari, come versione e dipendenze] mcabber-0.10.2/doc/help/it/hlp_move.txt000066400000000000000000000004771216603513500176620ustar00rootroot00000000000000 /MOVE [gruppo] Muove il contatto corrente nel gruppo richiesto. Se non viene specificato alcun gruppo, il contatto viene spostato nel gruppo si default. Se il gruppo "gruppo" non esiste, viene creato. Trucco: se la modalità chat è abilitata, puoi usare "/roster alternate" per spostarti sul contatto appena mosso. mcabber-0.10.2/doc/help/it/hlp_msay.txt000066400000000000000000000026661216603513500176670ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Invia un messaggio multilinea. Per scrivere un singolo messaggio di diverse linee, deve essere usato il modo 'multi-line'. In modo multi-line, ogni linea (eccetto i comandi) inserita viene aggiunta al messaggio. Una volta che il messaggio è finito, può essere spedito al contatto corrente con il comando "/msay send". Il sottocomando 'begin' abilita il modo multi-linea. Notate che consente di specificare un oggetto per il messaggio. Il modo multi-linea 'verbatim' disabilita i comandi, in modo da consentire l'inserimento di linee che cominciano con uno slash. Solo il comando "msay" (con i parametre 'send' o 'abort') può essere usato per uscire dalla modalità multi-linea. Il sottocomando 'toggle' può essere associato ad un tasto per utilizzare il modo multi-linea velocemente (per esempio, "bind M13 = msay toggle" per attivare/disattivare ;a modalità con la combinazione Meta-Enter). /msay begin [oggetto] Entra in modalità multi-linea /msay verbatim Entra in modalità multi-linea verbatim /msay send [-n|-h] Invia il messaggio multi-linea al contatto correntemente selezionato /msay send_to [-n|-h] jid Invia il messaggio multi-linea a "jid" /msay toggle|toggle_verbatim Entra ed esce dalla modalità multi-linea /msay abort Abbandona la modalità multi-linea senza spedire il messaggio Le opzioni -n o -h modificano il messaggio in "normal" o "headline" rispettivamente. mcabber-0.10.2/doc/help/it/hlp_otr.txt000066400000000000000000000021401216603513500175050ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Si può usare '.' per indicare il contatto correntemente selezionato. /otr key Stampa nel buffer di stato la fingerprint della propria chiave privata /otr start [jid] Apre un canale OTR verso il contatto specificato, o quello correntemente selezionato /otr stop [jid] Chiude il canale OTR verso il contatto specificato, o quello correntemente selezionato /otr info [jid] Mostra lo stato dell'OTR per il contatto specificato, o quello correntemente selezionato /otr fingerprint [jid [fpr]] Mostra la fingerprint attiva per il canale OTR. Se la fingerprint viene fornita al posto di "fpr", allora la fingerprint viene considerata affidabile. Se si sostituisce "fpr" con quelche stringa casuale, la fingerprint perderà il proprio stato di affidabile. /otr smpq [jid] secret Attiva il Socialist Millionaires Protocl con il secret ed il jid specificato /otr smpr [jid] secret Risponde all'attivazione del jid e del secret /otr smpa [jid] Interrompe il Socialist Millionaires Protocol in esecuzione mcabber-0.10.2/doc/help/it/hlp_otrpolicy.txt000066400000000000000000000024311216603513500207300ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Si può usare '.' per indicare il contatto correntemente selezionato. /otrpolicy Mostra tutte le politiche OTR nel buffer di stato /otrpolicy (default|jid) (plain|manual|opportunistic|always) Imposta sia la politica di default che quella per il jid specificato La policy plain non dovrebbe mai essere usata, dato che non consente la ricezione e l'invio di messaggi cifrati con OTR. Se la policy viene impostata su 'manual', tu o il tuo corrispondente dovrete iniziare la cifratura OTR manualmente (ad esempio, con /otr start). La policy 'opportunistic' fa si che venga inviata una speciale sequenza di spazi al termine di un messaggio non cifrato. In questo modo, l'altro client capace di OTR capirà che vuoi utilizzare OTR. Da notare che, utilizzando questa policy, il primo messaggio non sarà mai cifrato. Con la policy 'always' nessun messaggio verrà inviato in chiaro. Se provi ad inviare un messaggio non cifrato, mcabber proverà a stabilire un canale OTR. Devi reinviare il messaggio appena ricevuta la notifica che il canale è stato stabilito. Se qualcuno ti invia un messaggio in chiaro con la policy impostata a 'always', sarà possibile leggere il messaggio, ma questi non verrà salvato nella history. mcabber-0.10.2/doc/help/it/hlp_pgp.txt000066400000000000000000000023161216603513500174740ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [chiave]] Questo comando manipola le impostazioni PGP per il jid specificato (di default, il contatto correntemente selezionato). Nota che la cifratura PGP non viene utilizzate se non viene rilevato alcun supporto PGP esterno, anche se si utilizza questo comando. Puoi forzare l'uso della cifratura PGP con il sottocomando "force". /pgp disable [jid] Disabilita la cifratura PGP per jid (o per il contatto correntemente selezionato) /pgp enable [jid] Abilita la cifratura PGP per jid (o per il contatto correntemente selezionato) /pgp [+|-]force [jid] Forza l'uso della cifratura PGP, anche per i messaggi offline, e suppone che il destinatario abbia il supporto per PGP. Se non messaggio non può essere cifrato (perchè manca la chiave o l'id della chiave), il messaggio non viene spedito. Questa opzione viene ignorata se il supporto per PGP è disabilitato /pgp info [jid] Mostra le impostazioni PGP per il contatto /pgp setkey [jid [chiave]] Imposta la chiave PGP da utilizzare per cifrare i messaggi diretti a questo contatto. Se non viene fornita alcuna chiave, la chiave corrente viene cancellata. Puoi usare "." per fare riferimento al contatto corrente. mcabber-0.10.2/doc/help/it/hlp_quit.txt000066400000000000000000000001101216603513500176560ustar00rootroot00000000000000 /QUIT Questo comando chiude tutte le connessioni ed esce da mcabber. mcabber-0.10.2/doc/help/it/hlp_rawxml.txt000066400000000000000000000004531216603513500202200ustar00rootroot00000000000000 /RAWXML send stringa Invia "stringa" (in formato raw XML) al server jabber. Non viene effettuato alcun controllo sulla stringa inviata. ATTENZIONE! Usatelo solo se sapete cosa state facendo, o potreste interrompere la connessione. Esempio: "/rawxml send away" mcabber-0.10.2/doc/help/it/hlp_rename.txt000066400000000000000000000003061216603513500201520ustar00rootroot00000000000000 /RENAME nome Rinomina il contatto od il gruppo correnti usando "nome". Se si specifica - come "nome", il nome viene rimosso dal roster, ed al suo posto verranno visulizzati il JID o lo username. mcabber-0.10.2/doc/help/it/hlp_request.txt000066400000000000000000000007431216603513500204000ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Invia una query "IQ" al contatto corrente, od all'utente jabber specificato. Se la risorsa non viene specificata con il jid, mcabber invia un richiesta per tutte le risorse conosciute per l'utente. /request last Richiede l'informazione "last" (solitamente il tempo di inattività) /request ping /request time Richiede l'ora al contatto /request vcard Richiede la vCard al contatto /request version Richiede la versione al contatto mcabber-0.10.2/doc/help/it/hlp_room.txt000066400000000000000000000052531216603513500176650ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [valore] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Il comando 'room' gestisce le azioni per le stanze di chat multi-utente. /room join [stanza [nick [pass]]] Entra nella "stanza", utilizzando "nick" come nickname. Se non viene specificato un nickname (o se la stringa è vuota), viene utilizzato il valore dell'opzione "nickname" (vedi il file di configurazione di esempio). Se l'elemento correntemente selezionato viene riconosciuto da mcabber come una stanza, si può utilizzare "." al posto dell'id completo. Si può inserire una password per entrare nelle stanza protette. Se il nickname contiene spazi, usate gli apici. /room leave [message] Abbandona la stanza corrente /room names [--detail|--short|--quiet|--compact] Elenca i membri della stanza /room nick newnick Cambia il tuo nickname nella stanza corrente /room privmsg nick msg Invia un messaggio privato a "nick" /room remove Rimuove la stanza corrente dal roster (devi prima lasciare la stanza) /room topic argomento Imposta l'argomento della stanza corrente. Se si specifica come "argomento" -, l'argomento viene cancellato. /room unlock Sblocca la stanza corrente (se ne sei il proprietario) /room destroy [reason] Distrugge la stanza corrente (usare con cautela!) /room whois nick Mostra le informazioni MUC relative a "nick" /room ban jid [motivo] Esilia jid dalla stanza corrente /room unban jid Riammette jid alla stanza corrente /room invite jid [motivo] Invita jid nella stanza corrente /room kick nick [motivo] Caccia "nick" dalla stanza corrente /room role jid role [motivo] Cambia il ruolo di jid (il ruolo può essere "none", "visitor", "participant", "moderator") /room affil jid affil [motivo] Cambia l'affiliazione di jid (l'affiliazione può essere "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [value] Cambia le impostazioni della stanza corrente. Per l'opzione print_status i valori possibili sono "default", "none", "in_and_out", "all". Per auto_whois, i valori possibili sono "default", "off", "on". Per flag_joins, i valori possibili sono "default", "none", "joins", "all". Quando il valore è impostato a "default", vengono usate le opzioni muc_print_status / muc_auto_whois / muc_flag_joins. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Aggiunge, rimuove o aggiorna un bookmark (di default aggiunge). Se è impostato l'autojoin, mcabber entrerà automaticamente nella stanza quando si connette al server. Per visualizzare l'elenco dei bookmark, utilizzare /room bookmark nel buffer di stato. mcabber-0.10.2/doc/help/it/hlp_roster.txt000066400000000000000000000051241216603513500202240ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|testo] /ROSTER resource_lock|resource_unlock Il comando 'roster' manipola la lista dei contatti. Ecco i parametri disponibili. /roster bottom Salta in fondo al roster /roster top Salta in cima al roster /roster up [n] Sposta verso l'alto /roster down [n] Sposta verso il basso /roster group_prev Salta al gruppo precedente /roster group_next Salta al gruppo successivo /roster alternate Salta al conatto alternativo. Il contatto alternatico è l'ultimo contatto con cui hai parlato in modalità chat. Questo comando è quindi utlie dopo comandi quali "/roster unread_next" (Ctrl-q). /roster unread_first Salta al primo messaggio non letto /roster unread_next Salta al messaggio non letto successivo /roster search bud Cerca il contatto il cui nome o jid contengono "bud" (solo nella lista contatti visualizzata) /roster display [mask] Mostra o aggiorna il filtro per il roster. La maschera consiste di una lettera corrispondente allo stato che vuoi visualizzare ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). Per esempio, "ofdna" mostra solo i contatti connessi. "*" può essere usato come scorciatoio per visualizzare tutti i contatti. /roster hide_offline Nasconde i contatti offline (come /roster display ofdna) /roster show_offline Mostra i contatti offline (come /roster display ofdna_) /roster toggle_offline Visualizza/Nasconde i contatti offline /roster item_lock [jid] Blocca un elemento del roster in modo che rimanga visibile a prescindere dal suo stato /roster item_unlock [jid] Cancella gli effetti di item_lock /roster item_toggle_lock [jid] Inverte lo stato del lock per il contatto corrente o per il contatto specificato da jid /roster hide Nasconde il roster (chat a finestra piena) /roster show Mostra il roster /roster toggle Mostra/Nasconde il roster /roster note [-|testo] Imposta/aggiorna/cancella una annotazione Se "testo" non viene specificato, viene visualizzata l'annotazione dell'elemento corrente -- se ti trovi nel buffer di stato, vengono visualizzate tutte le note. Se "testo" e "-", la nota viene cancellata. /roster resource_lock [full jid|resource] Set active resource for a buddy in roster. Accepts special jid "./resource" for current buddy, or just a resource name. /roster resource_unlock [jid] Unset active resource for a buddy. Accepts special jid "." for current buddy. mcabber-0.10.2/doc/help/it/hlp_say.txt000066400000000000000000000005151216603513500175010ustar00rootroot00000000000000 /SAY [-n|-h|--] testo Manda il messaggio "testo" al contatto correntemente selezionato. Può essere utile se vuoi inviare un messaggio che comincia, per esempio, con uno slash (/). L'opzione "-n" trasforma il messaggio in "normale", "-h" in "headline". "--" può essere utilizzato per inviare messaggi che comincino con -n o -h. mcabber-0.10.2/doc/help/it/hlp_say_to.txt000066400000000000000000000014321216603513500202020ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f file] jid testo Invia il messaggio "testo" al jid specificato. Nota che questo comando non imposta una risorsa di default per un contatto, quindi se vuoi inviare diversi messaggi alla specifica risorsa devi usare "/say_to" per ciascun messaggio. L'opzione "-n" trasforma il messaggio in "normale", "-h" in "headline". "--" può essere utilizzato per inviare messaggi che comincino con -n o -h. Quando si usa "-q", il messaggio viene spedito in background e la finestra attiva non viene modificata. The option "-e" enables interpretation of the strings "\n" and "\t". This flag has no effect if the text comes from a file with option "-f". L'opzione "-f" serve a specificare un file di testo (nel qual caso non serve aggiungere testo dopo il jid, ovviamente). mcabber-0.10.2/doc/help/it/hlp_screen_refresh.txt000066400000000000000000000000631216603513500217000ustar00rootroot00000000000000 /SCREEN_REFRESH Aggiorna lo schermo di mcabber. mcabber-0.10.2/doc/help/it/hlp_set.txt000066400000000000000000000002621216603513500174770ustar00rootroot00000000000000 /SET [opzione [= valore]] Visualizza o imposta il valore di un'opzione. Se non vengono specificati parametri vengono elencate tutte le opzioni impostate ed i relativi valori. mcabber-0.10.2/doc/help/it/hlp_source.txt000066400000000000000000000002001216603513500201740ustar00rootroot00000000000000 /SOURCE pattern Legge uno o più file di configurazione che corrispondano al pattern specificato (ordinati alfabeticamente). mcabber-0.10.2/doc/help/it/hlp_status.txt000066400000000000000000000012201216603513500202220ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|Messaggio di stato]] /STATUS message -|StatusMessage Mostra od imposta lo stato corrente. Se non viene specificato uno stato, visualizza lo stato corrente. Se viene specificato un messaggio, la variabili message* verranno sovrascritte (queste variabili possono essere impostate nel file di configurazione). Se nessuna variabile message* è impostata, e non viene specificato alcun messaggio di stato, viene mantenuto lo stato corrente. Se "Messaggio di stato" è "-", lo stato corrente viene cancellato. Con il comando "/status message", viene aggiornato il messaggio senza modificare lo stato corrente. mcabber-0.10.2/doc/help/it/hlp_status_to.txt000066400000000000000000000007031216603513500207310ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [Messaggio di stato] /STATUS_TO jid message StatusMessage Manda lo stato richiesto all'utente jabber specificato. Se il jid specificato è ".", viene usato il contatto corrente. Nota: questo stato verrà sovrascritto dal comando "/status" successivo. Lo stato verrà sovrascritto anche se utilizzi la funzionalità di auto-away. Nota: il jid può includere una risorsa (es: user@server/risorsa). mcabber-0.10.2/doc/help/it/hlp_version.txt000066400000000000000000000000651216603513500203720ustar00rootroot00000000000000 /VERSION Mostra il numero di versione di mcabber. mcabber-0.10.2/doc/help/nl/000077500000000000000000000000001216603513500152755ustar00rootroot00000000000000mcabber-0.10.2/doc/help/nl/hlp.txt000066400000000000000000000007441216603513500166260ustar00rootroot00000000000000 /HELP [commando|+onderwep] Toon informatie over een commando of onderwerp. Als geen argument is meegegeven, wordt een tekst over het gebruik van dit commando getoond. Beschikbare commando's: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/nl/hlp_add.txt000066400000000000000000000006701216603513500174340ustar00rootroot00000000000000 /ADD [jid [nickname]] Voeg Jabber gebruiker "jid" toe aan het roster (in de standaard groep), en stuur een notificatie verzoek aan deze buddy. Indien geen nickname wordt vermeld wordt de jid gebruikt. Indien geen jid (of een lege string "") wordt opgegeven of indien de jid "." is, wordt de huidige buddy gebruikt. /add [jid [nickname]] Voeg "jid" aan ons roster toe als "nickname" Voorbeeld: "/add iemand@jabber.server.com Iemand" mcabber-0.10.2/doc/help/nl/hlp_alias.txt000066400000000000000000000007331216603513500177750ustar00rootroot00000000000000 /ALIAS [naam [= commando regel]] Met dit commando kunt u aliassen toevoegen ter vereenvoudiging van ingewikkelde commando reeksen. De aliassen kunnen worden bewerkt met: /alias Print een lijst van de momenteel gedefinieerde aliassen /alias naam Print de waarde van de alias genaamd "naam" /alias naam= Verwijder de alias genaamd "naam" /alias naam = commando regel Stel de alias genaamd "naam" in met de waarde "commando regel" Voorbeeld: "/alias weg = status away" mcabber-0.10.2/doc/help/nl/hlp_authorization.txt000066400000000000000000000012661216603513500216060ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Met dit commando beheer je status meldingen: Je regelt het opvragen van status meldingen van personen op je roster, en ook aan wie meldingen gedaan worden over veranderingen in je eigen status. Indien geen JID wordt wordt opgegeven, wordt de actieve buddy gebruikt. /authorization allow Buddy mag veranderingen in je status ontvangen /authorization cancel Buddy zal niet langer veranderingen in je status ontvangen /authorization request Vraag toestemming aan buddy om diens status veranderingen te mogen zien /authorization request_unsubscribe Informeer buddy dat je niet langer diens status veranderingen wenst te krijgen mcabber-0.10.2/doc/help/nl/hlp_bind.txt000066400000000000000000000014401216603513500176140ustar00rootroot00000000000000 /BIND [keycode [= commando regel]] Verbind het commando "commando regel" met de toets "keycode". Om te weten te komen of een bepaalde toets nog niet in gebruik is kun je het `mcabber` log venster observeren wanneer je de toets indrukt. Bijvoorbeeld: "Unknown key=265" betekent dat je een commando met toets #265 kan verbinden. /bind Toon een lijst met huidige toets verbindingen /bind keycode Toon de commando regel die met deze toets verbonden is /bind keycode= Maak de toets met code "keycode" weer vrij /bind keycode = commando regel Verbind "commando regel" met de toets die code "keycode" heeft Voorbeeld: "/bind 265 = status away" (265 is F1). NB: keycodes kunnen verschillen afhankelijk van je ncurses configuratie. Tip: in plaats van commando's kunnen ook aliassen worden gebruikt. mcabber-0.10.2/doc/help/nl/hlp_buffer.txt000066400000000000000000000034421216603513500201550ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save bestandsnaam Manipuleer de chat buffer van de actieve buddy. Je kunt bijvoorbeeld de buffer doorzoeken op "tekst", het chat venster wissen etc. /buffer clear Wis het chat venster van de actieve buddy /buffer close [jid] Wis de volledige inhoud van de chat buffer en sluit het venster van de actieve buddy /buffer close_all Wis de volledige inhoud van alle chat buffers en sluit alle chat vensters /buffer purge [jid] Wis het chat venster van de actieve buddy en verwijder de volledige inhoud van de chat buffer /buffer list Toon de lijst van bestaande buffers, met hun lengte (regels/blokken) /buffer top Spring naar het begin van de chat buffer van de actieve buddy /buffer bottom Spring naar het eind van de chat buffer van de actieve buddy /buffer up [n] Scroll de buffer [n] regels omhoog (standaard: een half scherm) /buffer down [n] Scroll de buffer [n] regels omlaag (standaard: een half scherm) /buffer date [datum] Spring naar de eerste regel na de aangeduide [datum] in de chat buffer (datum formaat: "YYYY-mm-dd") /buffer % n Spring naar positie %n in de buddy chat buffer /buffer readmark Jump to the readmark (first unread line), if there is one /buffer search_backward tekst Zoek achterwaarts naar [tekst] in de actieve buddy chat buffer /buffer search_forward tekst Zoek voorwaarts naar [tekst] in de actieve buddy chat buffer /buffer scroll_lock Blokkeer het scrollen van de buffer /buffer scroll_unlock Scrollen van de buffer toegestaan /buffer scroll_toggle Omschakelen van het scrollen van de buffer (toestaan/blokkeren) /buffer save bestandsnaam Sla de chat buffer op in bestand met naam 'bestandsnaam' mcabber-0.10.2/doc/help/nl/hlp_chat_disable.txt000066400000000000000000000001621216603513500213020ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Chat mode uitzetten. Met --show-roster wordt de volledige-scherm modus uitgezet. mcabber-0.10.2/doc/help/nl/hlp_clear.txt000066400000000000000000000001501216603513500177630ustar00rootroot00000000000000 /CLEAR Dit commando is feitelijk een alias voor "/buffer clear". Het wist het actieve chat venster. mcabber-0.10.2/doc/help/nl/hlp_color.txt000066400000000000000000000040641216603513500200230ustar00rootroot00000000000000 /COLOR roster (status joker (kleur|-)|clear) /COLOR mucnick nick (kleur|-) /COLOR muc (jid|.|*) [on|preset|off|-] Met het 'color' commando kunnen dynamisch de kleur eigenschappen van het scherm worden aangepast. /color roster clear Verwijder alle kleur-definities voor het roster. Alle roster elementen zullen hun standaard kleuren terug krijgen. /color roster status joker kleur Stel een kleur in (of overschrijf een bestaande definitie). 'Status' is een tekst die alle mogelijke statusen beschrijft waarin een roster element zich mag bevinden om bij de definitie te passen, of '*' indien elke status OK is. 'Joker' is een patroon (zoals ook gebruikt wordt voor het passen op bestandsnamen) dat op de JID toegepast zal worden. 'Kleur' is de gewenste kleur. Indien de waarde voor kleur '-' is, wordt de kleur-definitie verwijderd. Wanneer meer dan een definitie van toepassing is, wordt de kleur gebruikt van de laatst aangemaakte (niet overschreven) definitie. /color mucnick nick (kleur|-) Markeert de nick met de aangegeven kleur. ALs een MUC gekleurde nicks heeft, wordt deze kleur gebruikt. Indien de waarde voor kleur '-' is, wordt de kleur beschouwd als 'automatisch'. Dat betekent dat hij niet wordt gebruikt in 'preset' (voorkeur) kleurmode, en onveranderd blijft in 'on' (aan) kleurmode. /color muc (jid|.|*) [on|preset|off|-] Stel de kleurmode van een MUC in. Indien een JID ('.' staat voor de geselecteerde JID) wordt vermeld zal de kleur-definitie voor deze specifieke MUC gelden. Als '*' wordt gebruikt, geldt de kleur-definitie voor alle MUCs behalve degene die zelf een specifieke instelling hebben. Mode 'on' (aan) kleurt alle nicks, 'preset' (voorkeur) alleen de nicks voor wie de kleur handmatig is ingesteld via het /color mucnick commando; en 'off' (uit) kleurt geen enkele nick. Indien niet expliciet aangegeven, is de standaard instelling 'on' (aan). Mode '-' verwijdert de mode van de aangegeven JID, wat betekent dat de globale instelling van toepassing zal zijn. De globale mode kan niet worden verwijderd. Standaard staat de globale kleurmode op 'off' (uit). mcabber-0.10.2/doc/help/nl/hlp_connect.txt000066400000000000000000000000621216603513500203300ustar00rootroot00000000000000 /CONNECT Maak verbinding met de Jabber server. mcabber-0.10.2/doc/help/nl/hlp_del.txt000066400000000000000000000001621216603513500174440ustar00rootroot00000000000000 /DEL Verwijder de actieve buddy uit ons roster, en zet het wederzijds toezenden van status veranderingen stop. mcabber-0.10.2/doc/help/nl/hlp_disconnect.txt000066400000000000000000000003131216603513500210270ustar00rootroot00000000000000 /DISCONNECT Beëindig de verbinding met de Jabber server. NB: het Roster is alleen beschikbaar indien er een actieve verbinding met de server bestaat. De buddylijst is dus leeg indien niet verbonden. mcabber-0.10.2/doc/help/nl/hlp_echo.txt000066400000000000000000000000641216603513500176170ustar00rootroot00000000000000 /ECHO bericht Toon "bericht" in het log venster. mcabber-0.10.2/doc/help/nl/hlp_event.txt000066400000000000000000000016061216603513500200250ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [gebeurtenis-specifieke argumenten] /EVENT list Vertel mcabber wat te doen met gebeurtenissen in de wachtrij. Indien de eerste parameter '*' is, zal het commando van toepassing zijn op alle wachtende gebeurtenissen. Gebeurtenis-specifieke argumenten worden ge-evalueerd per gebeurtenis. Slechts een geval is ingebouwd; wanneer een argument meegegeven wordt bij een weigering van een MUC uitnodiging, wordt het argument gezien als de reden voor de weigering. /event #N|* accept [gebeurtenis-specifieke argumenten] Gebeurtenis nummer #N/Alle gebeurtenissen worden geaccepteerd /event #N|* ignore [gebeurtenis-specifieke argumenten] Gebeurtenis nummer #N/Alle gebeurtenissen worden genegeerd /event #N|* reject [gebeurtenis-specifieke argumenten] Gebeurtenis nummer #N/Alle gebeurtenissen worden geweigerd /event list Toon een lijst van wachtende gebeurtenissen mcabber-0.10.2/doc/help/nl/hlp_group.txt000066400000000000000000000005451216603513500200410ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] Dit commando verandert het aanzicht van de huidige groep. /group fold [groupname] Verbergen (inklappen) van de huidige group in het roster /group unfold [groupname] Tonen (uitklappen) van de huidige group in het roster /group toggle [groupname] Omschakelen van het aanzicht van de huidige groep (in-/uitklappen) mcabber-0.10.2/doc/help/nl/hlp_help.txt000066400000000000000000000001731216603513500176320ustar00rootroot00000000000000 /HELP [commando|+onderwerp] Toon helptekst voor commando "commando" of onderwerp "onderwerp". Voorbeeld: "/help buffer" mcabber-0.10.2/doc/help/nl/hlp_iline.txt000066400000000000000000000052261216603513500200060ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Invoer-regel commando's /iline fchar Beweeg naar het volgende karakter /iline bchar Beweeg naar het vorige karakter /iline char_fdel Verwijder het karakter op de cursor positie /iline char_bdel Verwijder het karakter voor de cursor positie /iline char_swap Wissel karakters om /iline fword Verplaats de cursor voorwaarts naar het eind van het huidige of volgende woord /iline bword Verplaats de cursor achterwaarts naar het begin van het huidige of vorige woord /iline word_bdel Verwijder het woord vanaf het begin tot de cursor positie /iline word_fdel Verwijder het woord vanaf de cursor positie tot het eind /iline word_upcase Converteer het woord naar hoofdletters vanaf de cursor positie tot het eind /iline word_downcase Converteer het woord naar kleine letters vanaf de cursor positie tot het eind /iline word_capit Converteer het woord naar kleine letters - met de eerste letter als hoofdletter - vanaf de cursor positie tot het eind /iline hist_beginning_search_bwd Zoek achterwaarts in de geschiedenis naar een regel die begint met de huidige regeltekst tot aan de cursor (dit laat de cursor op de originele positie staan) /iline hist_beginning_search_fwd Zoek voorwaarts in de geschiedenis naar een regel die begint met de huidige regeltekst tot aan de cursor (dit laat de cursor op de originele positie staan) /iline hist_prev Vorige regel in de geschiedenis van invoerregels /iline hist_next Volgende regel in de geschiedenis van invoerregels /iline iline_start Ga naar het begin van de invoerregel /iline iline_end Ga naar het eind van de invoerregel /iline iline_fdel Verwijder vanaf de cursor tot het eind van de regel /iline iline_bdel Verwijder vanaf het begin van de regel tot aan de cursor /iline iline_accept Accepteer regel /iline iline_accept_down_hist Accepteer regel en plaats de volgende regel uit de geschiedenis op de invoerregel /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). /iline clear_history Clear the command line history /iline compl_do Completeer het huidige woord op de invoerregel /iline compl_cancel Stop het completeren /iline send_multiline Verstuur/beeindig een meer-regelig bericht mcabber-0.10.2/doc/help/nl/hlp_info.txt000066400000000000000000000003241216603513500176330ustar00rootroot00000000000000 /INFO Toon informatie over de geselecteerde entry (account, agent, groep...). Bij accounts worden de resources getoond alsmede de status, prioriteit en (indien aanwezig) een statusbericht van iedere resource. mcabber-0.10.2/doc/help/nl/hlp_module.txt000066400000000000000000000012551216603513500201710ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Laad, ontlaad of toon info over module. /module load [-f] module Laad een specifieke module. Als de '-f' (force) flag wordt meegegeven, zullen de meeste foutmeldingen tijdens het laden worden genegeerd. /module unload [-f] module Ontlaad specifieke module. NB: Gebruik van de '-f' (force) optie zal de afhankelijkheden van deze module niet verwijderen! /module info module Toont beschikbare informatie over deze module. /module [list] Toont lijst van modules in het volgende formaat: [modulenaam] [aantal referenties] ([Handmatig/Automatisch geladen]) [extra informatie, zoals versie of afhankelijkheden] mcabber-0.10.2/doc/help/nl/hlp_move.txt000066400000000000000000000005401216603513500176460ustar00rootroot00000000000000 /MOVE [groepsnaam] Verplaats de actieve buddy naar de aangegeven groep. Indien geen groep werd gespecificeerd wordt buddy verplaatst naar de standaard groep. Indien de groep "groepsnaam" niet bestaat, wordt die eerst aangemaakt. Tip: indien chatmode actief is, kun je "/roster alternate" gebruiken om direct naar de verplaatste buddy te springen. mcabber-0.10.2/doc/help/nl/hlp_msay.txt000066400000000000000000000031261216603513500176540ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Verstuur een meer-regelig bericht. Om een enkel bericht te schrijven dat uit meerdere regels bestaat, moet de 'multi-regel modus' worden gebruikt. In deze modus wordt iedere invoerregel (behalve commando regels) toegevoegd aan het meerregelige bericht. Wanneer het bericht af is kan het aan de actieve buddy worden verzonden met het "/msay send" commando. Het 'begin' subcommando start de multi-regel modus. Hierbij is het mogelijk om een onderwerp mee te geven aan het bericht. In de 'verbatim' multi-regel modus kunnen commandos worden getypt zonder uitgevoerd te worden, zodat het mogelijk is om regels toe te voegen met een '/' karakter aan het begin. Enkel het "/msay" commando (met 'send' of 'abort' parameters) kan worden gebruikt om verbatim modus te stoppen. Het 'toggle' subcommando kan met een toets worden verbonden om de multi-regel modus snel te kunnen starten (bijvoorbeeld, "bind M13 = msay toggle" om over te kunnen schakelen via de Meta-Enter toets combinatie). /msay begin [onderwerp] Start de multi-regel modus /msay verbatim Start de verbatim multi-regel modus /msay send [-n|-h] Verzend het huidige meer-regelige bericht naar de actieve buddy /msay send_to [-n|-h] jid Verzend het huidige meer-regelige bericht naar "jid" /msay toggle|toggle_verbatim In/uitschakelen van multi-regel modus (begin/send) /msay abort Verlaat de multi-regel modus zonder het bericht te versturen De -n of -h vlag verandert het bericht respectievelijk in "normaal" of "koptekst" ('headline'), in tegenstelling tot het standaard "chat" bericht. mcabber-0.10.2/doc/help/nl/hlp_otr.txt000066400000000000000000000022371216603513500175110ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] De verkorte jid-notatie "." kan worden gebruikt voor het actueel geselecteerde contact. /otr key Print de vingerafdruk van je prive-sleutel in de Status Buffer /otr start [jid] Open een OTR kanaal naar de gespecificeerde jid (danwel het huidige geselecteerde contact) /otr stop [jid] Sluit het OTR kanaal naar de gespecificeerde jid (danwel het huidige geselecteerde contact) /otr info [jid] Toon actuele OTR status voor de gespecificeerde jid (danwel het huidige geselecteerde contact) /otr fingerprint [jid [fpr]] Toon de actieve vingerafdruk van een OTR kanaal. Indien een echte vingerafdruk wordt meegegeven in plaats van de tekst "fpr", zal deze vingerafdruk "vertrouwd" worden. Wanneer "fpr" door een verzonnen tekst wordt vervangen, zal de vingerafdruk zijn "vertrouwde" status verliezen. /otr smpq [jid] geheim Initieer het 'Socialist Millionaires Protocol' met de buddy, gebruik makend van het 'geheim' /otr smpr [jid] geheim Antwoord op de SMP Initiatie van de jid met het 'geheim' /otr smpa [jid] Stop het lopende Socialist Millionaires Protocol mcabber-0.10.2/doc/help/nl/hlp_otrpolicy.txt000066400000000000000000000030701216603513500207250ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) De verkorte jid-notatie "." kan worden gebruikt voor het actueel geselecteerde contact. /otrpolicy Print alle otr richtlijnen (off-the-record policies) naar de status buffer /otrpolicy (default|jid) (plain|manual|opportunistic|always) Stel de standaard richtlijn in, danwel de richtlijn voor de aangegeven jid. De "plain" (of 'open') richtlijn zou feitelijk nooit moeten worden gebruikt, omdat het daarmee niet mogelijk is om otr-versleutelde berichten te ontvangen of te verzenden. Indien de richtlijn op "manual" ('handmatig') wordt ingesteld, moet jij of je chat partner de otr versleuteling handmatig starten (bijv. via /otr start). De richtlijn "opportunistic" ('opportunistisch') doet dat zelf door een speciale keten van blanco karakters mee te sturen aan het eind van onversleutelde berichten. Daardoor komt een otr-capabel chat programma er achter dat je otr wilt gebruiken. Merk op, dat het eerste bericht altijd onversleuteld zal zijn bij gebruik van deze richtlijn. Met de richtlijn ingesteld op "always" ('altijd') zal geen enkel bericht onversleuteld worden verzonden. Bij een poging om het eerste bericht onversleuteld te versturen zal mcabber proberen een otr verbinding tot stand te brengen. Stuur aub het bericht opnieuw nadat mcabber meldt dat een otr verbinding tot stand is gebracht. Wanneer iemand je onversleutelde berichten stuurt terwijl de richtlijn is ingesteld op "always", zul je deze tekst wel kunnen lezen maar de berichten zullen niet in de geschiedenis worden opgeslagen. mcabber-0.10.2/doc/help/nl/hlp_pgp.txt000066400000000000000000000023211216603513500174650ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [key]] Dit commando manipuleert de PGP instellingen voor het specifieke jid (standaard is dat de actieve buddy). Houd er rekening mee dat er geen PGP versleuteling gebruikt wordt indien PGP ondersteuning aan de andere kant ontbreekt, zelfs wanneer PGP geactiveerd is met "/pgp enable". PGP versleuteling kan geforceerd worden met het "force" sub-commando. /pgp disable [jid] Uitzetten van PGP versleuteling voor jid (of de actieve buddy) /pgp enable [jid] Activeren van PGP versleuteling voor jid (of de actieve buddy) /pgp [+|-]force [jid] PGP versleuteling afdwingen, zelfs voor offline berichten, en ga er altijd vanuit dat de ontvanger PGP versleuteling ondersteunt. Indien een bericht niet kan worden versleuteld (ontbrekende sleutel of sleutel id), zal het niet verstuurd worden. Deze optie wordt genegeerd indien PGP versleuteling is uitgezet. /pgp info [jid] Toon de huidige PGP instellingen voor de buddy /pgp setkey [jid [key]] Stel de PGP sleutel om te gebruiken voor het versleutelen van berichten voor de buddy. Indien geen sleutel wordt opgegeven, wordt de actieve sleutel gewist. Je kunt de verkorte schrijfwijze "." gebruiken voor de actieve buddy. mcabber-0.10.2/doc/help/nl/hlp_quit.txt000066400000000000000000000001101216603513500176530ustar00rootroot00000000000000 /QUIT Dit commando sluit alle verbindingen af en beëindigt mcabber. mcabber-0.10.2/doc/help/nl/hlp_rawxml.txt000066400000000000000000000004751216603513500202210ustar00rootroot00000000000000 /RAWXML send string Verstuur "string" (raw XML formaat) naar de Jabber server. De aangegeven string wordt op geen enkele wijze gecontroleerd. PAS OP! Gebruik dit alleen indien je weet wat je doet, je kunt hiermee de verbinding abrupt beëindigen. Voorbeeld: "/rawxml send away" mcabber-0.10.2/doc/help/nl/hlp_rename.txt000066400000000000000000000003211216603513500201440ustar00rootroot00000000000000 /RENAME naam Hernoem de actieve buddy of groep in de aangegeven "naam". Indien '-' wordt gebruikt als 'naam', wordt die uit het roster verwijderd (en mcabber zal vervolgens de JID of gebruikersnaam tonen). mcabber-0.10.2/doc/help/nl/hlp_request.txt000066400000000000000000000011571216603513500203750ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Verstuur een "IQ" verzoek naar de actieve buddy, danwel naar het aangegeven Jabber account. Indien de resource niet wordt aangegeven bij de jid, zal mcabber het verzoek verzenden aan alle voor dit account bekende resources. /request last Verzoek "last" informatie (normalerwijs 'inactieve' tijd) /request ping Stuur een XMPP Ping verzoek. Gebruik hier de volledige JID omdat een ping naar de kale JID wordt afgehandeld door de server. /request time Vraag de buddy om de tijd /request vcard Vraag een VCard van de buddy /request version Vraag de versie op van de buddy mcabber-0.10.2/doc/help/nl/hlp_room.txt000066400000000000000000000056511216603513500176640ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [waarde] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Het 'room' commando verzorgt de Multi-User Chat (MUC) room acties. /room join [ruimte [nick [wachtwoord]]] Betreed chatroom "ruimte", met "nick" als je nickname. Indien geen nickname wordt aangegeven (of als dat een lege string is: ""), wordt de waarde voor de "nickname" configuratie-optie gebruikt (zie het voorbeeld configuratie bestand). Indien de actieve selectie door mcabber correct als een chatroom wordt herkend, kan de verkorte schrijfwijze "." worden gebruikt in plaats van de volledige naam van de chatroom. Een wachtwoord kan worden meegegeven voor beschermde chatrooms. Plaats aanhalingstekens om je nickname indien die spaties bevat. /room leave [bericht] Verlaat de huidige chatroom, met eventueel achterlaten van "bericht" /room names [--detail|--short|--quiet|--compact] Toon de leden van de huidige chatroom /room nick nieuwenick Verander je nickname in de huidige chatroom /room privmsg nick bericht Verstuur privé bericht "bericht" aan "nick" /room remove Verwijdert de huidige chatroom van het roster (je moet deze chatroom tevoren hebben verlaten) /room topic -|nieuwonderwerp Stel een nieuw onderwerp in voor de huidige chatroom (Het onderwerp wordt gewist indien '-' wordt gebruikt voor "nieuwonderwerp") /room unlock Ontsluit de huidige chatroom (indien je de eigenaar bent) /room destroy [reden] Vernietig de huidige chatroom (gebruik dit voorzichtig!) /room whois nick Toon MUC informatie over "nick" /room ban jid [reden] Verban jid uit de huidige chatroom /room unban jid Verwijder de ban van jid in de huidige chatroom /room invite jid [reden] Nodig jid uit in de huidige chatroom /room kick nick [reden] Schop "nick" uit de huidige chatroom /room role jid role [reden] Verander jid's rol (rol kan zijn: "none", "visitor", "participant", "moderator") /room affil jid affil [reden] Verander jid's verbintenis (affil kan zijn: "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [waarde] Verander instellingen voor de huidige chatroom Voor print_status zijn de mogelijke waarden "default", "none", "in_and_out", "all". Voor auto_whois zijn de mogelijke waarden "default", "off", "on". Voor flag_joins zijn de mogelijke waarden "default", "none", "joins", "all". Indien de waarde gelijk is aan "default" worden de waarden gebruikt van de opties muc_print_status, muc_auto_whois en muc_flag_joins. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Toevoegen, verwijderen of aanpassen van een bookmark (standaard is toevoegen). Indien 'autojoin' actief is, zal mcabber automatisch de MUC chatroom betreden wanner het verbinding met de server heeft gemaakt. Om de list met bookmarks te zien, kan het commando `/room bookmark` in de status buffer worden gebruikt. mcabber-0.10.2/doc/help/nl/hlp_roster.txt000066400000000000000000000052071216603513500202230ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Het 'roster' commando bewerkt het roster ofwel de buddy-lijst. Dit zijn de beschikbare parameters: /roster bottom Spring naar het eind van het roster /roster top Spring naar het begin van het roster /roster up [n] Beweeg omhoog in het roster /roster down [n] Beweeg omlaag in het roster /roster group_prev Spring naar de voorgaande groep in het roster /roster group_next Spring naar de volgende groep in het roster /roster alternate Spring naar de buddy met wie je het laatst gesproken hebt in chat mode. Dit commando is dus erg bruikbaar na een commando als "/roster unread_next" (Ctrl-q). /roster unread_first Spring naar het eerste ongelezen bericht /roster unread_next Spring naar het volgende ongelezen bericht /roster search bud Zoek naar een buddy in wiens naam of jid het woord "bud" voorkomt (zoekt enkel in de zichtbare buddylijst) /roster display [mask] Toon het roster filter of pas het aan. Het masker moet de snelkoppelings-letters bevatten van de status die je wilt zien ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). Bij voorbeeld "ofdna" om enkel de ingelogde buddies te tonen. "*" kan worden gebruikt om alle contacten te tonen. /roster hide_offline Verberg offline buddies (zelfde als /roster display ofdna) /roster show_offline Toon offline buddies (zelfde als /roster display ofdna_) /roster toggle_offline Schakel het aanzicht van offline buddies om (tonen/verbergen) /roster item_lock [jid] Bevries jid zodat deze zichtbaar blijft ongeacht diens status /roster item_unlock [jid] Maak het effect van 'item_lock' ongedaan /roster item_toggle_lock [jid] /roster hide Verberg het roster zodat het chat venster de volle breedte kan beslaan /roster show Toon het roster /roster toggle Schakel de zichtbaarheid van het roster om (tonen/verbergen) /roster note [-|tekst] Instellen/aanpassen/verwijderen van een notitie. Indien geen "tekst" is meegegeven, wordt de notitie getoond die behoort bij de actieve jid -- wanneer je in de status buffer staat worden alle notities weergegeven. Indien de tekst "-" is, wordt de notitie gewist. /roster resource_lock [full jid|resource] Set active resource for a buddy in roster. Accepts special jid "./resource" for current buddy, or just a resource name. /roster resource_unlock [jid] Unset active resource for a buddy. Accepts special jid "." for current buddy. mcabber-0.10.2/doc/help/nl/hlp_say.txt000066400000000000000000000005171216603513500175000ustar00rootroot00000000000000 /SAY [-n|-h|--] tekst Verstuur het "tekst" bericht naar de actieve buddy. Dit kan bruikbaar zijn wanneer je een bericht wilt verzenden dat met een '/' begint. De "-n" vlag verandert het bericht in het type "normaal", "-h" to "koptekst" ('headline'). "--" kan gebruikt worden om een bericht te verzenden dat begint met '-n' of '-h'. mcabber-0.10.2/doc/help/nl/hlp_say_to.txt000066400000000000000000000016021216603513500201760ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f file] jid tekst Verstuur het "tekst" bericht naar de gespecificeerde jid. Let op dat dit commando geen standaard resource instelt voor een contact. Als je meerdere berichten aan een specifieke resource wilt versturen moet "/say_to" voor ieder bericht worden gebruikt. De "-n" vlag schakelt het bericht naar type "normaal", "-h" naar "koptekst" ('headline'). "--" kan gebruikt worden om chatberichten te versturen die beginnen met -n of -h. Wanneer "-q" wordt gebruikt, zal het bericht in de achtergrond worden verstuurd, en zal het huidige actieve venster niet veranderen. The option "-e" enables interpretation of the strings "\n" and "\t". This flag has no effect if the text comes from a file with option "-f". Een tekstbestand kan worden aangegeven met de "-f" vlag (in dat geval is het natuurlijk niet nodig om een tekst-argument na de 'jid' mee te geven). mcabber-0.10.2/doc/help/nl/hlp_screen_refresh.txt000066400000000000000000000000571216603513500217000ustar00rootroot00000000000000 /SCREEN_REFRESH Ververs het mcabber scherm. mcabber-0.10.2/doc/help/nl/hlp_set.txt000066400000000000000000000002271216603513500174750ustar00rootroot00000000000000 /SET [option [= value]] Tonen of instellen van de waarde van een optie. Zonder argumenten toont dit een lijst met alle 'set' opties en hun waarden. mcabber-0.10.2/doc/help/nl/hlp_source.txt000066400000000000000000000002021216603513500201730ustar00rootroot00000000000000 /SOURCE tekst-patroon Lees configuratie-bestanden in, die voldoen aan het tekst-patroon (gesorteerd op alfabetische volgorde). mcabber-0.10.2/doc/help/nl/hlp_status.txt000066400000000000000000000013121216603513500202210ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|StatusBericht]] /STATUS message -|StatusBericht Tonen of instellen van de huidige status. Indien geen status wordt gespecificeerd, wordt de huidige status getoond. Indien een statusbericht wordt gespecificeerd, zal dat voorrang hebben op de message* variablelen (deze variabelen kunnen worden ingesteld in het configuratiebestand). Indien geen relevante message* variabelen ingesteld zijn en er geen statusbericht wordt meegegeven, blijft het huidige statusbericht behouden. Indien het StatusBericht "-" is, wordt het huidige statusbericht gewist. Met het "/status message" commando, zal mcabber het statusbericht aanpassen terwijl de status onveranderd blijft. mcabber-0.10.2/doc/help/nl/hlp_status_to.txt000066400000000000000000000007301216603513500207260ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [StatusBericht] /STATUS_TO jid message StatusBericht Verstuur de aangegeven status naar het gespecificeerde Jabber account. Indien de gespecificeerde jid "." is, wordt de actieve buddy gebruikt. NB: deze status wordt overschreven door latere "/status" commando's. Als de "auto-away" optie actief is, zal de status ook overschreven worden. NB: De jid kan een resource bevatten (bijvoorbeeld account@server/resource). mcabber-0.10.2/doc/help/nl/hlp_version.txt000066400000000000000000000000601216603513500203620ustar00rootroot00000000000000 /VERSION Toon de huidige versie van mcabber. mcabber-0.10.2/doc/help/pl/000077500000000000000000000000001216603513500152775ustar00rootroot00000000000000mcabber-0.10.2/doc/help/pl/hlp.txt000066400000000000000000000007431216603513500166270ustar00rootroot00000000000000 /HELP [polecenie|+temat] Wyświetla pomoc dotyczącą danego polecenia lub tematu. Jeśli nie podano żadnego argumentu, zostanie wyświetlona pomoc o sposobie użycia. Dostępne polecenia: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/pl/hlp_add.txt000066400000000000000000000007221216603513500174340ustar00rootroot00000000000000 /ADD [jid [nickname]] Dodaje "jid" użytkownika Jabbera do naszego rostera (grupa domyślna) i wysyła powiadomienie żądania do danej osoby. Jeśli nie podano pseudonimu, zostanie użyty jid danej osoby. Jeśli nie podano jid (podano pustą nazwę "") lub jeśli podany jid to ".", zostaną użyte dane aktualnie zaznaczonej osoby. /add [jid [nickname]] Dodaje do naszego rostera "jid" z pseudonimem "nickname" Przykład: "/add ktoś@jabber.serwer.pl Ktoś" mcabber-0.10.2/doc/help/pl/hlp_alias.txt000066400000000000000000000007151216603513500177770ustar00rootroot00000000000000 /ALIAS [nazwa [= polecenie]] Polecenie to pozwala dodawać aliasy, które sprawiają, że używanie długich i skomplikowanych poleceń staje się łatwiejsze. Możesz zarządzać aliasami w następujący sposób: /alias Wypisuje aktualnie zdefiniowane aliasy /alias nazwa Wypisuje wartość aliasu "nazwa" /alias nazwa= Usuwa alias "nazwa" /alias name = polecenie Ustawia alias "nazwa" z wartością "polecenie" Przykład: "/alias away = status away" mcabber-0.10.2/doc/help/pl/hlp_authorization.txt000066400000000000000000000013111216603513500215770ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] To polecenie zarządza subskrypcjami dostępności: pozwala na żądanie subskrypcji dostępności od innych osób z Twojego rostera oraz pozwala kontrolować kto może otrzymać Twoją subskrypcję. Jeśli nie podano JID, użyta zostanie aktualnie zaznaczona osoba. /authorization allow Pozwala danej osobie na otrzymywanie informacji o Twojej dostępności /authorization cancel Anuluje danej osobie otrzymywanie informacji o Twojej dostępności /authorization request Wysyła żądanie subskrypcji dostępności do danej osoby /authorization request_unsubscribe Wysyła żądanie usunięcia Twojej subskrypcji dostępności do danej osoby mcabber-0.10.2/doc/help/pl/hlp_bind.txt000066400000000000000000000014711216603513500176220ustar00rootroot00000000000000 /BIND [kod_klawisza [= polecenie]] Podpięcie polecenia do klawisza podanego jako [kod_klawisza]. Aby sprawdzić, które klawisze nie są używane naciśnij dany klawisz, a następnie zobacz co zostanie wypisane w oknie logowania 'mcabber'. Na przykład: "Unknown key=265" oznacza że możesz podpiąć polecenie pod klawisz #265. /bind Wyświetla wszystkie aktualnie zdefiniowane podpięcia /bind kod_klawisza Wyświetla polecenie, które jest podpięte do danego klawisza /bind kod_klawisza= Usuwa podpięcie do danego klawisza /bind kod_klawisza = polecenie Podpina "polecenie" do klawisza o kodzie "kod klawisza" Przykład: "/bind 265 = status away" (265 to klawisz F1). Uwaga: kody klawiszów mogą być różne w zależności od konfiguracji ncurses. Podpowiedź: zamiast poleceń mogą być używane aliasy. mcabber-0.10.2/doc/help/pl/hlp_buffer.txt000066400000000000000000000033251216603513500201570ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save filename Polecenie pozwalające zarządzać buforem rozmowy. Dzięki niemu możemy np. przeszukać bufor rozmowy w poszukiwaniu podanego wyrazu, możemy wyczyścić zawartość bufora itp. /buffer clear Czyści okno rozmowy /buffer close Czyści cały bufor rozmowy i zamyka aktualne okno z rozmową /buffer close_all Czyści wszystkie bufory rozmów i zamyka okna z rozmowami /buffer purge Czyści okno rozmowy i usuwa całą zawartość bufora rozmowy /buffer list Wyświetla liste wszystkich istniejących buforów, podając ich długość (linie/bloki) /buffer top Skacze na sam początek bufora rozmowy /buffer bottom Skacze na sam koniec bufora rozmowy /buffer up [n] Przesuwa bufor o "n" linijek do góry (domyślnie: pół ekranu) /buffer down [n] Przesuwa bufor o "n" linijek w dół (domyślnie: pół ekranu) /buffer date "data" Skacze do pierwszej linijki, która posiada datę "data" w buforze rozmowy (format daty: "YYYY-mm-dd") /buffer % n Skacze do pozycji %n w buforze rozmowy /buffer readmark Jump to the readmark (first unread line), if there is one /buffer search_backward tekst Szuka w tył "tekst" w aktualnym buforze rozmowy /buffer search_forward tekst Szuka w przód "tekst" w aktualnym buforze rozmowy /buffer scroll_lock Blokuje możliwość przesuwania tekstu w buforze /buffer scroll_unlock Odblokowuje możliwość przesuwania tekstu w buforze /buffer scroll_toggle Zmienia stan (blokowanie/odblokowanie) przesuwania w buforze /buffer save filename Zapisuje zawartość aktualnego bufora do pliku o nazwie "filename" mcabber-0.10.2/doc/help/pl/hlp_chat_disable.txt000066400000000000000000000001621216603513500213040ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Wyłączenie trybu rozmowy. Użycie --show-roster wyłącza tryb pełnoekranowy. mcabber-0.10.2/doc/help/pl/hlp_clear.txt000066400000000000000000000001301216603513500177630ustar00rootroot00000000000000 /CLEAR Polecenie to jest aliasem dla "/buffer clear". Czyści aktualne okno rozmowy. mcabber-0.10.2/doc/help/pl/hlp_color.txt000066400000000000000000000036421216603513500200260ustar00rootroot00000000000000 /COLOR roster (status wildcard (color|-)|clear) /COLOR mucnick nick (color|-) /COLOR muc (jid|.|*) [on|preset|off|-] Polecenie 'color' pozwala zarządzać kolorami ekranu w sposób dynamiczny. /color roster clear Usuwa wszystkie reguły w rosterze. Kolory wszystkich elementów rostera zostaną ustawione na kolor domyślny. /color roster status wildcard color Ustawia regułe koloru (lub nadpisuje, jeśli już taka istnieje). 'status' to ciąg znaków określający jakie statusy elementów rostera mają być dopasowane (np. 'o' oznacza wszystkich o statusie 'online'). '*' oznacza wszystkie statusy. 'wildcard' to zakres JIDów do dopasowania (np. mikael*) 'color' to kolor, którego chcemy użyć. Jeśli 'color' ustawimy na wartość -, reguła jest usuwana. Jeśli więcej niż jedna reguła pasuje, wybierany jest kolor z ostatnio stworzonej (nie nadpisanej) reguły. /color mucnick nick (color|-) Ustawia kolor dla danego nicka. Jeżeli MUC jest w trybie kolorowania nicków(patrz niżej) ten kolor zostanie użyty. Ustawienie 'color' na wartość - oznacza automatyczne kolorowanie, co oznacza, że kolor nie będzie użyty w trybie kolorowania 'preset' ale pozostanie taki sam w trybie kolorowania 'on'. /color muc (jid|.|*) [on|preset|off|-] Ustawia tryb kolorowania MUCa. Jeżeli zostanie podany 'jid' ('.' oznacza aktualnie wybrany) - tryb zostanie ustawiony dla konkretnego MUCa. Jeżeli zostanie użyta wartość '*' tryb zostanie ustawiony dla wszystkich MUCów, wyłączając te ustawione przez 'jid'. Tryb 'on' koloruje wszystkie nicki. Tryb 'preset' tylko te ręcznie ustawione przez polecenie /color mucnick, 'off' natomiast wyłącza kolorowanie. Tryb 'on' ustawiany jest domyślnie(jeżeli nie zostanie podany żaden z powyższych). Tryb '-' usuwa ustawienia trybu dla danego 'jid', co oznacza, że użyty zostanie dla niego tryb globalny. Trybu globalnego nie można usunąć. Domyślny tryb globalny to 'off'. mcabber-0.10.2/doc/help/pl/hlp_connect.txt000066400000000000000000000000671216603513500203370ustar00rootroot00000000000000 /CONNECT Ustanawia połączenie z serwerem Jabbera. mcabber-0.10.2/doc/help/pl/hlp_del.txt000066400000000000000000000001771216603513500174540ustar00rootroot00000000000000 /DEL Usuwa aktualnie zaznaczoną osobę z rostera, usuwa subskrypcję powiadomienia dostępności u danej osoby oraz u nas. mcabber-0.10.2/doc/help/pl/hlp_disconnect.txt000066400000000000000000000003101216603513500210260ustar00rootroot00000000000000 /DISCONNECT Przerywa połączenie z serwerem Jabbera. Uwaga: roster dostępny jest tylko gdy połączenie do serwera jest aktywne, zatem jeżeli nie jesteś połączony lista kontaktów jest pusta.mcabber-0.10.2/doc/help/pl/hlp_echo.txt000066400000000000000000000000751216603513500176230ustar00rootroot00000000000000 /ECHO wiadomość Wypisuje "wiadomość" oknie logowania. mcabber-0.10.2/doc/help/pl/hlp_event.txt000066400000000000000000000014651216603513500200320ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [argumenty zdarzenia] /EVENT list Zarządza oczekującymi zdarzeniami. Jeżeli pierwszy parametr to '*', polecenie będzie dotyczyło wszystkich oczekujących zdarzeń. Argumenty zdarzenia będą interpretowane na zasadach zdarzenie-do-zdarzenia. Jedyny wbudowany przypadek: w momencie odrzucania zaproszenia (reject) - argument, o ile występuje zostanie zinterpretowany jako powód odrzucenia. /event #N|* accept [argumenty zdarzenia] Zdarzenie o podanym numerze (#N) lub wszystkie (*) będą akceptowane /event #N|* ignore [argumenty zdarzenia] Zdarzenie o podanym numerze (#N) lub wszystkie (*) będą ignorowane /event #N|* reject [argumenty zdarzenia] Zdarzenie o podanym numerze (#N) lub wszystkie (*) będą odrzucane /event list Wyświetla listę oczekujących zdarzeń mcabber-0.10.2/doc/help/pl/hlp_group.txt000066400000000000000000000005431216603513500200410ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] To polecenie pozwala zarządzać sposobem wyświetlania grupy. /group fold [groupname] Zwija obecne drzewo grupy w liście kontaktów /group unfold [groupname] Rozwija obecne drzewo grupy w liście kontaktów /group toggle [groupname] Przełącza między stanem (zwinięty/rozwinięty) w obecnym drzewie grupy mcabber-0.10.2/doc/help/pl/hlp_help.txt000066400000000000000000000001421216603513500176300ustar00rootroot00000000000000 /HELP [polecenie|+temat] Wyświetla pomoc dla polecenia "polecenie". Przykład: "/help buffer" mcabber-0.10.2/doc/help/pl/hlp_iline.txt000066400000000000000000000047001216603513500200040ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Polecenia do zarządzania linią komend. /iline fchar Przechodzi do następnego znaku /iline bchar Przechodzi do poprzedniego znaku /iline char_fdel Usunięcie znaku z aktualnej pozycji kursora /iline char_bdel Usunięcie znaku przed aktualną pozycją kursora /iline char_swap Zamiana znaków /iline fword Przesuwa kursor na koniec aktualnego lub następnego wyrazu /iline bword Przesuwa kursor na początek aktualnego lub poprzedniego wyrazu /iline word_bdel Kasuje wyraz od aktualnej pozycji kursora do jego początku /iline word_fdel Kasuje wyraz od aktualnej pozycji kursora do jego końca /iline word_upcase Zamienia wszystkie litery na wielkie w aktualnym wyrazie /iline word_downcase Zamienia wszystkie litery na małe w aktualnym wyrazie /iline word_capit Zamienia pierwszą literę w wyrazie na dużą, a resztę na małe. /iline hist_beginning_search_bwd Szuka wstecz w historii linii zaczynającej się od aktualnego wyrazu aż do pozycji kursora (pozycja kursora nie zmienia się) /iline hist_beginning_search_fwd Szuka naprzód w historii linii zaczynającej się od aktualnego wyrazu aż do pozycji kursora (pozycja kursora nie zmienia się) /iline hist_prev Poprzednia linia z historii /iline hist_next Następna linia z historii /iline iline_start Przechodzi na początek linii /iline iline_end Przechodzi na koniec linii /iline iline_fdel Kasuje znaki od aktualnej pozycji kursora do końca linii /iline iline_bdel Kasuje znaki od początku linii do aktualnej pozycji kursora /iline iline_accept Akceptuje wprowadzoną linię /iline iline_accept_down_hist Akceptuje linie i wstawia następną z historii do linii komend /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). /iline clear_history Clear the command line history /iline compl_do Dopełnia aktualne słowo w linii komend /iline compl_cancel Anuluje dopełnienie /iline send_multiline Wysyła/przerywa tworzenie wiadomości wielolinijkowej mcabber-0.10.2/doc/help/pl/hlp_info.txt000066400000000000000000000003261216603513500176370ustar00rootroot00000000000000 /INFO Wyświetla informacje o zaznaczonym elemencie (użytkownik, agent, grupa...) Dla użytkowników, zasoby wyświetlane są wraz ze statusem, priorytetem oraz z opisem (jeśli dostępny) dla każdego zasobu. mcabber-0.10.2/doc/help/pl/hlp_module.txt000066400000000000000000000012271216603513500201720ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Włącza, wyłącza lub wyświetla informacje o module. /module load [-f] module Włącza wskazany moduł. Jeżeli wywołano z flagą -f, większość błędów ładowania modułu zostanie zignorowanych. /module unload [-f] module Wyłącza wskazany moduł. Uwaga: Użycie flagi -f nie spowoduje usunięcia zależności od modułu! /module info module Wyświetla dostępne informacje na temat modułu. /module [list] Wyświetla moduły w postaci: [nazwa modułu] [liczba odwołań] ([Załadowany ręcznie/automatycznie]) [dodatkowe informacje takie jak wersja, zależności modułu] mcabber-0.10.2/doc/help/pl/hlp_move.txt000066400000000000000000000005201216603513500176460ustar00rootroot00000000000000 /MOVE [nazwa grupy] Przenosi aktualną osobę do grupy "nazwa grupy". Jeśli nie podano nazwy grupy, wtedy osoba jest przenoszona do grupy domyślnej. Jeśli grupa "nazwa grupy" nie istnieje, zostaje utworzona. Podpowiedź: jeśli jest włączony tryb czatu, możesz użyć "/roster alternate" aby skoczyć do przeniesionej osoby. mcabber-0.10.2/doc/help/pl/hlp_msay.txt000066400000000000000000000027671216603513500176700ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Wysyła wiadomość złożoną z wielu linii. By napisać pojedynczą wiadomość złożoną z kilku linii, należy użyć trybu wielo-linijkowego. W trybie wielolinijkowym, każda wpisana linia (oprócz linii komend) będzie dodana do wielolinijkowej wiadomości. Kiedy wiadomość jest gotowa, może być wysłana do aktualnie zaznaczonej osoby za pomocą polecenia "/msay send". 'begin' włącza tryb wielolinijkowy. Pozwala to na dodanie tematu do wiadomości. Tryb 'verbatim' umożliwia wpisywanie linii zaczynających się od ukośnika '/'. Tylko polecenie "/msay" (z parametrami send lub abort) może być użyte aby wyjść z trybu 'verbatim'. 'toggle' może zostać przypisana do klawisza w celu szybkiego przełączania trybów (np. "bind M13 = msay toggle" pozwoli na przełączanie trybów kombinacją klawiszy Meta-Enter) /msay begin [temat] Zaczyna redagowanie nowej wiadomości wielolinijkowej o temacie "temat" /msay verbatim Wchodzi w tryb pozwalający na wpisywanie linii zaczynających się od ukośnika /msay send [-n|-h] Wysyła wiadomość do aktualnie wybranej osoby /msay send_to [-n|-h] jid Wysyła wiadomość do osoby z jabber id "jid" /msay toggle|toggle_verbatim Włącza/wyłącza tryb wielolinijkowy (begin/send) /msay abort Opuszcza tryb wielolinijkowy bez wysyłania wiadomości Flagi -n oraz -h tworzą odpowiednio wiadomość typu "normal" (normalna) oraz "headline" (nagłówek). Domyślny typ wiadomości to "chat". mcabber-0.10.2/doc/help/pl/hlp_otr.txt000066400000000000000000000020501216603513500175040ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Wartość "." może być używana jako skrót oznaczający aktualnie wybrany kontakt. /otr key Wyświetla odcisk twojego klucza prywatnego w oknie statusu /otr start [jid] Tworzy kanał OTR dla podanego jid (lub aktualnie wybranego) /otr stop [jid] Zamyka kanał OTR dla podanego jid (lub aktualnie wybranego) /otr info [jid] Wyświetla aktualny status OTR dla podanego jid (lub aktualnie wybranego kontaktu) /otr fingerprint [jid [fpr]] Wyświetla aktywny odcisk kanału OTR. Jeżeli podano odcisk zamiast 'fpr' stanie się on zaufany. Jeżeli 'fpr' zostanie ustawione na przypadkowy ciąg znaków skrót utraci status zaufanego. /otr smpq [jid] secret Inicjuje protokół "Socialist Millionaires Protocol" dla jid ze wskazanym 'secret' /otr smpr [jid] secret Odpowiada na żądanie "Socialist Millionaires Protocol" używając 'secret' oraz podanego jid /otr smpa [jid] Zakończ działanie protokołu "Socialist Millionaires Protocol" mcabber-0.10.2/doc/help/pl/hlp_otrpolicy.txt000066400000000000000000000025531216603513500207340ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Wartość "." może być używana jako skrót oznaczający aktualnie wybrany kontakt. /otrpolicy Wyświetla ustawienia polityki OTR w buforze statusu. /otrpolicy (default|jid) (plain|manual|opportunistic|always) Ustawia politykę OTR (domyślną lub dla podanego "jid"). Wartość 'plain' nie powinna być używana, gdyż uniemożliwia otrzymywanie i wysyłanie zaszyfrowanych wiadomości OTR. Jeżeli zostanie wybrana wartość 'manual', ty albo twój rozmówca musi jawnie rozpocząć (np. poleceniem /otr start) szyfrowanie OTR. Wartość 'opportunistic' powoduje automatyczne włączenie szyfrowania OTR w przypadku klientów, które na to pozwalają(wysyłana jest specjalna sekwencja znaków na końcu nieszyfrowanej wiadomości, by to sprawdzić). Należy zauważyć, że w tym trybie pierwsza wiadomość będzie zawsze nieszyfrowana. W przypadku wybranej wartości 'always' wszystkie wysyłane wiadomości będą szyfrowane. W momencie wysłania pierwszej wiadomości niezaszyfrowanej mcabber spróbuje utworzyć kanał OTR. Gdy otrzymasz wiadomość, że kanał został utworzony, prześlij pierwszą wiadomość jeszcze raz. Jeżeli w tym trybie ktoś będzie wysyłał do ciebie wiadomości nieszyfrowanym tekstem, będziesz mógł je odczytać, ale nie zostaną one zapisane w historii. mcabber-0.10.2/doc/help/pl/hlp_pgp.txt000066400000000000000000000021761216603513500174770ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [key]] Polecenie do zmiany ustawień PGP wybranego "jid" (domyślnie aktualnie wybrany kontakt). Uwaga: szyfrowanie PGP nie będzie użyte jeśli nie zostanie wykryta obsługa PGP po drugiej stronie (nawet jeśli PGP zostanie włączone tym poleceniem). Szyfrowanie PGP można wymusić przełącznikiem "force". /pgp disable [jid] Wyłączenie kodowania PGP dla "jid" (albo dla aktualnie wybranej osoby) /pgp enable [jid] Włączenie kodowania PGP dla "jid" (albo dla aktualnie wybranej osoby) /pgp [+|-]force [jid] Wymusza szyfrowanie PGP, nawet dla wiadomości offline, przyjmuje że odbiorca ma włączoną obsługę PGP. Jeśli wiadomość nie może być zaszyfrowana (brakujący klucz lub id kluczu). Ta opcja jest pomijana gdy obsługa PGP jest wyłączona. /pgp info [jid] Pokazuje aktualne ustawienia PGP dla kontaktu /pgp setkey [jid [key]] Ustawienie klucza PGP dla tego kontaktu w celu kodowania wiadomości. Jeśli nie podano żadnego klucza, obecny klucz jest usuwany. Można podać zamiast jid skrót ".", który zostanie użyty do dodania aktualnie wybranego kontaktu. mcabber-0.10.2/doc/help/pl/hlp_quit.txt000066400000000000000000000001131216603513500176600ustar00rootroot00000000000000 /QUIT Polecenie to zamyka wszystkie połączenia i wychodzi z mcabbera. mcabber-0.10.2/doc/help/pl/hlp_rawxml.txt000066400000000000000000000005011216603513500202110ustar00rootroot00000000000000 /RAWXML send [ciąg znaków] Wysyła "ciąg znaków" (surowy format XML) do serwera Jabbera. Nie ma żadnego sprawdzania składni przed wysłaniem. UWAGA! Używaj tylko wtedy, kiedy wiesz co robisz, ponieważ możesz stracić połączenie z serwerem. Przykład: "/rawxml send away" mcabber-0.10.2/doc/help/pl/hlp_rename.txt000066400000000000000000000003611216603513500201520ustar00rootroot00000000000000 /RENAME nazwa Zmienia nazwę aktualnej osoby lub grupy na "nazwa". Jeżeli jako argument polecenia zostanie podany "-" wcześniejsza nazwa zostanie usunięta z listy kontaktów (mcabber będzie wyświetlał JID lub nazwę użytkownika). mcabber-0.10.2/doc/help/pl/hlp_request.txt000066400000000000000000000012161216603513500203730ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Wysyła zapytanie "IQ" do aktualnie zaznaczonej osoby, albo do wskazanego użytkownika. Jeżeli zasób nie jest podany wraz z JIDem, mcabber wyśle kwerendę do wszystkich mu znanych zasobów tego użytkownika. /request last Żąda "ostatnich" informacji (najczęściej czas bezczynności) /request ping Wysyła żądanie XMPP Ping. Należy użyć pełnego JIDa; żądanie z niepełnym JIDem zostanie obsłużone przez serwer. /request time Żąda zwrócenia jaki jest obecnie czas u danej osoby /request vcard Żąda Vcard od danej osoby /request version Żąda zwrócenia wersji klienta danej osoby mcabber-0.10.2/doc/help/pl/hlp_room.txt000066400000000000000000000053731216603513500176670ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [wartość] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Polecenie 'room' służy do obsługi wieloużytkownikowych chat-room'ów. /room join [pokój [nick [hasło]]] Dołącza do pokoju "pokój" z ksywą "nick". Jeżeli nie ma podanego nicka (albo jeśli jest to pusty ciąg znaków), użyta jest opcja "nickname" z pliku konfiguracyjnego. Jeżeli podany pokój jest prawidłowy, skrót "." może być użyty zamiast pełnego id pokoju. Opcjonalnie można podać hasło "hasło". Jeśli Twój "nick" zawiera spacje - użyj cudzysłowów. /room leave [wiadomość] Opuszcza aktualny pokój. Opcjonalnie można podać wiadomość "wiadomość" /room names [--detail|--short|--quiet] Wyświetla kto jest w pokoju /room nick [nick] Zmienia Twoją ksywę w aktualnym pokoju na "nick" /room privmsg [nick] [wiadomość] Wysyła prywatną wiadomość [wiadomość] do osoby "nick" /room remove Usuwa aktualny pokój z listy kontaktów (musisz najpierw opuścić pokój) /room topic -|newtopic Ustawia temat dla aktualnego pokoju (Użycie "-" spowoduje wyczyszczenie tematu) /room unlock Odblokowuje aktualny pokój (jeśli jesteś jego właścicielem) /room destroy [powód] Niszczy aktualny pokój (używać z rozwagą!) /room whois [nick] Wyświetla informację MUC osoby "nick" /room ban jid [powód] Banuje jid z powodu "powód" (opcjonalnie) /room unban jid Odbanowanie jid z aktualnego pokoju /room invite jid [powód] Zaprasza osobę jid do aktualnego pokoju z powodu "powód" (opcjonalnie) /room kick nick [powód] Wyrzucenie osoby "nick" z aktualnego pokoju z powodu "powód" (opcjonalnie) /room role jid role [powód] Zmienia rolę użytkownika jid (może być: "none", "visitor", "participant", "moderator") /room affil jid affil [powód] Zmienia przynależność jid'a (może być: "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [warotść] Zmienia ustawienia wyświetlania statusów dla aktualnego pokoju. Możliwe wartości dla print_status: "default" (domyślne), "none" (wyłączone), "in_and_out" (wejścia i wyjścia), "all" (wszystkie). Możliwe wartości dla auto_whois: "default" (domyślne), "off" (wyłączone), "on" (włączone). For flag_joins, the possible values are "default", "none", "joins", "all". Jeżeli została wybrana wartość "default", używane są ustawienia muc_print_status / muc_auto_whois / muc_flag_joins. /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Dodaje, usuwa, aktualizuje zakładki (domyślnie dodaje). Jeśli ustawiona jest opcja "autojoin", mcabber automatycznie dołączy do danego MUC po połączeniu z serwerem. mcabber-0.10.2/doc/help/pl/hlp_roster.txt000066400000000000000000000053341216603513500202260ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Polecenie służy do zarządzania listą kontaktów. Dostępne parametry: /roster bottom Skacze na koniec listy kontaktów /roster top Skacze na początek listy kontaktów /roster up [n] Porusza się w górę w liście kontaktów /roster down [n] Porusza się w dół w liście kontaktów /roster group_prev Przejdź do poprzedniej grupy w rosterze /roster group_next Przejdź do następnej grupy w rosterze /roster alternate Skacze do ostatniej osoby, która zmieniła stan z dostępnego na niedostępny. Jest szczególnie przydatna po poleceniach typu "/roster unread_next" (Ctrl-q). /roster unread_first Skacze do pierwszej nieprzeczytanej wiadomości /roster unread_next Skacze do następnej nieprzeczytanej wiadomości /roster search "osoba" Szuka osoby "osoba", lub osoby której nazwa zawiera słowo "osoba" /roster display [mask] Wyświetla lub aktualizuje filtr rostera. "mask" powinna składać się z liter statusu, który ma być wyświetlany (np. [o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_] offline). Na przykład "ofdna" oznacza, że wyświetlani będą tylko połączeni znajomi. "*" może być użyte jako skrót do wyświetlania wszystkich kontaktów /roster hide_offline Ukrywa niedostępnych (działa jak /roster display ofdna) /roster show_offline Pokazuje niedostępnych (działa jak /roster display ofdna_) /roster toggle_offline Włącza/wyłącza wyświetlanie niedostępnych /roster item_lock [jid] Zablokuj wyświetlanie elementu rostera, tak aby był widoczny cały czas (bez względu na jego status) /roster item_unlock [jid] Odblokuj wyświetlanie elementu rostera (działanie odwrotne do /roster item_lock [jid]) /roster item_toggle_lock [jid] Włącz/wyłącz blokowanie wyświetlania elementu rostera /roster hide Ukrywa całą liste kontaktów /roster show Pokazuje listę kontaktów /roster toggle Włącza/wyłącza listę kontaktów /roster note [-|text] Ustawia/aktualizuje/usuwa notatkę o użytkowniku. Jeśli nie podano "text", notka aktualnego elementu jest wyświetlana -- jeśli jesteś w "status buffer", wszystkie notatki są wyświetlane. Jeśli jako "text" podano "-", notatka jest kasowana. /roster resource_lock [full jid|resource] Set active resource for a buddy in roster. Accepts special jid "./resource" for current buddy, or just a resource name. /roster resource_unlock [jid] Unset active resource for a buddy. Accepts special jid "." for current buddy. mcabber-0.10.2/doc/help/pl/hlp_say.txt000066400000000000000000000004671216603513500175060ustar00rootroot00000000000000 /SAY [-n|-h|--] tekst Wysyła wiadomość "tekst" do aktualnie wybranej osoby. Jest użyteczna jeśli chcesz wysłać wiadomość zaczynającą się od ukośnika '/'. Flaga "-n" oraz "-h" pozwala ustawić tryby: "normal" oraz "headline". "--" może zostać użyte gdy wiadomość zaczyna się od -n lub -h. mcabber-0.10.2/doc/help/pl/hlp_say_to.txt000066400000000000000000000014541216603513500202050ustar00rootroot00000000000000 /SAY_TO [-h|-h] [-e] [-q] [-f file] jid tekst Wysyła wiadomość "tekst" do podanej osoby "jid". Polecenie nie ustawia domyślnego zasobu dla kontaktu, więc jeżeli chcesz wysłać kilka wiadomości do konkretnego zasobu, musisz użyć "/say_to" dla każdej z wiadomości. Flaga "-n" oraz "-h" pozwala ustawić tryby: "normal" oraz "headline". "--" może zostać użyte gdy wiadomość zaczyna się od -n lub -h. Kiedy "-q" jest użyte, wiadomośc zostanie wysłana w tle i nie zmieni bieżącego aktywnego okna. The option "-e" enables interpretation of the strings "\n" and "\t". This flag has no effect if the text comes from a file with option "-f". Plik zawierający tekst może być podany za pomocą przełącznika "-f" (w tym wypadku, oczywiście nie potrzeba podawać argumentu "tekst" po "jid") mcabber-0.10.2/doc/help/pl/hlp_screen_refresh.txt000066400000000000000000000000561216603513500217010ustar00rootroot00000000000000 /SCREEN_REFRESH Odświeża ekran mcabbera. mcabber-0.10.2/doc/help/pl/hlp_set.txt000066400000000000000000000002561216603513500175010ustar00rootroot00000000000000 /SET [opcja [= wartość]] Wyświetla, lub zmienia wartość opcji "opcja". Jeżeli nie podano argumentów wyświetla listę wszystkich ustawionych opcji i ich wartości. mcabber-0.10.2/doc/help/pl/hlp_source.txt000066400000000000000000000001641216603513500202040ustar00rootroot00000000000000 /SOURCE wzorzec Wczytuje pliki konfiguracyjne, pasujące do podanego wzorca (według kolejności alfabetycznej). mcabber-0.10.2/doc/help/pl/hlp_status.txt000066400000000000000000000011461216603513500202300ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|opis]] /STATUS message -|opis Wyświetla albo zmienia aktualny status. Jeśli nie jest podany opis - zostaje wyświetlony aktualny status. Jeśli podany jest status wraz z opisem, opis ten zastąpi zmienne message* (mogą one być ustawione w pliku konfiguracyjnym). Jeśli zmieniamy status, a nie ma zdefiniowanych zmiennych message*, lub opis nie jest podany - aktualny opis jest zachowywany. Jeżeli "opis" jest równy "-", aktualny opis jest czyszczony. Użycie polecenia "/status message" spowoduje, że mcabber uaktualni opis zachowując bieżący status. mcabber-0.10.2/doc/help/pl/hlp_status_to.txt000066400000000000000000000006271216603513500207350ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [opis] /STATUS_TO jid message opis Wysyła aktualny status do wybranej osoby. Jeśli jako jid podasz ".", aktualnie wybrana osoba zobaczy wybrany status. Porada: to polecenie jest zastępowane przez polecenie "/status". Jeśli używasz auto-away, status także zostanie zastąpiony. Porada: jid może zawierać zasób (np. użytkownik@serwer/zasób). mcabber-0.10.2/doc/help/pl/hlp_version.txt000066400000000000000000000000511216603513500203640ustar00rootroot00000000000000 /VERSION Wyświetla wersję mcabbera. mcabber-0.10.2/doc/help/ru/000077500000000000000000000000001216603513500153125ustar00rootroot00000000000000mcabber-0.10.2/doc/help/ru/hlp.txt000066400000000000000000000011101216603513500166270ustar00rootroot00000000000000 /HELP [command|+topic] Отображает файл помощи о запрошенной команде или топике. Если выполнить без аргументов, будут отображены допустимые команды. Допустимые команды: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/ru/hlp_add.txt000066400000000000000000000014501216603513500174460ustar00rootroot00000000000000 /ADD [jid [nickname]] Добавляет "jid" пользователя Jabber в Ваш список контактов (группа по умолчанию) и отправляет уведомление о подтверждении данному пользователю. Если "jid" не указан (или сторока пуста "") или "jid" указан как "." - используется текущий пользователь. /add [jid [nickname]] Добавляет в список контактов "jid" с указанным именем (nickname) Пример: "/add somebody@jabber.server.com Somebody", где "somebody@jabber.server.com" - "jid" пользователя, "Somebody" - имя пользователя (nickname) в списке контактов. mcabber-0.10.2/doc/help/ru/hlp_alias.txt000066400000000000000000000025141216603513500200110ustar00rootroot00000000000000 /ALIAS [имя [= команды]] Эта команда позволяет добавлять собственные альтернативные команды (обозначить ряд команд (одну команду) под определенным именем, для удобства использования). Вы можете управлять альтернативными командами следующим образом: /alias Выводит список уже определенных альтернативных команд /alias name Выводит значение для альтернативной команды с именем "name" /alias name= Удаляет альтернативную команду с именем "name" /alias name = command line Определяет альтернативную команду с именем "name" и значением "command line" Пример: "/alias away = status away", где "away" - название альтернативной команды (по которой она будет вызываться), "status away" - исполняемая команда, которая определит Ваш статус как "away" (т.е. при выполнении команды "away" - Ваш статус будет сменен на "away") mcabber-0.10.2/doc/help/ru/hlp_authorization.txt000066400000000000000000000023111216603513500216130ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Эта команда управляет уведомлениями о присутствии (статусе) пользователей: она позволяет Вам получать статус пользователей в Вашем списке контактов и позволяет Вам контролировать просмотр Вашего статуса другими пользователями. Если jid пользователя не указан, используется jid текущего пользователя. /authorization allow Позволяет пользователю jabber получать уведомления о Вашем статусе /authorization cancel Отменяет уведомление пользователя jabber о Вашем статусе /authorization request Посылает запрос пользователю jabber на получения уведомлений о его статусе /authorization request_unsubscribe Посылает запрос пользователю jabber на отмену получения уведомлений о его статусе mcabber-0.10.2/doc/help/ru/hlp_bind.txt000066400000000000000000000035621216603513500176400ustar00rootroot00000000000000 /BIND [keycode [= command line]] Присваивает клавише (определяется по ее keycode) определенную команду. Чтобы проверить, какие клавишы в настоящее время не используются, перейдите в "log window" и нажмите клавишу, которую Вы хотите определить для команды. Пример: "Unknown key=265" - это значит, что Вы можете присвоить клавише 265 (F1) свое значение и она не занята. (от переводчика: многие windows manager`ы не очень охотно отдают keycode в терминале, поэтому проще проверять назначена или нет клавиша командой "/bind 'keycode'", если Вы получите в ответ "Key 265 is not bound." - значит клавише не присвоена команда). /bind Выводит список назначенных клавиш и команд /bind keycode Выводит команду, которая назначена на введенный keycode /bind keycode= Отменяет привязку использования команды с введенным keycode /bind keycode = command line Присваивает команду "command line" к клавише с определенным "keycode" Пример: "/bind 265 = status away" (265 стандартно клавиша "F1"). Пояснение: коды клавиш (keycodes) могут отличаться от Ваших, в зависимости от настройки ncurses. Полезно: альтернативные (назначенные) команды также могут использоваться вместо стандартных команд. mcabber-0.10.2/doc/help/ru/hlp_buffer.txt000066400000000000000000000065631216603513500202010ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save filename Команда для управления буфером (от переводчика: историей переписки) с пользователеми jabber. То есть, Вы можете искать текст прямо в буфере (истории переписки), очищать окно чата и т.д. /buffer clear Очищает текущее окно чата /buffer close [jid] Очищает весь контент текущего буфера и закрывает окно чата с текущим пользователем /buffer close_all Очищает весь контент буфера чата и закрывает окно чата /buffer purge [jid] Очищает текущее окно чата и очищает все содержимое буфера (истории переписки) /buffer bottom Перемещает к концу буфера (истории переписки) с текущим пользователем /buffer list Выводит список всех буферов вместе с количеством содержащихся в них строк/блоков. /buffer top Перемещает к началу буфера (истории переписки) с текущим пользователем /buffer up [n] Перемещает на [n] строк вверх в буфере (истории переписки) (по умолчанию: половина экрана) /buffer down [n] Перемещает на [n] строк вниз в буфере (истории переписки) (по умолчанию: половина экрана) /buffer date [date] Перемещает в первой строке после определенной даты [date] в буфере (истории переписки) (формат даты: "год-месяц-день", для примера "2006-01-01") /buffer % n Перемещает на позицию %n в текущем буфере (истории переписки) /buffer readmark Перемещает к разделителю непрочитанных сообщений (если он есть) /buffer search_backward text Ищет введенное значение [text] в текущем буфере (истории переписки) (от переводчика: до текущей позиции) /buffer search_forward text Ищет введенное значение [text] в текущем буфере (истории переписки) (от переводчика: после текущей позиции) /buffer scroll_lock Блокирует скроллинг (прокрутку) буфера (истории переписки) /buffer scroll_unlock Разблокирует скроллинг (прокрутку) буфера (истории переписки) /buffer scroll_toggle Показывает настоящее значение скроллинга (прокрутки) (заблокировано/разблокировано) /buffer save имя_файла Сохраняет содержимое текущего буфера (истории переписки) в файле с указаным именем mcabber-0.10.2/doc/help/ru/hlp_chat_disable.txt000066400000000000000000000002331216603513500213160ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Выключает режим чата. Опция --show-roster отключает полноэкранный режим.mcabber-0.10.2/doc/help/ru/hlp_clear.txt000066400000000000000000000002751216603513500200100ustar00rootroot00000000000000 /CLEAR Эта команда просто альтернативное название (alias) для "/buffer clear". Она очищает текущее окно переписки. mcabber-0.10.2/doc/help/ru/hlp_color.txt000066400000000000000000000055521216603513500200430ustar00rootroot00000000000000 /COLOR список контактов (aka roster) (шаблон статуса (color|-)|clear) /COLOR mucnick ник (color|-) /COLOR muc (jid|.|*) [on|preset|off|-] Команда 'color' позволяет менять параметры цветовой схемы экрана. /color roster clear Удаляет все цветовые схемы для списка контактов. Весь список контактов приобретает цвет по умолчанию. /color roster status wildcard color Устанавливает правило расцветки (или перезаписывает установленное ранее). Статус это строка содержащая все возможные статусы списка контактов, которые могут соответствовать правилу или * для всех статусов. Шаблон (wildcard) это шаблон соответствия, который будет применен к JID. Color - желаемый цвет. Если color задан как -, правило удаляется. Если шаблону соответствует более одного совпадения - используется последний созданый шаблон. /color mucnick nick (color|-) Помечает ник пользователя заданым цветом. Если группа пользователей содержит цветные ники, то цвет изменится на установленный. Если цвет установлен как -, цвет устанавливается как выбраный по умолчанию, это значит, что он будет использоваться в режиме расцветки по умолчанию. /color muc (jid|.|*) [on|preset|off|-] Устанавливает цветовую схему группы пользователей. Если jid ( . означает текущий выбраный jid) указан, то режим будет применен к этому контакту. Если используется * то установка цвета будет применена ко всем спискам. Режим 'on' задает цвета для всех ников. 'preset' только для одного выбраного вручную с помощью /color mucnick команда и режим 'off' убирает все цвета. Если флаг 'off' не указан, то по умолчанию принимается флаг 'on'. Режим '-' удаляет установки с указанного контакта. Вы не можете удалять глобальные режимы расцветки. Режим расцветки по умолчанию находится в режиме 'off'. mcabber-0.10.2/doc/help/ru/hlp_connect.txt000066400000000000000000000001301216603513500203410ustar00rootroot00000000000000 /CONNECT Устанавливает соединение с Jabber-сервером. mcabber-0.10.2/doc/help/ru/hlp_del.txt000066400000000000000000000004161216603513500174630ustar00rootroot00000000000000 /DEL Удаляет текущего пользователя из списка контактов, отключает уведомления о его статусе и отключает уведомления пользователя о вашем статусе. mcabber-0.10.2/doc/help/ru/hlp_disconnect.txt000066400000000000000000000005251216603513500210510ustar00rootroot00000000000000 /DISCONNECT Завершает соединение с Jabber-сервером. Примечание: список контактов доступен только когда соединение с сервером активно, поэтому список контактов пуст при завершении соединения. mcabber-0.10.2/doc/help/ru/hlp_echo.txt000066400000000000000000000001371216603513500176350ustar00rootroot00000000000000 /ECHO сообщение Отображает сообщение в окне с логом. mcabber-0.10.2/doc/help/ru/hlp_event.txt000066400000000000000000000023701216603513500200410ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [дополнительные аргументы] /EVENT list Говорит mcabber`у что делать с событиями. Если первый параметр '*', команда будет применена ко всей очереди событий. Дополнительные аргументы используются в зависимости от типа события. Из встроенных событий единственный случай, когда они используются - это отклонение приглашения в чат, если есть дополнительный аргумент, он будет использован в качестве сообщения о причине отказа. /event #N|* accept [дополнительные аргументы] Событие номер #N/All будет разрешено /event #N|* ignore [дополнительные аргументы] Событие номер #N/All будет проигнорировано /event #N|* reject [дополнительные аргументы] Событие номер #N/All будет отклонено /event list Показать список всех событий mcabber-0.10.2/doc/help/ru/hlp_group.txt000066400000000000000000000015521216603513500200550ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [groupname] Эта команда управляет отображением списка пользователей определенной группы в списке контактов. /group fold [groupname] Сворачивает (закрывает) текущий развернутый список пользователей определенной группы в списке контактов /group unfold [groupname] Разворачивает (раскрывает) текущий свернутый список пользователей определенной группы в списке контактов /group toggle [groupname] Отображает текущее состояние (свернуто\развернуто) списка определенной группы в списке контактов mcabber-0.10.2/doc/help/ru/hlp_help.txt000066400000000000000000000003271216603513500176500ustar00rootroot00000000000000 /HELP [command|+topic] Выводит помощь для указанной команды "command" или темы "topic" Пример: "/help buffer" выводит помощь по команде "buffer" mcabber-0.10.2/doc/help/ru/hlp_iline.txt000066400000000000000000000074251216603513500200260ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Команды строки ввода. /iline fchar Переместиться к следующему символу /iline bchar Переместиться к предыдущему символу /iline char_fdel Удалить символ на позиции курсора /iline char_bdel Удалить символ предшедствующий позиции курсора /iline char_swap Перенести символы /iline fword Переместиться вперед к концу этого или следующего слова /iline bword Переместиться назад к началу этого или предыдущего слова /iline word_bdel Удалить слово с позиции курсора до его начала /iline word_fdel Удалить слово с позиции предшедствующей курсору до его конца /iline word_upcase Перевести слово в верхний регистр с позиции курсора /iline word_downcase Перевести слово в нижний регистр с позиции курсора /iline word_capit Сделать букву на позиции курсора заглавной, остальные до конца слова - строчными /iline hist_beginning_search_bwd Искать в истории (от текущего положения курсора к началу) строку начинающуюся с аналогично введенной (курсор остается на месте) /iline hist_beginning_search_fwd Искать в истории (от текущего положения курсора к концу) строку начинающуюся с аналогично введенной (курсор остается на месте) /iline hist_prev Предыдущая строка истории ввода /iline hist_next Следующая строка истории ввода /iline iline_start Переместиться в начало строки ввода /iline iline_end Переместиться в конец строки ввода /iline iline_fdel Удалить строку с позиции курсора до конца /iline iline_bdel Удалить строку с позиции предшедствующей курсору до начала /iline iline_accept Закончить ввод, отправить строку текущему пользователю /iline iline_accept_down_hist Закончить ввод, отправить строку текущему пользователю, поместить следующую строку истории в строку ввода /iline iline_insert текст Вставить текст в текущей позиции курсора. Заметьте, что кавычки в тексте необходимо обезвредить с помощью '\', а также, что экран не будет обновлен автоматически (используйте /screen_refresh) /iline clear_history Очистить историю команд /iline compl_do Завершить текущее слово в строке ввода /iline compl_cancel Отменить завершение слова /iline send_multiline Послать/завершить многострочное сообщение mcabber-0.10.2/doc/help/ru/hlp_info.txt000066400000000000000000000005441216603513500176540ustar00rootroot00000000000000 /INFO Выводит информацию о выделенном элементе (пользователь, агент, группа...). Для пользователей и ресурсов отображается статус, приоритет и сообщение статуса (если имеется) для каждого ресурса. mcabber-0.10.2/doc/help/ru/hlp_module.txt000066400000000000000000000021211216603513500201770ustar00rootroot00000000000000 /MODULE load|unload [-f] module /MODULE info module /MODULE [list] Загружает, выгружает или показывает информацию о модуле. /module load [-f] module Загружает указаный модуль. Если используется флаг -f, то большинство ошибок при загрузке модуля будут игнорироваться. /module unload [-f] module Выгружает указаный модуль. Примечание: Флаг -f (force) не удаляет зависимости модуля! /module info module Показывает доступную информацию об указаном модуле. /module [list] Отображает модули в формате: [имя_модуля] [количество_ссылок_на_него] ([Manually/Automatically loaded]) (*загружен в ручную или автоматически) [любая дополнительная информация, такакая как версия модуля или зависимости] mcabber-0.10.2/doc/help/ru/hlp_move.txt000066400000000000000000000011041216603513500176600ustar00rootroot00000000000000 /MOVE [groupname] Перемещает пользователя в определенную группу. Если группа не указана, пользователь перещается в группу по умолчанию (default group). Если группа "groupname" не создана, она автоматически создается. Полезно: Если включен режим чата (chatmode), Вы можете использовать "/roster alternate" для перехода к перемещенному пользователю. mcabber-0.10.2/doc/help/ru/hlp_msay.txt000066400000000000000000000053111216603513500176670ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Посылает сообщение, состоящие из большого количества строк. Чтобы написать сообщение из нескольких строк должен использоваться режим поддержки многострочных сообщений 'multi-line mode'. В режиме поддержки многострочных сообщений 'multi-line mode' каждая написанная строка (исключая командные строки) добавляется в тело многострочного сообщения. Когда многострочное сообщение написано, оно может быть отправлено текущему пользователю командой "/msay send". Команда '/msay begin' включает режим многострочного сообщения. Обратите внимание, что может быть указана тема сообщения [subject]. Подкоманда 'verbatim' включает режим стенограммы. Только команда "/msay" (с параметром send или abort) может быть использована для выхода из режима стенограммы (соответственно, для пересылки или отмены сообщения). Подкомандой 'toggle' можно назначить определенную клавишу для быстрого использования многострочного режима 'multi-line mode' (пример: "bind M13 = msay toggle" для переключения режима) /msay begin [subject] Включить многострочный режим 'multi-line mode' /msay verbatim Войти в режим стенограммы многострочного сообщения /msay send [-n|-h] Послать текущее многострочное сообщение текущему пользователю /msay send_to [-n|-h] jid Послать текущее многострочное сообщение определенному пользователю "jid" /msay toggle|toggle_verbatim Переключиться в/из режима 'multi-line mode' (begin/send) /msay abort Выйти из режима многострочного сообщения не отправляя его Флаги -n или -h переключают сообщение в нормальный режим или режим заголовка соответственно, игнорируя установки сообщения "chat" по умолчанию. mcabber-0.10.2/doc/help/ru/hlp_otr.txt000066400000000000000000000027121216603513500175240ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [fpr]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Можно использовать "." для активного контакта. /otr key Выводит отпечаток вашего ключа в Статус бар. /otr start [jid] Открывает канал OTR для указанного контакта (или для текущего). /otr stop [jid] Закрывает OTR канал для указанного или текущего контакта. /otr info [jid] Показывает текущий статус OTR для указанного или текущего контакта. /otr fingerprint [jid [fpr]] Показывает активный отпечаток OTR канала. Если отпечаток предусмотрен вместо "fpr" - отпечаток становится проверенным (надежным). Если заменить "fpr" фиктивной строкой, то отпечаток утратит статус "надежный". /otr smpq [jid] secret Инициирует передачу по SMP протоколу (Socialist Millionaires Protocol) с заданым secret ключом и пользователем. /otr smpr [jid] secret Отвечает на запрос пользователя с заданым secret ключом. /otr smpa [jid] Отключает запущенный SMP протокол. mcabber-0.10.2/doc/help/ru/hlp_otrpolicy.txt000066400000000000000000000044451216603513500207510ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Можно использовать "." для текущего контакта. /otrpolicy Выводит все политики OTR в буффер статуса. /otrpolicy (default|jid) (plain|manual|opportunistic|always) Устанавливает политику по умолчанию или заданую политики относительно указаного контакта Пустая строка политики никогда не должна быть использована, потому что в этом случае у вас не будет возможности отсылать или получать зашифрованные сообщения OTR. Если вы устанавливаете политики вручную, вы или ваш собеседник должны стартовать OTR шифрование вручную (с помощью /otr start). Политика "opportunistic" делает это самостоятельно, посылая специальный набор символов в конце незашифрованного сообщения. Поэтому другие участники чата с включенным OTR знают, что вы хотите использовать OTR. Запомните, что данная политика всегда отсылает первое сообщение в незашифрованном виде. При использовании политики "always" ни одно сообщение не будет отправлено в режиме "просто текст". Если вы попытаетесь отправить первое сообщение в незашифрованном виде, mcabber попробует установить OTR канал. Пожалуйста повторите отправку сообщения после того как получите информацию о том что соединение установлено. Если кто то отправит вам сообщение в режиме "просто текст" вы сможете его прочитать, но оно не будет записано в историю переписки. mcabber-0.10.2/doc/help/ru/hlp_pgp.txt000066400000000000000000000035561216603513500175150ustar00rootroot00000000000000 /PGP disable|enable|info [jid] /PGP setkey [jid [key]] Эта команда управляет настройками PGP для определенного пользователя "jid" (по умолчанию, для текущего контакта). Запомните, что шифрование PGP не может быть использовано, если не обнаружена удаленная поддержка PGP. /pgp disable [jid] Отключает шифрование PGP для пользователя "jid" (или для текущего контакта) /pgp enable [jid] Включает шифрование PGP для пользователя "jid" (или для текущего контакта) /pgp [+|-]force [jid] Принудительное включение PGP шифрования, в том числе для сообщений, отосланых в режиме оффлайн, так же всегда проверяется поддержка PGP получателем. Если сообщение не может быть зашифровано (отсутствует ключ или идентификатор ключа) сообщение не отсылается. Эта опция игнорируется, если поддержка PGP выключена. /pgp info [jid] Показывает текущие настройки PGP для пользователя "jid" /pgp setkey [jid [key]] Устанавливает PGP-ключ, который будет использоваться для шифрования сообщений для данного пользователя. Если PGP-ключ отсутствует, то текущий ключ удаляется. Вы можете использовать сокращенный jid "." для текущего контакта (пользователя). mcabber-0.10.2/doc/help/ru/hlp_quit.txt000066400000000000000000000002021216603513500176720ustar00rootroot00000000000000 /QUIT Эта команда завершает все активные соединения и выходит из mcabber`а. mcabber-0.10.2/doc/help/ru/hlp_rawxml.txt000066400000000000000000000007151216603513500202330ustar00rootroot00000000000000 /RAWXML send string Отправляет строку "string" (в формате XML) на Jabber-сервер. Проверка строки не выполняется. БУДЬТЕ ОСТОРОЖНЫ! Используйте эту команду только если Вы знаете, что делаете или если Вы можете завершить соединение. Пример: "/rawxml send away" mcabber-0.10.2/doc/help/ru/hlp_rename.txt000066400000000000000000000007371216603513500201740ustar00rootroot00000000000000 /RENAME name Переименовывает текущего пользователя или группу в заданное имя "name". Если заданное имя имеет значение "-", то заданное ранее имя текущего пользователя или группы удаляется из списка контактов (mcabber будет отображать JID или имя пользователя по умолчанию). mcabber-0.10.2/doc/help/ru/hlp_request.txt000066400000000000000000000017751216603513500204200ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Отправляет "IQ" запрос текущему или указанному пользователю jabber. Если подобная функция не поддерживается указанным "jid", mcabber пошлет запрос всем известным интерфейсам для данного пользователя. /request last Запрашивает последнюю информацию (обычно: свободное время) /request ping Посылает XMPP запрос "ping". Помните, что Вы должны указывать полное имя JID, потому что запрос будет выполняться непосредственно через сервер. /request time Запрашивает время пользователя /request vcard Запрашивает VCard пользователя /request version Запрашивает пользовательскую версию mcabber-0.10.2/doc/help/ru/hlp_room.txt000066400000000000000000000106021216603513500176710ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [value] /ROOM bookmark [add|del] [-autojoin|+autojoin] [-|nick] Команда 'room' работает с конференциями (Multi-User Chat room). /room join [room [nick [pass]]] Производит подключение к конференции, используя "nick" как имя пользователя. Если имя пользователя не задано (или если оставлено пустым), то используется имя пользователя заданное в конфигурации mcabber`а (смотри файл конфигурации). Если текущая запись корректно распознана mcabber как конференция, сокращение "." может быть использовано вместо полного названия конференции. Пароль может быть предусмотрен для закрытых конференций. Если в Вашем имени пользователя (nickname) содержатся пробелы используйте кавычки "nick". /room leave [message] Покинуть конференцию /room names [--detail|--short|--quiet|--compact] Показать участников текущей конференции /room nick newnick Изменить имя пользователя в текущей конференции /room privmsg nick msg Отправить личное сообщение "msg" пользователю "nick" /room remove Удалить текущую конференцию из списка контактов (Вы должны вначале покинуть конференцию) /room topic -|newtopic Установить тему текущей конференции (Тема очищается если параметр newtopic указан как "-") /room unlock Разблокировать текущую конференцию (если Вы являетесь ее владельцем) /room destroy [reason] Уничтожить текущую конференцию (использовать осторожно!) /room whois nick Показать информацию о пользователе "nick" /room ban jid [reason] Наложить запрет (забанить) пользователя "jid" в текущей конференции /room unban jid Снять бан с пользователя "jid" в текущей конференции /room invite jid [reason] Пригласить пользователя "jid" в текущую конференцию /room kick nick [reason] Исключить пользователя "jid" из текущей конференции /room role jid role [reason] Изменить статус пользователя "jid" (статус может быть "none", "visitor", "participant", "moderator") /room affil jid affil [reason] Принять пользователя "jid" в члены конференции (члены могут быть "none", "member", "admin", "owner") /room setopt print_status|auto_whois|flag_joins [value] Изменяет настройки для текущей конференции (уведомления о событиях в конференции) Для опции "print_status" доступны следующие значения "default", "none", "in_and_out", "all". Для опции "auto_whois" возможные значения "default", "off", "on". Для опции "flag_joins" возможны значения "default", "none", "joins", "all". Когда опция выставлена в "default" используются параметры "muc_print_status" / "muc_auto_whois" / "muc_flag_joins". /room bookmark [add|del] [-autojoin|+autojoin] [-|nick] Добавить, удалить или обновить закладку (по умолчанию: add - добавить) Если включена опция autojoin, mcabber автоматически подключается к конференции после соединения с Jabber-сервером. Чтобы просмотреть список закладок, используйте команду /room bookmark в буфере статуса. mcabber-0.10.2/doc/help/ru/hlp_roster.txt000066400000000000000000000103671216603513500202430ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search bud /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|text] /ROSTER resource_lock|resource_unlock Команда 'roster' управляет Вашим списком контактов. Могут использоваться следующие параметры: /roster bottom Переместиться к концу списка контактов /roster top Переместиться в начало списка контактов /roster up [n] Листать вверх список контактов /roster down [n] Листать вниз список контактов /roster group_prev Переместиться в предыдущую группу пользователей в списке контактов /roster group_next Переместиться в следующую группу пользователей в списке контактов /roster alternate Переместиться на альтернативного пользователю. "Альтернативный пользователь" - это последний пользователь, с которым Вы вели переписку. Эта команда может быть использована после команд наподобие "/roster unread_next" (Ctrl-q). /roster unread_first Переместиться к первому непрочитанному сообшению /roster unread_next Переместиться к следующему непрочитанному сообшению /roster search bud Найти пользователя, чье имя или jid содержить значение "bud" (только в отображаемом списке контактов) /roster display [mask] Просмотреть или обновить список контактов. Маска должна содержать сокращенное значение статуса ([o]nline, [f]ree_for_chat, [d]o_not_disturb. [n]ot_available, [a]way, [_]offline). Пример: "ofdna" отобразит только пользователей, подключенных к jabber. "*" может быть использован для того чтобы отобразить все контакты. /roster hide_offline Скрыть недоступных пользователей /roster show_offline Показать недоступных пользователей /roster toggle_offline Показать значение параметра скрытия недоступных пользователей /roster item_lock [jid] Закрепить пользователя из списка контактов и всегда отображать независимо от его статуса /roster item_unlock [jid] Отменить функцию /roster item_lock /roster item_toggle_lock [jid] Инвертировать текущее значение параметра lock /roster hide Скрыть список контактов (окно чата на весь экран) /roster show Показать список контактов /roster toggle Изменить размер списка контактов /roster note [-|text] Установить обновление\удаление комментариев Если текст не задан, отображается текущий комментарий -- если Вы находитесь в истории переписки, все заметки отображаются. Если текст задан как "-", заметка стирается. /roster resource_lock [full jid|resource] Установить активный ресурс для указанного пользователя. Позволяет использовать формат "./resource" (или просто "resource") для указания текущего пользователя. /roster resource_unlock [jid] Отменить действие /roster resource_lock. Позволяет использовать "." для указания текущего пользователя. mcabber-0.10.2/doc/help/ru/hlp_say.txt000066400000000000000000000006771216603513500175240ustar00rootroot00000000000000 /SAY [-n|-h|--] text Отправляет сообщение "text" текущему пользователю. Команда может быть полезна, если Вы хотите отправить сообщение начинающееся с флеша (/). Флаг "-n" задает сообщению тип "normal", "-h" - заголовок, "--" для отсылки сообщений начинающихся с -n / -h. mcabber-0.10.2/doc/help/ru/hlp_say_to.txt000066400000000000000000000022741216603513500202210ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f file] jid text Отправляет сообщение "text" определенному пользователю "jid". Имейте ввиду, что если Вы хотите отправить несколько сообщений определенному пользователю, данная команда должна вводиться перед каждым сообщением. Флаг "-n" задает сообщению тип "normal", "-h" - заголовок, "--" для отсылки сообщений начинающихся с -n / -h. При заданном флаге "-q" сообщение будет отправлено в фоновом режиме и Вы останетесь в текущем окне переписки. Флаг "-e" разрешает интерпретацию строк "\n" и "\t". Не имеет эффекта, если текст берется из файла с помощью параметра "-f". Флаг "-f" отправит в сообщении содержимое текстового файла (при этом нет необходимости задавать параметр "text"). mcabber-0.10.2/doc/help/ru/hlp_screen_refresh.txt000066400000000000000000000000731216603513500217130ustar00rootroot00000000000000 /SCREEN_REFRESH Обновить экран mcabber'а. mcabber-0.10.2/doc/help/ru/hlp_set.txt000066400000000000000000000003421216603513500175100ustar00rootroot00000000000000 /SET [option [= value]] Отображает или меняет значение опций. Без аргументов выводит список всех установленных опций и их значения. mcabber-0.10.2/doc/help/ru/hlp_source.txt000066400000000000000000000003111216603513500202110ustar00rootroot00000000000000 /SOURCE шаблон Загружает все файлы конфигурации, которые соответствуют данному шаблону (в алфавитном порядке). mcabber-0.10.2/doc/help/ru/hlp_status.txt000066400000000000000000000020061216603513500202370ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|StatusMessage]] /STATUS message -|StatusMessage Отображает или устанавливает текущий статус и сообщение статуса. Если параметры не заданы, то отобразится текущий статус и сообщение статуса. Если сообщение статуса не указано, то оно будет задано согласно списку переменных в файле конфигурации. Если указанный статус не найден в списке переменных, сохранится текущее сообщение статуса. Если "StatusMessage" имеет вид "-", то сообщение статуса будет очищено. Когда команда имеет вид "/status message", устанавливается новое сообщение статуса, а текущий статус сохраняется. mcabber-0.10.2/doc/help/ru/hlp_status_to.txt000066400000000000000000000013251216603513500207440ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [StatusMessage] /STATUS_TO jid message StatusMessage Отправляет запрос на определение статуса определенного пользователя. Если "jid" указан как "." используется текущий пользователь. Замечание: статус будет изменен следующей командой "/status". Если Вы пользуетесь функцией auto-away (автоматическая смена статуса), статус будет изменен также. Замечание: "jid" может быть задан в виде записи user@server/resource mcabber-0.10.2/doc/help/ru/hlp_version.txt000066400000000000000000000001111216603513500203740ustar00rootroot00000000000000 /VERSION Отображает текущую версию mcabber`а. mcabber-0.10.2/doc/help/uk/000077500000000000000000000000001216603513500153035ustar00rootroot00000000000000mcabber-0.10.2/doc/help/uk/hlp.txt000066400000000000000000000010131216603513500166220ustar00rootroot00000000000000 /HELP [команда|+вираз] Друкує допоміжну інформацію про команду або вираз. Без аргументу друкує оце повідомлення. Наявні команди: add, alias, authorization, bind, buffer, chat_disable, clear, color, connect, del, disconnect, echo, event, group, help, iline, info, module, move, msay, otr, otrpolicy, pgp, quit, rawxml, rename, request, room, roster, say_to, say, screen_refresh, set, source, status_to, status, version. mcabber-0.10.2/doc/help/uk/hlp_add.txt000066400000000000000000000012021216603513500174320ustar00rootroot00000000000000 /ADD [jid [прізвисько]] Додає користувача "jid" у загальну групу вашого спису контактів, а також надсилає запит на повідомлення про присутність до цього "jid". Якщо прізвисько не вказане, буде використаний "jid". Якщо "jid" не вказаний (чи "" або "."), береться поточний. /add [jid [прізвисько]] Додає до списку контактів "jid" як "прізвисько" Приклад: "/add somebody@jabber.server.com Дехто" mcabber-0.10.2/doc/help/uk/hlp_alias.txt000066400000000000000000000017211216603513500200010ustar00rootroot00000000000000 /ALIAS [скорочення [= рядок команди]] Ця команда дозволяє спростити складні чи довгі команди, призначивши їм друге ім'я. Керування скороченнми здійснюється командами: /alias Друкує список визначених на даний момент скорочень /alias скорочення Друкує поточне значення "скорочення" /alias скорочення = Вилучає вказане скорочення /alias скорочення = рядок команди Призначає для "рядок команди" інше ім'я "скорочення" Приклад: "/alias кава = status away Пішов варити каву..." Примітка: наразі кириличні скорочення підтримуються лише у однобайтових кодуваннях. mcabber-0.10.2/doc/help/uk/hlp_authorization.txt000066400000000000000000000020111216603513500216010ustar00rootroot00000000000000 /AUTHORIZATION allow|cancel|request|request_unsubscribe [jid] Цією командою можна керувати підпискою на повідомлення про присутність - надсилати запити до інших, а також дозволяти чи забороняти їм отримувати повідомлення про ваш статус. Якщо не вказати "jid", команда працюватиме з поточним. /authorization allow [jid] Дозволяє jid отримувати повідомлення про ваш статус /authorization cancel [jid] Скасовує підписку jid на ваші повідомлення про присутність /authorization request [jid] Надсилає до jid запит на його повідомлення про присутність /authorization request_unsubscribe [jid] Надсилає запит на відписку від повідомлень про присутність jid mcabber-0.10.2/doc/help/uk/hlp_bind.txt000066400000000000000000000021601216603513500176220ustar00rootroot00000000000000 /BIND [код [= рядок команди]] Прив'язує до клавіші з кодом "код" команду "рядок команди". Щоб визначити код клавіші - натисніть її, якщо в віконці стану з'явиться щось на зразок "Unknown key=265", значить клавіша не призначена, і її код 265 (в цьому випадку). /bind Друкує спис поточних призначень. /bind код Друкує призначену цьому коду клавіші команду. /bind код = Скасовує призначення до цього коду. /bind код = рядок команди Прив'язує команду до клавіші із заданим кодом. Приклад: "/bind 265 = status away" (265 - це F1). Примітка: коди можуть відрізнятися в залежності від вашої libncureses. Примітка: визначені вами скорочення теж можуть використовуватися в команді. mcabber-0.10.2/doc/help/uk/hlp_buffer.txt000066400000000000000000000045101216603513500201600ustar00rootroot00000000000000 /BUFFER clear|close|close_all|purge|list /BUFFER top|bottom|date|%|readmark /BUFFER search_backward|search_forward /BUFFER scroll_lock|scroll_unlock|scroll_toggle /BUFFER save назва_файлу Різноманітні операції з буфером розмови. Наприклад, ви можете шукати деякий текст в буфері, очистити вікно розмови, ітп. /buffer clear Очистити поточне вікно діалогу. /buffer close [jid] Закрити вікно діалогу і витерти вміст буферу на додачу. /buffer close_all Потерти всі буфери з пам'яті і позакривати вікна діалогу. /buffer purge [jid] Очистити вікно діалогу а також потерти його вміст з пам'яті. /buffer list Показати перелік усіх відкритих буферів та їх розмір (рядків/блоків). /buffer top Перейти до початку буферу. /buffer bottom Перейти до кінця буферу. /buffer up [n] Посунути буфер вверх на n рядків (якщо не вказано - пів екрану). /buffer down [n] Посунути буфер вниз на n рядків (якщо не вказано - пів екрану). /buffer date [дата] Перейти до першого повідомлення після дати (дата вигляду РРРР-ММ-ДД). /buffer % процент Перейти до вказаної у процентах позиції. /buffer readmark Перейти до розділювача непрочитаних повідомлень (якщо він є). /buffer search_backward текст Шукати текст, рухаючись до початку буфера. /buffer search_forward текст Шукати далі в буфері текст. /buffer scroll_lock Заборонити переміщення буферу. /buffer scroll_unlock Зняти заборону переміщення буферу. /buffer scroll_toggle Переключити стан буферу (дозволене/не дозволене переміщення). /buffer save назва_файлу Зберегти вміст буферу у файл. mcabber-0.10.2/doc/help/uk/hlp_chat_disable.txt000066400000000000000000000003661216603513500213160ustar00rootroot00000000000000 /CHAT_DISABLE [--show-roster] Виходить з режиму розмови. З аргументом --show-roster також виходить із повноекранного режиму й показує список контактів. mcabber-0.10.2/doc/help/uk/hlp_clear.txt000066400000000000000000000001771216603513500200020ustar00rootroot00000000000000 /CLEAR Фактично - скорочення до "/buffer clear". Очищує поточне вікно діалогу. mcabber-0.10.2/doc/help/uk/hlp_color.txt000066400000000000000000000051461216603513500200330ustar00rootroot00000000000000 /COLOR roster (статус маска (колір|-)|clear) /COLOR mucnick прізвисько (колір|-) /COLOR muc (jid|.|*) [on|preset|off|-] Керує кольорами контактів у списку. /color roster clear Спустошує набір правил кольору. Після цього всі контакти набудуть свого звичайного кольору. /color roster статус маска колір Додає нове чи змінює існуюче правило кольору. "Статус" складений з літер статусу, до яких докладається це правило (наприклад "n_d?"). Зірочка ("*") відповідає будь-якому статусу. "Маска" подібна до файлової маски й докладається до jid. Правило встановлює колір контактів, що йому відповідають. Щоб вилучити правило, вкажіть колір "-". Коли є декілька правил, що відповідають контакту, спрацьовує останнє додане (_не_ змінене). /color muc (jid|.|*) [on|preset|off|-] Встановлює режим забарвлення прізвиськ у чаті. Якщо замість jid вказано * режим докладається до всіх чатів, для яких не визначено особистого правила (з вказанням jid). У режимі on забарвлюються усі прізвиська, у режимі preset - лише ті, для яких колір встановлено командою /color mucnick, а режим off вимикає забарвлення прізвиськ. Режим - прибирає з вказаних jid особисті режими забарвлення. Тоді до них докладається глобальний. Глобальний режим прибрати не можна. Початковий глобальний режим - off. /color mucnick прізвисько (колір|-) Створює правило забарвлювати прізвисько вказаним кольором. Якщо вказано -, колір позначається як автоматично обраний, тобто його не буде використано у режимі preset, але у режимі on він залишиться тим самим. Випадкові кольори беруться з параметру "nick_colors" (mcabberrc) mcabber-0.10.2/doc/help/uk/hlp_connect.txt000066400000000000000000000001101216603513500203300ustar00rootroot00000000000000 /CONNECT Встановити з'єднання з сервером. mcabber-0.10.2/doc/help/uk/hlp_del.txt000066400000000000000000000003401216603513500174500ustar00rootroot00000000000000 /DEL Потерти поточний контакт зі списку. На додачу відписатися від його повідомлень про статус і відписати його від ваших. mcabber-0.10.2/doc/help/uk/hlp_disconnect.txt000066400000000000000000000004241216603513500210400ustar00rootroot00000000000000 /DISCONNECT Розірвати з'єднання з сервером. Майте на увазі, що список контактів зберігається на сервері, отож після від'єднання ви його більше не побачите. mcabber-0.10.2/doc/help/uk/hlp_echo.txt000066400000000000000000000001601216603513500176220ustar00rootroot00000000000000 /ECHO повідомлення Друкує "повідомлення" у вікно повідомлень. mcabber-0.10.2/doc/help/uk/hlp_event.txt000066400000000000000000000023211216603513500200260ustar00rootroot00000000000000 /EVENT #N|* accept|ignore|reject [додаткові аргументи] /EVENT list Розібратися з подіями, що трапилися (запити на авторизацію ітп). Якщо перший параметр - зірочка (*), відповідь буде застосована до всіх подій. Значення додаткового аргументу залежить від типу події. Єдиний випадок використання додаткового аргументу вбудованими подіями - відмова увійти у багатокористувацької розмови: якщо аргумент вказано, його буде надіслано, як причину відмови. /event N|* accept [додаткові аргументи] Подія номер #N отримає позитивну відповідь. /event N|* ignore [додаткові аргументи] Не відповідати на подію номер N. /event N|* reject [додаткові аргументи] Подія номер N отримає негативну відповідь. /event list Друкує перелік подій. mcabber-0.10.2/doc/help/uk/hlp_group.txt000066400000000000000000000011261216603513500200430ustar00rootroot00000000000000 /GROUP fold|unfold|toggle [назва групи] Змінює стан відображення вказаної групи. Якщо групу не вказано, береться та, у якій знаходиться вибраний контакт. /group fold [назва групи] Згорнути (приховати) дерево групи у списку. /group unfold [назва групи] Розгорнути (показати) дерево групи у списку. /group toggle [назва групи] Змінити стан відображення групи. mcabber-0.10.2/doc/help/uk/hlp_help.txt000066400000000000000000000002431216603513500176360ustar00rootroot00000000000000 /HELP [команда|+вираз] Друкує допоміжну інформацію до команди або виразу. Приклад: "/help buffer" mcabber-0.10.2/doc/help/uk/hlp_iline.txt000066400000000000000000000067441216603513500200220ustar00rootroot00000000000000 /ILINE fchar|bchar|char_fdel|char_bdel|char_swap /ILINE fword|bword|word_bdel|word_fdel /ILINE word_upcase|word_downcase|word_capit /ILINE hist_beginning_search_bwd|hist_beginning_search_fwd /ILINE hist_prev|hist_next /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline Команди редагування рядка. /iline fchar Пересунутись на символ вперед. /iline bchar Парейти на літеру назад. /iline char_fdel Вилучити поточний символ. /iline char_bdel Вилучити попередній символ. /iline char_swap Переставити літери місцями. /iline fword Пересунути курсор до наступного кінця слова. /iline bword Пересунути курсор на початок слова. /iline word_fdel Вилучити кінець слова, починаючи від курсору. /iline word_bdel Витерти початок слова, починаючи від курсору. /iline word_upcase Обернути до верхнього регістру літери від курсору й до кінця слова. /iline word_downcase Перетворити літери з початку слова до курсору у нижній регістр. /iline word_capit Приводить слово (від курсору до проміжку) до форми власного імені (Київ). /iline hist_beginning_search_bwd Шукати в зворотньому напрямку по історії рядок, що збігається з поточним від початку до курсору (команда не зрушить курсор з місця). /iline hist_beginning_search_fwd Шукати з далі у історії рядок, що збігається з поточним від початку до курсору (виконання команди не рухає курсор). /iline hist_prev Попередній рядок з історії уводу. /iline hist_next Наступний рядок в історії. /iline iline_start Перескочити на початок рядка. /iline iline_end Перескочити до кінця рядка. /iline iline_fdel Вилучити кінець рядка, починаючи з курсору. /iline iline_bdel Вилучити початок рядка до позиції курсору. /iline iline_accept Затвердити рядок. /iline iline_accept_down_hist Перейти до наступного рядка в історії, затвердивши поточний. /iline iline_insert текст Вставити вказаний текст у поточній позиції курсору. Зауважте, що лапки у тексті мають бути знешкоджені за допомогою '\', а також, що екран не буде оновлено автоматично (скористайтеся /screen_refresh). /iline clear_history Спустошити історію командного рядка. /iline compl_do Доповнити поточне слово. /iline compl_cancel Скасувати попереднє доповнення. /iline send_multiline Завершити й надіслати багаторядкове повідомлення. mcabber-0.10.2/doc/help/uk/hlp_info.txt000066400000000000000000000005101216603513500176360ustar00rootroot00000000000000 /INFO Друкує інформацію про поточний об'єкт (контакт, групу, ітп...). Для контактів ресурси друкуються із статусом, пріоритетом, та повідомленням статусу (якщо є) для кожного ресурсу. mcabber-0.10.2/doc/help/uk/hlp_module.txt000066400000000000000000000026471216603513500202050ustar00rootroot00000000000000 /MODULE load|unload [-f] назва /MODULE info назва /MODULE [list] Завантажує, вивантажує та показує інформацію про модулі. /module load [-f] назва Завантажує вказаний модуль. Більшу частину помилок завантаження модуля буде проігноромано, якщо ви вкажете параметр -f. /module unload [-f] назва Вивантажує вказаний модуль. Примітка: Примусове вивантаження (з параметром -f) не спричинить вивантаження залежних від цього модулів, будьте обережні! /module info назва Показує доступну інформацію стосовно модуля. /module [list] Виводить список завантажених модулів у форматі: [назва] [кількість посилань на цей модуль] ([Завантажений вручну (M) чи автоматично (A)]) [додаткова інформація, на кшталт версії чи залежностей] Примітка: кількість посилань - це скільки разів цей модуль був потрібен комусь - користувачу (максимум 1 раз) та іншим модулям. mcabber-0.10.2/doc/help/uk/hlp_move.txt000066400000000000000000000007321216603513500176570ustar00rootroot00000000000000 /MOVE [група] Переносить поточний контакт до вказаної групи. Якщо групу не вказати контакт опиниться у головній групі. Якщо група не існує, її буде створено. Примітка: в режимі розмови можна використати "/roster alternate", щоб перейти до нового місця контакту контакту. mcabber-0.10.2/doc/help/uk/hlp_msay.txt000066400000000000000000000035101216603513500176570ustar00rootroot00000000000000 /MSAY begin|verbatim|send|send_to|toggle|toggle_verbatim|abort Надсилає багаторядкове повідомлення. Щоб написати одне повідомлення з декількох рядків потрібно використовувати багаторядковий режим. В цьому режимі кожний введений рядок (за виключенням рядків команд) додається до багаторядкового повідомлення. Коли повідомлення завершене, воно може бути надіслане за допомогою "/msay send". Флаги -n та -h змінюють тип повідомлення зі звичайного "chat" на "normal" та "headline" відповідно. /msay begin [тема] Починає багаторядкове повідомлення. Зауважте, можна вказати тему цього повідомлення. /msay verbatim Входить до багаторядкового режиму, в якому розпізнається лише команда "/msay send|abort". /msay send [-n|-h] Відсилає поточне повідомлення до поточного контакту. /msay send_to [-n|-h] jid Відсилає повідомлення до "jid". /msay toggle|toggle_verbatim Перемикає багаторядковий режим (begin/send). Примітка: може використовуватися для швидкого переключення режимів (наприклад, "bind M13 = msay toggle" дозволяє починати й закінчувати повідомлення Meta-Enter). /msay abort Вийти з багаторядкового режиму не надіславши повідомлення. mcabber-0.10.2/doc/help/uk/hlp_otr.txt000066400000000000000000000027371216603513500175240ustar00rootroot00000000000000 /OTR key /OTR start|stop|info [jid] /OTR fingerprint [jid [відбиток]] /OTR smpq|smpr [jid] secret /OTR smpa [jid] Щоб позначити обраний у списку контакт, можна використовувати ".", а якщо крапка є останнім аргументом, можна не вказувати й її. /otr key Виводить у вікно стану відбиток з вашого приватного ключа /otr start [jid] Створює захищений за допомогою OTR канал до jid /otr stop [jid] Закриває захищений канал до вказаного jid /otr info [jid] Показує поточний стан шифрованого з'єднання з jid /otr fingerprint [jid [відбиток]] Показує поточний відбиток ключа каналу шифрування. Ви можете підтвердити відбиток, коли вкажете його. Якщо ви вкажете неправильний відбиток, поточний стане непідтвердженим. /otr smpq [jid] secret Розпочинає Socialist Millionaires Protocol до jid з використанням secret /otr smpr [jid] secret Відповідає на запит розпочати SMP від jid з використанням secret /otr smpa [jid] Перериває працююче з'єднання по Socialist Millionaires Protocol mcabber-0.10.2/doc/help/uk/hlp_otrpolicy.txt000066400000000000000000000041541216603513500207370ustar00rootroot00000000000000 /OTRPOLICY /OTRPOLICY (default|jid) (plain|manual|opportunistic|always) Щоб позначити обраний у списку контакт, можна використовувати "." . /otrpolicy Друкує список правил поведінки OTR до буферу статусу /otrpolicy (default|jid) (plain|manual|opportunistic|always) Вказує правило поведінки для jid (чи встановлює стандартне). Правило plain краще не використовувати, бо ви не змаожете приймати чи надсилати OTR-шифровані повідомлення взагалі. Із правилом manual вам (чи вашому співрозмовнику) треба явно увімкнути шифрування (наприклад /otr start). Правило opportunistic дозволяє вмикати OTR автоматично - у кінці кожного незашифрованого повідомлення буде додано послідовність невідображуваних символів, завдяки якій інші клієнти, здібні до OTR, знатимуть, що ви бажаєте використовувати шифрування. Але майте на увазі, що перше повідомлення завжди буде незашифрованим. Правило always забороняє незашифровані повідомлення. Коли ви спробуєте надіслати незашифроване повідомлення, mcabber буде намагатися встановити захищений канал. Отож, коли ви отримаєте повідомлення, що канал встановлено, будь ласка, надішліть те повідомлення знов. Якщо вам прийде незашифроване повідомлення від jid з цим правилом, ви його побачите, але воно не збережеться у записах спілкування. mcabber-0.10.2/doc/help/uk/hlp_pgp.txt000066400000000000000000000027061216603513500175020ustar00rootroot00000000000000 /PGP disable|enable|force|info [jid] /PGP setkey [jid [ключ]] Команда pgp керує використанням PGP-шифрування для вказаного jid. Коли jid не вказано, використовуватиметься поточний (обраний у списку) контакт. Але майте на увазі, що PGP буде дійсно використовуватися лише якщо інша сторона теж дозволить його, або якщо ви застосуєте режим force. /pgp disable [jid] Заборонити використання PGP для jid. /pgp enable [jid] Дозволити використання PGP для jid. /pgp force [jid] Примусове використання PGP для jid. Забороняє незашифровані повідомлення взагалі (отже перевірте наявність ключа шифрування). Втім, якщо pgp заборонене, ця команда не має ніякого ефекту. /pgp info [jid] Показує чи дозволене PGP-шифрування для jid. /pgp setkey [jid [ключ]] Вказує ключ для шифрування повідомлень для jid. Якщо ключ не вказано, поточний ключ скидається. Щоб вказати поточний контакт можна використовувати "." . mcabber-0.10.2/doc/help/uk/hlp_quit.txt000066400000000000000000000001201216603513500176620ustar00rootroot00000000000000 /QUIT Закриває всі з'єднання й завершує mcabber. mcabber-0.10.2/doc/help/uk/hlp_rawxml.txt000066400000000000000000000005051216603513500202210ustar00rootroot00000000000000 /RAWXML send рядок Надсилає рядок до серверу (ніяк його при цьому не змінюючи). Увага! Використовуйте цю команду лише якщо ви знаєте, що робите. Приклад: "/rawxml send away" mcabber-0.10.2/doc/help/uk/hlp_rename.txt000066400000000000000000000001671216603513500201620ustar00rootroot00000000000000 /RENAME ім'я Змінює прізвисько поточного контакту або назву групи. mcabber-0.10.2/doc/help/uk/hlp_request.txt000066400000000000000000000016301216603513500203770ustar00rootroot00000000000000 /REQUEST last|ping|time|vcard|version [jid] Надсилає запит "IQ" до jid або до поточного контакту. Якщо ресурс не вказаний, то запит буде надісланий до всіх відомих ресурсів. /request last [jid] Запитати "останню інформацію" в контакту (зазвичай, це час неактивності). /request ping [jid] Надіслати запит луни в контакту. Примітка: ви маєте вказати повний jid з ресурсом, інакше запит буде оброблений сервером. /request time [jid] Запитати котра година в контакту. /request vcard [jid] Попросити в контакту візитівку. /request version [jid] Запитати яку версію має контакт. mcabber-0.10.2/doc/help/uk/hlp_room.txt000066400000000000000000000077511216603513500176750ustar00rootroot00000000000000 /ROOM join|leave|names|nick|remove|topic|unlock|destroy /ROOM privmsg|invite|whois|kick|ban|unban|role|affil /ROOM setopt print_status|auto_whois|flag_joins [значення] /ROOM bookmark [add|del] [+autojoin|-autojoin] [-|nick] Команда, відповідальна за дії при багатокористувацькій розмові. /room join [кімната [прізвисько [пароль]]] Увійти до "кімнати", під іменем "прізвисько". Якщо не вказане (або ""), береться з параметру "nickname" (mcabberrc). Якщо поточний контакт є кімнатою, можна використати "." замість повної назви кімнати. Пароль може бути потрбен для входу в захищені кімнати. Для назв з пробілами використовуйте лапки. /room leave [повідомлення] Вийти з поточної кімнати. /room names [--detail|--short|--quiet|--compact] Друкує інформацію про присутніх в кімнаті з вказаним рівнем деталізації. /room nick прізвисько Змінити ваше прізвисько у поточній кімнаті. /room privmsg прізвисько повідомлення Надіслати приватне повідомлення до "прізвисько". /room remove Потерти поточну кімнату зі списку контактів (ви повинні спочатку вийти). /room topic -|тема Встановити тему обговорення у поточній кімнаті. Щоб очистити тему, вкажіть замість неї -. /room unlock Відкрити поточну кімнату (якщо ви її власник). /room destroy [причина] Розвалити поточну кімнату (обережно!). /room whois прізвисько Друкує інформацію про "прізвисько". /room ban jid [причина] Вибанити jid з кімнати. /room unban jid Знімає бан (блокування) з jid у поточній кімнаті. /room invite jid [причина] Надіслати jid запрошення до поточної кімнати. /room kick прізвисько [причина] Кікнути "прізвисько" з кімнати. /room role jid роль [причина] Змінити роль jid у комнаті ("none", "visitor", "participant", "moderator") /room affil jid ступінь [причина] Змінити ступінь довіри для jid ("none", "member", "admin", "owner"). /room setopt print_status|auto_whois|flag_joins [значення] Встановлює додаткові параметри для поточної кімнати print_status керує відображенням змін у статусі присутніх ("default", "none", "in_and_out", "all"). auto_whois визначає, чи запитувати автоматично інформацію про новоприбульців до кімнати ("default", "off", "on"). flag_joins вказує, чи потрібно підсвічувати кімнату, коли хтось входить чи виходить ("default", "none", "joins", "all"). Коли встановлено "default", мають силу глобальні опції muc_print_status / muc_auto_whois / muc_flag_joins. /room bookmark [add|del] [+autojoin|-autojoin] [-|nick] Додати, потерти, або замінити закладку (якщо не вказано - додасть). Якщо встановити автовхід, mcabber буде заходити в цю кімнату після з'єднання з сервером. Переглянути наявні закладки можна за допомогою /room bookmark у буфері стану. mcabber-0.10.2/doc/help/uk/hlp_roster.txt000066400000000000000000000075251216603513500202360ustar00rootroot00000000000000 /ROSTER bottom|top|up|down|group_prev|group_next /ROSTER alternate|unread_first|unread_next /ROSTER search ім'я /ROSTER display|hide_offline|show_offline|toggle_offline /ROSTER item_lock|item_unlock|item_toggle_lock /ROSTER hide|show|toggle /ROSTER note [-|текст] /ROSTER resource_lock|resource_unlock Керує списком контактів. /roster bottom Перейти до кінця списку. /roster top Перейти на початок списку. /roster up [n] Перейти вище по списку. /roster down [n] Перейти нижче по списку. /roster group_prev Перейти до попередньої групи в списку. /roster group_next Перейти до наступної групи в списку. /roster alternate Прейти до "альтернативного" контакту. "Альтернативний" контакт - це останній контакт, який був в режимі розмови. Ця команда може використовуватись після команд типу "/roster unread_next" (Ctrl-q). /roster unread_first Перейти до першого непрочитанного повідомлення. /roster unread_next Перейти до наступного непрочитанного повідомлення. /roster search ім'я Шукати контакт з прізвиськом або jid, що вміщують "ім'я" (тільки по контактах, що відображуються) /roster display [маска] Перевірка чи зміна фільтру, що накладаєтья на список контактів. Маска є рядком з літер статусу, які не буде відфільтровано (o - присутній, f - бажає поговорити, d - не турбувати, n - відсутній, a - відійшов, _ - не у мережі) Наприклад, ofdna залишить у списку лише тих, хто зараз підключений до мережі. "*" відповідає усім статусам. /roster hide_offline Сховати неприсутні контакти (як /roster display ofdna). /roster show_offline Показувати неприсутні контакти також (/roster display ofdna_). /roster toggle_offline Переключити відображення неприсутніх контактів. /roster item_lock [jid] Закріплює вказаний об'єкт списку так, що він завжди відображується, незважаючи на свій статус. /roster item_unlock [jid] Відміняє дію item_lock. /roster item_toggle_lock [jid] Перемикає "закріпленість" об'єкта. /roster hide Сховати список. /roster show Показати список. /roster toggle Переключити відображення списку. /roster note [-|текст] Встановити "текст" як нотатку. Коли "текст" не вказано, покаже нотатку до поточного об'єкту (а якщо цей об'єкт є вікном стану - відобразить усі нотатки). Якщо вказати "-", то нотатку буде витерто. /roster resource_lock [повний jid|ресурс] Встановити вказаний ресурс активним. Дозволяє використовувати синтаксис "./ресурс" (або просто ресурс) для поточного контакту. /roster resource_unlock [jid] Скасувати попередні вказівки щодо активності ресурсів. Щоб вказати поточний контакт, можна використати ".". mcabber-0.10.2/doc/help/uk/hlp_say.txt000066400000000000000000000007751216603513500175140ustar00rootroot00000000000000 /SAY [-n|-h|--] текст Надсилає текст до поточного контакту. Це може стати в нагоді, якщо ви хочете надіслати повідомлення з символом '/' на початку. Флаги -n та -h змінюють тип повідомлення у "normal" або "headline". -- використовується, щоб надіслати звичайне повідомлення, що починається з -n чи -h. mcabber-0.10.2/doc/help/uk/hlp_say_to.txt000066400000000000000000000031251216603513500202060ustar00rootroot00000000000000 /SAY_TO [-n|-h] [-e] [-q] [-f файл] jid текст Надсилає текст до вказаного jid. Майте на увазі, що ця команда не встановлює стандартного ресурсу для контакту, отже, якщо вам треба надіслати декілька повідомлень до визначених ресурсів, вам треба використовувати "/say_to" для кожного повідомлення. Флаги -n та -h змінюють тип повідомлення у "normal" або "headline". "--" використовується, щоб надіслати звичайне повідомлення, що починається з -n чи -h. Флаг -q дозволяє надсилати повідомлення, не перемикаючи вікна розмови (корисно при автоматичному надсиланні через fifo). Флаг -e вмикає перетворення послідовностей "\n" та "\t" на відповідно перенос рядка та табуляцію. Проте, якщо повідомлення береться з файлу (через -f), це перетворення не робиться. Ви можете узяти текст повідомлення із текстового файлу за допомогою аргументу -f. Звісно, якщо вказано файл з повідомленням, "текст" ігнорується, й його можна не вказувати взагалі. mcabber-0.10.2/doc/help/uk/hlp_screen_refresh.txt000066400000000000000000000000701216603513500217010ustar00rootroot00000000000000 /SCREEN_REFRESH Оновлює зображення. mcabber-0.10.2/doc/help/uk/hlp_set.txt000066400000000000000000000004031216603513500174770ustar00rootroot00000000000000 /SET [параметр [= значення]] Встановлює або друкує значення вказаного параметру. Без аргументів виводить список всіх встановлених параметрів. mcabber-0.10.2/doc/help/uk/hlp_source.txt000066400000000000000000000006751216603513500202170ustar00rootroot00000000000000 /SOURCE шаблон Читає налаштування з файлів, що відповідають вказаному шаблону (у алфавітному порядку). Примітка: у під'єднаному до сервера стані команда розуміє й звичайні команди (як то say, group та інші) це можна використати у hook-post-connect (див. mcabberrc). mcabber-0.10.2/doc/help/uk/hlp_status.txt000066400000000000000000000013761216603513500202410ustar00rootroot00000000000000 /STATUS [online|avail|free|dnd|notavail|away [-|повідомлення]] /STATUS message -|повідомлення Друкує або встановлює ваш статус. Якщо статус не вказано, друкує поточний. Якщо не вказане повідомлення, використовується повідомлення вказане відповідним параметром message* (з mcabberrc). Якщо відповідний message* не визначений, залишається поточне повідомлення. "-" прибирає поточне повідомлення. "/status message" змінює лише повідомлення, не чіпаючи поточний статус. mcabber-0.10.2/doc/help/uk/hlp_status_to.txt000066400000000000000000000010601216603513500207310ustar00rootroot00000000000000 /STATUS_TO jid online|avail|free|dnd|notavail|away [повідомлення] /STATUS_TO jid message повідомлення Надсилає до jid вказаний статус. Поточний контакт можна вказати як "." . Примітка: Цей статус буде скинуто наступною командою "/status". Автоматична зміна статусу також це робить. Примітка: jid може вказувати й ресурс (користувач@сервер/ресурс). mcabber-0.10.2/doc/help/uk/hlp_version.txt000066400000000000000000000000621216603513500203720ustar00rootroot00000000000000 /VERSION Друкує версію mcabber'у. mcabber-0.10.2/doc/manpage.css000066400000000000000000000011341216603513500160550ustar00rootroot00000000000000/* AsciiDoc manpage stylesheet. */ BODY { background-color: #FFD; } /* Man page text is indented from headings. */ h1 { border-bottom: solid 2px; } h2 { border-bottom: dashed 1px; } p,ul,ol,dl,h4,h5 { padding: 0 2%; } table { padding: 0 2%; } /* Man page emphasis is always bold. */ dt { font-style: normal; font-weight: bold; margin-top : 10px; margin-left: 0 } em { font-style: normal; font-weight: bold; } div#synopsis p { } div.literalparagraph { margin: 0 10%; } div.literalblock { margin: 0 10%; } div.listingblock { margin: 0 10%; } mcabber-0.10.2/doc/mcabber.1000066400000000000000000001075321216603513500154210ustar00rootroot00000000000000'\" t .\" Title: mcabber .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 03/19/2011 .\" Manual: \ \& .\" Source: \ \& 0.10.2 .\" Language: English .\" .TH "MCABBER" "1" "03/19/2011" "\ \& 0\&.10\&.2\" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" mcabber \- a simple Jabber (XMPP) console client .SH "SYNOPSIS" .sp \fImcabber\fR [ \-h | \-V | \-f configfile ] .SH "DESCRIPTION" .sp mcabber(1) is a small Jabber (XMPP) console client\&. For now it needs a configuration file to start, so please copy the sample mcabberrc file and adapt your connection settings\&. .sp You also need to have an existing Jabber account to use this software, as it cannot (un)register accounts yet\&. .sp Here are some of the features of mcabber: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fISASL/SSL/TLS support\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIMUC support\fR (Multi\-User Chat)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIPGP, OTR support\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIChat States\fR support (typing notifications) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIHistory logging:\fR If enabled (see the CONFIGURATION FILE section), mcabber can save discussions to text history log files\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fICommands completion:\fR If possible, mcabber will try to complete your command line if you hit the Tab key\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIInput line history:\fR Any message or command entered is in the input line history and can be reused easily\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIExternal actions:\fR Some events (like receiving a message) can trigger an external action such as a shell script if you enable it in your configuration file\&. A sample events script ("eventcmd") is provided with mcabber source code, in the contrib directory\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIModules:\fR mcabber can load modules (a\&.k\&.a\&. plugins) at runtime that extend its features\&. .RE .SH "OPTIONS" .PP \-h .RS 4 Quick help usage message .RE .PP \-V .RS 4 Displays mcabber version and compile\-time definitions\&. .RE .PP \-f configfile .RS 4 Use configuration file \fIconfigfile\fR .RE .SH "WINDOWS/PANES" .sp The mcabber(1) screen is divided into 4 regions\&. The \fIroster\fR, alias \fIbuddylist\fR, is on the left\&. The \fIchat window\fR, or chat buffer, is on the right\&. The \fIinput line\fR lies at the bottom of the screen, under a small \fIlog window\fR\&. .sp Two status lines surround the log window\&. The bottom status line is the "main status line" and reflects mcabber general status\&. The other line is the "chat status line" and shows the status of the currently selected buddy\&. .sp To display buddies chat buffers, you will have to enter \fIchat mode\fR\&. You can enter chat mode by pressing enter, and leave chat mode with the ESC key\&. Simply sending a message will also enable chat mode\&. .sp There are several advantages to the two\-mode implementation: first, it allows accurate "unread" message functionality, as described in the next section; without this, merely scrolling to a specific buddy will "read" the new messages of all buddies in\-between\&. Second, it allows quickly hiding the conversation with a single keystroke\&. Third, it allows jumping between the few buddies with whom you are conversing with the \fI/roster alternate\fR command described in another section, without having to manually scroll back and forth\&. .SH "KEYS" .sp Text typing occurs in the \fIinput line\fR; basic operations are supported (left arrow, right arrow, home/end keys, insert, delete, backspace\&...)\&. .sp PageUp and PageDown keys are used to move in the roster\&. .sp Up and Down arrow keys can be used to move in the input line history; they jump to the previous/next line from the history beginning with the same string (from first column to the cursor column)\&. .sp To send a message, move to the chosen buddy in the buddylist, type your message and hit enter\&. If the line begins with a slash, this will be interpreted as a command (see the COMMAND section below)\&. Hit escape to leave the chat mode\&. .sp Here is a quick description of the default key bindings: .PP Esc .RS 4 Disable chat mode .RE .PP Ctrl\-a .RS 4 Go to the beginning of the input line .RE .PP Ctrl\-e .RS 4 Go to the end of the input line .RE .PP Ctrl\-l .RS 4 Force a refresh .RE .PP Up/Down .RS 4 Move in the input line history .RE .PP PgUp/PgDown .RS 4 Move inside the roster (buddylist) .RE .PP Tab .RS 4 Complete current word, in the input line .RE .PP Ctrl\-g .RS 4 Cancel completion .RE .PP Ctrl\-c .RS 4 Abort multi\-line messages and completions .RE .PP Ctrl\-d .RS 4 Send/terminate a multi\-line message .RE .PP Ctrl\-p/Ctrl\-n .RS 4 Scroll up/down half a screen in the buffer window (chat mode) .RE .PP Ctrl\-Left .RS 4 Move the cursor back to the start of the current or previous word .RE .PP Ctrl\-Right .RS 4 Move the cursor forward to the end of the current or next word .RE .PP Ctrl\-u .RS 4 Delete from beginning of the line to the cursor .RE .PP Ctrl\-k .RS 4 Delete from the cursor to the end of line .RE .PP Ctrl\-w .RS 4 Backward kill word .RE .PP Ctrl\-t .RS 4 Transpose chars .RE .PP Ctrl\-o .RS 4 Accept line and put the next history line in the input line (accept\-line\-and\-down\-history) .RE .sp Additional key bindings may be specified using the \fI/bind\fR command described in the COMMANDS section\&. .SH "MCABBER\(cqS ROSTER" .sp The first listed item on the roster is \fI[status]\fR, which keeps a log of everything that appears in the short log window below the main chat area\&. While the log window was designed for showing the latest few elements, the dedicated \fI[status]\fR buffer allows more comfortable viewing of the log, as well as scrolling it in a standard manner\&. .sp Group names are displayed above the items that are within them, and are indicated by \fI\-\-\-\fR to the left of the name\&. .sp For every real Jabber contact, the roster displays four pieces of information: the buddy\(cqs name or alias, its online status, its authorization status, and whether there are unread messages from the buddy waiting for you\&. .sp The online status is one of the following: .PP \fIo\fR .RS 4 online .RE .PP \fIf\fR .RS 4 free for chat .RE .PP \fIa\fR .RS 4 away .RE .PP \fIn\fR .RS 4 not available (labeled \fIextended away\fR in some clients) .RE .PP \fId\fR .RS 4 do not disturb .RE .PP \fI_\fR .RS 4 offline (or invisible to you) .RE .PP \fI?\fR .RS 4 unknown, usually meaning you are not authorized to see this buddy\(cqs status .RE .PP \fIx\fR .RS 4 a conference room in which you are not participating .RE .PP \fIC\fR .RS 4 a conference room in which you are participating .RE .sp The authorization status indicates whether a buddy is authorized to receive your online status updates, and is displayed by the brackets surrounding the buddy\(cqs online status\&. Square brackets, like \fI[o]\fR, indicate that this buddy is authorized to receive your status\&. Curly braces, like \fI{o}\fR, indicate that they are not authorized to receive your status\&. .sp When there are unread messages from a buddy which you have not looked at, a hash mark (\fI#\fR) appears in the leftmost section of the roster for that buddy\&. The hash mark disappears once you view that buddy\(cqs message buffer\&. When the user attention is requested (or when you receive a message containing your nickname in a MUC room), the hash mark is replaced with the \fIattention sign\fR, an exclamation mark (\fI!\fR)\&. .sp Examples: .PP \fI\-\-\- Buds\fR .RS 4 This is a group named \fIBuds\fR .RE .PP \fI#[o] John\fR .RS 4 John is online, can see your status, and sent you a message that you did not read yet .RE .PP \fI{?} Sally\fR .RS 4 Neither you nor Sally have authorized each other to see your online status .RE .PP \fI{a} Jane\fR .RS 4 Jane is away, but she cannot see your online status .RE .PP \fI#[C] x@y\&.c\fR .RS 4 You are participating in x@y\&.c conference room, and there are unread messages .RE .SH "COMMANDS" .sp Please refer to the online help (command /help), it is probably more up\-to\-date than this manpage\&. Furthermore, help files have been translated into several languages\&. You will find an overview of the mcabber commands in this manual\&. .SH "COMMANDS RELATED TO MCABBER" .PP /add [jid [nickname]] .RS 4 Add the "jid" Jabber user to our roster (default group), and send a notification request to this buddy\&. If no nickname is specified, the jid is used\&. If no jid (or an empty string "") is provided or if jid is "\&.", the current buddy is used\&. .PP [\fIjid\fR [nickname]] .RS 4 Add to our roster "jid" as "nickname" .sp .if n \{\ .RS 4 .\} .nf Example: "/add somebody@jabber\&.server\&.com Somebody" .fi .if n \{\ .RE .\} .RE .RE .PP /alias [name [= command line]] .RS 4 This command let you to add aliases which can simplify sophisticated commands\&. You can manage your aliases by: .PP (without arguments) .RS 4 Print list of currently defined aliases .RE .PP \fIname\fR .RS 4 Print the value of alias called "name" .RE .PP \fIname\fR= .RS 4 Unset alias called "name" .RE .PP \fIname\fR = command line .RS 4 Set alias called "name" with value "command line" .sp .if n \{\ .RS 4 .\} .nf Example: "/alias away = status away" .fi .if n \{\ .RE .\} .RE .RE .PP /authorization allow|cancel|request|request_unsubscribe [jid] .RS 4 This command manages presence subscriptions: it allows you to request presence subscriptions from others on your roster, and allows you to control who receives your presence notifications\&. If no JID is provided, the currently\-selected buddy is used\&. .PP \fIallow\fR .RS 4 Allow the buddy to receive your presence updates .RE .PP \fIcancel\fR .RS 4 Cancel the buddy\(cqs subscription to your presence updates .RE .PP \fIrequest\fR .RS 4 Request a subscription to the buddy\(cqs presence updates .RE .PP \fIrequest_unsubscribe\fR .RS 4 Request unsubscription from the buddy\(cqs presence updates .RE .RE .PP /bind [keycode [= command line]] .RS 4 Bind the command to the key given as "keycode"\&. To examine which keys are currently not used look at mcabber log window and press examined key\&. For example: "Unknown key=265" means that you can bind some command to key #265\&. .PP (without arguments) .RS 4 Display list of current bindings .RE .PP \fIkeycode\fR .RS 4 Display the command line bound to this key .RE .PP \fIkeycode\fR= .RS 4 Unbind key with code "keycode" .RE .PP \fIkeycode\fR = command line .RS 4 Bind "command line" to the key with code "keycode" .sp .if n \{\ .RS 4 .\} .nf Example: "/bind 265 = status away" (265 is F1)\&. + Note: keycodes can be different depending on your ncurses configuration\&. + Tip: aliases also can be used instead of commands\&. .fi .if n \{\ .RE .\} .RE .RE .PP /buffer clear|close|close_all|purge|list, /buffer top|bottom|date|%|search_backward|search_forward, /buffer scroll_lock|scroll_unlock|scroll_toggle, /buffer save filename .RS 4 Buddy\(cqs buffer manipulation command\&. E\&.g\&. you can search through buffer for "text", clear chat window etc\&. .PP \fIclear\fR .RS 4 Clear the current buddy chat window .RE .PP \fIclose\fR [jid] .RS 4 Empty all contents of the buffer and close the current buddy chat window .RE .PP \fIclose_all\fR .RS 4 Empty all contents of the chat buffers and close the chat windows .RE .PP \fIpurge\fR [jid] .RS 4 Clear the current buddy chat window and empty all contents of the chat buffer .RE .PP \fIlist\fR .RS 4 Display the list of existing buffers, with their length (lines/blocks) .RE .PP \fItop\fR .RS 4 Jump to the top of the current buddy chat buffer .RE .PP \fIbottom\fR .RS 4 Jump to the bottom of the current buddy chat buffer .RE .PP \fIup\fR [n] .RS 4 Scroll the buffer up [n] lines (default: half a screen) .RE .PP \fIdown\fR [n] .RS 4 Scroll the buffer down [n] lines (default: half a screen) .RE .PP \fIdate\fR [date] .RS 4 Jump to the first line after the specified [date] in the chat buffer (date format: "YYYY\-mm\-dd") .RE .PP % n .RS 4 Jump to position %n of the buddy chat buffer .RE .PP \fIsearch_backward\fR text .RS 4 Search for [text] in the current buddy chat buffer .RE .PP \fIsearch_forward\fR text .RS 4 Search for [text] in the current buddy chat buffer .RE .PP \fIscroll_lock\fR .RS 4 Lock buffer scrolling .RE .PP \fIscroll_unlock\fR .RS 4 Unlock buffer scrolling .RE .PP \fIscroll_toggle\fR .RS 4 Toggle buffer scrolling (lock/unlock) .RE .PP \fIsave\fR filename .RS 4 Save the contents of the current buffer to the file "filename" .RE .RE .PP /chat_disable [\-\-show\-roster] .RS 4 Disable chat mode\&. With \-\-show\-roster, the fullscreen mode will be disabled\&. .RE .PP /clear .RS 4 This command is actually an alias for "/buffer clear"\&. It clears the current buddy chat window\&. .RE .PP /color roster (status wildcard (color|\-)|clear), /color mucnick nick (color|\-), /color muc (jid|\&.|*) [on|preset|off|\-] .RS 4 The \fIcolor\fR command allows setting dynamic color properties of the screen\&. .PP \fIroster\fR clear .RS 4 Remove all color rules for the roster\&. All roster items will get its default color\&. .RE .PP \fIroster\fR status wildcard color .RS 4 Set a color rule (or overwrite, if it already exists)\&. The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK\&. Wildcard is the file\-matching wildcard that will be applied to JID\&. Color is the wanted color\&. If color is \-, the rule is removed\&. If more than one rule matches, the color from the last created (not overwritten) is used\&. .RE .PP \fImucnick\fR nick (color|\-) .RS 4 Marks the nick to be colored by given color\&. If a MUC has colored nicks, this one will be used\&. If color is \-, the color is marked as chosen automatically, which means it will not be used in \fIpreset\fR coloring mode, but will stay the same in \fIon\fR coloring mode\&. .RE .PP \fImuc\fR (jid|\&.|*) [on|preset|off|\-] .RS 4 Sets a MUC nick coloring mode\&. If a jid (\&. means currently selected jid) is provided, the mode will apply to this specific MUC\&. If * is used, it will be applied to all MUCs, except the ones set by their jid\&. Mode \fIon\fR colors all nicks, \fIpreset\fR only the ones manually set by /color mucnick command and \fIoff\fR colors none\&. If not specified, defaults to \fIon\fR\&. Mode \fI\-\fR removes the mode from given JID, which means the global one will apply\&. You can not remove the global mode\&. Default global coloring mode is \fIoff\fR\&. .RE .RE .PP /connect .RS 4 Establish connection to the Jabber server\&. .RE .PP /del .RS 4 Delete the current buddy from our roster, unsubscribe from its presence notification and unsubscribe it from ours\&. .RE .PP /disconnect .RS 4 Terminate the connection to the Jabber server\&. Note: the roster is only available when the connection to the server is active, so the buddylist is empty when disconnected\&. .RE .PP /echo message .RS 4 Display "message" in the log window\&. .RE .PP /event #n|* accept|ignore|reject [event\-specific arguments], /event list .RS 4 Tell mcabber what to do about pending events\&. If the first parameter is \fI*\fR, the command will apply to all queued events\&. Event\-specific arguments will be interpreted on event\-to event basis\&. The only built\-in case, when argument is used is MUC invitation reject \- argument, if present, will be interpreted as reject reason\&. .PP #N|* accept [event\-specific arguments] .RS 4 Event number #N/All events will be accepted .RE .PP #N|* ignore [event\-specific arguments] .RS 4 Event number #N/All events will be ignored .RE .PP #N|* reject [event\-specific arguments] .RS 4 Event number #N/All events will be rejected .RE .PP \fIlist\fR .RS 4 List all pending events .RE .RE .PP /group fold|unfold|toggle [groupname] .RS 4 This command changes the current group display\&. .PP \fIfold\fR [groupname] .RS 4 Fold (shrink) the current/specified group tree in the roster .RE .PP \fIunfold\fR [groupname] .RS 4 Unfold (expand) the current/specified group tree in the roster .RE .PP \fItoggle\fR [groupname] .RS 4 Toggle the state (fold/unfold) of the current/specified tree .RE .RE .PP /help [command|+topic] .RS 4 Display help for command "command" or topic "topic"\&. Example: "/help buffer" .RE .PP /iline fchar|bchar|char_fdel|char_bdel|char_swap, /iline fword|bword|word_bdel|word_fdel, /iline word_upcase|word_downcase|word_capit, /iline hist_beginning_search_bwd|hist_beginning_search_fwd, /iline hist_prev|hist_next, /iline iline_start|iline_end|iline_fdel|iline_bdel, /iline iline_accept|iline_accept_down_hist, /iline compl_do|compl_cancel, /iline send_multiline .RS 4 Input line commands .PP \fIfchar\fR .RS 4 Move to the next letter .RE .PP \fIbchar\fR .RS 4 Move to the previous letter .RE .PP \fIchar_fdel\fR .RS 4 Delete the letter at cursor position .RE .PP \fIchar_bdel\fR .RS 4 Delete the letter before cursor position .RE .PP \fIchar_swap\fR .RS 4 Transpose chars .RE .PP \fIfword\fR .RS 4 Move the cursor forward to the end of the current or next word .RE .PP \fIbword\fR .RS 4 Move the cursor back to the start of the current or previous word .RE .PP \fIword_bdel\fR .RS 4 Delete the word from cursor position to its start .RE .PP \fIword_fdel\fR .RS 4 Delete the word from cursor position to its end .RE .PP \fIword_upcase\fR .RS 4 Convert the word from cursor position to its end to upper case .RE .PP \fIword_downcase\fR .RS 4 Convert the word from cursor position to its end to down case .RE .PP \fIword_capit\fR .RS 4 Capitalize the word from cursor position to its end .RE .PP \fIhist_beginning_search_bwd\fR .RS 4 Search backward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) .RE .PP \fIhist_beginning_search_fwd\fR .RS 4 Search forward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) .RE .PP \fIhist_prev\fR .RS 4 Previous line of input line history .RE .PP \fIhist_next\fR .RS 4 Next line of input line history .RE .PP \fIiline_start\fR .RS 4 Go to the beginning of the input line .RE .PP \fIiline_end\fR .RS 4 Go to the end of the input line .RE .PP \fIiline_fdel\fR .RS 4 Delete from the cursor to the end of line .RE .PP \fIiline_bdel\fR .RS 4 Delete from beginning of the line to the cursor .RE .PP \fIiline_accept\fR .RS 4 Accept line .RE .PP \fIiline_accept_down_hist\fR .RS 4 Accept line and put the next history line in the input line .RE .PP \fIcompl_do\fR .RS 4 Complete current word, in the input line .RE .PP \fIcompl_cancel\fR .RS 4 Cancel completion .RE .PP \fIsend_multiline\fR .RS 4 Send/terminate a multi\-line message .RE .RE .PP /info .RS 4 Display info on the selected entry (user, agent, group\&...)\&. For users, resources are displayed with the status, priority and status message (if available) of each resource\&. .RE .PP /module load|unload [\-f] module, /module info module, /module [list] .RS 4 Load, unload or show info on module\&. .PP \fIload\fR [\-f] module .RS 4 Loads specified module\&. If \-f flag is specified, most of module loading errors will be ignored\&. .RE .PP \fIunload\fR [\-f] module .RS 4 Unloads specified module\&. Note: The force flag will not remove any dependency on this module! .RE .PP \fIinfo\fR module .RS 4 Shows available information about this module\&. .RE .PP [\fIlist\fR] .RS 4 Lists modules in a format: [modulename] [reference count] ([Manually/Automatically loaded]) [any extra info, like version or dependencies] .RE .RE .PP /move [groupname] .RS 4 Move the current buddy to the requested group\&. If no group is specified, then the buddy is moved to the default group\&. If the group "groupname" doesn\(cqt exist, it is created\&. Tip: if the chatmode is enabled, you can use "/roster alternate" to jump to the moved buddy\&. .RE .PP /msay begin|verbatim|send|send_to|toggle|toggle_verbatim|abort .RS 4 Send a multi\-line message\&. To write a single message with several lines, the \fImulti\-line mode\fR should be used\&. In multi\-line mode, each line (except command lines) typed in the input line will be added to the multi\-line message\&. Once the message is finished, it can be sent to the current selected buddy with the "/msay send" command\&. The \fIbegin\fR subcommand enables multi\-line mode\&. Note that it allows a message subject to be specified\&. The \fIverbatim\fR multi\-line mode disables commands, so that it is possible to enter lines starting with a slash\&. Only the "/msay" command (with send or abort parameters) can be used to exit verbatim mode\&. The \fItoggle\fR subcommand can be bound to a key to use the multi\-line mode quickly (for example, "bind M13 = msay toggle" to switch using the Meta\-Enter combination)\&. .PP \fIbegin\fR [subject] .RS 4 Enter multi\-line mode .RE .PP \fIverbatim\fR .RS 4 Enter verbatim multi\-line mode .RE .PP \fIsend\fR [\-n|\-h] .RS 4 Send the current multi\-line message to the currently selected buddy .RE .PP \fIsend_to\fR [\-n|\-h] jid .RS 4 Send the current multi\-line message to "jid" .RE .PP \fItoggle\fR|\fItoggle_verbatim\fR .RS 4 Switch to/from multi\-line mode (begin/send) .RE .PP \fIabort\fR .RS 4 Leave multi\-line mode without sending the message .sp .if n \{\ .RS 4 .\} .nf The \-n or \-h flags turn the message to "normal" or "headline" accordingly, as opposed to default "chat" message\&. .fi .if n \{\ .RE .\} .RE .RE .PP /otr key, /otr start|stop|info [jid], /otr fingerprint [jid [fpr]], /otr smpq|smpr [jid] secret, /otr smpa [jid] .RS 4 You can use the shortcut\-jid "\&." for the currently selected contact\&. .PP \fIkey\fR .RS 4 Print the fingerprint of your private key to the Status Buffer .RE .PP \fIstart\fR [jid] .RS 4 Open an OTR channel to the specified jid (or the currently selected contact) .RE .PP \fIstop\fR [jid] .RS 4 Close the OTR channel to the specified jid (or the currently selected contact) .RE .PP \fIinfo\fR [jid] .RS 4 Show current OTR status for the specified jid (or the currently selected contact) .RE .PP \fIfingerprint\fR [jid [fpr]] .RS 4 Show the active fingerprint of an OTR channel\&. If the fingerprint is provided instead of "fpr", the fingerprint will become trusted\&. If you replace "fpr" by some bogus string the fingerprint will loose the trusted status\&. .RE .PP \fIsmpq\fR [jid] secret .RS 4 Initiate the Socialist Millionaires Protocol with the secret and the buddy .RE .PP \fIsmpr\fR [jid] secret .RS 4 Respond to the Initiation of the jid with the secret .RE .PP \fIsmpa\fR [jid] .RS 4 Abort the running Socialist Millionaires Protocol .RE .RE .PP /otrpolicy, /otrpolicy (default|jid) (plain|manual|opportunistic|always) .RS 4 You can use the shortcut\-jid "\&." for the currently selected contact\&. .PP (without arguments) .RS 4 Prints all OTR policies to the status buffer .RE .PP (\fIdefault\fR|\fIjid\fR) (plain|manual|opportunistic|always) .RS 4 Sets either the default policy or the policy for the given jid The plain policy should never be used, because you won\(cqt be able to receive or send any OTR encrypted messages\&. If you set the policy to manual, you or your chat partner have to start the OTR encryption by hand (e\&.g\&. with /otr start)\&. The policy "opportunistic" does that itself by sending a special whitespace\-sequence at the end of unencrypted messages\&. So the other OTR\-enabled chat client knows, that you want to use OTR\&. Note that the first message will always be unencryted, if you use this policy\&. With the policy "always" no message will be sent in plain text\&. If you try to sent the first message unencrypted, mcabber will try to establish an OTR channel\&. Please resend your message, when you get the information that the channel was established\&. If someone sends you plaintext messages while the policy is set to "always", you\(cqll be able to read the message but it won\(cqt be saved to the history\&. .RE .RE .PP /pgp disable|enable|force|info [jid], /pgp setkey [jid [key]] .RS 4 This command manipulates PGP settings for the specified jid (by default the currently selected contact)\&. Please note that PGP encryption won\(cqt be used if no remote PGP support is detected, even if PGP is enabled with this command\&. You can force PGP encryption with the "force" subcommand\&. .PP \fIdisable\fR [jid] .RS 4 Disable PGP encryption for jid (or the currently selected contact) .RE .PP \fIenable\fR [jid] .RS 4 Enable PGP encryption for jid (or the currently selected contact) .RE .PP \fIforce\fR [jid] .RS 4 Enforce PGP encryption, even for offline messages, and always assume the recipient has PGP support\&. If a message can\(cqt be encrypted (missing key or key id), the messages won\(cqt be sent at all\&. This option is ignored when PGP is disabled\&. .RE .PP \fIinfo\fR [jid] .RS 4 Show current PGP settings for the contact .RE .PP \fIsetkey\fR [jid [key]] .RS 4 Set the PGP key to be used to encrypt message for this contact\&. If no key is provided, the current key is erased\&. You can use the shortcut\-jid "\&." for the currently selected contact\&. .RE .RE .PP /quit .RS 4 This command closes all connections and quit mcabber\&. .RE .PP /rawxml send string .RS 4 Send "string" (raw XML format) to the Jabber server\&. No check is done on the string provided\&. BEWARE! Use this only if you know what you are doing, or you could terminate the connection\&. Example: "/rawxml send away" .RE .PP /rename name .RS 4 Rename the current buddy or group to the given "name"\&. If "name" is \-, the name is removed from the roster (and mcabber will display the JID or username)\&. .RE .PP /request last|ping|time|vcard|version [jid] .RS 4 Send a "IQ" query to the current buddy, or to the specified Jabber user\&. If the resource is not provided with the jid, mcabber will send the query to all known resources for this user\&. .PP \fIlast\fR .RS 4 Request "last" information (usually idle time) .RE .PP \fIping\fR .RS 4 Send an XMPP Ping request\&. Note that you should use the full JID since a ping sent to a bare JID will be handled by the server\&. .RE .PP \fItime\fR .RS 4 Request time from the buddy .RE .PP \fIvcard\fR .RS 4 Request VCard from the buddy .RE .PP \fIversion\fR .RS 4 Request version from the buddy .RE .RE .PP /room join|leave|names|nick|remove|topic|unlock|destroy, /room privmsg|invite|whois|kick|ban|unban|role|affil, /room setopt print_status|auto_whois [value], /room bookmark [add|del] [\-autojoin|+autojoin] [\-|nick] .RS 4 The \fIroom\fR command handles Multi\-User Chat room actions\&. .PP \fIjoin\fR [room [nick [pass]]] .RS 4 Join "room", using "nick" as nickname\&. If no nickname is provided (or if it is an empty string), the "nickname" option value is used (see sample configuration file)\&. If the currently selected entry is correctly recognized as a room by mcabber, the shortcut "\&." can be used instead of the full room id\&. A password can be provided to enter protected rooms\&. If your nickname contains space characters, use quotes\&. .RE .PP \fIleave\fR [message] .RS 4 Leave the current room .RE .PP \fInames\fR [\-\-detail|\-\-short|\-\-quiet|\-\-compact] .RS 4 Display members of the current room .RE .PP \fInick\fR newnick .RS 4 Change your nickname in the current room .RE .PP \fIprivmsg\fR nick msg .RS 4 Send private message "msg" to "nick" .RE .PP \fIremove\fR .RS 4 Remove the current room from the roster (you must have left this room before) .RE .PP \fItopic\fR \-|newtopic .RS 4 Set topic for current room .RE .PP \fIunlock\fR .RS 4 Unlock current room (if you are the owner) .RE .PP \fIdestroy\fR [reason] .RS 4 Destroy the current room (use with care!) .RE .PP \fIwhois\fR nick .RS 4 Display MUC information about "nick" .RE .PP \fIban\fR jid [reason] .RS 4 Ban jid from the current room .RE .PP \fIunban\fR jid .RS 4 Unban jid from the current room .RE .PP \fIinvite\fR jid [reason] .RS 4 Invite jid to the current room .RE .PP \fIkick\fR nick [reason] .RS 4 Kick "nick" from the current room .RE .PP \fIrole\fR jid role [reason] .RS 4 Change jid\(cqs role (role can be "none", "visitor", "participant", "moderator") .RE .PP \fIaffil\fR jid affil [reason] .RS 4 Change jid\(cqs affiliation (affil can be "none", "member", "admin", "owner") .RE .PP \fIsetopt\fR print_status|auto_whois [value] .RS 4 Change settings for the current room For print_status, the possible values are "default", "none", "in_and_out", "all"\&. For auto_whois, the possible values are "default", "off", "on"\&. When the value is "default", the options muc_print_status / muc_auto_whois is used\&. .RE .PP \fIbookmark\fR [add|del] [\-autojoin|+autojoin] [\-|nick] .RS 4 Add, remove or update a bookmark (default is add)\&. If autojoin is set, mcabber will automatically join the MUC room when it connects to the server\&. To see the list of bookmarks, use /room bookmark in the status buffer\&. .RE .RE .PP /roster bottom|top|up|down|group_prev|group_next, /roster alternate|unread_first|unread_next, /roster search bud, /roster display|hide_offline|show_offline|toggle_offline, /roster item_lock|item_unlock|item_toggle_lock, /roster hide|show|toggle, /roster note [\-|text] .RS 4 The \fIroster\fR command manipulates the roster/buddylist\&. Here are the available parameters: .PP \fIbottom\fR .RS 4 Jump to the bottom of the roster .RE .PP \fItop\fR .RS 4 Jump to the top of the roster .RE .PP \fIup\fR [n] .RS 4 Move up [n lines] in the roster .RE .PP \fIdown\fR [n] .RS 4 Move down [n lines] in the roster .RE .PP \fIgroup_prev\fR .RS 4 Jump to the previous group in the roster .RE .PP \fIgroup_next\fR .RS 4 Jump to the next group in the roster .RE .PP \fIalternate\fR .RS 4 Jump to alternate buddy\&. The "alternate" buddy is the last buddy left while being in chat mode\&. This command is thus especially useful after commands like "/roster unread_next" (Ctrl\-q)\&. .RE .PP \fIunread_first\fR .RS 4 Jump to the first unread message .RE .PP \fIunread_next\fR .RS 4 Jump to the next unread message .RE .PP \fIsearch\fR bud .RS 4 Search for a buddy with a name or jid containing "bud" (only in the displayed buddylist) .RE .PP \fIdisplay\fR [mask] .RS 4 See or update the roster filter\&. The mask should contain the shortcut letters of the status you want to see ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline)\&. For example "ofdna" to display only connected buddies\&. .RE .PP \fIhide_offline\fR .RS 4 Hide offline buddies (same as /roster display ofdna) .RE .PP \fIshow_offline\fR .RS 4 Show offline buddies (same as /roster display ofdna_) .RE .PP \fItoggle_offline\fR .RS 4 Toggle display of offline buddies .RE .PP \fIitem_lock\fR [jid] .RS 4 Lock the roster item so it remains visible regardless of its status .RE .PP \fIitem_unlock\fR [jid] .RS 4 Undo the effects of item_lock .RE .PP \fIitem_toggle_lock\fR [jid] .RS 4 Invert the current lock flag .RE .PP \fIhide\fR .RS 4 Hide roster (full\-width chat window) .RE .PP \fIshow\fR .RS 4 Show roster .RE .PP \fItoggle\fR .RS 4 Toggle roster visibility .RE .PP \fInote\fR [\-|text] .RS 4 Set/update/delete an annotation\&. If there is no text, the current item\(cqs annotation is displayed \(em if you are in the status buffer, all notes are displayed\&. If text is "\-", the note is erased\&. .RE .RE .PP /say [\-n|\-h|\-\-] text .RS 4 Send the "text" message to the currently selected buddy\&. It can be useful if you want to send a message beginning with a slash, for example\&. The "\-n" flag turns the message to "normal" type, "\-h" to "headline"\&. "\-\-" can be used to send chat message beginning with \-n or \-h\&. .RE .PP /say_to [\-n|\-h] [\-q] [\-f file] jid text .RS 4 Send the "text" message to the specified jid\&. Please note that this command doesn\(cqt set the default resource for a contact, so if you want to send several messages to a specific resource you will have to use "/say_to" for each message\&. You can send a message to a specific resource of the currently selected contact by using /say_to ./resourcename message\&. The "\-n" flag turns the message to "normal" type, "\-h" to "headline"\&. "\-\-" can be used to send chat messages beginning with \-n or \-h\&. When "\-q" is used, the message will be sent in the background and will not change the current active window\&. A text file can be provided with the "\-f" switch (in which case there\(cqs no need to pass a text argument after the jid, of course)\&. .RE .PP /screen_refresh .RS 4 Refresh the mcabber screen\&. .RE .PP /set [option [= value]] .RS 4 Display or set an option value\&. Without arguments prints a list of all set options with their values .RE .PP /source pattern .RS 4 Read configuration files, that match glob pattern (sorted in alphabetical order)\&. .RE .PP /status [online|avail|free|dnd|notavail|away [\-|statusmessage]], /status message \-|statusmessage .RS 4 Show or set the current status\&. If no status is specified, display the current status\&. If a status message is specified, it will overrride the message* variables (these variables can be set in the configuration file)\&. If no relevant message* variable is set and no status message provided, the current status message is kept\&. If StatusMessage is "\-", the current status message is cleared\&. With the "/status message" command, mcabber will update the message while preserving the status\&. .RE .PP /status_to jid online|avail|free|dnd|notavail|away [statusmessage], /status_to jid message statusmessage .RS 4 Send the requested status to the specified Jabber user\&. If the specified jid is "\&.", the current buddy is used\&. Note: this status will be overridden by subsequent "/status" commands\&. If you are using the auto\-away feature, the status will overridden too\&. Note: The jid can include a resource (i\&.e\&. user@server/resource)\&. .RE .PP /version .RS 4 Display current version of mcabber\&. .RE .SH "CONFIGURATION FILE" .sp See the provided sample configuration file, which should be self\-documenting\&. .SH "FILES" .sp The following files can be used by mcabber(1): .sp .if n \{\ .RS 4 .\} .nf $HOME/\&.mcabber/mcabberrc Default configuration file $HOME/\&.mcabberrc Configuration file used if no other has been found $HOME/\&.mcabber/histo/ Default directory for storing chat history files, if enabled /usr/share/mcabber/help/ Default directory for online help files /usr/lib/mcabber/ Default directory for modules .fi .if n \{\ .RE .\} .SH "BUGS" .sp Certainly\&. Please tell me if you find one! :\-) Please visit our website to find out about the MUC room and the bug tracker\&. .SH "AUTHOR" .sp Written by \m[blue]\fBMikael BERTHE\fR\m[]\&\s-2\u[1]\d\s+2 and others (see AUTHORS file)\&. .SH "RESOURCES" .sp \m[blue]\fBMain web site\fR\m[]\&\s-2\u[2]\d\s+2 .sp \m[blue]\fBOfficial wiki\fR\m[]\&\s-2\u[3]\d\s+2 .sp \m[blue]\fBMCabber MUC room\fR\m[]\&\s-2\u[4]\d\s+2 .SH "COPYING" .sp Copyright (C) 2005\-2012 Mikael Berthe and others\&. .sp Free use of this software is granted under the terms of the GNU General Public License (GPL)\&. .SH "NOTES" .IP " 1." 4 Mikael BERTHE .RS 4 \%mailto:mikael@lilotux.net .RE .IP " 2." 4 Main web site .RS 4 \%http://mcabber.com/ .RE .IP " 3." 4 Official wiki .RS 4 \%http://wiki.mcabber.com/ .RE .IP " 4." 4 MCabber MUC room .RS 4 \%xmpp:mcabber@conf.lilotux.net .RE mcabber-0.10.2/doc/mcabber.1.html000066400000000000000000001661401216603513500163640ustar00rootroot00000000000000 MCABBER(1)

SYNOPSIS

mcabber [ -h | -V | -f configfile ]

DESCRIPTION

mcabber(1) is a small Jabber (XMPP) console client.
For now it needs a configuration file to start, so please copy the sample mcabberrc file and adapt your connection settings.

You also need to have an existing Jabber account to use this software, as it cannot (un)register accounts yet.

Here are some of the features of mcabber:

  • SASL/SSL/TLS support.

  • MUC support (Multi-User Chat).

  • PGP, OTR support

  • Chat States support (typing notifications)

  • History logging: If enabled (see the CONFIGURATION FILE section), mcabber can save discussions to text history log files.

  • Commands completion: If possible, mcabber will try to complete your command line if you hit the Tab key.

  • Input line history: Any message or command entered is in the input line history and can be reused easily.

  • External actions: Some events (like receiving a message) can trigger an external action such as a shell script if you enable it in your configuration file. A sample events script ("eventcmd") is provided with mcabber source code, in the contrib directory.

  • Modules: mcabber can load modules (a.k.a. plugins) at runtime that extend its features.

OPTIONS

-h

Quick help usage message

-V

Displays mcabber version and compile-time definitions.

-f configfile

Use configuration file configfile

WINDOWS/PANES

The mcabber(1) screen is divided into 4 regions. The roster, alias buddylist, is on the left. The chat window, or chat buffer, is on the right. The input line lies at the bottom of the screen, under a small log window.

Two status lines surround the log window. The bottom status line is the "main status line" and reflects mcabber general status. The other line is the "chat status line" and shows the status of the currently selected buddy.

To display buddies chat buffers, you will have to enter chat mode. You can enter chat mode by pressing enter, and leave chat mode with the ESC key. Simply sending a message will also enable chat mode.

There are several advantages to the two-mode implementation: first, it allows accurate "unread" message functionality, as described in the next section; without this, merely scrolling to a specific buddy will "read" the new messages of all buddies in-between. Second, it allows quickly hiding the conversation with a single keystroke. Third, it allows jumping between the few buddies with whom you are conversing with the /roster alternate command described in another section, without having to manually scroll back and forth.

KEYS

Text typing occurs in the input line; basic operations are supported (left arrow, right arrow, home/end keys, insert, delete, backspace…).

PageUp and PageDown keys are used to move in the roster.

Up and Down arrow keys can be used to move in the input line history; they jump to the previous/next line from the history beginning with the same string (from first column to the cursor column).

To send a message, move to the chosen buddy in the buddylist, type your message and hit enter. If the line begins with a slash, this will be interpreted as a command (see the COMMAND section below). Hit escape to leave the chat mode.

Here is a quick description of the default key bindings:

Esc

Disable chat mode

Ctrl-a

Go to the beginning of the input line

Ctrl-e

Go to the end of the input line

Ctrl-l

Force a refresh

Up/Down

Move in the input line history

PgUp/PgDown

Move inside the roster (buddylist)

Tab

Complete current word, in the input line

Ctrl-g

Cancel completion

Ctrl-c

Abort multi-line messages and completions

Ctrl-d

Send/terminate a multi-line message

Ctrl-p/Ctrl-n

Scroll up/down half a screen in the buffer window (chat mode)

Ctrl-Left

Move the cursor back to the start of the current or previous word

Ctrl-Right

Move the cursor forward to the end of the current or next word

Ctrl-u

Delete from beginning of the line to the cursor

Ctrl-k

Delete from the cursor to the end of line

Ctrl-w

Backward kill word

Ctrl-t

Transpose chars

Ctrl-o

Accept line and put the next history line in the input line (accept-line-and-down-history)

Additional key bindings may be specified using the /bind command described in the COMMANDS section.

MCABBER’S ROSTER

The first listed item on the roster is [status], which keeps a log of everything that appears in the short log window below the main chat area. While the log window was designed for showing the latest few elements, the dedicated [status] buffer allows more comfortable viewing of the log, as well as scrolling it in a standard manner.

Group names are displayed above the items that are within them, and are indicated by --- to the left of the name.

For every real Jabber contact, the roster displays four pieces of information: the buddy’s name or alias, its online status, its authorization status, and whether there are unread messages from the buddy waiting for you.

The online status is one of the following:

o

online

f

free for chat

a

away

n

not available (labeled extended away in some clients)

d

do not disturb

_

offline (or invisible to you)

?

unknown, usually meaning you are not authorized to see this buddy’s status

x

a conference room in which you are not participating

C

a conference room in which you are participating

The authorization status indicates whether a buddy is authorized to receive your online status updates, and is displayed by the brackets surrounding the buddy’s online status. Square brackets, like [o], indicate that this buddy is authorized to receive your status. Curly braces, like {o}, indicate that they are not authorized to receive your status.

When there are unread messages from a buddy which you have not looked at, a hash mark (#) appears in the leftmost section of the roster for that buddy. The hash mark disappears once you view that buddy’s message buffer. When the user attention is requested (or when you receive a message containing your nickname in a MUC room), the hash mark is replaced with the attention sign, an exclamation mark (!).

Examples:

' --- Buds'

This is a group named Buds

#[o] John

John is online, can see your status, and sent you a message that you did not read yet

{?} Sally

Neither you nor Sally have authorized each other to see your online status

{a} Jane

Jane is away, but she cannot see your online status

#[C] x@y.c

You are participating in x@y.c conference room, and there are unread messages

COMMANDS

Please refer to the online help (command /help), it is probably more up-to-date than this manpage. Furthermore, help files have been translated into several languages.
You will find an overview of the mcabber commands in this manual.

/add [jid [nickname]]

Add the "jid" Jabber user to our roster (default group), and send a notification request to this buddy. If no nickname is specified, the jid is used. If no jid (or an empty string "") is provided or if jid is ".", the current buddy is used.

[jid [nickname]]

Add to our roster "jid" as "nickname"

Example: "/add somebody@jabber.server.com Somebody"
/alias [name [= command line]]

This command let you to add aliases which can simplify sophisticated commands.
You can manage your aliases by:

(without arguments)

Print list of currently defined aliases

name

Print the value of alias called "name"

name=

Unset alias called "name"

name = command line

Set alias called "name" with value "command line"

Example: "/alias away = status away"
/authorization allow|cancel|request|request_unsubscribe [jid]

This command manages presence subscriptions: it allows you to request presence subscriptions from others on your roster, and allows you to control who receives your presence notifications.
If no JID is provided, the currently-selected buddy is used.

allow

Allow the buddy to receive your presence updates

cancel

Cancel the buddy’s subscription to your presence updates

request

Request a subscription to the buddy’s presence updates

request_unsubscribe

Request unsubscription from the buddy’s presence updates

/bind [keycode [= command line]]

Bind the command to the key given as "keycode". To examine which keys are currently not used look at mcabber log window and press examined key. For example: "Unknown key=265" means that you can bind some command to key #265.

(without arguments)

Display list of current bindings

keycode

Display the command line bound to this key

keycode=

Unbind key with code "keycode"

keycode = command line

Bind "command line" to the key with code "keycode"

Example: "/bind 265 = status away" (265 is F1). +
Note: keycodes can be different depending on your ncurses configuration. +
Tip: aliases also can be used instead of commands.
/buffer clear|close|close_all|purge|list
/buffer top|bottom|date|%|search_backward|search_forward
/buffer scroll_lock|scroll_unlock|scroll_toggle
/buffer save filename

Buddy’s buffer manipulation command. E.g. you can search through buffer for "text", clear chat window etc.

clear

Clear the current buddy chat window

close [jid]

Empty all contents of the buffer and close the current buddy chat window

close_all

Empty all contents of the chat buffers and close the chat windows

purge [jid]

Clear the current buddy chat window and empty all contents of the chat buffer

list

Display the list of existing buffers, with their length (lines/blocks)

top

Jump to the top of the current buddy chat buffer

bottom

Jump to the bottom of the current buddy chat buffer

up [n]

Scroll the buffer up [n] lines (default: half a screen)

down [n]

Scroll the buffer down [n] lines (default: half a screen)

date [date]

Jump to the first line after the specified [date] in the chat buffer (date format: "YYYY-mm-dd")

% n

Jump to position %n of the buddy chat buffer

search_backward text

Search for [text] in the current buddy chat buffer

search_forward text

Search for [text] in the current buddy chat buffer

scroll_lock

Lock buffer scrolling

scroll_unlock

Unlock buffer scrolling

scroll_toggle

Toggle buffer scrolling (lock/unlock)

save filename

Save the contents of the current buffer to the file "filename"

/chat_disable [--show-roster]

Disable chat mode.
With --show-roster, the fullscreen mode will be disabled.

/clear

This command is actually an alias for "/buffer clear". It clears the current buddy chat window.

/color roster (status wildcard (color|-)|clear)
/color mucnick nick (color|-)
/color muc (jid|.|*) [on|preset|off|-]

The color command allows setting dynamic color properties of the screen.

roster clear

Remove all color rules for the roster. All roster items will get its default color.

roster status wildcard color

Set a color rule (or overwrite, if it already exists). The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK. Wildcard is the file-matching wildcard that will be applied to JID. Color is the wanted color. If color is -, the rule is removed. If more than one rule matches, the color from the last created (not overwritten) is used.

mucnick nick (color|-)

Marks the nick to be colored by given color. If a MUC has colored nicks, this one will be used. If color is -, the color is marked as chosen automatically, which means it will not be used in preset coloring mode, but will stay the same in on coloring mode.

muc (jid|.|*) [on|preset|off|-]

Sets a MUC nick coloring mode. If a jid (. means currently selected jid) is provided, the mode will apply to this specific MUC. If * is used, it will be applied to all MUCs, except the ones set by their jid. Mode on colors all nicks, preset only the ones manually set by /color mucnick command and off colors none. If not specified, defaults to on. Mode - removes the mode from given JID, which means the global one will apply. You can not remove the global mode. Default global coloring mode is off.

/connect

Establish connection to the Jabber server.

/del

Delete the current buddy from our roster, unsubscribe from its presence notification and unsubscribe it from ours.

/disconnect

Terminate the connection to the Jabber server.
Note: the roster is only available when the connection to the server is active, so the buddylist is empty when disconnected.

/echo message

Display "message" in the log window.

/event #n|* accept|ignore|reject [event-specific arguments]
/event list

Tell mcabber what to do about pending events.
If the first parameter is *, the command will apply to all queued events.
Event-specific arguments will be interpreted on event-to event basis. The only built-in case, when argument is used is MUC invitation reject - argument, if present, will be interpreted as reject reason.

#N|* accept [event-specific arguments]

Event number #N/All events will be accepted

#N|* ignore [event-specific arguments]

Event number #N/All events will be ignored

#N|* reject [event-specific arguments]

Event number #N/All events will be rejected

list

List all pending events

/group fold|unfold|toggle [groupname]

This command changes the current group display.

fold [groupname]

Fold (shrink) the current/specified group tree in the roster

unfold [groupname]

Unfold (expand) the current/specified group tree in the roster

toggle [groupname]

Toggle the state (fold/unfold) of the current/specified tree

/help [command|+topic]

Display help for command "command" or topic "topic".
Example: "/help buffer"

/iline fchar|bchar|char_fdel|char_bdel|char_swap
/iline fword|bword|word_bdel|word_fdel
/iline word_upcase|word_downcase|word_capit
/iline hist_beginning_search_bwd|hist_beginning_search_fwd
/iline hist_prev|hist_next
/iline iline_start|iline_end|iline_fdel|iline_bdel
/iline iline_accept|iline_accept_down_hist
/iline compl_do|compl_cancel
/iline send_multiline

Input line commands

fchar

Move to the next letter

bchar

Move to the previous letter

char_fdel

Delete the letter at cursor position

char_bdel

Delete the letter before cursor position

char_swap

Transpose chars

fword

Move the cursor forward to the end of the current or next word

bword

Move the cursor back to the start of the current or previous word

word_bdel

Delete the word from cursor position to its start

word_fdel

Delete the word from cursor position to its end

word_upcase

Convert the word from cursor position to its end to upper case

word_downcase

Convert the word from cursor position to its end to down case

word_capit

Capitalize the word from cursor position to its end

hist_beginning_search_bwd

Search backward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position)

hist_beginning_search_fwd

Search forward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position)

hist_prev

Previous line of input line history

hist_next

Next line of input line history

iline_start

Go to the beginning of the input line

iline_end

Go to the end of the input line

iline_fdel

Delete from the cursor to the end of line

iline_bdel

Delete from beginning of the line to the cursor

iline_accept

Accept line

iline_accept_down_hist

Accept line and put the next history line in the input line

compl_do

Complete current word, in the input line

compl_cancel

Cancel completion

send_multiline

Send/terminate a multi-line message

/info

Display info on the selected entry (user, agent, group…).
For users, resources are displayed with the status, priority and status message (if available) of each resource.

/module load|unload [-f] module
/module info module
/module [list]

Load, unload or show info on module.

load [-f] module

Loads specified module. If -f flag is specified, most of module loading errors will be ignored.

unload [-f] module

Unloads specified module. Note: The force flag will not remove any dependency on this module!

info module

Shows available information about this module.

[list]

Lists modules in a format: [modulename] [reference count] ([Manually/Automatically loaded]) [any extra info, like version or dependencies]

/move [groupname]

Move the current buddy to the requested group. If no group is specified, then the buddy is moved to the default group. If the group "groupname" doesn’t exist, it is created.
Tip: if the chatmode is enabled, you can use "/roster alternate" to jump to the moved buddy.

/msay begin|verbatim|send|send_to|toggle|toggle_verbatim|abort

Send a multi-line message. To write a single message with several lines, the multi-line mode should be used.
In multi-line mode, each line (except command lines) typed in the input line will be added to the multi-line message. Once the message is finished, it can be sent to the current selected buddy with the "/msay send" command.
The begin subcommand enables multi-line mode. Note that it allows a message subject to be specified.
The verbatim multi-line mode disables commands, so that it is possible to enter lines starting with a slash. Only the "/msay" command (with send or abort parameters) can be used to exit verbatim mode.
The toggle subcommand can be bound to a key to use the multi-line mode quickly (for example, "bind M13 = msay toggle" to switch using the Meta-Enter combination).

begin [subject]

Enter multi-line mode

verbatim

Enter verbatim multi-line mode

send [-n|-h]

Send the current multi-line message to the currently selected buddy

send_to [-n|-h] jid

Send the current multi-line message to "jid"

toggle|toggle_verbatim

Switch to/from multi-line mode (begin/send)

abort

Leave multi-line mode without sending the message

The -n or -h flags turn the message to "normal" or "headline" accordingly, as opposed to default "chat" message.
/otr key
/otr start|stop|info [jid]
/otr fingerprint [jid [fpr]]
/otr smpq|smpr [jid] secret
/otr smpa [jid]

You can use the shortcut-jid "." for the currently selected contact.

key

Print the fingerprint of your private key to the Status Buffer

start [jid]

Open an OTR channel to the specified jid (or the currently selected contact)

stop [jid]

Close the OTR channel to the specified jid (or the currently selected contact)

info [jid]

Show current OTR status for the specified jid (or the currently selected contact)

fingerprint [jid [fpr]]

Show the active fingerprint of an OTR channel. If the fingerprint is provided instead of "fpr", the fingerprint will become trusted. If you replace "fpr" by some bogus string the fingerprint will loose the trusted status.

smpq [jid] secret

Initiate the Socialist Millionaires Protocol with the secret and the buddy

smpr [jid] secret

Respond to the Initiation of the jid with the secret

smpa [jid]

Abort the running Socialist Millionaires Protocol

/otrpolicy
/otrpolicy (default|jid) (plain|manual|opportunistic|always)

You can use the shortcut-jid "." for the currently selected contact.

(without arguments)

Prints all OTR policies to the status buffer

(default|jid) (plain|manual|opportunistic|always)

Sets either the default policy or the policy for the given jid The plain policy should never be used, because you won’t be able to receive or send any OTR encrypted messages. If you set the policy to manual, you or your chat partner have to start the OTR encryption by hand (e.g. with /otr start). The policy "opportunistic" does that itself by sending a special whitespace-sequence at the end of unencrypted messages. So the other OTR-enabled chat client knows, that you want to use OTR. Note that the first message will always be unencryted, if you use this policy. With the policy "always" no message will be sent in plain text. If you try to sent the first message unencrypted, mcabber will try to establish an OTR channel. Please resend your message, when you get the information that the channel was established. If someone sends you plaintext messages while the policy is set to "always", you’ll be able to read the message but it won’t be saved to the history.

/pgp disable|enable|force|info [jid]
/pgp setkey [jid [key]]

This command manipulates PGP settings for the specified jid (by default the currently selected contact).
Please note that PGP encryption won’t be used if no remote PGP support is detected, even if PGP is enabled with this command. You can force PGP encryption with the "force" subcommand.

disable [jid]

Disable PGP encryption for jid (or the currently selected contact)

enable [jid]

Enable PGP encryption for jid (or the currently selected contact)

force [jid]

Enforce PGP encryption, even for offline messages, and always assume the recipient has PGP support. If a message can’t be encrypted (missing key or key id), the messages won’t be sent at all. This option is ignored when PGP is disabled.

info [jid]

Show current PGP settings for the contact

setkey [jid [key]]

Set the PGP key to be used to encrypt message for this contact. If no key is provided, the current key is erased. You can use the shortcut-jid "." for the currently selected contact.

/quit

This command closes all connections and quit mcabber.

/rawxml send string

Send "string" (raw XML format) to the Jabber server.
No check is done on the string provided.
BEWARE! Use this only if you know what you are doing, or you could terminate the connection.
Example: "/rawxml send <presence><show>away</show></presence>"

/rename name

Rename the current buddy or group to the given "name". If "name" is -, the name is removed from the roster (and mcabber will display the JID or username).

/request last|ping|time|vcard|version [jid]

Send a "IQ" query to the current buddy, or to the specified Jabber user. If the resource is not provided with the jid, mcabber will send the query to all known resources for this user.

last

Request "last" information (usually idle time)

ping

Send an XMPP Ping request. Note that you should use the full JID since a ping sent to a bare JID will be handled by the server.

time

Request time from the buddy

vcard

Request VCard from the buddy

version

Request version from the buddy

/room join|leave|names|nick|remove|topic|unlock|destroy
/room privmsg|invite|whois|kick|ban|unban|role|affil
/room setopt print_status|auto_whois [value]
/room bookmark [add|del] [-autojoin|+autojoin] [-|nick]

The room command handles Multi-User Chat room actions.

join [room [nick [pass]]]

Join "room", using "nick" as nickname. If no nickname is provided (or if it is an empty string), the "nickname" option value is used (see sample configuration file). If the currently selected entry is correctly recognized as a room by mcabber, the shortcut "." can be used instead of the full room id. A password can be provided to enter protected rooms. If your nickname contains space characters, use quotes.

leave [message]

Leave the current room

names [--detail|--short|--quiet|--compact]

Display members of the current room

nick newnick

Change your nickname in the current room

privmsg nick msg

Send private message "msg" to "nick"

remove

Remove the current room from the roster (you must have left this room before)

topic -|newtopic

Set topic for current room

unlock

Unlock current room (if you are the owner)

destroy [reason]

Destroy the current room (use with care!)

whois nick

Display MUC information about "nick"

ban jid [reason]

Ban jid from the current room

unban jid

Unban jid from the current room

invite jid [reason]

Invite jid to the current room

kick nick [reason]

Kick "nick" from the current room

role jid role [reason]

Change jid’s role (role can be "none", "visitor", "participant", "moderator")

affil jid affil [reason]

Change jid’s affiliation (affil can be "none", "member", "admin", "owner")

setopt print_status|auto_whois [value]

Change settings for the current room For print_status, the possible values are "default", "none", "in_and_out", "all". For auto_whois, the possible values are "default", "off", "on". When the value is "default", the options muc_print_status / muc_auto_whois is used.

bookmark [add|del] [-autojoin|+autojoin] [-|nick]

Add, remove or update a bookmark (default is add). If autojoin is set, mcabber will automatically join the MUC room when it connects to the server. To see the list of bookmarks, use /room bookmark in the status buffer.

/roster bottom|top|up|down|group_prev|group_next
/roster alternate|unread_first|unread_next
/roster search bud
/roster display|hide_offline|show_offline|toggle_offline
/roster item_lock|item_unlock|item_toggle_lock
/roster hide|show|toggle
/roster note [-|text]

The roster command manipulates the roster/buddylist.
Here are the available parameters:

bottom

Jump to the bottom of the roster

top

Jump to the top of the roster

up [n]

Move up [n lines] in the roster

down [n]

Move down [n lines] in the roster

group_prev

Jump to the previous group in the roster

group_next

Jump to the next group in the roster

alternate

Jump to alternate buddy. The "alternate" buddy is the last buddy left while being in chat mode. This command is thus especially useful after commands like "/roster unread_next" (Ctrl-q).

unread_first

Jump to the first unread message

unread_next

Jump to the next unread message

search bud

Search for a buddy with a name or jid containing "bud" (only in the displayed buddylist)

display [mask]

See or update the roster filter. The mask should contain the shortcut letters of the status you want to see ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). For example "ofdna" to display only connected buddies.

hide_offline

Hide offline buddies (same as /roster display ofdna)

show_offline

Show offline buddies (same as /roster display ofdna_)

toggle_offline

Toggle display of offline buddies

item_lock [jid]

Lock the roster item so it remains visible regardless of its status

item_unlock [jid]

Undo the effects of item_lock

item_toggle_lock [jid]

Invert the current lock flag

hide

Hide roster (full-width chat window)

show

Show roster

toggle

Toggle roster visibility

note [-|text]

Set/update/delete an annotation. If there is no text, the current item’s annotation is displayed — if you are in the status buffer, all notes are displayed. If text is "-", the note is erased.

/say [-n|-h|--] text

Send the "text" message to the currently selected buddy. It can be useful if you want to send a message beginning with a slash, for example.
The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat message beginning with -n or -h.

/say_to [-n|-h] [-q] [-f file] jid text

Send the "text" message to the specified jid.
Please note that this command doesn’t set the default resource for a contact, so if you want to send several messages to a specific resource you will have to use "/say_to" for each message.
You can send a message to a specific resource of the currently selected contact by using /say_to ./resourcename message.
The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat messages beginning with -n or -h.
When "-q" is used, the message will be sent in the background and will not change the current active window.
A text file can be provided with the "-f" switch (in which case there’s no need to pass a text argument after the jid, of course).

/screen_refresh

Refresh the mcabber screen.

/set [option [= value]]

Display or set an option value.
Without arguments prints a list of all set options with their values

/source pattern

Read configuration files, that match glob pattern (sorted in alphabetical order).

/status [online|avail|free|dnd|notavail|away [-|statusmessage]]
/status message -|statusmessage

Show or set the current status.
If no status is specified, display the current status.
If a status message is specified, it will overrride the message* variables (these variables can be set in the configuration file).
If no relevant message* variable is set and no status message provided, the current status message is kept.
If StatusMessage is "-", the current status message is cleared.
With the "/status message" command, mcabber will update the message while preserving the status.

/status_to jid online|avail|free|dnd|notavail|away [statusmessage]
/status_to jid message statusmessage

Send the requested status to the specified Jabber user.
If the specified jid is ".", the current buddy is used.
Note: this status will be overridden by subsequent "/status" commands. If you are using the auto-away feature, the status will overridden too.
Note: The jid can include a resource (i.e. user@server/resource).

/version

Display current version of mcabber.

CONFIGURATION FILE

See the provided sample configuration file, which should be self-documenting.

FILES

The following files can be used by mcabber(1):

$HOME/.mcabber/mcabberrc    Default configuration file
$HOME/.mcabberrc            Configuration file used if no other has been found
$HOME/.mcabber/histo/       Default directory for storing chat history files, if enabled
/usr/share/mcabber/help/    Default directory for online help files
/usr/lib/mcabber/           Default directory for modules

BUGS

Certainly. Please tell me if you find one! :-)
Please visit our website to find out about the MUC room and the bug tracker.

AUTHOR

Written by Mikael BERTHE and others (see AUTHORS file).

RESOURCES

COPYING

Copyright (C) 2005-2012 Mikael Berthe and others.

Free use of this software is granted under the terms of the GNU General Public License (GPL).


mcabber-0.10.2/doc/mcabber.1.txt000066400000000000000000001000201216603513500162200ustar00rootroot00000000000000MCABBER(1) =========== Mikael BERTHE v0.10.2, December 2012 NAME ---- mcabber - a simple Jabber (XMPP) console client SYNOPSIS -------- 'mcabber' [ -h | -V | -f configfile ] DESCRIPTION ----------- `mcabber(1)` is a small Jabber (XMPP) console client. + For now it needs a configuration file to start, so please copy the sample mcabberrc file and adapt your connection settings. You also need to have an existing Jabber account to use this software, as it cannot (un)register accounts yet. Here are some of the features of `mcabber`: - 'SASL/SSL/TLS support'. - 'MUC support' (Multi-User Chat). - 'PGP, OTR support' - 'Chat States' support (typing notifications) - 'History logging:' If enabled (see the CONFIGURATION FILE section), `mcabber` can save discussions to text history log files. - 'Commands completion:' If possible, `mcabber` will try to complete your command line if you hit the Tab key. - 'Input line history:' Any message or command entered is in the input line history and can be reused easily. - 'External actions:' Some events (like receiving a message) can trigger an external action such as a shell script if you enable it in your configuration file. A sample events script ("eventcmd") is provided with `mcabber` source code, in the contrib directory. - 'Modules:' `mcabber` can load modules (a.k.a. plugins) at runtime that extend its features. OPTIONS ------- -h:: Quick help usage message -V:: Displays `mcabber` version and compile-time definitions. -f configfile:: Use configuration file 'configfile' WINDOWS/PANES ------------- The `mcabber(1)` screen is divided into 4 regions. The 'roster', alias 'buddylist', is on the left. The 'chat window', or chat buffer, is on the right. The 'input line' lies at the bottom of the screen, under a small 'log window'. Two status lines surround the log window. The bottom status line is the "main status line" and reflects mcabber general status. The other line is the "chat status line" and shows the status of the currently selected buddy. To display buddies chat buffers, you will have to enter 'chat mode'. You can enter chat mode by pressing enter, and leave chat mode with the ESC key. Simply sending a message will also enable chat mode. There are several advantages to the two-mode implementation: first, it allows accurate "unread" message functionality, as described in the next section; without this, merely scrolling to a specific buddy will "read" the new messages of all buddies in-between. Second, it allows quickly hiding the conversation with a single keystroke. Third, it allows jumping between the few buddies with whom you are conversing with the '/roster alternate' command described in another section, without having to manually scroll back and forth. KEYS ---- Text typing occurs in the 'input line'; basic operations are supported (left arrow, right arrow, home/end keys, insert, delete, backspace...). PageUp and PageDown keys are used to move in the roster. Up and Down arrow keys can be used to move in the input line history; they jump to the previous/next line from the history beginning with the same string (from first column to the cursor column). To send a message, move to the chosen buddy in the buddylist, type your message and hit enter. If the line begins with a slash, this will be interpreted as a command (see the COMMAND section below). Hit escape to leave the chat mode. Here is a quick description of the default key bindings: Esc:: Disable chat mode Ctrl-a:: Go to the beginning of the input line Ctrl-e:: Go to the end of the input line Ctrl-l:: Force a refresh Up/Down:: Move in the input line history PgUp/PgDown:: Move inside the roster (buddylist) Tab:: Complete current word, in the input line Ctrl-g:: Cancel completion Ctrl-c:: Abort multi-line messages and completions Ctrl-d:: Send/terminate a multi-line message Ctrl-p/Ctrl-n:: Scroll up/down half a screen in the buffer window (chat mode) Ctrl-Left:: Move the cursor back to the start of the current or previous word Ctrl-Right:: Move the cursor forward to the end of the current or next word Ctrl-u:: Delete from beginning of the line to the cursor Ctrl-k:: Delete from the cursor to the end of line Ctrl-w:: Backward kill word Ctrl-t:: Transpose chars Ctrl-o:: Accept line and put the next history line in the input line (accept-line-and-down-history) Additional key bindings may be specified using the '/bind' command described in the COMMANDS section. MCABBER'S ROSTER ---------------- The first listed item on the roster is '[status]', which keeps a log of everything that appears in the short log window below the main chat area. While the log window was designed for showing the latest few elements, the dedicated '[status]' buffer allows more comfortable viewing of the log, as well as scrolling it in a standard manner. Group names are displayed above the items that are within them, and are indicated by '---' to the left of the name. For every real Jabber contact, the roster displays four pieces of information: the buddy's name or alias, its online status, its authorization status, and whether there are unread messages from the buddy waiting for you. The online status is one of the following: 'o';; online 'f';; free for chat 'a';; away 'n';; not available (labeled 'extended away' in some clients) 'd';; do not disturb '_';; offline (or invisible to you) '?';; unknown, usually meaning you are not authorized to see this buddy's status 'x';; a conference room in which you are not participating 'C';; a conference room in which you are participating The authorization status indicates whether a buddy is authorized to receive your online status updates, and is displayed by the brackets surrounding the buddy's online status. Square brackets, like '[o]', indicate that this buddy is authorized to receive your status. Curly braces, like '\{o\}', indicate that they are not authorized to receive your status. When there are unread messages from a buddy which you have not looked at, a hash mark ('#') appears in the leftmost section of the roster for that buddy. The hash mark disappears once you view that buddy's message buffer. When the user attention is requested (or when you receive a message containing your nickname in a MUC room), the hash mark is replaced with the 'attention sign', an exclamation mark ('!'). Examples: ' --- Buds';; This is a group named 'Buds' '#[o] John';; John is online, can see your status, and sent you a message that you did not read yet ' \{?\} Sally';; Neither you nor Sally have authorized each other to see your online status ' \{a\} Jane';; Jane is away, but she cannot see your online status '#[C] \x@y.c';; You are participating in \x@y.c conference room, and there are unread messages COMMANDS -------- Please refer to the online help (command /help), it is probably more up-to-date than this manpage. Furthermore, help files have been translated into several languages. + You will find an overview of the `mcabber` commands in this manual. COMMANDS RELATED TO MCABBER --------------------------- /add [jid [nickname]]:: Add the "jid" Jabber user to our roster (default group), and send a notification request to this buddy. If no nickname is specified, the jid is used. If no jid (or an empty string "") is provided or if jid is ".", the current buddy is used. ['jid' [nickname]];; Add to our roster "jid" as "nickname" Example: "/add somebody@jabber.server.com Somebody" /alias [name [= command line]]:: This command let you to add aliases which can simplify sophisticated commands. + You can manage your aliases by: (without arguments);; Print list of currently defined aliases 'name';; Print the value of alias called "name" 'name'=;; Unset alias called "name" 'name' = command line;; Set alias called "name" with value "command line" Example: "/alias away = status away" /authorization allow|cancel|request|request_unsubscribe [jid]:: This command manages presence subscriptions: it allows you to request presence subscriptions from others on your roster, and allows you to control who receives your presence notifications. + If no JID is provided, the currently-selected buddy is used. 'allow';; Allow the buddy to receive your presence updates 'cancel';; Cancel the buddy's subscription to your presence updates 'request';; Request a subscription to the buddy's presence updates 'request_unsubscribe';; Request unsubscription from the buddy's presence updates /bind [keycode [= command line]]:: Bind the command to the key given as "keycode". To examine which keys are currently not used look at `mcabber` log window and press examined key. For example: "Unknown key=265" means that you can bind some command to key #265. (without arguments);; Display list of current bindings 'keycode';; Display the command line bound to this key 'keycode'=;; Unbind key with code "keycode" 'keycode' = command line;; Bind "command line" to the key with code "keycode" Example: "/bind 265 = status away" (265 is F1). + Note: keycodes can be different depending on your ncurses configuration. + Tip: aliases also can be used instead of commands. /buffer clear|close|close_all|purge|list:: /buffer top|bottom|date|%|search_backward|search_forward:: /buffer scroll_lock|scroll_unlock|scroll_toggle:: /buffer save filename:: Buddy's buffer manipulation command. E.g. you can search through buffer for "text", clear chat window etc. 'clear';; Clear the current buddy chat window 'close' [jid];; Empty all contents of the buffer and close the current buddy chat window 'close_all';; Empty all contents of the chat buffers and close the chat windows 'purge' [jid];; Clear the current buddy chat window and empty all contents of the chat buffer 'list';; Display the list of existing buffers, with their length (lines/blocks) 'top';; Jump to the top of the current buddy chat buffer 'bottom';; Jump to the bottom of the current buddy chat buffer 'up' [n];; Scroll the buffer up [n] lines (default: half a screen) 'down' [n];; Scroll the buffer down [n] lines (default: half a screen) 'date' [date];; Jump to the first line after the specified [date] in the chat buffer (date format: "YYYY-mm-dd") % n;; Jump to position %n of the buddy chat buffer 'search_backward' text;; Search for [text] in the current buddy chat buffer 'search_forward' text;; Search for [text] in the current buddy chat buffer 'scroll_lock';; Lock buffer scrolling 'scroll_unlock';; Unlock buffer scrolling 'scroll_toggle';; Toggle buffer scrolling (lock/unlock) 'save' filename;; Save the contents of the current buffer to the file "filename" /chat_disable [--show-roster]:: Disable chat mode. + With --show-roster, the fullscreen mode will be disabled. /clear:: This command is actually an alias for "/buffer clear". It clears the current buddy chat window. /color roster (status wildcard (color|-)|clear):: /color mucnick nick (color|-):: /color muc (jid|.|*) [on|preset|off|-]:: The 'color' command allows setting dynamic color properties of the screen. 'roster' clear;; Remove all color rules for the roster. All roster items will get its default color. 'roster' status wildcard color;; Set a color rule (or overwrite, if it already exists). The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK. Wildcard is the file-matching wildcard that will be applied to JID. Color is the wanted color. If color is -, the rule is removed. If more than one rule matches, the color from the last created (not overwritten) is used. 'mucnick' nick (color|-);; Marks the nick to be colored by given color. If a MUC has colored nicks, this one will be used. If color is -, the color is marked as chosen automatically, which means it will not be used in 'preset' coloring mode, but will stay the same in 'on' coloring mode. 'muc' (jid|.|*) [on|preset|off|-];; Sets a MUC nick coloring mode. If a jid (. means currently selected jid) is provided, the mode will apply to this specific MUC. If * is used, it will be applied to all MUCs, except the ones set by their jid. Mode 'on' colors all nicks, 'preset' only the ones manually set by /color mucnick command and 'off' colors none. If not specified, defaults to 'on'. Mode '-' removes the mode from given JID, which means the global one will apply. You can not remove the global mode. Default global coloring mode is 'off'. /connect:: Establish connection to the Jabber server. /del:: Delete the current buddy from our roster, unsubscribe from its presence notification and unsubscribe it from ours. /disconnect:: Terminate the connection to the Jabber server. + Note: the roster is only available when the connection to the server is active, so the buddylist is empty when disconnected. /echo message:: Display "message" in the log window. /event #n|* accept|ignore|reject [event-specific arguments]:: /event list:: Tell mcabber what to do about pending events. + If the first parameter is '*', the command will apply to all queued events. + Event-specific arguments will be interpreted on event-to event basis. The only built-in case, when argument is used is MUC invitation reject - argument, if present, will be interpreted as reject reason. #N|* accept [event-specific arguments];; Event number #N/All events will be accepted #N|* ignore [event-specific arguments];; Event number #N/All events will be ignored #N|* reject [event-specific arguments];; Event number #N/All events will be rejected 'list';; List all pending events /group fold|unfold|toggle [groupname]:: This command changes the current group display. 'fold' [groupname];; Fold (shrink) the current/specified group tree in the roster 'unfold' [groupname];; Unfold (expand) the current/specified group tree in the roster 'toggle' [groupname];; Toggle the state (fold/unfold) of the current/specified tree /help [command|+topic]:: Display help for command "command" or topic "topic". + Example: "/help buffer" /iline fchar|bchar|char_fdel|char_bdel|char_swap:: /iline fword|bword|word_bdel|word_fdel:: /iline word_upcase|word_downcase|word_capit:: /iline hist_beginning_search_bwd|hist_beginning_search_fwd:: /iline hist_prev|hist_next:: /iline iline_start|iline_end|iline_fdel|iline_bdel:: /iline iline_accept|iline_accept_down_hist:: /iline compl_do|compl_cancel:: /iline send_multiline:: Input line commands 'fchar';; Move to the next letter 'bchar';; Move to the previous letter 'char_fdel';; Delete the letter at cursor position 'char_bdel';; Delete the letter before cursor position 'char_swap';; Transpose chars 'fword';; Move the cursor forward to the end of the current or next word 'bword';; Move the cursor back to the start of the current or previous word 'word_bdel';; Delete the word from cursor position to its start 'word_fdel';; Delete the word from cursor position to its end 'word_upcase';; Convert the word from cursor position to its end to upper case 'word_downcase';; Convert the word from cursor position to its end to down case 'word_capit';; Capitalize the word from cursor position to its end 'hist_beginning_search_bwd';; Search backward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) 'hist_beginning_search_fwd';; Search forward in the history for a line beginning with the current line up to the cursor (this leaves the cursor in its original position) 'hist_prev';; Previous line of input line history 'hist_next';; Next line of input line history 'iline_start';; Go to the beginning of the input line 'iline_end';; Go to the end of the input line 'iline_fdel';; Delete from the cursor to the end of line 'iline_bdel';; Delete from beginning of the line to the cursor 'iline_accept';; Accept line 'iline_accept_down_hist';; Accept line and put the next history line in the input line 'compl_do';; Complete current word, in the input line 'compl_cancel';; Cancel completion 'send_multiline';; Send/terminate a multi-line message /info:: Display info on the selected entry (user, agent, group...). + For users, resources are displayed with the status, priority and status message (if available) of each resource. /module load|unload [-f] module:: /module info module:: /module [list]:: Load, unload or show info on module. 'load' [-f] module;; Loads specified module. If -f flag is specified, most of module loading errors will be ignored. 'unload' [-f] module;; Unloads specified module. Note: The force flag will not remove any dependency on this module! 'info' module;; Shows available information about this module. ['list'];; Lists modules in a format: [modulename] [reference count] ([Manually/Automatically loaded]) [any extra info, like version or dependencies] /move [groupname]:: Move the current buddy to the requested group. If no group is specified, then the buddy is moved to the default group. If the group "groupname" doesn't exist, it is created. + Tip: if the chatmode is enabled, you can use "/roster alternate" to jump to the moved buddy. /msay begin|verbatim|send|send_to|toggle|toggle_verbatim|abort:: Send a multi-line message. To write a single message with several lines, the 'multi-line mode' should be used. + In multi-line mode, each line (except command lines) typed in the input line will be added to the multi-line message. Once the message is finished, it can be sent to the current selected buddy with the "/msay send" command. + The 'begin' subcommand enables multi-line mode. Note that it allows a message subject to be specified. + The 'verbatim' multi-line mode disables commands, so that it is possible to enter lines starting with a slash. Only the "/msay" command (with send or abort parameters) can be used to exit verbatim mode. + The 'toggle' subcommand can be bound to a key to use the multi-line mode quickly (for example, "bind M13 = msay toggle" to switch using the Meta-Enter combination). 'begin' [subject];; Enter multi-line mode 'verbatim';; Enter verbatim multi-line mode 'send' [-n|-h];; Send the current multi-line message to the currently selected buddy 'send_to' [-n|-h] jid;; Send the current multi-line message to "jid" 'toggle'|'toggle_verbatim';; Switch to/from multi-line mode (begin/send) 'abort';; Leave multi-line mode without sending the message The -n or -h flags turn the message to "normal" or "headline" accordingly, as opposed to default "chat" message. /otr key:: /otr start|stop|info [jid]:: /otr fingerprint [jid [fpr]]:: /otr smpq|smpr [jid] secret:: /otr smpa [jid]:: You can use the shortcut-jid "." for the currently selected contact. 'key';; Print the fingerprint of your private key to the Status Buffer 'start' [jid];; Open an OTR channel to the specified jid (or the currently selected contact) 'stop' [jid];; Close the OTR channel to the specified jid (or the currently selected contact) 'info' [jid];; Show current OTR status for the specified jid (or the currently selected contact) 'fingerprint' [jid [fpr]];; Show the active fingerprint of an OTR channel. If the fingerprint is provided instead of "fpr", the fingerprint will become trusted. If you replace "fpr" by some bogus string the fingerprint will loose the trusted status. 'smpq' [jid] secret;; Initiate the Socialist Millionaires Protocol with the secret and the buddy 'smpr' [jid] secret;; Respond to the Initiation of the jid with the secret 'smpa' [jid];; Abort the running Socialist Millionaires Protocol /otrpolicy:: /otrpolicy (default|jid) (plain|manual|opportunistic|always):: You can use the shortcut-jid "." for the currently selected contact. (without arguments);; Prints all OTR policies to the status buffer ('default'|'jid') (plain|manual|opportunistic|always);; Sets either the default policy or the policy for the given jid The plain policy should never be used, because you won't be able to receive or send any OTR encrypted messages. If you set the policy to manual, you or your chat partner have to start the OTR encryption by hand (e.g. with /otr start). The policy "opportunistic" does that itself by sending a special whitespace-sequence at the end of unencrypted messages. So the other OTR-enabled chat client knows, that you want to use OTR. Note that the first message will always be unencryted, if you use this policy. With the policy "always" no message will be sent in plain text. If you try to sent the first message unencrypted, mcabber will try to establish an OTR channel. Please resend your message, when you get the information that the channel was established. If someone sends you plaintext messages while the policy is set to "always", you'll be able to read the message but it won't be saved to the history. /pgp disable|enable|force|info [jid]:: /pgp setkey [jid [key]]:: This command manipulates PGP settings for the specified jid (by default the currently selected contact). + Please note that PGP encryption won't be used if no remote PGP support is detected, even if PGP is enabled with this command. You can force PGP encryption with the "force" subcommand. 'disable' [jid];; Disable PGP encryption for jid (or the currently selected contact) 'enable' [jid];; Enable PGP encryption for jid (or the currently selected contact) [+|-]'force' [jid];; Enforce PGP encryption, even for offline messages, and always assume the recipient has PGP support. If a message can't be encrypted (missing key or key id), the messages won't be sent at all. This option is ignored when PGP is disabled. 'info' [jid];; Show current PGP settings for the contact 'setkey' [jid [key]];; Set the PGP key to be used to encrypt message for this contact. If no key is provided, the current key is erased. You can use the shortcut-jid "." for the currently selected contact. /quit:: This command closes all connections and quit mcabber. /rawxml send string:: Send "string" (raw XML format) to the Jabber server. + No check is done on the string provided. + BEWARE! Use this only if you know what you are doing, or you could terminate the connection. + Example: "/rawxml send away" /rename name:: Rename the current buddy or group to the given "name". If "name" is -, the name is removed from the roster (and mcabber will display the JID or username). /request last|ping|time|vcard|version [jid]:: Send a "IQ" query to the current buddy, or to the specified Jabber user. If the resource is not provided with the jid, mcabber will send the query to all known resources for this user. 'last';; Request "last" information (usually idle time) 'ping';; Send an XMPP Ping request. Note that you should use the full JID since a ping sent to a bare JID will be handled by the server. 'time';; Request time from the buddy 'vcard';; Request VCard from the buddy 'version';; Request version from the buddy /room join|leave|names|nick|remove|topic|unlock|destroy:: /room privmsg|invite|whois|kick|ban|unban|role|affil:: /room setopt print_status|auto_whois [value]:: /room bookmark [add|del] [-autojoin|+autojoin] [-|nick]:: The 'room' command handles Multi-User Chat room actions. 'join' [room [nick [pass]]];; Join "room", using "nick" as nickname. If no nickname is provided (or if it is an empty string), the "nickname" option value is used (see sample configuration file). If the currently selected entry is correctly recognized as a room by mcabber, the shortcut "." can be used instead of the full room id. A password can be provided to enter protected rooms. If your nickname contains space characters, use quotes. 'leave' [message];; Leave the current room 'names' [--detail|--short|--quiet|--compact];; Display members of the current room 'nick' newnick;; Change your nickname in the current room 'privmsg' nick msg;; Send private message "msg" to "nick" 'remove';; Remove the current room from the roster (you must have left this room before) 'topic' -|newtopic;; Set topic for current room 'unlock';; Unlock current room (if you are the owner) 'destroy' [reason];; Destroy the current room (use with care!) 'whois' nick;; Display MUC information about "nick" 'ban' jid [reason];; Ban jid from the current room 'unban' jid;; Unban jid from the current room 'invite' jid [reason];; Invite jid to the current room 'kick' nick [reason];; Kick "nick" from the current room 'role' jid role [reason];; Change jid's role (role can be "none", "visitor", "participant", "moderator") 'affil' jid affil [reason];; Change jid's affiliation (affil can be "none", "member", "admin", "owner") 'setopt' print_status|auto_whois [value];; Change settings for the current room For print_status, the possible values are "default", "none", "in_and_out", "all". For auto_whois, the possible values are "default", "off", "on". When the value is "default", the options muc_print_status / muc_auto_whois is used. 'bookmark' [add|del] [-autojoin|+autojoin] [-|nick];; Add, remove or update a bookmark (default is add). If autojoin is set, mcabber will automatically join the MUC room when it connects to the server. To see the list of bookmarks, use /room bookmark in the status buffer. /roster bottom|top|up|down|group_prev|group_next:: /roster alternate|unread_first|unread_next:: /roster search bud:: /roster display|hide_offline|show_offline|toggle_offline:: /roster item_lock|item_unlock|item_toggle_lock:: /roster hide|show|toggle:: /roster note [-|text]:: The 'roster' command manipulates the roster/buddylist. + Here are the available parameters: 'bottom';; Jump to the bottom of the roster 'top';; Jump to the top of the roster 'up' [n];; Move up [n lines] in the roster 'down' [n];; Move down [n lines] in the roster 'group_prev';; Jump to the previous group in the roster 'group_next';; Jump to the next group in the roster 'alternate';; Jump to alternate buddy. The "alternate" buddy is the last buddy left while being in chat mode. This command is thus especially useful after commands like "/roster unread_next" (Ctrl-q). 'unread_first';; Jump to the first unread message 'unread_next';; Jump to the next unread message 'search' bud;; Search for a buddy with a name or jid containing "bud" (only in the displayed buddylist) 'display' [mask];; See or update the roster filter. The mask should contain the shortcut letters of the status you want to see ([o]nline, [f]ree_for_chat, [d]o_not_disturb, [n]ot_available, [a]way, [_]offline). For example "ofdna" to display only connected buddies. 'hide_offline';; Hide offline buddies (same as /roster display ofdna) 'show_offline';; Show offline buddies (same as /roster display ofdna_) 'toggle_offline';; Toggle display of offline buddies 'item_lock' [jid];; Lock the roster item so it remains visible regardless of its status 'item_unlock' [jid];; Undo the effects of item_lock 'item_toggle_lock' [jid];; Invert the current lock flag 'hide';; Hide roster (full-width chat window) 'show';; Show roster 'toggle';; Toggle roster visibility 'note' [-|text];; Set/update/delete an annotation. If there is no text, the current item's annotation is displayed -- if you are in the status buffer, all notes are displayed. If text is "-", the note is erased. /say [-n|-h|--] text:: Send the "text" message to the currently selected buddy. It can be useful if you want to send a message beginning with a slash, for example. + The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat message beginning with -n or -h. /say_to [-n|-h] [-q] [-f file] jid text:: Send the "text" message to the specified jid. + Please note that this command doesn't set the default resource for a contact, so if you want to send several messages to a specific resource you will have to use "/say_to" for each message. + You can send a message to a specific resource of the currently selected contact by using /say_to ./resourcename message. + The "-n" flag turns the message to "normal" type, "-h" to "headline". "--" can be used to send chat messages beginning with -n or -h. + When "-q" is used, the message will be sent in the background and will not change the current active window. + A text file can be provided with the "-f" switch (in which case there's no need to pass a text argument after the jid, of course). /screen_refresh:: Refresh the mcabber screen. /set [option [= value]]:: Display or set an option value. + Without arguments prints a list of all set options with their values /source pattern:: Read configuration files, that match glob pattern (sorted in alphabetical order). /status [online|avail|free|dnd|notavail|away [-|statusmessage]]:: /status message -|statusmessage:: Show or set the current status. + If no status is specified, display the current status. + If a status message is specified, it will overrride the message* variables (these variables can be set in the configuration file). + If no relevant message* variable is set and no status message provided, the current status message is kept. + If StatusMessage is "-", the current status message is cleared. + With the "/status message" command, mcabber will update the message while preserving the status. /status_to jid online|avail|free|dnd|notavail|away [statusmessage]:: /status_to jid message statusmessage:: Send the requested status to the specified Jabber user. + If the specified jid is ".", the current buddy is used. + Note: this status will be overridden by subsequent "/status" commands. If you are using the auto-away feature, the status will overridden too. + Note: The jid can include a resource (i.e. \user@server/resource). /version:: Display current version of mcabber. CONFIGURATION FILE ------------------ See the provided sample configuration file, which should be self-documenting. FILES ----- The following files can be used by `mcabber(1)`: $HOME/.mcabber/mcabberrc Default configuration file $HOME/.mcabberrc Configuration file used if no other has been found $HOME/.mcabber/histo/ Default directory for storing chat history files, if enabled /usr/share/mcabber/help/ Default directory for online help files /usr/lib/mcabber/ Default directory for modules BUGS ---- Certainly. Please tell me if you find one! :-) + Please visit our website to find out about the MUC room and the bug tracker. AUTHOR ------ Written by mailto:mikael@lilotux.net[Mikael BERTHE] and others (see AUTHORS file). + RESOURCES --------- http://mcabber.com/[Main web site] + http://wiki.mcabber.com/[Official wiki] + xmpp:mcabber@conf.lilotux.net[MCabber MUC room] COPYING ------- Copyright \(C) 2005-2012 Mikael Berthe and others. + Free use of this software is granted under the terms of the GNU General Public License (GPL). mcabber-0.10.2/hgcset.sh000077500000000000000000000007171216603513500150100ustar00rootroot00000000000000#! /bin/sh srcdir="$1" builddir="$2" if [ ! -f "$srcdir/logprint.h" ]; then echo "Unable to find mcabber sources!" >&2 exit 1 fi cd "$srcdir" if which hg > /dev/null 2>&1; then cs=$(hg id 2> /dev/null | cut -d' ' -f1) if test $? -eq 0; then if [ x"$cs" != x ]; then grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \ echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h" exit 0 fi fi fi echo > "$builddir/hgcset.h" mcabber-0.10.2/include/000077500000000000000000000000001216603513500146125ustar00rootroot00000000000000mcabber-0.10.2/include/config.h.in000066400000000000000000000014451216603513500166410ustar00rootroot00000000000000#ifndef __MCABBER_CONFIG_H__ #define __MCABBER_CONFIG_H__ 1 /* Are modules enabled or no */ #undef MODULES_ENABLE /* ... */ #undef HAVE_LIBOTR /* ... */ #undef HAVE_GPGME /* ... */ #undef HAVE_NCURSESW_NCURSES_H /* ... */ #undef HAVE_NCURSES_NCURSES_H /* ... */ #undef WITH_ENCHANT /* ... */ #undef WITH_ASPELL /* ... */ #undef XEP0022 /* ... */ #undef HAVE_UNICODE /* ... */ #undef HAVE_WCHAR_H /* ... */ #undef HAVE_WCTYPE_H /* ... */ #undef HAVE_WCHAR_H /* ... */ #undef HAVE_ISWBLANK /* ... */ #undef HAVE_STRCASESTR /* Default data files prefix */ #undef DATA_DIR /* Default modules location */ #undef PKGLIB_DIR /* To satisfy gnutls */ #undef _FILE_OFFSET_BITS /* Mcabber branch name (string) */ #undef MCABBER_BRANCH /* Mcabber version (string) */ #undef MCABBER_VERSION #endif mcabber-0.10.2/install-sh000077500000000000000000000325371216603513500152050ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mcabber-0.10.2/ltmain.sh000077500000000000000000010520261216603513500150200ustar00rootroot00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.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 "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_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 "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { 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 "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -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 () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-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 ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$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 "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # 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 "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_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 "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi 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 "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" 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 "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 mcabber-0.10.2/macros/000077500000000000000000000000001216603513500144535ustar00rootroot00000000000000mcabber-0.10.2/macros/curslib.m4000066400000000000000000000046711216603513500163700ustar00rootroot00000000000000dnl --------------------------------------------------------------------------- dnl Look for the curses libraries. Older curses implementations may require dnl termcap/termlib to be linked as well. AC_DEFUN([CF_CURSES_LIBS],[ AC_CHECK_FUNC(initscr,,[ case $host_os in #(vi freebsd*) #(vi AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"]) ;; hpux10.*|hpux11.*) AC_CHECK_LIB(cur_colr,initscr,[ LIBS="-lcur_colr $LIBS" CFLAGS="-I/usr/include/curses_colr $CFLAGS" ac_cv_func_initscr=yes ],[ AC_CHECK_LIB(Hcurses,initscr,[ # HP's header uses __HP_CURSES, but user claims _HP_CURSES. LIBS="-lHcurses $LIBS" CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS" ac_cv_func_initscr=yes ])]) ;; linux*) # Suse Linux does not follow /usr/lib convention LIBS="$LIBS -L/lib" ;; esac if test ".$With5lib" != ".no" ; then if test -d /usr/5lib ; then # SunOS 3.x or 4.x CPPFLAGS="$CPPFLAGS -I/usr/5include" LIBS="$LIBS -L/usr/5lib" fi fi if test ".$ac_cv_func_initscr" != .yes ; then cf_save_LIBS="$LIBS" cf_term_lib="" cf_curs_lib="" # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ for cf_term_lib in termcap termlib unknown do AC_CHECK_LIB($cf_term_lib,tgoto,[break]) done ]) # Check for library containing initscr test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown do AC_CHECK_LIB($cf_curs_lib,initscr,[break]) done test $cf_curs_lib = unknown && AC_ERROR(no curses library found) LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown ; then AC_MSG_CHECKING(if we can link with $cf_curs_lib library) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) test $cf_result = no && AC_ERROR(Cannot link curses library) elif test "$cf_term_lib" != predefined ; then AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr(); tgoto((char *)0, 0, 0);], [cf_result=no], [ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], [cf_result=yes], [cf_result=error]) ]) AC_MSG_RESULT($cf_result) fi fi ])]) mcabber-0.10.2/macros/define_dir.m4000066400000000000000000000021621216603513500170060ustar00rootroot00000000000000dnl define_dir.m4 dnl http://autoconf-archive.cryp.to/ac_define_dir.html # AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) # This macro sets VARNAME to the expansion of the DIR variable, taking care # of fixing up ${prefix} and such. # VARNAME is then offered as both an output variable and a C preprocessor # symbol. # Authors # Stepan Kasal , Andreas Schwab , # Guido Draheim , Alexandre Oliva # (Slightly modified -- Mikael Berthe) AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. ac_define_dir=`eval echo [$]$2` ac_define_dir=`eval echo [$]ac_define_dir` AC_SUBST($1, "$ac_define_dir") ifelse($3, , AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) mcabber-0.10.2/macros/libtool.m4000066400000000000000000010575421216603513500163770ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [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 _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 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 "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [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 $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $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 "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([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 "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' 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*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-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 "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$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" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; 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"; 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 $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # 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 "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # 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 "$lt_cv_prog_gnu_ld" = yes; 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 ;; # 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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # 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*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # 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 "$with_gnu_ld" = yes; 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=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # 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 "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ 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 which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(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 "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$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 $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_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 "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_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 $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS mcabber-0.10.2/macros/ltoptions.m4000066400000000000000000000300731216603513500167530ustar00rootroot00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=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=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) mcabber-0.10.2/macros/ltsugar.m4000066400000000000000000000104241216603513500163770ustar00rootroot00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) mcabber-0.10.2/macros/ltversion.m4000066400000000000000000000012621216603513500167430ustar00rootroot00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) mcabber-0.10.2/macros/lt~obsolete.m4000066400000000000000000000137561216603513500173030ustar00rootroot00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) mcabber-0.10.2/macros/missing/000077500000000000000000000000001216603513500161245ustar00rootroot00000000000000mcabber-0.10.2/macros/missing/glib-2.0.m4000066400000000000000000000176421216603513500176120ustar00rootroot00000000000000# Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or dnl gthread is specified in MODULES, pass to pkg-config dnl AC_DEFUN([AM_PATH_GLIB_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done PKG_PROG_PKG_CONFIG([0.7]) no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GOBJECT_QUERY) AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) mcabber-0.10.2/macros/missing/gpgme.m4000066400000000000000000000240641216603513500174730ustar00rootroot00000000000000# gpgme.m4 - autoconf macro to detect GPGME. # Copyright (C) 2002, 2003, 2004 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This file 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. AC_DEFUN([_AM_PATH_GPGME_CONFIG], [ AC_ARG_WITH(gpgme-prefix, AC_HELP_STRING([--with-gpgme-prefix=PFX], [prefix where GPGME is installed (optional)]), gpgme_config_prefix="$withval", gpgme_config_prefix="") if test "x$gpgme_config_prefix" != x ; then GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config" fi AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no) if test "$GPGME_CONFIG" != "no" ; then gpgme_version=`$GPGME_CONFIG --version` fi gpgme_version_major=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` gpgme_version_minor=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` gpgme_version_micro=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` ]) dnl AM_PATH_GPGME([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_CFLAGS and GPGME_LIBS. dnl AC_DEFUN([AM_PATH_GPGME], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_CFLAGS=`$GPGME_CONFIG --cflags` GPGME_LIBS=`$GPGME_CONFIG --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_CFLAGS="" GPGME_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_CFLAGS) AC_SUBST(GPGME_LIBS) ]) dnl AM_PATH_GPGME_PTH([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_PTH_CFLAGS and GPGME_PTH_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_PTH], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME Pth - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then if `$GPGME_CONFIG --thread=pth 2> /dev/null` ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_PTH_CFLAGS=`$GPGME_CONFIG --thread=pth --cflags` GPGME_PTH_LIBS=`$GPGME_CONFIG --thread=pth --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_PTH_CFLAGS="" GPGME_PTH_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_PTH_CFLAGS) AC_SUBST(GPGME_PTH_LIBS) ]) dnl AM_PATH_GPGME_PTHREAD([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS dnl and GPGME_PTHREAD_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_PTHREAD], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags` GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_PTHREAD_CFLAGS="" GPGME_PTHREAD_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_PTHREAD_CFLAGS) AC_SUBST(GPGME_PTHREAD_LIBS) ]) dnl AM_PATH_GPGME_GLIB([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme-glib and define GPGME_GLIB_CFLAGS and GPGME_GLIB_LIBS. dnl AC_DEFUN([AM_PATH_GPGME_GLIB], [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl tmp=ifelse([$1], ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags` GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else GPGME_GLIB_CFLAGS="" GPGME_GLIB_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPGME_GLIB_CFLAGS) AC_SUBST(GPGME_GLIB_LIBS) ]) mcabber-0.10.2/macros/missing/libgcrypt.m4000066400000000000000000000101161216603513500203640ustar00rootroot00000000000000dnl Autoconf macros for libgcrypt dnl Copyright (C) 2002, 2004 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_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_PROG(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) 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]) else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) ]) mcabber-0.10.2/macros/missing/libotr.m4000066400000000000000000000103031216603513500176560ustar00rootroot00000000000000dnl dnl Off-the-Record Messaging library dnl Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov dnl dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of version 2.1 of the GNU Lesser General dnl Public License as published by the Free Software Foundation. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl AM_PATH_LIBOTR([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libotr, and define LIBOTR_CFLAGS and LIBOTR_LIBS as appropriate. dnl enables arguments --with-libotr-prefix= dnl --with-libotr-inc-prefix= dnl dnl You must already have found libgcrypt with AM_PATH_LIBGCRYPT dnl dnl Adapted from alsa.m4, originally by dnl Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela AC_DEFUN([AM_PATH_LIBOTR], [dnl Save the original CFLAGS, LDFLAGS, and LIBS libotr_save_CFLAGS="$CFLAGS" libotr_save_LDFLAGS="$LDFLAGS" libotr_save_LIBS="$LIBS" libotr_found=yes dnl dnl Get the cflags and libraries for libotr dnl AC_ARG_WITH(libotr-prefix, [ --with-libotr-prefix=PFX prefix where libotr is installed (optional)], [libotr_prefix="$withval"], [libotr_prefix=""]) AC_ARG_WITH(libotr-inc-prefix, [ --with-libotr-inc-prefix=PFX prefix where libotr includes are (optional)], [libotr_inc_prefix="$withval"], [libotr_inc_prefix=""]) dnl Add any special include directories AC_MSG_CHECKING(for libotr CFLAGS) if test "$libotr_inc_prefix" != "" ; then LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix" CFLAGS="$CFLAGS $LIBOTR_CFLAGS" fi AC_MSG_RESULT($LIBOTR_CFLAGS) dnl add any special lib dirs AC_MSG_CHECKING(for libotr LIBS) if test "$libotr_prefix" != "" ; then LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix" LDFLAGS="$LDFLAGS $LIBOTR_LIBS" fi dnl add the libotr library LIBOTR_LIBS="$LIBOTR_LIBS -lotr" LIBS="$LIBOTR_LIBS $LIBS" AC_MSG_RESULT($LIBOTR_LIBS) dnl Check for a working version of libotr that is of the right version. min_libotr_version=ifelse([$1], ,3.0.0,$1) no_libotr="" libotr_min_major_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` libotr_min_minor_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` libotr_min_sub_version=`echo $min_libotr_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_MSG_CHECKING(for libotr headers version $libotr_min_major_version.x >= $min_libotr_version) AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include #include ], [ # if(OTRL_VERSION_MAJOR != $libotr_min_major_version) # error not present # else # if(OTRL_VERSION_MINOR > $libotr_min_minor_version) exit(0); # else # if(OTRL_VERSION_MINOR < $libotr_min_minor_version) # error not present # endif # if(OTRL_VERSION_SUB < $libotr_min_sub_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libotr not found.)]) libotr_found=no] ) AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. AC_CHECK_LIB([otr], [otrl_message_receiving],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libotr was found.)]) libotr_found=no], $LIBGCRYPT_LIBS ) LDFLAGS="$libotr_save_LDFLAGS" LIBS="$libotr_save_LIBS" if test "x$libotr_found" = "xyes" ; then ifelse([$2], , :, [$2]) else LIBOTR_CFLAGS="" LIBOTR_LIBS="" ifelse([$3], , :, [$3]) fi dnl That should be it. Now just export our symbols: AC_SUBST(LIBOTR_CFLAGS) AC_SUBST(LIBOTR_LIBS) ]) mcabber-0.10.2/macros/timezone.m4000066400000000000000000000031251216603513500165500ustar00rootroot00000000000000dnl ac_var_timeszone_externals.m4 # Define 'timezone', 'altzone' and 'daylight' # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the # the external timezone variables 'timezone', 'altzone' and 'daylight' exist, # defining 'HAVE_TIMEZONE', 'HAVE_ALTZONE' and 'HAVE_DAYLIGHT' respectively # (as well as gaining the macros defined by 'AC_STRUCT_TIMEZONE'). # Mark R.Bannister AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS], [ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone, [ AC_TRY_LINK([#include ], [return (int)timezone;], mb_cv_var_timezone=yes, mb_cv_var_timezone=no) ]) AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone, [ AC_TRY_LINK([#include ], [return (int)altzone;], mb_cv_var_altzone=yes, mb_cv_var_altzone=no) ]) AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight, [ AC_TRY_LINK([#include ], [return (int)daylight;], mb_cv_var_daylight=yes, mb_cv_var_daylight=no) ]) if test $mb_cv_var_timezone = yes; then AC_DEFINE([HAVE_TIMEZONE], 1, [Define if you have the external 'timezone' variable.]) fi if test $mb_cv_var_altzone = yes; then AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable.]) fi if test $mb_cv_var_daylight = yes; then AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if you have the external 'daylight' variable.]) fi ]) mcabber-0.10.2/macros/tm-gmtoff.m4000066400000000000000000000007401216603513500166160ustar00rootroot00000000000000dnl Check for the tm_gmtoff field in struct tm dnl (Borrowed from the Gaim project) AC_DEFUN([MC_TM_GMTOFF], [AC_REQUIRE([AC_STRUCT_TM])dnl AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = yes; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [tm_gmtoff is available.]) fi ]) mcabber-0.10.2/mcabber.desktop000066400000000000000000000003201216603513500161500ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Type=Application Name=MCabber GenericName=Jabber IM Client Comment=Console Jabber Client Exec=mcabber Terminal=true Categories=ConsoleOnly;System;Network;InstantMessaging;Chat; mcabber-0.10.2/mcabber.pc.in000066400000000000000000000004401216603513500155110ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: MCabber Description: Modular XMPP client URL: http://mcabber.com Requires.private: glib-2.0 gmodule-2.0 loudmouth-1.0 Version: @VERSION@ Libs: Cflags: -I${includedir} @LIBOTR_CFLAGS@ @GPGME_CFLAGS@ mcabber-0.10.2/mcabber/000077500000000000000000000000001216603513500145625ustar00rootroot00000000000000mcabber-0.10.2/mcabber/COPYING000066400000000000000000000434211216603513500156210ustar00rootroot00000000000000Specific permission is granted for the GPLed code in this distribution to be linked to OpenSSL without invoking GPL clause 2(b). ---------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. mcabber-0.10.2/mcabber/Makefile.am000066400000000000000000000031621216603513500166200ustar00rootroot00000000000000bin_PROGRAMS = mcabber mcabber_SOURCES = main.c main.h roster.c roster.h events.c events.h \ commands.c commands.h compl.c compl.h \ hbuf.c hbuf.h screen.c screen.h logprint.h \ settings.c settings.h hooks.c hooks.h utf8.c utf8.h \ histolog.c histolog.h utils.c utils.h pgp.c pgp.h \ xmpp.c xmpp.h xmpp_helper.c xmpp_helper.h xmpp_defines.h \ xmpp_iq.c xmpp_iq.h xmpp_iqrequest.c xmpp_iqrequest.h \ xmpp_muc.c xmpp_muc.h xmpp_s10n.c xmpp_s10n.h \ caps.c caps.h help.c help.h if OTR mcabber_SOURCES += otr.c otr.h nohtml.c nohtml.h endif LDADD = $(GLIB_LIBS) $(LOUDMOUTH_LIBS) $(GPGME_LIBS) $(LIBOTR_LIBS) \ $(ENCHANT_LIBS) $(LIBIDN_LIBS) AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ $(ENCHANT_CFLAGS) $(LIBIDN_CFLAGS) CLEANFILES = hgcset.h if HGCSET BUILT_SOURCES = hgcset.h hgcset.h: $(top_srcdir)/hgcset.sh "$(top_srcdir)/mcabber" "$(top_builddir)/mcabber" .PHONY: hgcset.h endif if INSTALL_HEADERS mcabber_SOURCES += modules.c modules.h api.h mcabberinclude_HEADERS = main.h roster.h events.h \ commands.h compl.h \ hbuf.h screen.h logprint.h \ settings.h hooks.h utf8.c utf8.h \ histolog.h utils.h pgp.h \ xmpp.h xmpp_helper.h xmpp_defines.h \ xmpp_iq.h xmpp_iqrequest.h \ xmpp_muc.h xmpp_s10n.h \ caps.h fifo.h help.h modules.h api.h \ $(top_builddir)/include/config.h if OTR mcabberinclude_HEADERS += otr.h nohtml.h endif if HGCSET mcabberinclude_HEADERS += hgcset.h endif mcabberincludedir = $(includedir)/mcabber else mcabber_SOURCES += fifo.c fifo.h endif #SUBDIRS = mcabber-0.10.2/mcabber/Makefile.in000066400000000000000000000630211216603513500166310ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = mcabber$(EXEEXT) @OTR_TRUE@am__append_1 = otr.c otr.h nohtml.c nohtml.h @INSTALL_HEADERS_TRUE@am__append_2 = modules.c modules.h api.h @INSTALL_HEADERS_TRUE@@OTR_TRUE@am__append_3 = otr.h nohtml.h @HGCSET_TRUE@@INSTALL_HEADERS_TRUE@am__append_4 = hgcset.h @INSTALL_HEADERS_FALSE@am__append_5 = fifo.c fifo.h subdir = mcabber DIST_COMMON = $(am__mcabberinclude_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(mcabberincludedir)" PROGRAMS = $(bin_PROGRAMS) am__mcabber_SOURCES_DIST = main.c main.h roster.c roster.h events.c \ events.h commands.c commands.h compl.c compl.h hbuf.c hbuf.h \ screen.c screen.h logprint.h settings.c settings.h hooks.c \ hooks.h utf8.c utf8.h histolog.c histolog.h utils.c utils.h \ pgp.c pgp.h xmpp.c xmpp.h xmpp_helper.c xmpp_helper.h \ xmpp_defines.h xmpp_iq.c xmpp_iq.h xmpp_iqrequest.c \ xmpp_iqrequest.h xmpp_muc.c xmpp_muc.h xmpp_s10n.c xmpp_s10n.h \ caps.c caps.h help.c help.h otr.c otr.h nohtml.c nohtml.h \ modules.c modules.h api.h fifo.c fifo.h @OTR_TRUE@am__objects_1 = otr.$(OBJEXT) nohtml.$(OBJEXT) @INSTALL_HEADERS_TRUE@am__objects_2 = modules.$(OBJEXT) @INSTALL_HEADERS_FALSE@am__objects_3 = fifo.$(OBJEXT) am_mcabber_OBJECTS = main.$(OBJEXT) roster.$(OBJEXT) events.$(OBJEXT) \ commands.$(OBJEXT) compl.$(OBJEXT) hbuf.$(OBJEXT) \ screen.$(OBJEXT) settings.$(OBJEXT) hooks.$(OBJEXT) \ utf8.$(OBJEXT) histolog.$(OBJEXT) utils.$(OBJEXT) \ pgp.$(OBJEXT) xmpp.$(OBJEXT) xmpp_helper.$(OBJEXT) \ xmpp_iq.$(OBJEXT) xmpp_iqrequest.$(OBJEXT) xmpp_muc.$(OBJEXT) \ xmpp_s10n.$(OBJEXT) caps.$(OBJEXT) help.$(OBJEXT) \ $(am__objects_1) $(am__objects_2) $(am__objects_3) mcabber_OBJECTS = $(am_mcabber_OBJECTS) mcabber_LDADD = $(LDADD) am__DEPENDENCIES_1 = mcabber_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(mcabber_SOURCES) DIST_SOURCES = $(am__mcabber_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__mcabberinclude_HEADERS_DIST = main.h roster.h events.h commands.h \ compl.h hbuf.h screen.h logprint.h settings.h hooks.h utf8.c \ utf8.h histolog.h utils.h pgp.h xmpp.h xmpp_helper.h \ xmpp_defines.h xmpp_iq.h xmpp_iqrequest.h xmpp_muc.h \ xmpp_s10n.h caps.h fifo.h help.h modules.h api.h \ $(top_builddir)/include/config.h otr.h nohtml.h hgcset.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } HEADERS = $(mcabberinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ mcabber_SOURCES = main.c main.h roster.c roster.h events.c events.h \ commands.c commands.h compl.c compl.h hbuf.c hbuf.h screen.c \ screen.h logprint.h settings.c settings.h hooks.c hooks.h \ utf8.c utf8.h histolog.c histolog.h utils.c utils.h pgp.c \ pgp.h xmpp.c xmpp.h xmpp_helper.c xmpp_helper.h xmpp_defines.h \ xmpp_iq.c xmpp_iq.h xmpp_iqrequest.c xmpp_iqrequest.h \ xmpp_muc.c xmpp_muc.h xmpp_s10n.c xmpp_s10n.h caps.c caps.h \ help.c help.h $(am__append_1) $(am__append_2) $(am__append_5) LDADD = $(GLIB_LIBS) $(LOUDMOUTH_LIBS) $(GPGME_LIBS) $(LIBOTR_LIBS) \ $(ENCHANT_LIBS) $(LIBIDN_LIBS) AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ $(ENCHANT_CFLAGS) $(LIBIDN_CFLAGS) CLEANFILES = hgcset.h @HGCSET_TRUE@BUILT_SOURCES = hgcset.h @INSTALL_HEADERS_TRUE@mcabberinclude_HEADERS = main.h roster.h \ @INSTALL_HEADERS_TRUE@ events.h commands.h compl.h hbuf.h \ @INSTALL_HEADERS_TRUE@ screen.h logprint.h settings.h hooks.h \ @INSTALL_HEADERS_TRUE@ utf8.c utf8.h histolog.h utils.h pgp.h \ @INSTALL_HEADERS_TRUE@ xmpp.h xmpp_helper.h xmpp_defines.h \ @INSTALL_HEADERS_TRUE@ xmpp_iq.h xmpp_iqrequest.h xmpp_muc.h \ @INSTALL_HEADERS_TRUE@ xmpp_s10n.h caps.h fifo.h help.h \ @INSTALL_HEADERS_TRUE@ modules.h api.h \ @INSTALL_HEADERS_TRUE@ $(top_builddir)/include/config.h \ @INSTALL_HEADERS_TRUE@ $(am__append_3) $(am__append_4) @INSTALL_HEADERS_TRUE@mcabberincludedir = $(includedir)/mcabber all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mcabber/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu mcabber/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(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): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status mcabber/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 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 mcabber$(EXEEXT): $(mcabber_OBJECTS) $(mcabber_DEPENDENCIES) $(EXTRA_mcabber_DEPENDENCIES) @rm -f mcabber$(EXEEXT) $(LINK) $(mcabber_OBJECTS) $(mcabber_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commands.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/histolog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hooks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nohtml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/otr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/roster.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/screen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp_helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp_iq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp_iqrequest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp_muc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmpp_s10n.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-mcabberincludeHEADERS: $(mcabberinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(mcabberinclude_HEADERS)'; test -n "$(mcabberincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(mcabberincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(mcabberincludedir)" || 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)$(mcabberincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(mcabberincludedir)" || exit $$?; \ done uninstall-mcabberincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(mcabberinclude_HEADERS)'; test -n "$(mcabberincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(mcabberincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mcabberincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-mcabberincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-mcabberincludeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-mcabberincludeHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-mcabberincludeHEADERS @HGCSET_TRUE@hgcset.h: @HGCSET_TRUE@ $(top_srcdir)/hgcset.sh "$(top_srcdir)/mcabber" "$(top_builddir)/mcabber" @HGCSET_TRUE@.PHONY: hgcset.h #SUBDIRS = # 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: mcabber-0.10.2/mcabber/api.h000066400000000000000000000010311216603513500154770ustar00rootroot00000000000000#ifndef __MCABBER_API_H__ #define __MCABBER_API_H__ 1 #include #include // For MCABBER_BRANCH #define MCABBER_API_VERSION 1 #define MCABBER_API_MIN 1 /* #define MCABBER_BRANCH_DEV 0 */ // cmd_add returns gpointer id #define MCABBER_API_HAVE_CMD_ID 1 // compl_new_category accepts flags argument #define MCABBER_API_HAVE_COMPL_FLAGS 1 extern const gchar *mcabber_branch; extern const guint mcabber_api_version; #endif /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/caps.c000066400000000000000000000413351216603513500156620ustar00rootroot00000000000000/* * caps.c -- Entity Capabilities Cache for mcabber * * Copyright (C) 2008-2010 Frank Zschockelt * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include "settings.h" #include "utils.h" typedef struct { char *category; char *type; char *name; } identity; typedef struct { GHashTable *fields; } dataform; typedef struct { GHashTable *identities; GHashTable *features; GHashTable *forms; } caps; static GHashTable *caps_cache = NULL; void caps_destroy(gpointer data) { caps *c = data; g_hash_table_destroy(c->identities); g_hash_table_destroy(c->features); g_hash_table_destroy(c->forms); g_free(c); } void identity_destroy(gpointer data) { identity *i = data; g_free(i->category); g_free(i->type); g_free(i->name); g_free(i); } void form_destroy(gpointer data) { dataform *f = data; g_hash_table_destroy(f->fields); g_free(f); } void field_destroy(gpointer data) { GList *v = data; g_list_foreach (v, (GFunc) g_free, NULL); g_list_free (v); } void caps_init(void) { if (!caps_cache) caps_cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, caps_destroy); } void caps_free(void) { if (caps_cache) { g_hash_table_destroy(caps_cache); caps_cache = NULL; } } void caps_add(const char *hash) { if (!hash) return; caps *c = g_new0(caps, 1); c->features = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); c->identities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, identity_destroy); c->forms = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, form_destroy); g_hash_table_insert(caps_cache, g_strdup(hash), c); } void caps_remove(const char *hash) { if (!hash) return; g_hash_table_remove(caps_cache, hash); } /* if hash is not verified, this will bind capabilities set only with bare jid */ void caps_move_to_local(char *hash, char *bjid) { char *orig_hash; caps *c = NULL; if (!hash || !bjid) return; g_hash_table_lookup_extended(caps_cache, hash, (gpointer*)&orig_hash, (gpointer*)&c); if (c) { g_hash_table_steal(caps_cache, hash); g_free(orig_hash); g_hash_table_replace(caps_cache, g_strdup_printf("%s/#%s", bjid, hash), c); // solidus is guaranteed to never appear in bare jid // hash will not appear in base64 encoded hash // sequence "/#" is deterministic separator, and allows to identify local cache entry } } /*if bjid is NULL, it will check only verified hashes */ int caps_has_hash(const char *hash, const char *bjid) { caps *c = NULL; if (!hash) return 0; c = g_hash_table_lookup(caps_cache, hash); if (!c && bjid) { char *key = g_strdup_printf("%s/#%s", bjid, hash); c = g_hash_table_lookup(caps_cache, key); g_free(key); } return (c != NULL); } void caps_add_identity(const char *hash, const char *category, const char *name, const char *type, const char *lang) { caps *c; if (!hash || !category || !type) return; if (!lang) lang = ""; c = g_hash_table_lookup(caps_cache, hash); if (c) { identity *i = g_new0(identity, 1); i->category = g_strdup(category); i->name = g_strdup(name); i->type = g_strdup(type); g_hash_table_replace(c->identities, g_strdup(lang), i); } } void caps_set_identity(char *hash, const char *category, const char *name, const char *type) { caps_add_identity(hash, category, name, type, NULL); } void caps_add_dataform(const char *hash, const char *formtype) { caps *c; if (!formtype) return; c = g_hash_table_lookup(caps_cache, hash); if (c) { dataform *d = g_new0(dataform, 1); char *f = g_strdup(formtype); d->fields = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, field_destroy); g_hash_table_replace(c->forms, f, d); } } gint _strcmp_sort(gconstpointer a, gconstpointer b) { return g_strcmp0(a, b); } void caps_add_dataform_field(const char *hash, const char *formtype, const char *field, const char *value) { caps *c; if (!formtype || !field || !value) return; c = g_hash_table_lookup(caps_cache, hash); if (c) { dataform *d; d = g_hash_table_lookup(c->forms, formtype); if (d) { gpointer key, val; char *f; GList *v = NULL; if (g_hash_table_lookup_extended(d->fields, field, &key, &val)) { g_hash_table_steal(d->fields, field); g_free(key); v = val; } f = g_strdup(field); v = g_list_insert_sorted(v, g_strdup(value), _strcmp_sort); g_hash_table_replace(d->fields, f, v); } } } void caps_add_feature(const char *hash, const char *feature) { caps *c; if (!hash || !feature) return; c = g_hash_table_lookup(caps_cache, hash); if (c) { char *f = g_strdup(feature); g_hash_table_replace(c->features, f, f); } } /* If hash is verified, then bare jid is ignored. * If there is no globally verified hash, and bare jid is not null, * then local storage for that jid will be checked */ int caps_has_feature(const char *hash, char *feature, char *bjid) { caps *c = NULL; if (!hash || !feature) return 0; c = g_hash_table_lookup(caps_cache, hash); if (!c && bjid) { char *key = g_strdup_printf("%s/#%s", bjid, hash); c = g_hash_table_lookup(caps_cache, key); g_free(key); } if (c) return (g_hash_table_lookup(c->features, feature) != NULL); return 0; } static GFunc _foreach_function; void _caps_foreach_helper(gpointer key, gpointer value, gpointer user_data) { // GFunc func = (GFunc)user_data; _foreach_function(value, user_data); } void caps_foreach_feature(const char *hash, GFunc func, gpointer user_data) { caps *c; if (!hash) return; c = g_hash_table_lookup(caps_cache, hash); if (!c) return; _foreach_function = func; g_hash_table_foreach(c->features, _caps_foreach_helper, user_data); } // Generates the sha1 hash for the special capability "" and returns it const char *caps_generate(void) { GList *features, *langs; GChecksum *sha1; guint8 digest[20]; gsize digest_size = 20; gchar *hash, *old_hash = NULL; caps *old_caps; caps *c = g_hash_table_lookup(caps_cache, ""); g_hash_table_steal(caps_cache, ""); sha1 = g_checksum_new(G_CHECKSUM_SHA1); langs = g_hash_table_get_keys(c->identities); langs = g_list_sort(langs, _strcmp_sort); { identity *i; GList *lang; char *identity_S; for (lang=langs; lang; lang=lang->next) { i = g_hash_table_lookup(c->identities, lang->data); identity_S = g_strdup_printf("%s/%s/%s/%s<", i->category, i->type, (char *)lang->data, i->name ? i->name : ""); g_checksum_update(sha1, (guchar *)identity_S, -1); g_free(identity_S); } } g_list_free(langs); features = g_hash_table_get_values(c->features); features = g_list_sort(features, _strcmp_sort); { GList *feature; for (feature=features; feature; feature=feature->next) { g_checksum_update(sha1, feature->data, -1); g_checksum_update(sha1, (guchar *)"<", -1); } } g_list_free(features); g_checksum_get_digest(sha1, digest, &digest_size); hash = g_base64_encode(digest, digest_size); g_checksum_free(sha1); g_hash_table_lookup_extended(caps_cache, hash, (gpointer *)&old_hash, (gpointer *)&old_caps); g_hash_table_insert(caps_cache, hash, c); if (old_hash) return old_hash; else return hash; } gboolean caps_verify(const char *hash, char *function) { GList *features, *langs, *forms; GChecksum *checksum; guint8 digest[20]; gsize digest_size = 20; gchar *local_hash; gboolean match = FALSE; caps *c = g_hash_table_lookup(caps_cache, hash); if (!g_strcmp0(function, "sha-1")) { checksum = g_checksum_new(G_CHECKSUM_SHA1); } else if (!g_strcmp0(function, "md5")) { checksum = g_checksum_new(G_CHECKSUM_MD5); digest_size = 16; } else return FALSE; langs = g_hash_table_get_keys(c->identities); langs = g_list_sort(langs, _strcmp_sort); { identity *i; GList *lang; char *identity_S; for (lang=langs; lang; lang=lang->next) { i = g_hash_table_lookup(c->identities, lang->data); identity_S = g_strdup_printf("%s/%s/%s/%s<", i->category, i->type, (char *)lang->data, i->name ? i->name : ""); g_checksum_update(checksum, (guchar *)identity_S, -1); g_free(identity_S); } } g_list_free(langs); features = g_hash_table_get_values(c->features); features = g_list_sort(features, _strcmp_sort); { GList *feature; for (feature=features; feature; feature=feature->next) { g_checksum_update(checksum, feature->data, -1); g_checksum_update(checksum, (guchar *)"<", -1); } } g_list_free(features); forms = g_hash_table_get_keys(c->forms); forms = g_list_sort(forms, _strcmp_sort); { dataform *d; GList *form, *fields; for (form=forms; form; form=form->next) { d = g_hash_table_lookup(c->forms, form->data); g_checksum_update(checksum, form->data, -1); g_checksum_update(checksum, (guchar *)"<", -1); fields = g_hash_table_get_keys(d->fields); fields = g_list_sort(fields, _strcmp_sort); { GList *field; GList *values; for (field=fields; field; field=field->next) { g_checksum_update(checksum, field->data, -1); g_checksum_update(checksum, (guchar *)"<", -1); values = g_hash_table_lookup(d->fields, field->data); { GList *value; for (value=values; value; value=value->next) { g_checksum_update(checksum, value->data, -1); g_checksum_update(checksum, (guchar *)"<", -1); } } } } g_list_free(fields); } } g_list_free(forms); g_checksum_get_digest(checksum, digest, &digest_size); local_hash = g_base64_encode(digest, digest_size); g_checksum_free(checksum); match = !g_strcmp0(hash, local_hash); g_free(local_hash); return match; } static gchar* caps_get_filename(const char* hash) { gchar *hash_fs; gchar *dir = (gchar *) settings_opt_get ("caps_directory"); gchar *file = NULL; if (!dir) goto caps_filename_return; hash_fs = g_strdup (hash); { const gchar *valid_fs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+="; g_strcanon(hash_fs, valid_fs, '-'); } dir = expand_filename (dir); file = g_strdup_printf ("%s/%s.ini", dir, hash_fs); g_free(dir); g_free(hash_fs); caps_filename_return: return file; } /* Store capabilities set in GKeyFile. To be used with verified hashes only */ void caps_copy_to_persistent(const char* hash, char* xml) { gchar *file; GList *features, *langs, *forms; GKeyFile *key_file; caps *c; int fd; g_free (xml); c = g_hash_table_lookup (caps_cache, hash); if (!c) goto caps_copy_return; file = caps_get_filename (hash); if (!file) goto caps_copy_return; fd = open (file, O_WRONLY|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); if (fd == -1) goto caps_copy_exists; key_file = g_key_file_new (); g_key_file_set_comment (key_file, NULL, NULL, "This is autogenerated file. Please do not modify.", NULL); langs = g_hash_table_get_keys (c->identities); { identity *i; GList *lang; gchar *group; for (lang=langs; lang; lang=lang->next) { i = g_hash_table_lookup (c->identities, lang->data); group = g_strdup_printf("identity_%s", (gchar *)lang->data); g_key_file_set_string (key_file, group, "category", i->category); g_key_file_set_string (key_file, group, "type", i->type); g_key_file_set_string (key_file, group, "name", i->name); g_free (group); } } g_list_free (langs); features = g_hash_table_get_values (c->features); { GList *feature; gchar **string_list; gint i; i = g_list_length (features); string_list = g_new (gchar*, i + 1); i = 0; for (feature=features; feature; feature=feature->next) { string_list[i] = g_strdup(feature->data); ++i; } string_list[i] = NULL; g_key_file_set_string_list (key_file, "features", "features", (const gchar**)string_list, i); g_strfreev (string_list); } g_list_free (features); forms = g_hash_table_get_keys(c->forms); { dataform *d; GList *form, *fields; gchar *group; for (form=forms; form; form=form->next) { d = g_hash_table_lookup (c->forms, form->data); group = g_strdup_printf ("form_%s", (gchar *)form->data); fields = g_hash_table_get_keys(d->fields); { GList *field; GList *values; for (field=fields; field; field=field->next) { values = g_hash_table_lookup (d->fields, field->data); { GList *value; gchar **string_list; gint i; i = g_list_length (values); string_list = g_new (gchar*, i + 1); i = 0; for (value=values; value; value=value->next) { string_list[i] = g_strdup(value->data); ++i; } string_list[i] = NULL; g_key_file_set_string_list (key_file, group, field->data, (const gchar**)string_list, i); g_strfreev (string_list); } } } g_list_free(fields); g_free (group); } } g_list_free (forms); { gchar *data; gsize length; data = g_key_file_to_data (key_file, &length, NULL); write (fd, data, length); g_free(data); close (fd); } g_key_file_free(key_file); caps_copy_exists: g_free(file); caps_copy_return: return; } /* Restore capabilities from GKeyFile. Hash is not verified afterwards */ gboolean caps_restore_from_persistent (const char* hash) { gchar *file; GKeyFile *key_file; gchar **groups, **group; gboolean restored = FALSE; file = caps_get_filename (hash); if (!file) goto caps_restore_no_file; key_file = g_key_file_new (); if (!g_key_file_load_from_file (key_file, file, G_KEY_FILE_NONE, NULL)) goto caps_restore_bad_file; caps_add(hash); groups = g_key_file_get_groups (key_file, NULL); for (group = groups; *group; ++group) { if (!g_strcmp0(*group, "features")) { gchar **features, **feature; features = g_key_file_get_string_list (key_file, *group, "features", NULL, NULL); for (feature = features; *feature; ++feature) { caps_add_feature(hash, *feature); } g_strfreev (features); } else if (g_str_has_prefix (*group, "identity_")) { gchar *category, *type, *name, *lang; category = g_key_file_get_string(key_file, *group, "category", NULL); type = g_key_file_get_string(key_file, *group, "type", NULL); name = g_key_file_get_string(key_file, *group, "name", NULL); lang = *group + 9; /* "identity_" */ caps_add_identity(hash, category, name, type, lang); g_free(category); g_free(type); g_free(name); } else if (g_str_has_prefix (*group, "form_")) { gchar *formtype; gchar **fields, **field; formtype = *group + 5; /* "form_" */ caps_add_dataform (hash, formtype); fields = g_key_file_get_keys(key_file, *group, NULL, NULL); for (field = fields; *field; ++field) { gchar **values, **value; values = g_key_file_get_string_list (key_file, *group, *field, NULL, NULL); for (value = values; *value; ++value) { caps_add_dataform_field (hash, formtype, *field, *value); } g_strfreev (values); } g_strfreev (fields); } } g_strfreev(groups); restored = TRUE; caps_restore_bad_file: g_key_file_free (key_file); g_free (file); caps_restore_no_file: return restored; } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/caps.h000066400000000000000000000025761216603513500156730ustar00rootroot00000000000000#ifndef __MCABBER_CAPS_H__ #define __MCABBER_CAPS_H__ 1 #include void caps_init(void); void caps_free(void); void caps_add(const char *hash); void caps_remove(const char *hash); void caps_move_to_local(const char *hash, char *bjid); int caps_has_hash(const char *hash, const char *bjid); void caps_add_identity(const char *hash, const char *category, const char *name, const char *type, const char *lang); void caps_set_identity(char *hash, const char *category, const char *name, const char *type); void caps_add_dataform(const char *hash, const char *formtype); void caps_add_dataform_field(const char *hash, const char *formtype, const char *field, const char *value); void caps_add_feature(char *hash, const char *feature); int caps_has_feature(char *hash, char *feature, char *bjid); void caps_foreach_feature(const char *hash, GFunc func, gpointer user_data); char *caps_generate(void); gboolean caps_verify(const char *hash, char *function); void caps_copy_to_persistent(const char *hash, char *xml); gboolean caps_restore_from_persistent(const char *hash); #endif /* __MCABBER_CAPS_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/commands.c000066400000000000000000003542121216603513500165360ustar00rootroot00000000000000/* * commands.c -- user commands handling * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #include #include "config.h" #include "commands.h" #include "help.h" #include "roster.h" #include "screen.h" #include "compl.h" #include "hooks.h" #include "hbuf.h" #include "utils.h" #include "settings.h" #include "events.h" #include "otr.h" #include "utf8.h" #include "xmpp.h" #include "main.h" #define IMSTATUS_AWAY "away" #define IMSTATUS_ONLINE "online" #define IMSTATUS_OFFLINE "offline" #define IMSTATUS_FREE4CHAT "free" #define IMSTATUS_AVAILABLE "avail" #define IMSTATUS_NOTAVAILABLE "notavail" #define IMSTATUS_DONOTDISTURB "dnd" #ifdef WITH_DEPRECATED_STATUS_INVISIBLE # define IMSTATUS_INVISIBLE "invisible" #endif // Return value container for the following functions static int retval_for_cmds; // Commands callbacks static void do_roster(char *arg); static void do_status(char *arg); static void do_status_to(char *arg); static void do_add(char *arg); static void do_del(char *arg); static void do_group(char *arg); static void do_say(char *arg); static void do_msay(char *arg); static void do_say_to(char *arg); static void do_buffer(char *arg); static void do_clear(char *arg); static void do_info(char *arg); static void do_rename(char *arg); static void do_move(char *arg); static void do_set(char *arg); static void do_alias(char *arg); static void do_bind(char *arg); static void do_connect(char *arg); static void do_disconnect(char *arg); static void do_rawxml(char *arg); static void do_room(char *arg); static void do_authorization(char *arg); static void do_version(char *arg); static void do_request(char *arg); static void do_event(char *arg); static void do_help(char *arg); static void do_pgp(char *arg); static void do_iline(char *arg); static void do_screen_refresh(char *arg); static void do_chat_disable(char *arg); static void do_source(char *arg); static void do_color(char *arg); static void do_otr(char *arg); static void do_otrpolicy(char *arg); static void do_echo(char *arg); static void do_module(char *arg); static void room_bookmark(gpointer bud, char *arg); // Global variable for the commands list static GSList *Commands; static GSList *safe_commands; #ifdef MODULES_ENABLE #include "modules.h" gpointer cmd_del(gpointer id) { GSList *sl_cmd; if (!id) return NULL; for (sl_cmd = Commands; sl_cmd; sl_cmd = sl_cmd->next) if (sl_cmd -> data == id) { cmd *command = (cmd *) sl_cmd->data; gpointer userdata = command->userdata; Commands = g_slist_delete_link(Commands, sl_cmd); compl_del_category_word(COMPL_CMD, command->name); g_free(command); return userdata; } return NULL; } #endif // cmd_add() // Adds a command to the commands list and to the CMD completion list gpointer cmd_add(const char *name, const char *help, guint flags_row1, guint flags_row2, void (*f)(char*), gpointer userdata) { cmd *n_cmd = g_new0(cmd, 1); strncpy(n_cmd->name, name, 32-1); n_cmd->help = help; n_cmd->completion_flags[0] = flags_row1; n_cmd->completion_flags[1] = flags_row2; n_cmd->func = f; n_cmd->userdata = userdata; Commands = g_slist_prepend(Commands, n_cmd); // Add to completion CMD category compl_add_category_word(COMPL_CMD, name); return n_cmd; } // cmd_set_safe(name, safe) // Sets if command can be used in startup configuration file. gboolean cmd_set_safe(const gchar *name, gboolean safe) { GSList *sel; if (!name) return FALSE; for (sel = safe_commands; sel; sel = sel->next) if (!strcmp((const char *)sel->data, name)) { if (safe) return FALSE; else { g_free(sel->data); safe_commands = g_slist_delete_link(safe_commands, sel); } } if (safe) safe_commands = g_slist_append(safe_commands, g_strdup(name)); else return FALSE; return TRUE; } // cmd_is_safe(name) // Returns if command is safe or not gboolean cmd_is_safe(const gchar *name) { GSList *sel; if (!name) return FALSE; for (sel = safe_commands; sel; sel = sel->next) if (!strcmp((const char *)sel->data, name)) return TRUE; return FALSE; } // cmd_init() // Commands table initialization // !!! // After changing commands names and it arguments names here, you must change // ones in init_bindings()! // void cmd_init(void) { cmd_add("add", "Add a jabber user", COMPL_JID, 0, &do_add, NULL); cmd_add("alias", "Add an alias", 0, 0, &do_alias, NULL); cmd_add("authorization", "Manage subscription authorizations", COMPL_AUTH, COMPL_JID, &do_authorization, NULL); cmd_add("bind", "Add an key binding", 0, 0, &do_bind, NULL); cmd_add("buffer", "Manipulate current buddy's buffer (chat window)", COMPL_BUFFER, 0, &do_buffer, NULL); cmd_add("chat_disable", "Disable chat mode", 0, 0, &do_chat_disable, NULL); cmd_add("clear", "Clear the dialog window", 0, 0, &do_clear, NULL); cmd_add("color", "Set coloring options", COMPL_COLOR, 0, &do_color, NULL); cmd_add("connect", "Connect to the server", 0, 0, &do_connect, NULL); cmd_add("del", "Delete the current buddy", 0, 0, &do_del, NULL); cmd_add("disconnect", "Disconnect from server", 0, 0, &do_disconnect, NULL); cmd_add("echo", "Display a string in the log window", 0, 0, &do_echo, NULL); cmd_add("event", "Process an event", COMPL_EVENTSID, COMPL_EVENTS, &do_event, NULL); cmd_add("group", "Change group display settings", COMPL_GROUP, COMPL_GROUPNAME, &do_group, NULL); cmd_add("help", "Display some help", COMPL_CMD, 0, &do_help, NULL); cmd_add("iline", "Manipulate input buffer", 0, 0, &do_iline, NULL); cmd_add("info", "Show basic info on current buddy", 0, 0, &do_info, NULL); cmd_add("module", "Manipulations with modules", COMPL_MODULE, 0, &do_module, NULL); cmd_add("move", "Move the current buddy to another group", COMPL_GROUPNAME, 0, &do_move, NULL); cmd_add("msay", "Send a multi-lines message to the selected buddy", COMPL_MULTILINE, 0, &do_msay, NULL); cmd_add("otr", "Manage OTR settings", COMPL_OTR, COMPL_JID, &do_otr, NULL); cmd_add("otrpolicy", "Manage OTR policies", COMPL_JID, COMPL_OTRPOLICY, &do_otrpolicy, NULL); cmd_add("pgp", "Manage PGP settings", COMPL_PGP, COMPL_JID, &do_pgp, NULL); cmd_add("quit", "Exit the software", 0, 0, NULL, NULL); cmd_add("rawxml", "Send a raw XML string", 0, 0, &do_rawxml, NULL); cmd_add("rename", "Rename the current buddy", 0, 0, &do_rename, NULL); cmd_add("request", "Send a Jabber IQ request", COMPL_REQUEST, COMPL_JID, &do_request, NULL); cmd_add("room", "MUC actions command", COMPL_ROOM, 0, &do_room, NULL); cmd_add("roster", "Manipulate the roster/buddylist", COMPL_ROSTER, 0, &do_roster, NULL); cmd_add("say", "Say something to the selected buddy", 0, 0, &do_say, NULL); cmd_add("say_to", "Say something to a specific buddy", COMPL_JID, 0, &do_say_to, NULL); cmd_add("screen_refresh", "Redraw mcabber screen", 0, 0, &do_screen_refresh, NULL); cmd_add("set", "Set/query an option value", 0, 0, &do_set, NULL); cmd_add("source", "Read a configuration file", 0, 0, &do_source, NULL); cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status, NULL); cmd_add("status_to", "Show or set your status for one recipient", COMPL_JID, COMPL_STATUS, &do_status_to, NULL); cmd_add("version", "Show mcabber version", 0, 0, &do_version, NULL); cmd_set_safe("set", TRUE); cmd_set_safe("bind", TRUE); cmd_set_safe("alias", TRUE); cmd_set_safe("pgp", TRUE); cmd_set_safe("source", TRUE); cmd_set_safe("status", TRUE); cmd_set_safe("color", TRUE); cmd_set_safe("otrpolicy", TRUE); cmd_set_safe("module", TRUE); // Status category compl_add_category_word(COMPL_STATUS, "online"); compl_add_category_word(COMPL_STATUS, "avail"); #ifdef WITH_DEPRECATED_STATUS_INVISIBLE compl_add_category_word(COMPL_STATUS, "invisible"); #endif compl_add_category_word(COMPL_STATUS, "free"); compl_add_category_word(COMPL_STATUS, "dnd"); compl_add_category_word(COMPL_STATUS, "notavail"); compl_add_category_word(COMPL_STATUS, "away"); compl_add_category_word(COMPL_STATUS, "offline"); compl_add_category_word(COMPL_STATUS, "message"); // Roster category compl_add_category_word(COMPL_ROSTER, "bottom"); compl_add_category_word(COMPL_ROSTER, "top"); compl_add_category_word(COMPL_ROSTER, "up"); compl_add_category_word(COMPL_ROSTER, "down"); compl_add_category_word(COMPL_ROSTER, "group_prev"); compl_add_category_word(COMPL_ROSTER, "group_next"); compl_add_category_word(COMPL_ROSTER, "hide"); compl_add_category_word(COMPL_ROSTER, "show"); compl_add_category_word(COMPL_ROSTER, "toggle"); compl_add_category_word(COMPL_ROSTER, "display"); compl_add_category_word(COMPL_ROSTER, "hide_offline"); compl_add_category_word(COMPL_ROSTER, "show_offline"); compl_add_category_word(COMPL_ROSTER, "toggle_offline"); compl_add_category_word(COMPL_ROSTER, "item_lock"); compl_add_category_word(COMPL_ROSTER, "item_unlock"); compl_add_category_word(COMPL_ROSTER, "item_toggle_lock"); compl_add_category_word(COMPL_ROSTER, "alternate"); compl_add_category_word(COMPL_ROSTER, "search"); compl_add_category_word(COMPL_ROSTER, "unread_first"); compl_add_category_word(COMPL_ROSTER, "unread_next"); compl_add_category_word(COMPL_ROSTER, "note"); compl_add_category_word(COMPL_ROSTER, "resource_lock"); compl_add_category_word(COMPL_ROSTER, "resource_unlock"); // Buffer category compl_add_category_word(COMPL_BUFFER, "clear"); compl_add_category_word(COMPL_BUFFER, "bottom"); compl_add_category_word(COMPL_BUFFER, "top"); compl_add_category_word(COMPL_BUFFER, "up"); compl_add_category_word(COMPL_BUFFER, "down"); compl_add_category_word(COMPL_BUFFER, "search_backward"); compl_add_category_word(COMPL_BUFFER, "search_forward"); compl_add_category_word(COMPL_BUFFER, "readmark"); compl_add_category_word(COMPL_BUFFER, "date"); compl_add_category_word(COMPL_BUFFER, "%"); compl_add_category_word(COMPL_BUFFER, "purge"); compl_add_category_word(COMPL_BUFFER, "close"); compl_add_category_word(COMPL_BUFFER, "close_all"); compl_add_category_word(COMPL_BUFFER, "scroll_lock"); compl_add_category_word(COMPL_BUFFER, "scroll_unlock"); compl_add_category_word(COMPL_BUFFER, "scroll_toggle"); compl_add_category_word(COMPL_BUFFER, "list"); compl_add_category_word(COMPL_BUFFER, "save"); // Group category compl_add_category_word(COMPL_GROUP, "fold"); compl_add_category_word(COMPL_GROUP, "unfold"); compl_add_category_word(COMPL_GROUP, "toggle"); // Multi-line (msay) category compl_add_category_word(COMPL_MULTILINE, "abort"); compl_add_category_word(COMPL_MULTILINE, "begin"); compl_add_category_word(COMPL_MULTILINE, "send"); compl_add_category_word(COMPL_MULTILINE, "send_to"); compl_add_category_word(COMPL_MULTILINE, "toggle"); compl_add_category_word(COMPL_MULTILINE, "toggle_verbatim"); compl_add_category_word(COMPL_MULTILINE, "verbatim"); // Room category compl_add_category_word(COMPL_ROOM, "affil"); compl_add_category_word(COMPL_ROOM, "ban"); compl_add_category_word(COMPL_ROOM, "bookmark"); compl_add_category_word(COMPL_ROOM, "destroy"); compl_add_category_word(COMPL_ROOM, "invite"); compl_add_category_word(COMPL_ROOM, "join"); compl_add_category_word(COMPL_ROOM, "kick"); compl_add_category_word(COMPL_ROOM, "leave"); compl_add_category_word(COMPL_ROOM, "names"); compl_add_category_word(COMPL_ROOM, "nick"); compl_add_category_word(COMPL_ROOM, "privmsg"); compl_add_category_word(COMPL_ROOM, "remove"); compl_add_category_word(COMPL_ROOM, "role"); compl_add_category_word(COMPL_ROOM, "setopt"); compl_add_category_word(COMPL_ROOM, "topic"); compl_add_category_word(COMPL_ROOM, "unban"); compl_add_category_word(COMPL_ROOM, "unlock"); compl_add_category_word(COMPL_ROOM, "whois"); // Authorization category compl_add_category_word(COMPL_AUTH, "allow"); compl_add_category_word(COMPL_AUTH, "cancel"); compl_add_category_word(COMPL_AUTH, "request"); compl_add_category_word(COMPL_AUTH, "request_unsubscribe"); // Request (query) category compl_add_category_word(COMPL_REQUEST, "last"); compl_add_category_word(COMPL_REQUEST, "ping"); compl_add_category_word(COMPL_REQUEST, "time"); compl_add_category_word(COMPL_REQUEST, "vcard"); compl_add_category_word(COMPL_REQUEST, "version"); // Events category compl_add_category_word(COMPL_EVENTS, "accept"); compl_add_category_word(COMPL_EVENTS, "ignore"); compl_add_category_word(COMPL_EVENTS, "reject"); // PGP category compl_add_category_word(COMPL_PGP, "disable"); compl_add_category_word(COMPL_PGP, "enable"); compl_add_category_word(COMPL_PGP, "force"); compl_add_category_word(COMPL_PGP, "info"); compl_add_category_word(COMPL_PGP, "setkey"); // OTR category compl_add_category_word(COMPL_OTR, "start"); compl_add_category_word(COMPL_OTR, "stop"); compl_add_category_word(COMPL_OTR, "fingerprint"); compl_add_category_word(COMPL_OTR, "smpq"); compl_add_category_word(COMPL_OTR, "smpr"); compl_add_category_word(COMPL_OTR, "smpa"); compl_add_category_word(COMPL_OTR, "info"); compl_add_category_word(COMPL_OTR, "key"); // OTR Policy category compl_add_category_word(COMPL_OTRPOLICY, "plain"); compl_add_category_word(COMPL_OTRPOLICY, "manual"); compl_add_category_word(COMPL_OTRPOLICY, "opportunistic"); compl_add_category_word(COMPL_OTRPOLICY, "always"); // Color category compl_add_category_word(COMPL_COLOR, "roster"); compl_add_category_word(COMPL_COLOR, "muc"); compl_add_category_word(COMPL_COLOR, "mucnick"); #ifdef MODULES_ENABLE // Module category compl_add_category_word(COMPL_MODULE, "info"); compl_add_category_word(COMPL_MODULE, "list"); compl_add_category_word(COMPL_MODULE, "load"); compl_add_category_word(COMPL_MODULE, "unload"); #endif } // expandalias(line) // If there is one, expand the alias in line and returns a new allocated line // If no alias is found, returns line // Note: if the returned pointer is different from line, the caller should // g_free() the pointer after use char *expandalias(const char *line) { const char *p1, *p2; char *word; const gchar *value; char *newline = (char*)line; // Ignore leading COMMAND_CHAR for (p1 = line ; *p1 == COMMAND_CHAR ; p1++) ; // Locate the end of the word for (p2 = p1 ; *p2 && (*p2 != ' ') ; p2++) ; // Extract the word and look for an alias in the list word = g_strndup(p1, p2-p1); value = settings_get(SETTINGS_TYPE_ALIAS, (const char*)word); g_free(word); if (value) newline = g_strdup_printf("%c%s%s", COMMAND_CHAR, value, p2); return newline; } // cmd_get // Finds command in the command list structure. // Returns a pointer to the cmd entry, or NULL if command not found. cmd *cmd_get(const char *command) { const char *p1, *p2; char *com; GSList *sl_com; // Ignore leading COMMAND_CHAR for (p1 = command ; *p1 == COMMAND_CHAR ; p1++) ; // Locate the end of the command for (p2 = p1 ; *p2 && (*p2 != ' ') ; p2++) ; // Copy the clean command com = g_strndup(p1, p2-p1); // Look for command in the list for (sl_com=Commands; sl_com; sl_com = g_slist_next(sl_com)) { if (!strcasecmp(com, ((cmd*)sl_com->data)->name)) break; } g_free(com); if (sl_com) // Command has been found. return (cmd*)sl_com->data; return NULL; } // process_command(line, iscmd) // Process a command line. // If iscmd is TRUE, process the command even if verbatim mmode is set; // it is intended to be used for key bindings. // Return 255 if this is the /quit command, and 0 for the other commands. int process_command(const char *line, guint iscmd) { char *p; char *xpline; cmd *curcmd; if (!line) return 0; // We do alias expansion here if (iscmd || scr_get_multimode() != 2) xpline = expandalias(line); else xpline = (char*)line; // No expansion in verbatim multi-line mode // We want to use a copy if (xpline == line) xpline = g_strdup(line); // Remove trailing spaces: for (p=xpline ; *p ; p++) ; for (p-- ; p>xpline && (*p == ' ') ; p--) *p = 0; // Command "quit"? if ((iscmd || scr_get_multimode() != 2) && (!strncasecmp(xpline, mkcmdstr("quit"), strlen(mkcmdstr("quit"))))) { if (!xpline[5] || xpline[5] == ' ') { g_free(xpline); return 255; } } else if (iscmd && !strncasecmp(xpline, "quit", 4) && (!xpline[4] || xpline[4] == ' ')) { // If iscmd is true we can have the command without the command prefix // character (usually '/'). g_free(xpline); return 255; } // If verbatim multi-line mode, we check if another /msay command is typed if (!iscmd && scr_get_multimode() == 2 && (strncasecmp(xpline, mkcmdstr("msay "), strlen(mkcmdstr("msay "))))) { // It isn't an /msay command scr_append_multiline(xpline); g_free(xpline); return 0; } // Commands handling curcmd = cmd_get(xpline); if (!curcmd) { scr_LogPrint(LPRINT_NORMAL, "Unrecognized command. " "Please see the manual for a list of known commands."); g_free(xpline); return 0; } if (!curcmd->func) { scr_LogPrint(LPRINT_NORMAL, "This functionality is not yet implemented, sorry."); g_free(xpline); return 0; } // Lets go to the command parameters for (p = xpline+1; *p && (*p != ' ') ; p++) ; // Skip spaces while (*p && (*p == ' ')) p++; // Call command-specific function retval_for_cmds = 0; #ifdef MODULES_ENABLE if (curcmd->userdata) (*(void (*)(char *p, gpointer u))curcmd->func)(p, curcmd->userdata); else (*curcmd->func)(p); #else (*curcmd->func)(p); #endif g_free(xpline); return retval_for_cmds; } // process_line(line) // Process a command/message line. // If this isn't a command, this is a message and it is sent to the // currently selected buddy. // Return 255 if the line is the /quit command, or 0. int process_line(const char *line) { if (!*line) { // User only pressed enter if (scr_get_multimode()) { scr_append_multiline(""); return 0; } if (current_buddy) { if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) do_group("toggle"); else { // Enter chat mode scr_set_chatmode(TRUE); scr_show_buddy_window(); } } return 0; } if (*line != COMMAND_CHAR) { // This isn't a command if (scr_get_multimode()) scr_append_multiline(line); else say_cmd((char*)line, 0); return 0; } /* It is _probably_ a command -- except for verbatim multi-line mode */ return process_command(line, FALSE); } // Helper routine for buffer item_{lock,unlock,toggle_lock} // "lock" values: 1=lock 0=unlock -1=invert static void roster_buddylock(char *bjid, int lock) { gpointer bud = NULL; bool may_need_refresh = FALSE; // Allow special jid "" or "." (current buddy) if (bjid && (!*bjid || !strcmp(bjid, "."))) bjid = NULL; if (bjid) { // The JID has been specified. Quick check... if (check_jid_syntax(bjid)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", bjid); } else { // Find the buddy GSList *roster_elt; roster_elt = roster_find(bjid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM); if (roster_elt) bud = roster_elt->data; else scr_LogPrint(LPRINT_NORMAL, "This jid isn't in the roster."); may_need_refresh = TRUE; } } else { // Use the current buddy if (current_buddy) bud = BUDDATA(current_buddy); } // Update the ROSTER_FLAG_USRLOCK flag if (bud) { if (lock == -1) lock = !(buddy_getflags(bud) & ROSTER_FLAG_USRLOCK); buddy_setflags(bud, ROSTER_FLAG_USRLOCK, lock); if (may_need_refresh) { buddylist_build(); update_roster = TRUE; } } } static void roster_resourcelock(char *jidres, gboolean lock) { gpointer bud = NULL; char *resource = NULL; if (!jidres) { if (lock) return; jidres = "."; } if (jidres[0] == '.' && (jidres[1] == '\0' || jidres[1] == JID_RESOURCE_SEPARATOR)) { //Special jid: . or ./resource switch (jidres[1]) { case JID_RESOURCE_SEPARATOR: resource = jidres+2; case '\0': if (current_buddy) bud = BUDDATA(current_buddy); } } else { char *tmp; if (!check_jid_syntax(jidres) && (tmp = strchr(jidres, JID_RESOURCE_SEPARATOR))) { //Any other valid full jid *tmp = '\0'; // for roster search by bare jid; resource = tmp+1; GSList *roster_elt; roster_elt = roster_find(jidres, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (roster_elt) bud = roster_elt->data; *tmp = JID_RESOURCE_SEPARATOR; } if (!bud) { //Resource for current buddy if (current_buddy) bud = BUDDATA(current_buddy); resource = jidres; } } if (bud && buddy_gettype(bud) & (ROSTER_TYPE_USER|ROSTER_TYPE_AGENT)) { if (lock) { GSList *resources, *p_res; gboolean found = FALSE; resources = buddy_getresources(bud); for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) { if (!g_strcmp0((char*)p_res->data, resource)) found = TRUE; g_free(p_res->data); } g_slist_free(resources); if (!found) { scr_LogPrint(LPRINT_NORMAL, "No such resource <%s>...", jidres); return; } } else { resource = NULL; } buddy_setactiveresource(bud, resource); scr_update_chat_status(TRUE); } } // display_and_free_note(note, winId) // Display the note information in the winId buffer, and free note // (winId is a bare jid or NULL for the status window, in which case we // display the note jid too) static void display_and_free_note(struct annotation *note, const char *winId) { gchar tbuf[128]; GString *sbuf; guint msg_flag = HBB_PREFIX_INFO; /* We use the flag prefix_info for the first line, and prefix_cont for the other lines, for better readability */ if (!note) return; sbuf = g_string_new(""); if (!winId) { // We're writing to the status window, so let's show the jid too. g_string_printf(sbuf, "Annotation on <%s>", note->jid); scr_WriteIncomingMessage(winId, sbuf->str, 0, msg_flag, 0); msg_flag = HBB_PREFIX_INFO | HBB_PREFIX_CONT; } // If we have the creation date, display it if (note->cdate) { strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(¬e->cdate)); g_string_printf(sbuf, "Note created %s", tbuf); scr_WriteIncomingMessage(winId, sbuf->str, 0, msg_flag, 0); msg_flag = HBB_PREFIX_INFO | HBB_PREFIX_CONT; } // If we have the modification date, display it // unless it's the same as the creation date if (note->mdate && note->mdate != note->cdate) { strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(¬e->mdate)); g_string_printf(sbuf, "Note modified %s", tbuf); scr_WriteIncomingMessage(winId, sbuf->str, 0, msg_flag, 0); msg_flag = HBB_PREFIX_INFO | HBB_PREFIX_CONT; } // Note text g_string_printf(sbuf, "Note: %s", note->text); scr_WriteIncomingMessage(winId, sbuf->str, 0, msg_flag, 0); g_string_free(sbuf, TRUE); g_free(note->text); g_free(note->jid); g_free(note); } static void display_all_annotations(void) { GSList *notes; notes = xmpp_get_all_storage_rosternotes(); if (!notes) return; // Call display_and_free_note() for each note, // with winId = NULL (special window) g_slist_foreach(notes, (GFunc)&display_and_free_note, NULL); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); g_slist_free(notes); } static void roster_note(char *arg) { const char *bjid; guint type; if (!current_buddy) return; bjid = buddy_getjid(BUDDATA(current_buddy)); type = buddy_gettype(BUDDATA(current_buddy)); if (!bjid && type == ROSTER_TYPE_SPECIAL && !arg) { // We're in the status window (the only special buffer currently) // Let's display all server notes display_all_annotations(); return; } if (!bjid || (type != ROSTER_TYPE_USER && type != ROSTER_TYPE_ROOM && type != ROSTER_TYPE_AGENT)) { scr_LogPrint(LPRINT_NORMAL, "This item can't have a note."); return; } if (arg && *arg) { // Set a note gchar *msg, *notetxt; msg = to_utf8(arg); if (!strcmp(msg, "-")) notetxt = NULL; // delete note else notetxt = msg; xmpp_set_storage_rosternotes(bjid, notetxt); g_free(msg); } else { // Display a note struct annotation *note = xmpp_get_storage_rosternotes(bjid, FALSE); if (note) { display_and_free_note(note, bjid); } else { scr_WriteIncomingMessage(bjid, "This item doesn't have a note.", 0, HBB_PREFIX_INFO, 0); } } } // roster_updown(updown, nitems) // updown: -1=up, +1=down inline static void roster_updown(int updown, char *nitems) { int nbitems; if (!nitems || !*nitems) nbitems = 1; else nbitems = strtol(nitems, NULL, 10); if (nbitems > 0) scr_roster_up_down(updown, nbitems); } /* Commands callback functions */ /* All these do_*() functions will be called with a "arg" parameter */ /* (with arg not null) */ static void do_roster(char *arg) { char **paramlst; char *subcmd; paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "top")) { scr_roster_top(); update_roster = TRUE; } else if (!strcasecmp(subcmd, "bottom")) { scr_roster_bottom(); update_roster = TRUE; } else if (!strcasecmp(subcmd, "hide")) { scr_roster_visibility(0); } else if (!strcasecmp(subcmd, "show")) { scr_roster_visibility(1); } else if (!strcasecmp(subcmd, "toggle")) { scr_roster_visibility(-1); } else if (!strcasecmp(subcmd, "hide_offline")) { buddylist_set_hide_offline_buddies(TRUE); if (current_buddy) buddylist_build(); update_roster = TRUE; } else if (!strcasecmp(subcmd, "show_offline")) { buddylist_set_hide_offline_buddies(FALSE); buddylist_build(); update_roster = TRUE; } else if (!strcasecmp(subcmd, "toggle_offline")) { buddylist_set_hide_offline_buddies(-1); buddylist_build(); update_roster = TRUE; } else if (!strcasecmp(subcmd, "display")) { scr_roster_display(arg); } else if (!strcasecmp(subcmd, "item_lock")) { roster_buddylock(arg, 1); } else if (!strcasecmp(subcmd, "item_unlock")) { roster_buddylock(arg, 0); } else if (!strcasecmp(subcmd, "item_toggle_lock")) { roster_buddylock(arg, -1); } else if (!strcasecmp(subcmd, "unread_first")) { scr_roster_unread_message(0); } else if (!strcasecmp(subcmd, "unread_next")) { scr_roster_unread_message(1); } else if (!strcasecmp(subcmd, "alternate")) { scr_roster_jump_alternate(); } else if (!strncasecmp(subcmd, "search", 6)) { strip_arg_special_chars(arg); if (!arg || !*arg) { scr_LogPrint(LPRINT_NORMAL, "What name or JID are you looking for?"); free_arg_lst(paramlst); return; } scr_roster_search(arg); update_roster = TRUE; } else if (!strcasecmp(subcmd, "up")) { roster_updown(-1, arg); } else if (!strcasecmp(subcmd, "down")) { roster_updown(1, arg); } else if (!strcasecmp(subcmd, "group_prev")) { scr_roster_prev_group(); } else if (!strcasecmp(subcmd, "group_next")) { scr_roster_next_group(); } else if (!strcasecmp(subcmd, "note")) { roster_note(arg); } else if (!strcasecmp(subcmd, "resource_lock")) { roster_resourcelock(arg, TRUE); } else if (!strcasecmp(subcmd, "resource_unlock")) { roster_resourcelock(arg, FALSE); } else scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); free_arg_lst(paramlst); } void do_color(char *arg) { char **paramlst; char *subcmd; paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "roster")) { char *status, *wildcard, *color; char **arglist = split_arg(arg, 3, 0); status = *arglist; wildcard = to_utf8(arglist[1]); color = arglist[2]; if (status && !strcmp(status, "clear")) { // Not a color command, clear all scr_roster_clear_color(); update_roster = TRUE; } else { if (!status || !*status || !wildcard || !*wildcard || !color || !*color) { scr_LogPrint(LPRINT_NORMAL, "Missing argument"); } else { update_roster = scr_roster_color(status, wildcard, color) || update_roster; } } free_arg_lst(arglist); g_free(wildcard); } else if (!strcasecmp(subcmd, "muc")) { char **arglist = split_arg(arg, 2, 0); char *free_muc = to_utf8(*arglist); const char *muc = free_muc, *mode = arglist[1]; if (!muc || !*muc) scr_LogPrint(LPRINT_NORMAL, "What MUC?"); else { if (!strcmp(muc, ".")) if (!(muc = CURRENT_JID)) scr_LogPrint(LPRINT_NORMAL, "No JID selected"); if (muc) { if (check_jid_syntax(muc) && strcmp(muc, "*")) scr_LogPrint(LPRINT_NORMAL, "Not a JID"); else { if (!mode || !*mode || !strcasecmp(mode, "on")) scr_muc_color(muc, MC_ALL); else if (!strcasecmp(mode, "preset")) scr_muc_color(muc, MC_PRESET); else if (!strcasecmp(mode, "off")) scr_muc_color(muc, MC_OFF); else if (!strcmp(mode, "-")) scr_muc_color(muc, MC_REMOVE); else scr_LogPrint(LPRINT_NORMAL, "Unknown coloring mode"); } } } free_arg_lst(arglist); g_free(free_muc); } else if (!strcasecmp(subcmd, "mucnick")) { char **arglist = split_arg(arg, 2, 0); const char *nick = *arglist, *color = arglist[1]; if (!nick || !*nick || !color || !*color) scr_LogPrint(LPRINT_NORMAL, "Missing argument"); else scr_muc_nick_color(nick, color); free_arg_lst(arglist); } else scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); free_arg_lst(paramlst); } // cmd_setstatus(recipient, arg) // Set your Jabber status. // - if recipient is not NULL, the status is sent to this contact only // - arg must be "status message" (message is optional) void cmd_setstatus(const char *recipient, const char *arg) { char **paramlst; char *status; char *msg; enum imstatus st; if (!xmpp_is_online()) scr_LogPrint(LPRINT_NORMAL, "You are currently not connected..."); // We do not return now, so that the status is memorized and used later... // It makes sense to reset autoaway before changing the status // (esp. for FIFO or remote commands) or the behaviour could be // unexpected... if (!recipient) scr_check_auto_away(TRUE); paramlst = split_arg(arg, 2, 1); // status, message status = *paramlst; msg = *(paramlst+1); if (!status) { free_arg_lst(paramlst); return; } if (!strcasecmp(status, IMSTATUS_OFFLINE)) st = offline; else if (!strcasecmp(status, IMSTATUS_ONLINE)) st = available; else if (!strcasecmp(status, IMSTATUS_AVAILABLE)) st = available; else if (!strcasecmp(status, IMSTATUS_AWAY)) st = away; #ifdef WITH_DEPRECATED_STATUS_INVISIBLE else if (!strcasecmp(status, IMSTATUS_INVISIBLE)) st = invisible; #endif else if (!strcasecmp(status, IMSTATUS_DONOTDISTURB)) st = dontdisturb; else if (!strcasecmp(status, IMSTATUS_NOTAVAILABLE)) st = notavail; else if (!strcasecmp(status, IMSTATUS_FREE4CHAT)) st = freeforchat; else if (!strcasecmp(status, "message")) { if (!msg || !*msg) { // We want a message. If there's none, we give up. scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } st = xmpp_getstatus(); // Preserve current status } else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized status!"); free_arg_lst(paramlst); return; } // Use provided message if (msg && !*msg) { msg = NULL; } // If a recipient is specified, let's don't use default status messages if (recipient && !msg) msg = ""; xmpp_setstatus(st, recipient, msg, FALSE); free_arg_lst(paramlst); } static void do_status(char *arg) { if (!*arg) { const char *sm = xmpp_getstatusmsg(); scr_LogPrint(LPRINT_NORMAL, "Your status is: [%c] %s", imstatus2char[xmpp_getstatus()], (sm ? sm : "")); return; } arg = to_utf8(arg); cmd_setstatus(NULL, arg); g_free(arg); } static void do_status_to(char *arg) { char **paramlst; char *fjid, *st, *msg; char *jid_utf8 = NULL; paramlst = split_arg(arg, 3, 1); // jid, status, [message] fjid = *paramlst; st = *(paramlst+1); msg = *(paramlst+2); if (!fjid || !st) { scr_LogPrint(LPRINT_NORMAL, "Please specify both a Jabber ID and a status."); free_arg_lst(paramlst); return; } // Allow things like /status_to "" away if (!*fjid || !strcmp(fjid, ".")) fjid = NULL; if (fjid) { // The JID has been specified. Quick check... if (check_jid_syntax(fjid)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); fjid = NULL; } else { // Convert jid to lowercase char *p = fjid; for ( ; *p && *p != JID_RESOURCE_SEPARATOR; p++) *p = tolower(*p); fjid = jid_utf8 = to_utf8(fjid); } } else { // Add the current buddy if (current_buddy) fjid = (char*)buddy_getjid(BUDDATA(current_buddy)); if (!fjid) scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); } if (fjid) { char *cmdline; if (!msg) msg = ""; msg = to_utf8(msg); cmdline = g_strdup_printf("%s %s", st, msg); scr_LogPrint(LPRINT_LOGNORM, "Sending to <%s> /status %s", fjid, cmdline); cmd_setstatus(fjid, cmdline); g_free(msg); g_free(cmdline); g_free(jid_utf8); } free_arg_lst(paramlst); } static void do_add(char *arg) { char **paramlst; char *id, *nick; char *jid_utf8 = NULL; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return; } paramlst = split_arg(arg, 2, 0); // jid, [nickname] id = *paramlst; nick = *(paramlst+1); if (!id) nick = NULL; // Allow things like: /add "" nick else if (!*id || !strcmp(id, ".")) id = NULL; if (id) { // The JID has been specified. Quick check... if (check_jid_syntax(id)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", id); id = NULL; } else { mc_strtolower(id); id = jid_utf8 = to_utf8(id); } } else { // Add the current buddy if (current_buddy) id = (char*)buddy_getjid(BUDDATA(current_buddy)); if (!id) scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); } if (nick) nick = to_utf8(nick); if (id) { // 2nd parameter = optional nickname xmpp_addbuddy(id, nick, NULL); scr_LogPrint(LPRINT_LOGNORM, "Sent presence notification request to <%s>.", id); } g_free(jid_utf8); g_free(nick); free_arg_lst(paramlst); } static void do_del(char *arg) { const char *bjid; if (*arg) { scr_LogPrint(LPRINT_NORMAL, "This action does not require a parameter; " "the currently-selected buddy will be deleted."); return; } if (!current_buddy) return; bjid = buddy_getjid(BUDDATA(current_buddy)); if (!bjid) return; if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_ROOM) { // This is a chatroom if (buddy_getinsideroom(BUDDATA(current_buddy))) { scr_LogPrint(LPRINT_NORMAL, "You haven't left this room!"); return; } } // Close the buffer scr_buffer_purge(1, NULL); scr_LogPrint(LPRINT_LOGNORM, "Removing <%s>...", bjid); xmpp_delbuddy(bjid); scr_update_buddy_window(); } static void do_group(char *arg) { gpointer group = NULL; guint leave_buddywindow; char **paramlst; char *subcmd; enum { group_toggle = -1, group_unfold = 0, group_fold = 1 } group_state = 0; if (!*arg) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); return; } if (!current_buddy) return; paramlst = split_arg(arg, 2, 0); // subcmd, [arg] subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) goto do_group_return; // Should not happen if (!strcasecmp(subcmd, "expand") || !strcasecmp(subcmd, "unfold")) group_state = group_unfold; else if (!strcasecmp(subcmd, "shrink") || !strcasecmp(subcmd, "fold")) group_state = group_fold; else if (!strcasecmp(subcmd, "toggle")) group_state = group_toggle; else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); goto do_group_return; } if (arg && *arg) { GSList *roster_elt; char *group_utf8 = to_utf8(arg); roster_elt = roster_find(group_utf8, namesearch, ROSTER_TYPE_GROUP); g_free(group_utf8); if (roster_elt) group = buddy_getgroup(roster_elt->data); } else { group = buddy_getgroup(BUDDATA(current_buddy)); } if (!group) { scr_LogPrint(LPRINT_NORMAL, "Group not found."); goto do_group_return; } // We'll have to redraw the chat window if we're not currently on the group // entry itself, because it means we'll have to leave the current buddy // chat window. leave_buddywindow = (group != BUDDATA(current_buddy) && group == buddy_getgroup(BUDDATA(current_buddy))); if (!(buddy_gettype(group) & ROSTER_TYPE_GROUP)) { scr_LogPrint(LPRINT_NORMAL, "You need to select a group."); goto do_group_return; } if (group_state != group_unfold && leave_buddywindow) scr_roster_prev_group(); buddy_hide_group(group, group_state); buddylist_build(); update_roster = TRUE; do_group_return: free_arg_lst(paramlst); } static int send_message_to(const char *fjid, const char *msg, const char *subj, LmMessageSubType type_overwrite, bool quiet) { char *bare_jid, *rp; char *hmsg; gint crypted; gint retval = 0; int isroom; gpointer xep184 = NULL; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return 1; } if (!fjid || !*fjid) { scr_LogPrint(LPRINT_NORMAL, "You must specify a Jabber ID."); return 1; } if (!msg || !*msg) { scr_LogPrint(LPRINT_NORMAL, "You must specify a message."); return 1; } if (check_jid_syntax((char*)fjid)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); return 1; } // We must use the bare jid in hk_message_out() rp = strchr(fjid, JID_RESOURCE_SEPARATOR); if (rp) bare_jid = g_strndup(fjid, rp - fjid); else bare_jid = (char*)fjid; if (!quiet) { // Jump to window, create one if needed scr_roster_jump_jid(bare_jid); } // Check if we're sending a message to a conference room // If not, we must make sure rp is NULL, for hk_message_out() isroom = !!roster_find(bare_jid, jidsearch, ROSTER_TYPE_ROOM); if (rp) { if (isroom) rp++; else rp = NULL; } isroom = isroom && (!rp || !*rp); // local part (UI, logging, etc.) if (subj) hmsg = g_strdup_printf("[%s]\n%s", subj, msg); else hmsg = (char*)msg; // Network part xmpp_send_msg(fjid, msg, (isroom ? ROSTER_TYPE_ROOM : ROSTER_TYPE_USER), subj, FALSE, &crypted, type_overwrite, &xep184); if (crypted == -1) { scr_LogPrint(LPRINT_LOGNORM, "Encryption error. Message was not sent."); retval = 1; goto send_message_to_return; } // Hook if (!isroom) hk_message_out(bare_jid, rp, 0, hmsg, crypted, xep184); send_message_to_return: if (hmsg != msg) g_free(hmsg); if (rp) g_free(bare_jid); return retval; } // send_message(msg, subj, type_overwrite) // Write the message in the buddy's window and send the message on // the network. static void send_message(const char *msg, const char *subj, LmMessageSubType type_overwrite) { const char *bjid; char *jid; const char *activeres; if (!current_buddy) { scr_LogPrint(LPRINT_NORMAL, "No buddy is currently selected."); return; } bjid = CURRENT_JID; if (!bjid) { scr_LogPrint(LPRINT_NORMAL, "No buddy is currently selected."); return; } activeres = buddy_getactiveresource(BUDDATA(current_buddy)); if (activeres) jid = g_strdup_printf("%s/%s", bjid, activeres); else jid = g_strdup(bjid); send_message_to(jid, msg, subj, type_overwrite, FALSE); g_free(jid); } static LmMessageSubType scan_mtype(char **arg) { // Try splitting it char **parlist = split_arg(*arg, 2, 1); LmMessageSubType result = LM_MESSAGE_SUB_TYPE_NOT_SET; // Is it a good parameter? if (parlist && *parlist) { if (!strcmp("-n", *parlist)) { result = LM_MESSAGE_SUB_TYPE_NORMAL; } else if (!strcmp("-h", *parlist)) { result = LM_MESSAGE_SUB_TYPE_HEADLINE; } if (result != LM_MESSAGE_SUB_TYPE_NOT_SET || (!strcmp("--", *parlist))) *arg += strlen(*arg) - (parlist[1] ? strlen(parlist[1]) : 0); } // Anything found? -> skip it free_arg_lst(parlist); return result; } void say_cmd(char *arg, int parse_flags) { gpointer bud; LmMessageSubType msgtype = LM_MESSAGE_SUB_TYPE_NOT_SET; scr_set_chatmode(TRUE); scr_show_buddy_window(); if (!current_buddy) { scr_LogPrint(LPRINT_NORMAL, "Whom are you talking to? Please select a buddy."); return; } bud = BUDDATA(current_buddy); if (!(buddy_gettype(bud) & (ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM))) { scr_LogPrint(LPRINT_NORMAL, "This is not a user."); return; } buddy_setflags(bud, ROSTER_FLAG_LOCK, TRUE); if (parse_flags) msgtype = scan_mtype(&arg); arg = to_utf8(arg); send_message(arg, NULL, msgtype); g_free(arg); } static void do_say(char *arg) { say_cmd(arg, 1); } static void do_msay(char *arg) { /* Parameters: begin verbatim abort send send_to */ char **paramlst; char *subcmd; paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); scr_LogPrint(LPRINT_NORMAL, "Please read the manual before using " "the /msay command."); scr_LogPrint(LPRINT_NORMAL, "(Use \"%s begin\" to enter " "multi-line mode...)", mkcmdstr("msay")); goto do_msay_return; } if (!strcasecmp(subcmd, "toggle")) { if (scr_get_multimode()) subcmd = "send"; else subcmd = "begin"; } else if (!strcasecmp(subcmd, "toggle_verbatim")) { if (scr_get_multimode()) subcmd = "send"; else subcmd = "verbatim"; } if (!strcasecmp(subcmd, "abort")) { if (scr_get_multimode()) scr_LogPrint(LPRINT_NORMAL, "Leaving multi-line message mode."); scr_set_multimode(FALSE, NULL); goto do_msay_return; } else if ((!strcasecmp(subcmd, "begin")) || (!strcasecmp(subcmd, "verbatim"))) { bool verbat; gchar *subj_utf8 = to_utf8(arg); if (!strcasecmp(subcmd, "verbatim")) { scr_set_multimode(2, subj_utf8); verbat = TRUE; } else { scr_set_multimode(1, subj_utf8); verbat = FALSE; } scr_LogPrint(LPRINT_NORMAL, "Entered %smulti-line message mode.", verbat ? "VERBATIM " : ""); scr_LogPrint(LPRINT_NORMAL, "Select a buddy and use \"%s send\" " "when your message is ready.", mkcmdstr("msay")); if (verbat) scr_LogPrint(LPRINT_NORMAL, "Use \"%s abort\" to abort this mode.", mkcmdstr("msay")); g_free(subj_utf8); goto do_msay_return; } else if (strcasecmp(subcmd, "send") && strcasecmp(subcmd, "send_to")) { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); goto do_msay_return; } /* send/send_to command */ if (!scr_get_multimode()) { scr_LogPrint(LPRINT_NORMAL, "No message to send. " "Use \"%s begin\" first.", mkcmdstr("msay")); goto do_msay_return; } scr_set_chatmode(TRUE); scr_show_buddy_window(); if (!strcasecmp(subcmd, "send_to")) { int err = FALSE; gchar *msg_utf8; LmMessageSubType msg_type = scan_mtype(&arg); // Let's send to the specified JID. We leave now if there // has been an error (so we don't leave multi-line mode). arg = to_utf8(arg); msg_utf8 = to_utf8(scr_get_multiline()); if (msg_utf8) { err = send_message_to(arg, msg_utf8, scr_get_multimode_subj(), msg_type, FALSE); g_free(msg_utf8); } g_free(arg); if (err) goto do_msay_return; } else { // Send to currently selected buddy gpointer bud; gchar *msg_utf8; if (!current_buddy) { scr_LogPrint(LPRINT_NORMAL, "Whom are you talking to?"); goto do_msay_return; } bud = BUDDATA(current_buddy); if (!(buddy_gettype(bud) & (ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM))) { scr_LogPrint(LPRINT_NORMAL, "This is not a user."); goto do_msay_return; } buddy_setflags(bud, ROSTER_FLAG_LOCK, TRUE); msg_utf8 = to_utf8(scr_get_multiline()); if (msg_utf8) { send_message(msg_utf8, scr_get_multimode_subj(), scan_mtype(&arg)); g_free(msg_utf8); } } scr_set_multimode(FALSE, NULL); scr_LogPrint(LPRINT_NORMAL, "You have left multi-line message mode."); do_msay_return: free_arg_lst(paramlst); } // load_message_from_file(filename) // Read the whole content of a file. // The data are converted to UTF8, they should be freed by the caller after // use. char *load_message_from_file(const char *filename) { FILE *fd; struct stat buf; char *msgbuf, *msgbuf_utf8; char *p; char *next_utf8_char; size_t len; fd = fopen(filename, "r"); if (!fd || fstat(fileno(fd), &buf)) { scr_LogPrint(LPRINT_LOGNORM, "Cannot open message file (%s)", filename); return NULL; } if (!buf.st_size || buf.st_size >= HBB_BLOCKSIZE) { if (!buf.st_size) scr_LogPrint(LPRINT_LOGNORM, "Message file is empty (%s)", filename); else scr_LogPrint(LPRINT_LOGNORM, "Message file is too big (%s)", filename); fclose(fd); return NULL; } msgbuf = g_new0(char, HBB_BLOCKSIZE); len = fread(msgbuf, 1, HBB_BLOCKSIZE-1, fd); fclose(fd); next_utf8_char = msgbuf; // Check there is no binary data. It must be a *message* file! for (p = msgbuf ; *p ; p++) { if (utf8_mode) { if (p == next_utf8_char) { if (!iswprint(get_char(p)) && *p != '\n' && *p != '\t') break; next_utf8_char = next_char(p); } } else { unsigned char sc = *p; if (!iswprint(sc) && sc != '\n' && sc != '\t') break; } } if (*p || (size_t)(p-msgbuf) != len) { // We're not at the End Of Line... scr_LogPrint(LPRINT_LOGNORM, "Message file contains " "invalid characters (%s)", filename); g_free(msgbuf); return NULL; } // p is now at the EOL // Let's strip trailing newlines if (p > msgbuf) p--; while (p > msgbuf && *p == '\n') *p-- = 0; // It could be empty, once the trailing newlines are gone if (p == msgbuf && *p == '\n') { scr_LogPrint(LPRINT_LOGNORM, "Message file is empty (%s)", filename); g_free(msgbuf); return NULL; } msgbuf_utf8 = to_utf8(msgbuf); if (!msgbuf_utf8 && msgbuf) scr_LogPrint(LPRINT_LOGNORM, "Message file charset conversion error (%s)", filename); g_free(msgbuf); return msgbuf_utf8; } static void do_say_to(char *arg) { char **paramlst; char *fjid, *msg_utf8; char *msg; char *unescaped_msg = NULL; char *uncompletedfjid = NULL; char *file = NULL; LmMessageSubType msg_type = LM_MESSAGE_SUB_TYPE_NOT_SET; bool quiet = FALSE; bool eval = FALSE; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return; } msg_type = scan_mtype(&arg); paramlst = split_arg(arg, 2, 1); // jid, message (or option, jid, message) if (!*paramlst) { // No parameter? scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); free_arg_lst(paramlst); return; } // Check for an option parameter while (*paramlst) { if (!strcmp(*paramlst, "-q")) { char **oldparamlst = paramlst; paramlst = split_arg(*(oldparamlst+1), 2, 1); // jid, message free_arg_lst(oldparamlst); quiet = TRUE; } else if (!strcmp(*paramlst, "-e")) { char **oldparamlst = paramlst; paramlst = split_arg(*(oldparamlst+1), 2, 1); // jid, message free_arg_lst(oldparamlst); eval = TRUE; } else if (!strcmp(*paramlst, "-f")) { char **oldparamlst = paramlst; paramlst = split_arg(*(oldparamlst+1), 2, 1); // filename, jid free_arg_lst(oldparamlst); if (!*paramlst) { scr_LogPrint(LPRINT_NORMAL, "Wrong usage."); free_arg_lst(paramlst); return; } file = g_strdup(*paramlst); // One more parameter shift... oldparamlst = paramlst; paramlst = split_arg(*(oldparamlst+1), 2, 1); // jid, nothing free_arg_lst(oldparamlst); } else break; } if (!*paramlst) { scr_LogPrint(LPRINT_NORMAL, "Wrong usage."); free_arg_lst(paramlst); return; } fjid = *paramlst; msg = *(paramlst+1); if (fjid[0] == '.') { const gchar *cjid = (current_buddy ? CURRENT_JID : NULL); if (fjid[1] == '\0') { fjid = g_strdup(cjid); } else if (fjid[1] == JID_RESOURCE_SEPARATOR) { char *res_utf8 = to_utf8(fjid+2); fjid = g_strdup_printf("%s%c%s", cjid, JID_RESOURCE_SEPARATOR, res_utf8); g_free(res_utf8); } else fjid = to_utf8(fjid); } else fjid = to_utf8(fjid); if (!strchr(fjid, JID_DOMAIN_SEPARATOR)) { const gchar *append_server = settings_opt_get("default_server"); if (append_server) { gchar *res = strchr(fjid, JID_RESOURCE_SEPARATOR); uncompletedfjid = fjid; if (res) { *res++ = '\0'; fjid = g_strdup_printf("%s%c%s%c%s", fjid, JID_DOMAIN_SEPARATOR, append_server, JID_RESOURCE_SEPARATOR, res); } else fjid = g_strdup_printf("%s%c%s", fjid, JID_DOMAIN_SEPARATOR, append_server); } } if (check_jid_syntax(fjid)) { scr_LogPrint(LPRINT_NORMAL, "Please specify a valid Jabber ID."); free_arg_lst(paramlst); g_free(uncompletedfjid); g_free(fjid); return; } if (!file) { msg_utf8 = to_utf8(msg); if (eval) { unescaped_msg = ut_unescape_tabs_cr(msg_utf8); // We must not free() if the original string was returned if (unescaped_msg == msg_utf8) unescaped_msg = NULL; } msg = (unescaped_msg ? unescaped_msg : msg_utf8); } else { char *filename_xp; if (msg) scr_LogPrint(LPRINT_NORMAL, "say_to: extra parameter ignored."); filename_xp = expand_filename(file); msg = msg_utf8 = load_message_from_file(filename_xp); g_free(filename_xp); g_free(file); } send_message_to(fjid, msg, NULL, msg_type, quiet); g_free(uncompletedfjid); g_free(fjid); g_free(msg_utf8); g_free(unescaped_msg); free_arg_lst(paramlst); } // buffer_updown(updown, nblines) // updown: -1=up, +1=down inline static void buffer_updown(int updown, char *nlines) { int nblines; if (!nlines || !*nlines) nblines = 0; else nblines = strtol(nlines, NULL, 10); if (nblines >= 0) scr_buffer_scroll_up_down(updown, nblines); } static void buffer_search(int direction, char *arg) { if (!arg || !*arg) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); return; } scr_buffer_search(direction, arg); } static void buffer_date(char *date) { time_t t; if (!date || !*date) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); return; } strip_arg_special_chars(date); t = from_iso8601(date, 0); if (t) scr_buffer_date(t); else scr_LogPrint(LPRINT_NORMAL, "The date you specified is " "not correctly formatted or invalid."); } static void buffer_percent(char *arg1, char *arg2) { // Basically, user has typed "%arg1 arg2" // "%50" -> arg1 = 50, arg2 null pointer // "% 50" -> arg1 = \0, arg2 = 50 if (!*arg1 && (!arg2 || !*arg2)) { // No value scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); return; } if (*arg1 && arg2 && *arg2) { // Two values scr_LogPrint(LPRINT_NORMAL, "Wrong parameters."); return; } scr_buffer_percent(atoi((*arg1 ? arg1 : arg2))); } static void do_buffer(char *arg) { char **paramlst; char *subcmd; if (!current_buddy) return; paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP && strcasecmp(subcmd, "close_all")) { scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer."); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "top")) { scr_buffer_top_bottom(-1); } else if (!strcasecmp(subcmd, "bottom")) { scr_buffer_top_bottom(1); } else if (!strcasecmp(subcmd, "clear")) { scr_buffer_clear(); } else if (!strcasecmp(subcmd, "close")) { scr_buffer_purge(1, arg); } else if (!strcasecmp(subcmd, "close_all")) { scr_buffer_purge_all(1); } else if (!strcasecmp(subcmd, "purge")) { scr_buffer_purge(0, arg); } else if (!strcasecmp(subcmd, "scroll_lock")) { scr_buffer_scroll_lock(1); } else if (!strcasecmp(subcmd, "scroll_unlock")) { scr_buffer_scroll_lock(0); } else if (!strcasecmp(subcmd, "scroll_toggle")) { scr_buffer_scroll_lock(-1); } else if (!strcasecmp(subcmd, "up")) { buffer_updown(-1, arg); } else if (!strcasecmp(subcmd, "down")) { buffer_updown(1, arg); } else if (!strcasecmp(subcmd, "search_backward")) { strip_arg_special_chars(arg); buffer_search(-1, arg); } else if (!strcasecmp(subcmd, "search_forward")) { strip_arg_special_chars(arg); buffer_search(1, arg); } else if (!strcasecmp(subcmd, "date")) { buffer_date(arg); } else if (*subcmd == '%') { buffer_percent(subcmd+1, arg); } else if (!strcasecmp(subcmd, "save")) { scr_buffer_dump(arg); } else if (!strcasecmp(subcmd, "list")) { scr_buffer_list(); } else if (!strcasecmp(subcmd, "readmark")) { scr_buffer_jump_readmark(); } else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); } free_arg_lst(paramlst); } static void do_clear(char *arg) // Alias for "buffer clear" { do_buffer("clear"); } static void do_info(char *arg) { gpointer bud; const char *bjid, *name; guint type, on_srv; char *buffer; enum subscr esub; if (!current_buddy) return; bud = BUDDATA(current_buddy); bjid = buddy_getjid(bud); name = buddy_getname(bud); type = buddy_gettype(bud); esub = buddy_getsubscription(bud); on_srv = buddy_getonserverflag(bud); buffer = g_new(char, 4096); if (bjid) { GSList *resources, *p_res; char *bstr = "unknown"; // Enter chat mode scr_set_chatmode(TRUE); scr_show_buddy_window(); snprintf(buffer, 4095, "jid: <%s>", bjid); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); if (name) { snprintf(buffer, 4095, "Name: %s", name); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); } if (type == ROSTER_TYPE_USER) bstr = "user"; else if (type == ROSTER_TYPE_ROOM) bstr = "chatroom"; else if (type == ROSTER_TYPE_AGENT) bstr = "agent"; snprintf(buffer, 127, "Type: %s", bstr); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); if (!on_srv) { scr_WriteIncomingMessage(bjid, "(Local item, not on the server)", 0, HBB_PREFIX_INFO, 0); } if (esub == sub_both) bstr = "both"; else if (esub & sub_from) bstr = "from"; else if (esub & sub_to) bstr = "to"; else bstr = "none"; snprintf(buffer, 64, "Subscription: %s", bstr); if (esub & sub_pending) strcat(buffer, " (pending)"); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); resources = buddy_getresources(bud); if (!resources && type == ROSTER_TYPE_USER) { // No resource; display last status message, if any. const char *rst_msg = buddy_getstatusmsg(bud, ""); if (rst_msg) { snprintf(buffer, 4095, "Last status message: %s", rst_msg); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); } } for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) { gchar rprio; enum imstatus rstatus; const char *rst_msg; time_t rst_time; rprio = buddy_getresourceprio(bud, p_res->data); rstatus = buddy_getstatus(bud, p_res->data); rst_msg = buddy_getstatusmsg(bud, p_res->data); rst_time = buddy_getstatustime(bud, p_res->data); snprintf(buffer, 4095, "Resource: [%c] (%d) %s", imstatus2char[rstatus], rprio, (char*)p_res->data); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); if (rst_msg) { snprintf(buffer, 4095, "Status message: %s", rst_msg); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } if (rst_time) { char tbuf[128]; strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(&rst_time)); snprintf(buffer, 127, "Status timestamp: %s", tbuf); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } #ifdef HAVE_GPGME struct pgp_data *rpgp = buddy_resource_pgp(bud, p_res->data); if (rpgp && rpgp->sign_keyid) { snprintf(buffer, 4095, "PGP key id: %s", rpgp->sign_keyid); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); if (rpgp->last_sigsum) { gpgme_sigsum_t ss = rpgp->last_sigsum; snprintf(buffer, 4095, "Last PGP signature: %s", (ss & GPGME_SIGSUM_GREEN ? "good": (ss & GPGME_SIGSUM_RED ? "bad" : "unknown"))); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } } #endif g_free(p_res->data); } g_slist_free(resources); } else { /* Item has no jid */ if (name) scr_LogPrint(LPRINT_NORMAL, "Name: %s", name); scr_LogPrint(LPRINT_NORMAL, "Type: %s", type == ROSTER_TYPE_GROUP ? "group" : (type == ROSTER_TYPE_SPECIAL ? "special" : "unknown")); } g_free(buffer); // Tell the user if this item has an annotation. if (type == ROSTER_TYPE_USER || type == ROSTER_TYPE_ROOM || type == ROSTER_TYPE_AGENT) { struct annotation *note = xmpp_get_storage_rosternotes(bjid, TRUE); if (note) { // We do not display the note, we just tell the user. g_free(note->text); g_free(note->jid); g_free(note); scr_WriteIncomingMessage(bjid, "(This item has an annotation)", 0, HBB_PREFIX_INFO, 0); } } } // room_names() is a variation of do_info(), for chatrooms only static void room_names(gpointer bud, char *arg) { const char *bjid; char *buffer; GSList *resources, *p_res; enum { style_normal = 0, style_detail, style_short, style_quiet, style_compact } style = 0; if (*arg) { if (!strcasecmp(arg, "--short")) style = style_short; else if (!strcasecmp(arg, "--quiet")) style = style_quiet; else if (!strcasecmp(arg, "--detail")) style = style_detail; else if (!strcasecmp(arg, "--compact")) style = style_compact; else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); return; } } // Enter chat mode scr_set_chatmode(TRUE); scr_show_buddy_window(); bjid = buddy_getjid(bud); buffer = g_new(char, 4096); strncpy(buffer, "Room members:", 127); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); resources = buddy_getresources(bud); for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) { enum imstatus rstatus; const char *rst_msg; rstatus = buddy_getstatus(bud, p_res->data); rst_msg = buddy_getstatusmsg(bud, p_res->data); if (style == style_short) { snprintf(buffer, 4095, "[%c] %s%s%s", imstatus2char[rstatus], (char*)p_res->data, rst_msg ? " -- " : "", rst_msg ? rst_msg : ""); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); } else if (style == style_compact) { enum imrole role = buddy_getrole(bud, p_res->data); enum imaffiliation affil = buddy_getaffil(bud, p_res->data); bool showaffil = (affil != affil_none); snprintf(buffer, 4095, "[%c] %s (%s%s%s)", imstatus2char[rstatus], (char*)p_res->data, showaffil ? straffil[affil] : "\0", showaffil ? "/" : "\0", strrole[role]); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); } else { // (Style "normal", "detail" or "quiet") snprintf(buffer, 4095, "[%c] %s", imstatus2char[rstatus], (char*)p_res->data); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0); if (rst_msg && style != style_quiet) { snprintf(buffer, 4095, "Status message: %s", rst_msg); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } if (style == style_detail) { enum imrole role = buddy_getrole(bud, p_res->data); enum imaffiliation affil = buddy_getaffil(bud, p_res->data); snprintf(buffer, 4095, "Role: %s", strrole[role]); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); if (affil != affil_none) { snprintf(buffer, 4095, "Affiliat.: %s", straffil[affil]); scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } } } g_free(p_res->data); } g_slist_free(resources); g_free(buffer); } static void move_group_member(gpointer bud, void *groupnamedata) { const char *bjid, *name, *groupname; guint type, on_srv; groupname = (char *)groupnamedata; bjid = buddy_getjid(bud); name = buddy_getname(bud); type = buddy_gettype(bud); on_srv = buddy_getonserverflag(bud); if (on_srv) xmpp_updatebuddy(bjid, name, *groupname ? groupname : NULL); else { buddy_setgroup(bud, (char *)groupname); if ((type & ROSTER_TYPE_ROOM) && xmpp_is_bookmarked(bjid) && settings_opt_get_int("muc_bookmark_autoupdate")) room_bookmark(bud, NULL); } } static void do_rename(char *arg) { gpointer bud; const char *bjid, *group; guint type, on_srv; char *newname, *p; char *name_utf8; if (!current_buddy) return; bud = BUDDATA(current_buddy); bjid = buddy_getjid(bud); group = buddy_getgroupname(bud); type = buddy_gettype(bud); on_srv = buddy_getonserverflag(bud); if (type & ROSTER_TYPE_SPECIAL) { scr_LogPrint(LPRINT_NORMAL, "You can't rename this item."); return; } if (!*arg && !(type & ROSTER_TYPE_GROUP)) { scr_LogPrint(LPRINT_NORMAL, "Please specify a new name."); return; } //if (!(type & ROSTER_TYPE_GROUP) && !on_srv) { // scr_LogPrint(LPRINT_NORMAL, // "Note: this item will be added to your server roster."); // // If this is a MUC room w/o bookmark, let's give a small hint... // if ((type & ROSTER_TYPE_ROOM) && !xmpp_is_bookmarked(bjid)) { // scr_LogPrint(LPRINT_NORMAL, // "You should add a room bookmark or it will not be " // "recognized as a MUC room next time you run mcabber."); // } //} newname = g_strdup(arg); // Remove trailing space for (p = newname; *p; p++) ; while (p > newname && *p == ' ') *p = 0; strip_arg_special_chars(newname); name_utf8 = to_utf8(newname); if (type & ROSTER_TYPE_GROUP) { // Rename a whole group foreach_group_member(bud, &move_group_member, name_utf8); // Let's jump to the previous buddy, because this group name should // disappear when we receive the server answer. scr_roster_up_down(-1, 1); } else { // Rename a single buddy guint del_name = 0; if (!*newname || !strcmp(arg, "-")) del_name = TRUE; if (on_srv) { /* We do not rename the buddy right now because the server could reject * the request. Let's wait for the server answer. */ xmpp_updatebuddy(bjid, (del_name ? NULL : name_utf8), group && *group ? group : NULL); } else { // This is a local item, we rename it without adding to roster. buddy_setname(bud, (del_name ? (char*)bjid : name_utf8)); if ((type & ROSTER_TYPE_ROOM) && xmpp_is_bookmarked(bjid) && settings_opt_get_int("muc_bookmark_autoupdate")) room_bookmark(bud, NULL); } } g_free(name_utf8); g_free(newname); update_roster = TRUE; } static void do_move(char *arg) { gpointer bud; const char *bjid, *name, *oldgroupname; guint type, on_srv; char *newgroupname, *p; char *group_utf8; if (!current_buddy) return; bud = BUDDATA(current_buddy); bjid = buddy_getjid(bud); name = buddy_getname(bud); type = buddy_gettype(bud); on_srv = buddy_getonserverflag(bud); oldgroupname = buddy_getgroupname(bud); if (type & ROSTER_TYPE_GROUP) { scr_LogPrint(LPRINT_NORMAL, "You can't move groups!"); return; } if (type & ROSTER_TYPE_SPECIAL) { scr_LogPrint(LPRINT_NORMAL, "You can't move this item."); return; } newgroupname = g_strdup(arg); // Remove trailing space for (p = newgroupname; *p; p++) ; while (p > newgroupname && *p == ' ') *p-- = 0; strip_arg_special_chars(newgroupname); group_utf8 = to_utf8(newgroupname); if (strcmp(oldgroupname, group_utf8)) { if (on_srv) { xmpp_updatebuddy(bjid, name, *group_utf8 ? group_utf8 : NULL); scr_roster_up_down(-1, 1); /* We do not move the buddy right now because the server could reject * the request. Let's wait for the server answer. */ } else { // This is a local item, we move it without adding to roster. guint msgflag; // If the buddy has a pending message flag, // we remove it temporarily in order to reset the global group // flag. We set it back once the room is in the new group, // which will update the new group's flag. msgflag = buddy_getflags(bud) & ROSTER_FLAG_MSG; if (msgflag) roster_msg_setflag(bjid, FALSE, FALSE); buddy_setgroup(bud, group_utf8); if (msgflag) roster_msg_setflag(bjid, FALSE, TRUE); if ((type & ROSTER_TYPE_ROOM) && xmpp_is_bookmarked(bjid) && settings_opt_get_int("muc_bookmark_autoupdate")) room_bookmark(bud, NULL); } } g_free(group_utf8); g_free(newgroupname); update_roster = TRUE; } static void list_option_cb(char *k, char *v, void *f) { if (strcmp(k, "password")) { GSList **list = f; *list = g_slist_insert_sorted(*list, k, (GCompareFunc)strcmp); } } static void do_set(char *arg) { guint assign; gchar *option, *value; gchar *option_utf8; if (!*arg) { // list all set options GSList *list = NULL; // Get sorted list of keys settings_foreach(SETTINGS_TYPE_OPTION, list_option_cb, &list); if (list) { gsize max = 0; gsize maxmax = scr_gettextwidth() / 3; GSList *lel; gchar *format; // Find out maximum key length for (lel = list; lel; lel = lel->next) { const gchar *key = lel->data; gsize len = strlen(key); if (len > max) { max = len; if (max > maxmax) { max = maxmax; break; } } } // Print out list of options format = g_strdup_printf("%%-%us = [%%s]", (unsigned)max); for (lel = list; lel; lel = lel->next) { const gchar *key = lel->data; scr_LogPrint(LPRINT_NORMAL, format, key, settings_opt_get(key)); } g_free(format); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } else scr_LogPrint(LPRINT_NORMAL, "No options found."); return; } assign = parse_assigment(arg, &option, &value); if (!option) { scr_LogPrint(LPRINT_NORMAL, "Set what option?"); return; } option_utf8 = to_utf8(option); g_free(option); if (!assign) { // This is a query const char *val = settings_opt_get(option_utf8); if (val) scr_LogPrint(LPRINT_NORMAL, "%s = [%s]", option_utf8, val); else scr_LogPrint(LPRINT_NORMAL, "Option %s is not set", option_utf8); g_free(option_utf8); return; } // Update the option // Maybe some options should be protected when user is connected (server, // username, etc.). And we should catch some options here, too // (hide_offline_buddies for ex.) if (!value) { settings_del(SETTINGS_TYPE_OPTION, option_utf8); } else { gchar *value_utf8 = to_utf8(value); settings_set(SETTINGS_TYPE_OPTION, option_utf8, value_utf8); g_free(value_utf8); g_free(value); } g_free(option_utf8); } static void dump_alias(char *k, char *v, void *param) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "Alias %s = %s", k, v); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } static void do_alias(char *arg) { guint assign; gchar *alias, *value; assign = parse_assigment(arg, &alias, &value); if (!alias) { settings_foreach(SETTINGS_TYPE_ALIAS, &dump_alias, NULL); update_roster = TRUE; return; } if (!assign) { // This is a query const char *val = settings_get(SETTINGS_TYPE_ALIAS, alias); // NOTE: LPRINT_NOTUTF8 here, see below why it isn't encoded... if (val) scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "%s = %s", alias, val); else scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "Alias '%s' does not exist", alias); goto do_alias_return; } // Check the alias does not conflict with a registered command if (cmd_get(alias)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "'%s' is a reserved word!", alias); goto do_alias_return; } // Update the alias if (!value) { if (settings_get(SETTINGS_TYPE_ALIAS, alias)) { settings_del(SETTINGS_TYPE_ALIAS, alias); // Remove alias from the completion list compl_del_category_word(COMPL_CMD, alias); } } else { /* Add alias to the completion list, if not already in. NOTE: We're not UTF8-encoding "alias" and "value" here because UTF-8 is not yet supported in the UI... (and we use the values in the completion system) */ if (!settings_get(SETTINGS_TYPE_ALIAS, alias)) compl_add_category_word(COMPL_CMD, alias); settings_set(SETTINGS_TYPE_ALIAS, alias, value); g_free(value); } do_alias_return: g_free(alias); } static void dump_bind(char *k, char *v, void *param) { scr_LogPrint(LPRINT_NORMAL, "Key %4s is bound to: %s", k, v); } static void do_bind(char *arg) { guint assign; gchar *k_code, *value; assign = parse_assigment(arg, &k_code, &value); if (!k_code) { settings_foreach(SETTINGS_TYPE_BINDING, &dump_bind, NULL); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); return; } if (!assign) { // This is a query const char *val = settings_get(SETTINGS_TYPE_BINDING, k_code); if (val) scr_LogPrint(LPRINT_NORMAL, "Key %s is bound to: %s", k_code, val); else scr_LogPrint(LPRINT_NORMAL, "Key %s is not bound.", k_code); g_free(k_code); return; } // Update the key binding if (!value) { settings_del(SETTINGS_TYPE_BINDING, k_code); } else { gchar *value_utf8 = to_utf8(value); settings_set(SETTINGS_TYPE_BINDING, k_code, value_utf8); g_free(value_utf8); g_free(value); } g_free(k_code); } static void do_rawxml(char *arg) { char **paramlst; char *subcmd; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return; } paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Please read the manual page" " before using /rawxml :-)"); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "send")) { gchar *buffer; if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } // We don't strip_arg_special_chars() here, because it would be a pain for // the user to escape quotes in a XML stream... buffer = to_utf8(arg); if (buffer) { scr_LogPrint(LPRINT_NORMAL, "Sending XML string"); lm_connection_send_raw(lconnection, buffer, NULL); g_free(buffer); } else { scr_LogPrint(LPRINT_NORMAL, "Conversion error in XML string."); } } else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); } free_arg_lst(paramlst); } // check_room_subcommand(arg, param_needed, buddy_must_be_a_room) // - Check if this is a room, if buddy_must_be_a_room is not null // - Check there is at least 1 parameter, if param_needed is true // - Return null if one of the checks fails, or a pointer to the first // non-space character. static char *check_room_subcommand(char *arg, bool param_needed, gpointer buddy_must_be_a_room) { if (buddy_must_be_a_room && !(buddy_gettype(buddy_must_be_a_room) & ROSTER_TYPE_ROOM)) { scr_LogPrint(LPRINT_NORMAL, "This isn't a conference room."); return NULL; } if (param_needed) { if (!arg) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); return NULL; } } if (arg) return arg; else return ""; } static void room_join(gpointer bud, char *arg) { char **paramlst; char *roomname, *nick, *pass; char *roomname_tmp = NULL; char *pass_utf8; paramlst = split_arg(arg, 3, 0); // roomid, nickname, password roomname = *paramlst; nick = *(paramlst+1); pass = *(paramlst+2); if (!roomname) nick = NULL; if (!nick) pass = NULL; if (!roomname || !strcmp(roomname, ".")) { // If the current_buddy is recognized as a room, the room name // can be omitted (or "." can be used). if (!bud || !(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { scr_LogPrint(LPRINT_NORMAL, "Please specify a room name."); free_arg_lst(paramlst); return; } roomname = (char*)buddy_getjid(bud); } else if (strchr(roomname, '/')) { scr_LogPrint(LPRINT_NORMAL, "Invalid room name."); free_arg_lst(paramlst); return; } else { // The room id has been specified. Let's convert it and use it. mc_strtolower(roomname); roomname = roomname_tmp = to_utf8(roomname); } // If no nickname is provided with the /join command, // we try to get a default nickname. if (!nick || !*nick) nick = default_muc_nickname(roomname); else nick = to_utf8(nick); // If we still have no nickname, give up if (!nick || !*nick) { scr_LogPrint(LPRINT_NORMAL, "Please specify a nickname."); g_free(nick); free_arg_lst(paramlst); return; } pass_utf8 = to_utf8(pass); xmpp_room_join(roomname, nick, pass_utf8); scr_LogPrint(LPRINT_LOGNORM, "Sent a join request to <%s>...", roomname); g_free(roomname_tmp); g_free(nick); g_free(pass_utf8); buddylist_build(); update_roster = TRUE; free_arg_lst(paramlst); } static void room_invite(gpointer bud, char *arg) { char **paramlst; const gchar *roomname; char* fjid; gchar *reason_utf8; paramlst = split_arg(arg, 2, 1); // jid, [reason] fjid = *paramlst; arg = *(paramlst+1); // An empty reason is no reason... if (arg && !*arg) arg = NULL; if (!fjid || !*fjid) { scr_LogPrint(LPRINT_NORMAL, "Missing or incorrect Jabber ID."); free_arg_lst(paramlst); return; } roomname = buddy_getjid(bud); reason_utf8 = to_utf8(arg); xmpp_room_invite(roomname, fjid, reason_utf8); scr_LogPrint(LPRINT_LOGNORM, "Invitation sent to <%s>.", fjid); g_free(reason_utf8); free_arg_lst(paramlst); } static void room_affil(gpointer bud, char *arg) { char **paramlst; gchar *fjid, *rolename; struct role_affil ra; const char *roomid = buddy_getjid(bud); paramlst = split_arg(arg, 3, 1); // jid, new_affil, [reason] fjid = *paramlst; rolename = *(paramlst+1); arg = *(paramlst+2); if (!fjid || !*fjid || !rolename || !*rolename) { scr_LogPrint(LPRINT_NORMAL, "Please specify both a Jabber ID and a role."); free_arg_lst(paramlst); return; } ra.type = type_affil; ra.val.affil = affil_none; for (; ra.val.affil < imaffiliation_size; ra.val.affil++) if (!strcasecmp(rolename, straffil[ra.val.affil])) break; if (ra.val.affil < imaffiliation_size) { gchar *jid_utf8, *reason_utf8; jid_utf8 = to_utf8(fjid); reason_utf8 = to_utf8(arg); xmpp_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); g_free(jid_utf8); g_free(reason_utf8); } else scr_LogPrint(LPRINT_NORMAL, "Wrong affiliation parameter."); free_arg_lst(paramlst); } static void room_role(gpointer bud, char *arg) { char **paramlst; gchar *fjid, *rolename; struct role_affil ra; const char *roomid = buddy_getjid(bud); paramlst = split_arg(arg, 3, 1); // jid, new_role, [reason] fjid = *paramlst; rolename = *(paramlst+1); arg = *(paramlst+2); if (!fjid || !*fjid || !rolename || !*rolename) { scr_LogPrint(LPRINT_NORMAL, "Please specify both a Jabber ID and a role."); free_arg_lst(paramlst); return; } ra.type = type_role; ra.val.role = role_none; for (; ra.val.role < imrole_size; ra.val.role++) if (!strcasecmp(rolename, strrole[ra.val.role])) break; if (ra.val.role < imrole_size) { gchar *jid_utf8, *reason_utf8; jid_utf8 = to_utf8(fjid); reason_utf8 = to_utf8(arg); xmpp_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); g_free(jid_utf8); g_free(reason_utf8); } else scr_LogPrint(LPRINT_NORMAL, "Wrong role parameter."); free_arg_lst(paramlst); } // The expected argument is a Jabber id static void room_ban(gpointer bud, char *arg) { char **paramlst; gchar *fjid, *bjid; const gchar *banjid; gchar *jid_utf8, *reason_utf8; struct role_affil ra; const char *roomid = buddy_getjid(bud); paramlst = split_arg(arg, 2, 1); // jid, [reason] fjid = *paramlst; arg = *(paramlst+1); if (!fjid || !*fjid) { scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); free_arg_lst(paramlst); return; } ra.type = type_affil; ra.val.affil = affil_outcast; bjid = jidtodisp(fjid); jid_utf8 = to_utf8(bjid); // If the argument doesn't look like a jid, we'll try to find a matching // nickname. if (!strchr(bjid, JID_DOMAIN_SEPARATOR) || check_jid_syntax(bjid)) { const gchar *tmp; // We want the initial argument, so the fjid variable, because // we don't want to strip a resource-like string from the nickname! g_free(jid_utf8); jid_utf8 = to_utf8(fjid); tmp = buddy_getrjid(bud, jid_utf8); if (!tmp) { scr_LogPrint(LPRINT_NORMAL, "Wrong JID or nickname"); goto room_ban_return; } banjid = jidtodisp(tmp); } else banjid = jid_utf8; scr_LogPrint(LPRINT_NORMAL, "Requesting a ban for %s", banjid); reason_utf8 = to_utf8(arg); xmpp_room_setattrib(roomid, banjid, NULL, ra, reason_utf8); g_free(reason_utf8); room_ban_return: g_free(bjid); g_free(jid_utf8); free_arg_lst(paramlst); } // The expected argument is a Jabber id static void room_unban(gpointer bud, char *arg) { gchar *fjid = arg; gchar *jid_utf8; struct role_affil ra; const char *roomid = buddy_getjid(bud); if (!fjid || !*fjid) { scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); return; } ra.type = type_affil; ra.val.affil = affil_none; jid_utf8 = to_utf8(fjid); xmpp_room_setattrib(roomid, jid_utf8, NULL, ra, NULL); g_free(jid_utf8); } // The expected argument is a nickname static void room_kick(gpointer bud, char *arg) { char **paramlst; gchar *nick; gchar *nick_utf8, *reason_utf8; struct role_affil ra; const char *roomid = buddy_getjid(bud); paramlst = split_arg(arg, 2, 1); // nickname, [reason] nick = *paramlst; arg = *(paramlst+1); if (!nick || !*nick) { scr_LogPrint(LPRINT_NORMAL, "Please specify a nickname."); free_arg_lst(paramlst); return; } ra.type = type_role; ra.val.affil = role_none; nick_utf8 = to_utf8(nick); reason_utf8 = to_utf8(arg); xmpp_room_setattrib(roomid, NULL, nick_utf8, ra, reason_utf8); g_free(nick_utf8); g_free(reason_utf8); free_arg_lst(paramlst); } void cmd_room_leave(gpointer bud, char *arg) { gchar *roomid, *desc; const char *nickname; nickname = buddy_getnickname(bud); if (!nickname) { scr_LogPrint(LPRINT_NORMAL, "You are not in this room."); return; } roomid = g_strdup_printf("%s/%s", buddy_getjid(bud), nickname); desc = to_utf8(arg); xmpp_setstatus(offline, roomid, desc, TRUE); g_free(desc); g_free(roomid); } static void room_nick(gpointer bud, char *arg) { if (!buddy_getinsideroom(bud)) { scr_LogPrint(LPRINT_NORMAL, "You are not in this room."); return; } if (!arg || !*arg) { const char *nick = buddy_getnickname(bud); if (nick) scr_LogPrint(LPRINT_NORMAL, "Your nickname is: %s", nick); else scr_LogPrint(LPRINT_NORMAL, "You have no nickname in this room."); } else { gchar *nick = to_utf8(arg); strip_arg_special_chars(nick); xmpp_room_join(buddy_getjid(bud), nick, NULL); g_free(nick); } } static void room_privmsg(gpointer bud, char *arg) { char **paramlst; gchar *fjid_utf8, *nick, *nick_utf8, *msg; paramlst = split_arg(arg, 2, 1); // nickname, message nick = *paramlst; arg = *(paramlst+1); if (!nick || !*nick || !arg || !*arg) { scr_LogPrint(LPRINT_NORMAL, "Please specify both a Jabber ID and a message."); free_arg_lst(paramlst); return; } nick_utf8 = to_utf8(nick); fjid_utf8 = g_strdup_printf("%s/%s", buddy_getjid(bud), nick_utf8); g_free (nick_utf8); msg = to_utf8(arg); send_message_to(fjid_utf8, msg, NULL, LM_MESSAGE_SUB_TYPE_NOT_SET, FALSE); g_free(fjid_utf8); g_free(msg); free_arg_lst(paramlst); } static void room_remove(gpointer bud, char *arg) { if (*arg) { scr_LogPrint(LPRINT_NORMAL, "This action does not require a parameter; " "the currently-selected room will be removed."); return; } // Quick check: if there are resources, we haven't left if (buddy_getinsideroom(bud)) { scr_LogPrint(LPRINT_NORMAL, "You haven't left this room!"); return; } // Delete the room roster_del_user(buddy_getjid(bud)); scr_update_buddy_window(); buddylist_build(); update_roster = TRUE; } static void room_topic(gpointer bud, char *arg) { if (!buddy_getinsideroom(bud)) { scr_LogPrint(LPRINT_NORMAL, "You are not in this room."); return; } // If no parameter is given, display the current topic if (!*arg) { const char *topic = buddy_gettopic(bud); if (topic) scr_LogPrint(LPRINT_NORMAL, "Topic: %s", topic); else scr_LogPrint(LPRINT_NORMAL, "No topic has been set."); return; } // If arg is "-", let's clear the topic if (!strcmp(arg, "-")) arg = NULL; arg = to_utf8(arg); // Set the topic xmpp_send_msg(buddy_getjid(bud), NULL, ROSTER_TYPE_ROOM, arg ? arg : "", FALSE, NULL, LM_MESSAGE_SUB_TYPE_NOT_SET, NULL); g_free(arg); } static void room_destroy(gpointer bud, char *arg) { gchar *msg; if (arg && *arg) msg = to_utf8(arg); else msg = NULL; xmpp_room_destroy(buddy_getjid(bud), NULL, msg); g_free(msg); } static void room_unlock(gpointer bud, char *arg) { if (*arg) { scr_LogPrint(LPRINT_NORMAL, "Unknown parameter."); return; } xmpp_room_unlock(buddy_getjid(bud)); } static void room_setopt(gpointer bud, char *arg) { char **paramlst; char *param, *value; enum { opt_none = 0, opt_printstatus, opt_autowhois, opt_flagjoins } option = 0; guint changed = 0; paramlst = split_arg(arg, 2, 1); // param, value param = *paramlst; value = *(paramlst+1); if (!param) { scr_LogPrint(LPRINT_NORMAL, "Please specify a room option."); free_arg_lst(paramlst); return; } if (!strcasecmp(param, "print_status")) option = opt_printstatus; else if (!strcasecmp(param, "auto_whois")) option = opt_autowhois; else if (!strcasecmp(param, "flag_joins")) option = opt_flagjoins; else { scr_LogPrint(LPRINT_NORMAL, "Wrong option!"); free_arg_lst(paramlst); return; } // If no value is given, display the current value if (!value) { const char *strval; if (option == opt_printstatus) strval = strprintstatus[buddy_getprintstatus(bud)]; else if (option == opt_autowhois) strval = strautowhois[buddy_getautowhois(bud)]; else strval = strflagjoins[buddy_getflagjoins(bud)]; scr_LogPrint(LPRINT_NORMAL, "%s is set to: %s", param, strval); free_arg_lst(paramlst); return; } if (option == opt_printstatus) { enum room_printstatus eval; if (!strcasecmp(value, "none")) eval = status_none; else if (!strcasecmp(value, "in_and_out")) eval = status_in_and_out; else if (!strcasecmp(value, "all")) eval = status_all; else { eval = status_default; if (strcasecmp(value, "default") != 0) scr_LogPrint(LPRINT_NORMAL, "Unrecognized value, assuming default..."); } if (eval != buddy_getprintstatus(bud)) { buddy_setprintstatus(bud, eval); changed = 1; } } else if (option == opt_autowhois) { enum room_autowhois eval; if (!strcasecmp(value, "on")) eval = autowhois_on; else if (!strcasecmp(value, "off")) eval = autowhois_off; else { eval = autowhois_default; if (strcasecmp(value, "default") != 0) scr_LogPrint(LPRINT_NORMAL, "Unrecognized value, assuming default..."); } if (eval != buddy_getautowhois(bud)) { buddy_setautowhois(bud, eval); changed = 1; } } else if (option == opt_flagjoins) { enum room_flagjoins eval; if (!strcasecmp(value, "none")) eval = flagjoins_none; else if (!strcasecmp(value, "joins")) eval = flagjoins_joins; else if (!strcasecmp(value, "all")) eval = flagjoins_all; else { eval = flagjoins_default; if (strcasecmp(value, "default") != 0) scr_LogPrint(LPRINT_NORMAL, "Unrecognized value, assuming default..."); } if (eval != buddy_getflagjoins(bud)) { buddy_setflagjoins(bud, eval); changed = 1; } } if (changed && xmpp_is_bookmarked(buddy_getjid(bud)) && settings_opt_get_int("muc_bookmark_autoupdate")) room_bookmark(bud, NULL); free_arg_lst(paramlst); } // cmd_room_whois(..) // If interactive is TRUE, chatmode can be enabled. // Please note that usernick is expected in UTF-8 locale iff interactive is // FALSE (in order to work correctly with auto_whois). void cmd_room_whois(gpointer bud, const char *usernick, guint interactive) { char **paramlst = NULL; gchar *nick, *buffer; const char *bjid, *realjid; const char *rst_msg; gchar rprio; enum imstatus rstatus; enum imrole role; enum imaffiliation affil; time_t rst_time; guint msg_flag = HBB_PREFIX_INFO; if (interactive) { paramlst = split_arg(usernick, 1, 0); // nickname nick = to_utf8(*paramlst); } else { nick = g_strdup(usernick); } if (!nick || !*nick) { scr_LogPrint(LPRINT_NORMAL, "Please specify a nickname."); if (paramlst) free_arg_lst(paramlst); return; } if (interactive) { // Enter chat mode scr_set_chatmode(TRUE); scr_show_buddy_window(); } else msg_flag |= HBB_PREFIX_NOFLAG; bjid = buddy_getjid(bud); rstatus = buddy_getstatus(bud, nick); if (rstatus == offline) { scr_LogPrint(LPRINT_NORMAL, "No such member: %s", nick); if (paramlst) free_arg_lst(paramlst); g_free(nick); return; } rst_time = buddy_getstatustime(bud, nick); rprio = buddy_getresourceprio(bud, nick); rst_msg = buddy_getstatusmsg(bud, nick); if (!rst_msg) rst_msg = ""; role = buddy_getrole(bud, nick); affil = buddy_getaffil(bud, nick); realjid = buddy_getrjid(bud, nick); buffer = g_new(char, 4096); snprintf(buffer, 4095, "Whois [%s]", nick); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag, 0); snprintf(buffer, 4095, "Status : [%c] %s", imstatus2char[rstatus], rst_msg); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); if (rst_time) { char tbuf[128]; strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(&rst_time)); snprintf(buffer, 127, "Timestamp: %s", tbuf); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); } if (realjid) { snprintf(buffer, 4095, "JID : <%s>", realjid); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); } snprintf(buffer, 4095, "Role : %s", strrole[role]); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); snprintf(buffer, 4095, "Affiliat.: %s", straffil[affil]); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); snprintf(buffer, 4095, "Priority : %d", rprio); scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag | HBB_PREFIX_CONT, 0); scr_WriteIncomingMessage(bjid, "End of WHOIS", 0, msg_flag, 0); g_free(buffer); g_free(nick); if (paramlst) free_arg_lst(paramlst); } static void room_bookmark(gpointer bud, char *arg) { const char *roomid; const char *name = NULL, *nick = NULL, *group = NULL; char *tmpnick = NULL; enum room_autowhois autowhois = 0; enum room_flagjoins flagjoins = 0; enum room_printstatus printstatus = 0; enum { bm_add = 0, bm_del = 1 } action = 0; int autojoin = 0, autojoin_set = 0; int nick_set = 0; if (arg && *arg) { // /room bookmark [add|del] [[+|-]autojoin] [-|nick] char **paramlst; char **pp; paramlst = split_arg(arg, 3, 0); // At most 3 parameters for (pp = paramlst; *pp; pp++) { if (!strcasecmp(*pp, "add")) action = bm_add; else if (!strcasecmp(*pp, "del")) action = bm_del; else if (!strcasecmp(*pp, "-autojoin")) { autojoin = 0; autojoin_set = 1; } else if (!strcasecmp(*pp, "+autojoin") || !strcasecmp(*pp, "autojoin")) { autojoin = 1; autojoin_set = 1; } else if (!strcmp(*pp, "-")) nick_set = 1; else { nick_set = 1; nick = tmpnick = to_utf8 (*pp); } } free_arg_lst(paramlst); } roomid = buddy_getjid(bud); if (action == bm_add) { name = buddy_getname(bud); if (!nick_set) { nick = buddy_getnickname(bud); if (!nick) //we are probably bookmarking offline room nick = xmpp_get_bookmark_nick(roomid); } if (!autojoin_set) { autojoin = xmpp_get_bookmark_autojoin(roomid); } printstatus = buddy_getprintstatus(bud); autowhois = buddy_getautowhois(bud); flagjoins = buddy_getflagjoins(bud); group = buddy_getgroupname(bud); } xmpp_set_storage_bookmark(roomid, name, nick, NULL, autojoin, printstatus, autowhois, flagjoins, group); g_free (tmpnick); } static void display_all_bookmarks(void) { GSList *bm, *bmp; GString *sbuf; struct bookmark *bm_elt; bm = xmpp_get_all_storage_bookmarks(); if (!bm) return; sbuf = g_string_new(""); scr_WriteIncomingMessage(NULL, "List of MUC bookmarks:", 0, HBB_PREFIX_INFO, 0); for (bmp = bm; bmp; bmp = g_slist_next(bmp)) { bm_elt = bmp->data; g_string_printf(sbuf, "%c <%s>", (bm_elt->autojoin ? '*' : ' '), bm_elt->roomjid); if (bm_elt->nick) g_string_append_printf(sbuf, " (%s)", bm_elt->nick); if (bm_elt->name) g_string_append_printf(sbuf, " %s", bm_elt->name); g_free(bm_elt->roomjid); g_free(bm_elt->name); g_free(bm_elt->nick); g_free(bm_elt); scr_WriteIncomingMessage(NULL, sbuf->str, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); g_string_free(sbuf, TRUE); g_slist_free(bm); } static void do_module(char *arg) { #ifdef MODULES_ENABLE gboolean force = FALSE; char **args; args = split_arg(arg, 2, 0); if (!args[0] || !strcmp(args[0], "list")) { module_list_print(); } else { const gchar *error = NULL; const gchar *name = args[1]; if (name && name[0] == '-' && name[1] == 'f') { force = TRUE; name +=2; while (*name && *name == ' ') ++name; } if (!strcmp(args[0], "load")) { error = module_load(name, TRUE, force); if (error) scr_log_print(LPRINT_LOGNORM, "Module '%s' loading error: %s", name, error); } else if (!strcmp(args[0], "unload")) { error = module_unload(name, TRUE, force); if (error) scr_log_print(LPRINT_LOGNORM, "Module '%s' unloading error: %s", name, error); } else if (!strcmp(args[0], "info")) module_info_print(name); else scr_log_print(LPRINT_LOGNORM, "Error: module: Unknown subcommand."); } free_arg_lst(args); #else scr_log_print(LPRINT_NORMAL, "Please recompile mcabber with modules enabled."); #endif } static void do_room(char *arg) { char **paramlst; char *subcmd; gpointer bud; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return; } paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } if (current_buddy) { bud = BUDDATA(current_buddy); } else { if (strcasecmp(subcmd, "join")) { free_arg_lst(paramlst); return; } // "room join" is a special case, we don't need to have a valid // current_buddy. bud = NULL; } if (!strcasecmp(subcmd, "join")) { if ((arg = check_room_subcommand(arg, FALSE, NULL)) != NULL) room_join(bud, arg); } else if (!strcasecmp(subcmd, "invite")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_invite(bud, arg); } else if (!strcasecmp(subcmd, "affil")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_affil(bud, arg); } else if (!strcasecmp(subcmd, "role")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_role(bud, arg); } else if (!strcasecmp(subcmd, "ban")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_ban(bud, arg); } else if (!strcasecmp(subcmd, "unban")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_unban(bud, arg); } else if (!strcasecmp(subcmd, "kick")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_kick(bud, arg); } else if (!strcasecmp(subcmd, "leave")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) cmd_room_leave(bud, arg); } else if (!strcasecmp(subcmd, "names")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_names(bud, arg); } else if (!strcasecmp(subcmd, "nick")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_nick(bud, arg); } else if (!strcasecmp(subcmd, "privmsg")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) room_privmsg(bud, arg); } else if (!strcasecmp(subcmd, "remove")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_remove(bud, arg); } else if (!strcasecmp(subcmd, "destroy")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_destroy(bud, arg); } else if (!strcasecmp(subcmd, "unlock")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_unlock(bud, arg); } else if (!strcasecmp(subcmd, "setopt")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_setopt(bud, arg); } else if (!strcasecmp(subcmd, "topic")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_topic(bud, arg); } else if (!strcasecmp(subcmd, "whois")) { if ((arg = check_room_subcommand(arg, TRUE, bud)) != NULL) cmd_room_whois(bud, arg, TRUE); } else if (!strcasecmp(subcmd, "bookmark")) { if (!arg && !buddy_getjid(BUDDATA(current_buddy)) && buddy_gettype(BUDDATA(current_buddy)) == ROSTER_TYPE_SPECIAL) display_all_bookmarks(); else if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_bookmark(bud, arg); } else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); } free_arg_lst(paramlst); } static void do_authorization(char *arg) { char **paramlst; char *subcmd; char *jid_utf8; if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); return; } paramlst = split_arg(arg, 2, 0); // subcmd, [jid] subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); goto do_authorization_return; } // Use the provided jid, if it looks valid if (arg) { if (!*arg) { // If no jid is provided, we use the current selected buddy arg = NULL; } else { if (check_jid_syntax(arg)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", arg); goto do_authorization_return; } } } if (!arg) { // Use the current selected buddy's jid gpointer bud; guint type; if (!current_buddy) goto do_authorization_return; bud = BUDDATA(current_buddy); jid_utf8 = arg = (char*)buddy_getjid(bud); type = buddy_gettype(bud); if (!(type & (ROSTER_TYPE_USER|ROSTER_TYPE_AGENT))) { scr_LogPrint(LPRINT_NORMAL, "Invalid buddy."); goto do_authorization_return; } } else { jid_utf8 = to_utf8(arg); } if (!strcasecmp(subcmd, "allow")) { xmpp_send_s10n(jid_utf8, LM_MESSAGE_SUB_TYPE_SUBSCRIBED); scr_LogPrint(LPRINT_LOGNORM, "Sent presence subscription approval to <%s>.", jid_utf8); } else if (!strcasecmp(subcmd, "cancel")) { xmpp_send_s10n(jid_utf8, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); scr_LogPrint(LPRINT_LOGNORM, "<%s> will no longer receive your presence updates.", jid_utf8); } else if (!strcasecmp(subcmd, "request")) { xmpp_send_s10n(jid_utf8, LM_MESSAGE_SUB_TYPE_SUBSCRIBE); scr_LogPrint(LPRINT_LOGNORM, "Sent presence notification request to <%s>.", jid_utf8); } else if (!strcasecmp(subcmd, "request_unsubscribe")) { xmpp_send_s10n(jid_utf8, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE); scr_LogPrint(LPRINT_LOGNORM, "Sent presence notification unsubscription request to <%s>.", jid_utf8); } else { scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); } // Only free jid_utf8 if it has been allocated, i.e. if != arg. if (jid_utf8 && jid_utf8 != arg) g_free(jid_utf8); do_authorization_return: free_arg_lst(paramlst); } static void do_version(char *arg) { gchar *ver = mcabber_version(); scr_LogPrint(LPRINT_NORMAL, "This is mcabber version %s.", ver); g_free(ver); #ifdef MODULES_ENABLE scr_LogPrint(LPRINT_NORMAL, "Compiled with modules support (API %s:%d-%d).", MCABBER_BRANCH, MCABBER_API_MIN, MCABBER_API_VERSION); # ifdef PKGLIB_DIR scr_LogPrint(LPRINT_NORMAL, " Modules directory: " PKGLIB_DIR); # endif #endif } static void do_request(char *arg) { char **paramlst; char *fjid, *type; enum iqreq_type numtype = iqreq_none; char *jid_utf8 = NULL; paramlst = split_arg(arg, 2, 0); // type, jid type = *paramlst; fjid = *(paramlst+1); if (type) { // Quick check... if (!strcasecmp(type, "version")) numtype = iqreq_version; else if (!strcasecmp(type, "time")) numtype = iqreq_time; else if (!strcasecmp(type, "last")) numtype = iqreq_last; else if (!strcasecmp(type, "ping")) numtype = iqreq_ping; else if (!strcasecmp(type, "vcard")) numtype = iqreq_vcard; } if (!type || !numtype) { scr_LogPrint(LPRINT_NORMAL, "Please specify a query type (version, time...)."); free_arg_lst(paramlst); return; } if (!xmpp_is_online()) { scr_LogPrint(LPRINT_NORMAL, "You are not connected."); free_arg_lst(paramlst); return; } // Allow special jid "" or "." (current buddy) if (fjid && (!*fjid || !strcmp(fjid, "."))) fjid = NULL; if (fjid) { // The JID has been specified. Quick check... if (check_jid_syntax(fjid)) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); fjid = NULL; } else { // Convert jid to lowercase char *p; for (p = fjid; *p && *p != JID_RESOURCE_SEPARATOR; p++) *p = tolower(*p); fjid = jid_utf8 = to_utf8(fjid); } } else { // Add the current buddy if (current_buddy) fjid = (char*)buddy_getjid(BUDDATA(current_buddy)); if (!fjid) scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID."); } if (fjid) { switch (numtype) { case iqreq_vcard: { // vCards requests are sent to the bare jid, except in MUC rooms gchar *tmp = strchr(fjid, JID_RESOURCE_SEPARATOR); if (tmp) { gchar *bjid = jidtodisp(fjid); if (!roster_find(bjid, jidsearch, ROSTER_TYPE_ROOM)) *tmp = '\0'; g_free(bjid); } } case iqreq_version: case iqreq_time: case iqreq_last: case iqreq_ping: xmpp_request(fjid, numtype); break; default: break; } } g_free(jid_utf8); free_arg_lst(paramlst); } static void do_event(char *arg) { char **paramlst; char *evid, *subcmd; int action = -1; paramlst = split_arg(arg, 3, 1); // id, subcmd, optional arg evid = *paramlst; subcmd = *(paramlst+1); if (!evid || !subcmd) { // Special case: /event list if (evid && !strcasecmp(evid, "list")) evs_display_list(); else scr_LogPrint(LPRINT_NORMAL, "Missing parameter. Usage: /event num action " "[event-specific args]"); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "reject")) action = EVS_CONTEXT_REJECT; else if (!strcasecmp(subcmd, "accept")) action = EVS_CONTEXT_ACCEPT; else if (!strcasecmp(subcmd, "ignore")) action = EVS_CONTEXT_CANCEL; if (action == -1) { scr_LogPrint(LPRINT_NORMAL, "Wrong action parameter."); } else { GSList *p; GSList *evidlst; if (!strcmp(evid, "*")) { // Use completion list evidlst = evs_geteventslist(); } else { // Let's create a slist with the provided event id evidlst = g_slist_append(NULL, evid); } for (p = evidlst; p; p = g_slist_next(p)) { if (evs_callback(p->data, action, (const char*)*(paramlst+2)) == -1) { scr_LogPrint(LPRINT_NORMAL, "Event %s not found.", (const char *)p->data); } } g_slist_free(evidlst); } free_arg_lst(paramlst); } static void do_pgp(char *arg) { char **paramlst; char *fjid, *subcmd, *keyid; enum { pgp_none, pgp_enable, pgp_disable, pgp_setkey, pgp_force, pgp_info } op = 0; int force = FALSE; paramlst = split_arg(arg, 3, 0); // subcmd, jid, [key] subcmd = *paramlst; fjid = *(paramlst+1); keyid = *(paramlst+2); if (!subcmd) fjid = NULL; if (!fjid) keyid = NULL; if (subcmd) { if (!strcasecmp(subcmd, "enable")) op = pgp_enable; else if (!strcasecmp(subcmd, "disable")) op = pgp_disable; else if (!strcasecmp(subcmd, "setkey")) op = pgp_setkey; else if ((!strcasecmp(subcmd, "force")) || (!strcasecmp(subcmd, "+force"))) { op = pgp_force; force = TRUE; } else if (!strcasecmp(subcmd, "-force")) op = pgp_force; else if (!strcasecmp(subcmd, "info")) op = pgp_info; } if (!op) { scr_LogPrint(LPRINT_NORMAL, "Unrecognized or missing parameter!"); free_arg_lst(paramlst); return; } // Allow special jid "" or "." (current buddy) if (fjid && (!*fjid || !strcmp(fjid, "."))) fjid = NULL; if (fjid) { // The JID has been specified. Quick check... if (check_jid_syntax(fjid) || !strchr(fjid, '@')) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); fjid = NULL; } else { // Convert jid to lowercase and strip resource char *p; for (p = fjid; *p && *p != JID_RESOURCE_SEPARATOR; p++) *p = tolower(*p); if (*p == JID_RESOURCE_SEPARATOR) *p = '\0'; } } else { gpointer bud = NULL; if (current_buddy) bud = BUDDATA(current_buddy); if (bud) { guint type = buddy_gettype(bud); if (type & ROSTER_TYPE_USER) // Is it a user? fjid = (char*)buddy_getjid(bud); else scr_LogPrint(LPRINT_NORMAL, "The selected item should be a user."); } } if (fjid) { // fjid is actually a bare jid... guint disabled; GString *sbuf; switch (op) { case pgp_enable: case pgp_disable: settings_pgp_setdisabled(fjid, (op == pgp_disable ? TRUE : FALSE)); break; case pgp_force: settings_pgp_setforce(fjid, force); break; case pgp_setkey: settings_pgp_setkeyid(fjid, keyid); break; case pgp_info: sbuf = g_string_new(""); if (settings_pgp_getkeyid(fjid)) { g_string_printf(sbuf, "PGP Encryption key id: %s", settings_pgp_getkeyid(fjid)); scr_WriteIncomingMessage(fjid, sbuf->str, 0, HBB_PREFIX_INFO, 0); } disabled = settings_pgp_getdisabled(fjid); g_string_printf(sbuf, "PGP encryption is %s", (disabled ? "disabled" : "enabled")); scr_WriteIncomingMessage(fjid, sbuf->str, 0, HBB_PREFIX_INFO, 0); if (!disabled && settings_pgp_getforce(fjid)) { scr_WriteIncomingMessage(fjid, "Encryption enforced (no negotiation)", 0, HBB_PREFIX_INFO, 0); } g_string_free(sbuf, TRUE); break; default: break; } } else { scr_LogPrint(LPRINT_NORMAL, "Please specify a valid Jabber ID."); } free_arg_lst(paramlst); } static void do_otr(char *arg) { #ifdef HAVE_LIBOTR char **paramlst; char *fjid, *subcmd, *keyid; enum { otr_none, otr_start, otr_stop, otr_fpr, otr_smpq, otr_smpr, otr_smpa, otr_k, otr_info } op = 0; if (!otr_enabled()) { scr_LogPrint(LPRINT_LOGNORM, "Warning: OTR hasn't been enabled -- command ignored."); return; } paramlst = split_arg(arg, 3, 0); // subcmd, jid, [key] subcmd = *paramlst; fjid = *(paramlst+1); keyid = *(paramlst+2); if (!subcmd) fjid = NULL; if (!fjid) keyid = NULL; if (subcmd) { if (!strcasecmp(subcmd, "start")) op = otr_start; else if (!strcasecmp(subcmd, "stop")) op = otr_stop; else if (!strcasecmp(subcmd, "fingerprint")) op = otr_fpr; else if (!strcasecmp(subcmd, "smpq")) op = otr_smpq; else if (!strcasecmp(subcmd, "smpr")) op = otr_smpr; else if (!strcasecmp(subcmd, "smpa")) op = otr_smpa; else if (!strcasecmp(subcmd, "key")) op = otr_k; else if (!strcasecmp(subcmd, "info")) op = otr_info; } if (!op) { scr_LogPrint(LPRINT_NORMAL, "Unrecognized or missing parameter!"); free_arg_lst(paramlst); return; } if (op == otr_k) otr_key(); else { // Allow special jid "" or "." (current buddy) if (fjid && (!*fjid || !strcmp(fjid, "."))) fjid = NULL; if (fjid) { // The JID has been specified. Quick check... if (check_jid_syntax(fjid) || !strchr(fjid, '@')) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); fjid = NULL; } else { // Convert jid to lowercase and strip resource char *p; for (p = fjid; *p && *p != JID_RESOURCE_SEPARATOR; p++) *p = tolower(*p); if (*p == JID_RESOURCE_SEPARATOR) *p = '\0'; } } else { gpointer bud = NULL; if (current_buddy) bud = BUDDATA(current_buddy); if (bud) { guint type = buddy_gettype(bud); if (type & ROSTER_TYPE_USER) // Is it a user? fjid = (char*)buddy_getjid(bud); else scr_LogPrint(LPRINT_NORMAL, "The selected item should be a user."); } } if (fjid) { // fjid is actually a bare jid... switch (op) { case otr_start: otr_establish(fjid); break; case otr_stop: otr_disconnect(fjid); break; case otr_fpr: otr_fingerprint(fjid, keyid); break; case otr_smpq: otr_smp_query(fjid, keyid); break; case otr_smpr: otr_smp_respond(fjid, keyid); break; case otr_smpa: otr_smp_abort(fjid); break; case otr_info: otr_print_info(fjid); break; default: break; } } else scr_LogPrint(LPRINT_NORMAL, "Please specify a valid Jabber ID."); } free_arg_lst(paramlst); #else scr_LogPrint(LPRINT_NORMAL, "Please recompile mcabber with libotr enabled."); #endif /* HAVE_LIBOTR */ } #ifdef HAVE_LIBOTR static char *string_for_otrpolicy(enum otr_policy p) { switch (p) { case plain: return "plain"; case opportunistic: return "opportunistic"; case manual: return "manual"; case always: return "always"; default: return "unknown"; } } static void dump_otrpolicy(char *k, char *v, void *nothing) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "otrpolicy for %s: %s", k, string_for_otrpolicy(*(enum otr_policy*)v)); } #endif static void do_otrpolicy(char *arg) { #ifdef HAVE_LIBOTR char **paramlst; char *fjid, *policy; enum otr_policy p; paramlst = split_arg(arg, 2, 0); // [jid|default] policy fjid = *paramlst; policy = *(paramlst+1); if (!fjid && !policy) { scr_LogPrint(LPRINT_NORMAL, "default otrpolicy: %s", string_for_otrpolicy(settings_otr_getpolicy(NULL))); settings_foreach(SETTINGS_TYPE_OTR, &dump_otrpolicy, NULL); free_arg_lst(paramlst); return; } if (!policy) { scr_LogPrint(LPRINT_NORMAL, "Please call otrpolicy correctly: /otrpolicy (default|jid) " "(plain|manual|opportunistic|always)"); free_arg_lst(paramlst); return; } if (!strcasecmp(policy, "plain")) p = plain; else if (!strcasecmp(policy, "manual")) p = manual; else if (!strcasecmp(policy, "opportunistic")) p = opportunistic; else if (!strcasecmp(policy, "always")) p = always; else { /* Fail, we don't know _this_ policy*/ scr_LogPrint(LPRINT_NORMAL, "mcabber doesn't support _this_ policy!"); free_arg_lst(paramlst); return; } if (!strcasecmp(fjid, "default") || !strcasecmp(fjid, "*")) { /*set default policy*/ settings_otr_setpolicy(NULL, p); free_arg_lst(paramlst); return; } // Allow special jid "" or "." (current buddy) if (fjid && (!*fjid || !strcmp(fjid, "."))) fjid = NULL; if (fjid) { // The JID has been specified. Quick check... if (check_jid_syntax(fjid) || !strchr(fjid, '@')) { scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "<%s> is not a valid Jabber ID.", fjid); fjid = NULL; } else { // Convert jid to lowercase and strip resource char *p; for (p = fjid; *p && *p != JID_RESOURCE_SEPARATOR; p++) *p = tolower(*p); if (*p == JID_RESOURCE_SEPARATOR) *p = '\0'; } } else { gpointer bud = NULL; if (current_buddy) bud = BUDDATA(current_buddy); if (bud) { guint type = buddy_gettype(bud); if (type & ROSTER_TYPE_USER) // Is it a user? fjid = (char*)buddy_getjid(bud); else scr_LogPrint(LPRINT_NORMAL, "The selected item should be a user."); } } if (fjid) settings_otr_setpolicy(fjid, p); else scr_LogPrint(LPRINT_NORMAL, "Please specify a valid Jabber ID."); free_arg_lst(paramlst); #else scr_LogPrint(LPRINT_NORMAL, "Please recompile mcabber with libotr enabled."); #endif /* HAVE_LIBOTR */ } /* !!! After changing the /iline arguments names here, you must change ones in init_bindings(). */ static void do_iline(char *arg) { if (!strcasecmp(arg, "fword")) { readline_forward_word(); } else if (!strcasecmp(arg, "bword")) { readline_backward_word(); } else if (!strcasecmp(arg, "word_fdel")) { readline_forward_kill_word(); } else if (!strcasecmp(arg, "word_bdel")) { readline_backward_kill_word(); } else if (!strcasecmp(arg, "word_upcase")) { readline_updowncase_word(1); } else if (!strcasecmp(arg, "word_downcase")) { readline_updowncase_word(0); } else if (!strcasecmp(arg, "word_capit")) { readline_capitalize_word(); } else if (!strcasecmp(arg, "fchar")) { readline_forward_char(); } else if (!strcasecmp(arg, "bchar")) { readline_backward_char(); } else if (!strcasecmp(arg, "char_fdel")) { readline_forward_kill_char(); } else if (!strcasecmp(arg, "char_bdel")) { readline_backward_kill_char(); } else if (!strcasecmp(arg, "char_swap")) { readline_transpose_chars(); } else if (!strcasecmp(arg, "hist_beginning_search_bwd")) { readline_hist_beginning_search_bwd(); } else if (!strcasecmp(arg, "hist_beginning_search_fwd")) { readline_hist_beginning_search_fwd(); } else if (!strcasecmp(arg, "hist_prev")) { readline_hist_prev(); } else if (!strcasecmp(arg, "hist_next")) { readline_hist_next(); } else if (!strcasecmp(arg, "iline_start")) { readline_iline_start(); } else if (!strcasecmp(arg, "iline_end")) { readline_iline_end(); } else if (!strcasecmp(arg, "iline_fdel")) { readline_forward_kill_iline(); } else if (!strcasecmp(arg, "iline_bdel")) { readline_backward_kill_iline(); } else if (!strcasecmp(arg, "send_multiline")) { readline_send_multiline(); } else if (!strcasecmp(arg, "iline_accept")) { retval_for_cmds = readline_accept_line(FALSE); } else if (!strcasecmp(arg, "iline_accept_down_hist")) { retval_for_cmds = readline_accept_line(TRUE); } else if (!strcasecmp(arg, "compl_cancel")) { readline_cancel_completion(); } else if (!strcasecmp(arg, "compl_do")) { readline_do_completion(); } else if (!strcasecmp(arg, "clear_history")) { readline_clear_history(); } else { char **paramlst; char *subcmd; paramlst = split_arg(arg, 2, 0); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); if (!subcmd || !*subcmd) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); free_arg_lst(paramlst); return; } if (!strcasecmp(subcmd, "iline_insert")) { readline_insert(arg); } else { scr_LogPrint(LPRINT_NORMAL, "Invalid subcommand."); } free_arg_lst(paramlst); } } static void do_screen_refresh(char *arg) { readline_refresh_screen(); } static void do_chat_disable(char *arg) { guint show_roster; if (arg && !strcasecmp(arg, "--show-roster")) show_roster = 1; else show_roster = 0; readline_disable_chat_mode(show_roster); } static int source_print_error(const char *path, int eerrno) { scr_LogPrint(LPRINT_DEBUG, "Source: glob (%s) error: %s.", path, strerror(eerrno)); return 0; } static void do_source(char *arg) { static int recur_level; gchar *filename, *expfname; glob_t flist; if (!*arg) { scr_LogPrint(LPRINT_NORMAL, "Missing filename."); return; } if (recur_level > 20) { scr_LogPrint(LPRINT_LOGNORM, "** Too many source commands!"); return; } filename = g_strdup(arg); strip_arg_special_chars(filename); expfname = expand_filename(filename); g_free(filename); // match flist.gl_offs = 0; if (glob(expfname, 0, source_print_error, &flist)) { scr_LogPrint(LPRINT_LOGNORM, "Source: error: %s.", strerror (errno)); } else { unsigned int i; // sort list for (i = 1; i < flist.gl_pathc; ++i) { int j; for (j = i-1; j > 0; --j) { char *a = flist.gl_pathv[j+1]; char *b = flist.gl_pathv[j]; if (strcmp(a, b) < 0) { flist.gl_pathv[j] = a; flist.gl_pathv[j+1] = b; } else break; } } // source files in list for (i=0; i < flist.gl_pathc; ++i) { recur_level++; cfg_read_file(flist.gl_pathv[i], FALSE); recur_level--; } // free globfree(&flist); } g_free(expfname); } static void do_connect(char *arg) { xmpp_connect(); } static void do_disconnect(char *arg) { xmpp_disconnect(); } static void do_help(char *arg) { help_process(arg); } static void do_echo(char *arg) { if (arg) scr_print_logwindow(arg); } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/commands.h000066400000000000000000000020771216603513500165420ustar00rootroot00000000000000#ifndef __MCABBER_COMMANDS_H__ #define __MCABBER_COMMANDS_H__ 1 #include #include // Command structure typedef struct { char name[32]; const char *help; guint completion_flags[2]; void (*func)(char *); gpointer userdata; } cmd; void cmd_init(void); cmd *cmd_get(const char *command); int process_line(const char *line); int process_command(const char *line, guint iscmd); char *expandalias(const char *line); #ifdef MODULES_ENABLE gpointer cmd_del(gpointer id); gpointer cmd_add(const char *name, const char *help, guint flags1, guint flags2, void (*f)(char*), gpointer userdata); gboolean cmd_set_safe(const gchar *name, gboolean safe); #endif gboolean cmd_is_safe(const gchar *name); void cmd_room_whois(gpointer bud, const char *nick, guint interactive); void cmd_room_leave(gpointer bud, char *arg); void cmd_setstatus(const char *recipient, const char *arg); void say_cmd(char *arg, int parse_flags); #endif /* __MCABBER_COMMANDS_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/compl.c000066400000000000000000000302421216603513500160410ustar00rootroot00000000000000/* * compl.c -- Completion system * * Copyright (C) 2005-2010 Mikael Berthe * Copyright (C) 2009-2012 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /* Usage, basically: * - new_completion(); // 1. Initialization * - complete(); // 2. 1st completion * - cancel_completion(); // 3a. 2nd completion / cancel previous * - complete(); // 3b. 2nd completion / complete * ... * - done_completion(); // n. finished -- free allocated areas * */ #include #include "compl.h" #include "utf8.h" #include "roster.h" #include "events.h" #include "settings.h" #include "logprint.h" // Completion structure typedef struct { GSList *list; // list of matches guint len_prefix; // length of text already typed by the user guint len_compl; // length of the last completion GSList *next; // pointer to next completion to try } compl; typedef GSList *(*compl_handler_t) (void); // XXX userdata? *dynlist? // Category structure typedef struct { guint flags; GSList *words; compl_handler_t dynamic; } category; #define COMPL_CAT_BUILTIN 0x01 #define COMPL_CAT_ACTIVE 0x02 #define COMPL_CAT_DYNAMIC 0x04 #define COMPL_CAT_REVERSE 0x10 #define COMPL_CAT_NOSORT 0x20 #define COMPL_CAT_USERFLAGS 0x30 static compl *InputCompl; static category *Categories; static guint num_categories; // Dynamic completions callbacks static GSList *compl_dyn_group (void) { return compl_list(ROSTER_TYPE_GROUP); } static GSList *compl_dyn_user (void) { return compl_list(ROSTER_TYPE_USER); } static GSList *compl_dyn_resource (void) { return buddy_getresources_locale(NULL); } static GSList *compl_dyn_events (void) { GSList *compl = evs_geteventslist(); GSList *cel; for (cel = compl; cel; cel = cel->next) cel->data = g_strdup(cel->data); compl = g_slist_append(compl, g_strdup("list")); return compl; } static inline void register_builtin_cat(guint c, compl_handler_t dynamic) { Categories[c-1].flags = COMPL_CAT_BUILTIN | COMPL_CAT_ACTIVE; Categories[c-1].words = NULL; Categories[c-1].dynamic = dynamic; if (dynamic != NULL) { Categories[c-1].flags |= COMPL_CAT_DYNAMIC; } } void compl_init_system(void) { num_categories = COMPL_MAX_ID; #ifdef MODULES_ENABLE num_categories = ((num_categories / 16) + 1) * 16; #endif Categories = g_new0(category, num_categories); // Builtin completion categories: register_builtin_cat(COMPL_CMD, NULL); register_builtin_cat(COMPL_JID, compl_dyn_user); register_builtin_cat(COMPL_URLJID, NULL); register_builtin_cat(COMPL_NAME, NULL); register_builtin_cat(COMPL_STATUS, NULL); register_builtin_cat(COMPL_FILENAME, NULL); register_builtin_cat(COMPL_ROSTER, NULL); register_builtin_cat(COMPL_BUFFER, NULL); register_builtin_cat(COMPL_GROUP, NULL); register_builtin_cat(COMPL_GROUPNAME, compl_dyn_group); register_builtin_cat(COMPL_MULTILINE, NULL); register_builtin_cat(COMPL_ROOM, NULL); register_builtin_cat(COMPL_RESOURCE, compl_dyn_resource); register_builtin_cat(COMPL_AUTH, NULL); register_builtin_cat(COMPL_REQUEST, NULL); register_builtin_cat(COMPL_EVENTS, NULL); register_builtin_cat(COMPL_EVENTSID, compl_dyn_events); register_builtin_cat(COMPL_PGP, NULL); register_builtin_cat(COMPL_COLOR, NULL); register_builtin_cat(COMPL_OTR, NULL); register_builtin_cat(COMPL_OTRPOLICY, NULL); register_builtin_cat(COMPL_MODULE, NULL); } #ifdef MODULES_ENABLE // compl_new_category(flags) // Reserves id for new completion category. // Flags determine word sorting order. // Returns 0, if no more categories can be allocated. guint compl_new_category(guint flags) { guint i; for (i = 0; i < num_categories; i++) if (!(Categories[i].flags & COMPL_CAT_ACTIVE)) break; if (i >= num_categories ) { guint j; if (num_categories > G_MAXUINT - 16) { scr_log_print(LPRINT_LOGNORM, "Warning: Too many " "completion categories!"); return 0; } num_categories += 16; Categories = g_renew(category, Categories, num_categories); for (j = i+1; j < num_categories; j++) Categories[j].flags = 0; } Categories[i].flags = COMPL_CAT_ACTIVE | (flags & COMPL_CAT_USERFLAGS); Categories[i].words = NULL; return i+1; } // compl_del_category(id) // Frees reserved id for category. // Note, that for now it not validates its input, so, be careful // and specify exactly what you get from compl_new_category. void compl_del_category(guint compl) { GSList *wel; if (!compl) { scr_log_print(LPRINT_DEBUG, "Error: compl_del_category() - " "Invalid category (0)."); return; } compl--; if ((compl >= num_categories) || (Categories[compl].flags & COMPL_CAT_BUILTIN)) { scr_log_print(LPRINT_DEBUG, "Error: compl_del_category() " "Invalid category."); return; } Categories[compl].flags = 0; for (wel = Categories[compl].words; wel; wel = g_slist_next (wel)) g_free (wel -> data); g_slist_free (Categories[compl].words); } #endif // new_completion(prefix, compl_cat, suffix) // . prefix = beginning of the word, typed by the user // . compl_cat = pointer to a completion category list (list of *char) // . suffix = string to append to all completion possibilities (i.e. ":") // Set the InputCompl pointer to an allocated compl structure. // done_completion() must be called when finished. // Returns the number of possible completions. guint new_completion(const char *prefix, GSList *compl_cat, const gchar *suffix) { compl *c; guint ret_len = 0; GSList *sl_cat; gint (*cmp)(const char *s1, const char *s2, size_t n); size_t len = strlen(prefix); if (InputCompl) { // This should not happen, but hey... scr_log_print(LPRINT_DEBUG, "Warning: new_completion() - " "Previous completion exists!"); done_completion(); } if (settings_opt_get_int("completion_ignore_case")) cmp = &strncasecmp; else cmp = &strncmp; c = g_new0(compl, 1); // Build the list of matches for (sl_cat = compl_cat; sl_cat; sl_cat = g_slist_next(sl_cat)) { char *word = sl_cat->data; if (!cmp(prefix, word, len)) { if (strlen(word) != len) { gchar *compval; if (suffix) compval = g_strdup_printf("%s%s", word+len, suffix); else compval = g_strdup(word+len); // for a bit of efficiency, will reverse order afterwards c->list = g_slist_prepend(c->list, compval); ret_len ++; } } } c->next = c->list = g_slist_reverse (c->list); InputCompl = c; return ret_len; } // done_completion(); void done_completion(void) { GSList *clp; if (!InputCompl) return; // Free the current completion list for (clp = InputCompl->list; clp; clp = g_slist_next(clp)) g_free(clp->data); g_slist_free(InputCompl->list); g_free(InputCompl); InputCompl = NULL; } // cancel_completion() // Returns the number of chars to delete to cancel the completion guint cancel_completion(void) { if (!InputCompl) return 0; return InputCompl->len_compl; } // Returns pointer to text to insert, NULL if no completion. const char *complete() { compl* c = InputCompl; char *r; if (!InputCompl) return NULL; if (!c->next) { c->next = c->list; // back to the beginning c->len_compl = 0; return NULL; } r = (char*)c->next->data; c->next = g_slist_next(c->next); if (!utf8_mode) { c->len_compl = strlen(r); } else { char *wc; c->len_compl = 0; for (wc = r; *wc; wc = next_char(wc)) c->len_compl++; } return r; } /* Categories functions */ static gint compl_sort_forward(gconstpointer a, gconstpointer b) { return g_ascii_strcasecmp((const gchar *)a, (const gchar *)b); } static gint compl_sort_reverse(gconstpointer a, gconstpointer b) { return -g_ascii_strcasecmp((const gchar *)a, (const gchar *)b); } static gint compl_sort_append(gconstpointer a, gconstpointer b) { return 1; } static gint compl_sort_prepend(gconstpointer a, gconstpointer b) { return -1; } // compl_add_category_word(categ, command) // Adds a keyword as a possible completion in category categ. void compl_add_category_word(guint categ, const gchar *word) { char *nword; if (!categ) { scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - " "Invalid category (0)."); return; } categ--; if ((categ >= num_categories) || !(Categories[categ].flags & COMPL_CAT_ACTIVE)) { scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - " "Category does not exist."); return; } // If word is not space-terminated, we add one trailing space for (nword = (char*)word; *nword; nword++) ; if (nword > word) nword--; if (*nword != ' ') { // Add a space nword = g_strdup_printf("%s ", word); } else { // word is fine nword = g_strdup(word); } if (g_slist_find_custom(Categories[categ].words, nword, (GCompareFunc)g_strcmp0) == NULL) { guint flags = Categories[categ].flags; GCompareFunc comparator = compl_sort_forward; if (flags & COMPL_CAT_NOSORT) { if (flags & COMPL_CAT_REVERSE) comparator = compl_sort_prepend; else comparator = compl_sort_append; } else if (flags & COMPL_CAT_REVERSE) comparator = compl_sort_reverse; Categories[categ].words = g_slist_insert_sorted (Categories[categ].words, nword, comparator); } } // compl_del_category_word(categ, command) // Removes a keyword from category categ in completion list. void compl_del_category_word(guint categ, const gchar *word) { GSList *wel; char *nword; if (!categ) { scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - " "Invalid category (0)."); return; } categ--; if ((categ >= num_categories) || !(Categories[categ].flags & COMPL_CAT_ACTIVE)) { scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - " "Category does not exist."); return; } // If word is not space-terminated, we add one trailing space for (nword = (char*)word; *nword; nword++) ; if (nword > word) nword--; if (*nword != ' ') // Add a space word = nword = g_strdup_printf("%s ", word); else nword = NULL; for (wel = Categories[categ].words; wel; wel = g_slist_next (wel)) { if (!strcasecmp((char*)wel->data, word)) { g_free(wel->data); Categories[categ].words = g_slist_delete_link (Categories[categ].words, wel); break; // Only remove first occurence } } g_free (nword); } // compl_get_category_list() // Returns a slist of all words in the specified categorie. // Iff this function sets *dynlist to TRUE, then the caller must free the // whole list after use. GSList *compl_get_category_list(guint categ, guint *dynlist) { if (!categ) { scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - " "Invalid category (0)."); return NULL; } categ --; if ((categ > num_categories) || !(Categories[categ].flags & COMPL_CAT_ACTIVE)) { scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - " "Category does not exist."); return NULL; } if (Categories[categ].flags & COMPL_CAT_DYNAMIC) { *dynlist = TRUE; return (*Categories[categ].dynamic) (); } else { *dynlist = FALSE; return Categories[categ].words; } } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/compl.h000066400000000000000000000031661216603513500160530ustar00rootroot00000000000000#ifndef __MCABBER_COMPL_H__ #define __MCABBER_COMPL_H__ 1 #include #include #define COMPL_CMD 1 #define COMPL_JID 2 #define COMPL_URLJID 3 // Not implemented yet #define COMPL_NAME 4 // Not implemented yet #define COMPL_STATUS 5 #define COMPL_FILENAME 6 // Not implemented yet #define COMPL_ROSTER 7 #define COMPL_BUFFER 8 #define COMPL_GROUP 9 #define COMPL_GROUPNAME 10 #define COMPL_MULTILINE 11 #define COMPL_ROOM 12 #define COMPL_RESOURCE 13 #define COMPL_AUTH 14 #define COMPL_REQUEST 15 #define COMPL_EVENTS 16 #define COMPL_EVENTSID 17 #define COMPL_PGP 18 #define COMPL_COLOR 19 #define COMPL_OTR 20 #define COMPL_OTRPOLICY 21 #define COMPL_MODULE 22 /* private */ #define COMPL_MAX_ID 22 void compl_init_system(void); /* private */ #ifdef MODULES_ENABLE #define COMPL_FLAGS_SORT 0x00 #define COMPL_FLAGS_REVERSE 0x10 #define COMPL_FLAGS_APPEND 0x20 #define COMPL_FLAGS_PREPEND 0x30 guint compl_new_category(guint flags); void compl_del_category(guint id); #endif void compl_add_category_word(guint categ, const gchar *command); void compl_del_category_word(guint categ, const gchar *word); GSList *compl_get_category_list(guint categ, guint *dynlist); guint new_completion(const gchar *prefix, GSList *compl_cat, const gchar *suffix); void done_completion(void); guint cancel_completion(void); const char *complete(void); #endif /* __MCABBER_COMPL_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/config.h.in000066400000000000000000000217051216603513500166120ustar00rootroot00000000000000/* mcabber/config.h.in. Generated from configure.ac by autoheader. */ /* Data files directory */ #undef DATA_DIR /* Devel compilation options */ #undef ENABLE_DEBUG /* Use Mercurial changeset */ #undef ENABLE_HGCSET /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define if you have the external 'altzone' variable. */ #undef HAVE_ALTZONE /* Define to 1 if you have the `arc4random' function. */ #undef HAVE_ARC4RANDOM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ASPELL_H /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define if you have the external 'daylight' variable. */ #undef HAVE_DAYLIGHT /* Define to 1 if you have the declaration of `strptime', and to 0 if you don't. */ #undef HAVE_DECL_STRPTIME /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define if ncurses has ESCDELAY variable */ #undef HAVE_ESCDELAY /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define if GLib has regex support */ #undef HAVE_GLIB_REGEX /* Define if you use GPGME to support OpenPGP */ #undef HAVE_GPGME /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isascii' function. */ #undef HAVE_ISASCII /* Define to 1 if you have the `iswblank' function. */ #undef HAVE_ISWBLANK /* Define to 1 if you have the `charset' library (-lcharset). */ #undef HAVE_LIBCHARSET /* Define to 1 if you want Libidn. */ #undef HAVE_LIBIDN /* Define to 1 if you have the `otr' library (-lotr). */ #undef HAVE_LIBOTR /* Define to 1 if you have the `panel' library (-lpanel). */ #undef HAVE_LIBPANEL /* Define to 1 if you have the `panelw' library (-lpanelw). */ #undef HAVE_LIBPANELW /* Define to 1 if you have the header file. */ #undef HAVE_LOCALCHARSET_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* 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 `modf' function. */ #undef HAVE_MODF /* Define to 1 if you have the header file. */ #undef HAVE_NCURSESW_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSESW_PANEL_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_PANEL_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_PANEL_H /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if `tm_zone' is a member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* 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_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define if you have the external 'timezone' variable. */ #undef HAVE_TIMEZONE /* tm_gmtoff is available. */ #undef HAVE_TM_GMTOFF /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ #undef HAVE_TM_ZONE /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ #undef HAVE_TZNAME /* Define if ncurses have unicode support */ #undef HAVE_UNICODE /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Mcabber branch */ #undef MCABBER_BRANCH /* Mcabber version string */ #undef MCABBER_VERSION /* Define if you want dynamic modules loading */ #undef MODULES_ENABLE /* 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 /* Modules directory */ #undef PKGLIB_DIR /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Provide own SIGWINCH handler */ #undef USE_SIGWINCH /* Version number of package */ #undef VERSION /* Define if you want aspell support */ #undef WITH_ASPELL /* Define if you want enchant support */ #undef WITH_ENCHANT /* Define if you want obsolete Message Events */ #undef XEP0022 /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t mcabber-0.10.2/mcabber/events.c000066400000000000000000000133651216603513500162420ustar00rootroot00000000000000/* * events.c -- Events fonctions * * Copyright (C) 2006-2010 Mikael Berthe * Copyright (C) 2010 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include "events.h" #include "screen.h" typedef struct { char *id; char *description; time_t timeout; guint source; evs_callback_t callback; gpointer data; GDestroyNotify notify; } evs_t; static GSList *evs_list; // Events list static evs_t *evs_find(const char *evid); static gboolean evs_check_timeout (gpointer userdata) { evs_t *event = userdata; if (event->callback && !event->callback(EVS_CONTEXT_TIMEOUT, NULL, event->data)) { evs_del(event->id); return FALSE; } return TRUE; // XXX } // evs_new(type, timeout) // Create new event. If id is omitted, generates unique // numerical id (recommended). If timeout is specified, sets // up timeout source, that will call handler in timeout // context after specified number of seconds. If supplied id // already exists, returns NULL, calling destroy notifier, if // one is specified. const char *evs_new(const char *desc, const char *id, time_t timeout, evs_callback_t callback, gpointer udata, GDestroyNotify notify) { static guint evs_idn; evs_t *event; char *stridn; if (!id) { if (!++evs_idn) evs_idn = 1; /* Check for wrapping, we shouldn't reuse ids */ stridn = g_strdup_printf("%d", evs_idn); if (evs_find(stridn)) { g_free(stridn); // We could try another id but for now giving up should be fine... if (notify) notify(udata); return NULL; } } else if (!evs_find(id)) stridn = g_strdup(id); else { if (notify) notify(udata); return NULL; } event = g_new(evs_t, 1); event->id = stridn; event->description = g_strdup(desc); event->timeout = timeout; event->callback = callback; event->data = udata; event->notify = notify; if (timeout) g_timeout_add_seconds(timeout, evs_check_timeout, event); evs_list = g_slist_append(evs_list, event); return stridn; } static evs_t *evs_find(const char *evid) { GSList *p; if (!evid) return NULL; for (p = evs_list; p; p = g_slist_next(p)) { evs_t *i = p->data; if (!strcmp(evid, i->id)) return i; } return NULL; } // evs_del(evid) // Deletes event. // This will not call event handler, however this will // call destroy notify function. // Returns 0 in case of success, -1 if the evid hasn't been found. int evs_del(const char *evid) { evs_t *event = evs_find(evid); if (!event) return -1; if (event->notify) event->notify(event->data); if (event->source) g_source_remove(event->source); evs_list = g_slist_remove(evs_list, event); g_free(event->id); g_free(event->description); g_free(event); return 0; // Ok, deleted } // evs_callback(evid, evcontext, argument) // Callback processing for the specified event. // If event handler will return FALSE, event will be destroyed. // Return 0 in case of success, -1 if the evid hasn't been found. // evcontext and argument are transparently passed to event handler. int evs_callback(const char *evid, guint context, const char *arg) { evs_t *event; event = evs_find(evid); if (!event) return -1; if (event->callback && !event->callback(context, arg, event->data)) evs_del(evid); return 0; } // evs_display_list() // Prints list of events to mcabber log window. void evs_display_list(void) { guint count = 0; GSList *p; scr_LogPrint(LPRINT_NORMAL, "Events list:"); for (p = evs_list; p; p = g_slist_next(p)) { evs_t *i = p->data; scr_LogPrint(LPRINT_NORMAL, "Id: %-3s %s", i->id, (i->description ? i->description : "")); count++; } scr_LogPrint(LPRINT_NORMAL, "End of events list."); if (count+2 > scr_getlogwinheight()) { scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } } // evs_geteventslist() // Return a singly-linked-list of events ids. // Data in list should not be modified and can disappear, // you must strdup them, if you want them to persist. // Note: the caller should free the list after use. GSList *evs_geteventslist(void) { GSList *evidlist = NULL, *p; for (p = evs_list; p; p = g_slist_next(p)) { evs_t *i = p->data; evidlist = g_slist_append(evidlist, i->id); } return evidlist; } // evs_deinit() // Frees all events. void evs_deinit(void) { GSList *eel; for (eel = evs_list; eel; eel = eel->next) { evs_t *event = eel->data; if (event->notify) event->notify(event->data); if (event->source) g_source_remove(event->source); evs_list = g_slist_remove(evs_list, event); g_free(event->id); g_free(event->description); g_free(event); } g_slist_free(evs_list); evs_list = NULL; } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/events.h000066400000000000000000000016031216603513500162370ustar00rootroot00000000000000#ifndef __MCABBER_EVENTS_H__ #define __MCABBER_EVENTS_H__ 1 #include #define EVS_DEFAULT_TIMEOUT 90 #define EVS_MAX_TIMEOUT 432000 #define EVS_CONTEXT_TIMEOUT 0U #define EVS_CONTEXT_CANCEL 1U #define EVS_CONTEXT_ACCEPT 2U #define EVS_CONTEXT_REJECT 3U /* There can be other user-defined contexts */ typedef gboolean (*evs_callback_t)(guint context, const char *arg, gpointer userdata); const char *evs_new(const char *description, const char *id, time_t timeout, evs_callback_t callback, gpointer userdata, GDestroyNotify notify); int evs_del(const char *evid); int evs_callback(const char *evid, guint evcontext, const char *arg); void evs_display_list(void); GSList *evs_geteventslist(void); void evs_deinit(void); #endif /* __MCABBER_EVENTS_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/fifo.c000066400000000000000000000134701216603513500156560ustar00rootroot00000000000000/* * fifo.c -- Read commands from a named pipe * * Copyright (C) 2008,2009 Mikael Berthe * Copyright (C) 2009 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #include #include #include "commands.h" #include "logprint.h" #include "utils.h" #include "settings.h" #include "main.h" static char *fifo_name = NULL; static GIOChannel *fifo_channel = NULL; static const char *FIFO_ENV_NAME = "MCABBER_FIFO"; static gboolean attach_fifo(const char *name); static guint fifo_callback(GIOChannel *channel, GIOCondition condition, gpointer data) { if (condition & (G_IO_IN|G_IO_PRI)) { GIOStatus chstat; gchar *buf; gsize endpos; chstat = g_io_channel_read_line(channel, &buf, NULL, &endpos, NULL); if (chstat == G_IO_STATUS_ERROR || chstat == G_IO_STATUS_EOF) { if (!attach_fifo(fifo_name)) scr_LogPrint(LPRINT_LOGNORM, "Reopening fifo failed! Fifo will not work from now!"); return FALSE; } if (buf) { guint logflag; guint fifo_ignore = settings_opt_get_int("fifo_ignore"); if (endpos) buf[endpos] = '\0'; if (settings_opt_get_int("fifo_hide_commands")) logflag = LPRINT_LOG; else logflag = LPRINT_LOGNORM; scr_LogPrint(logflag, "%s FIFO command: %s", (fifo_ignore ? "Ignoring" : "Executing"), buf); if (!fifo_ignore) { if (process_command(buf, TRUE) == 255) mcabber_set_terminate_ui(); } g_free(buf); } } else if (condition & (G_IO_ERR|G_IO_NVAL|G_IO_HUP)) { if (!attach_fifo(fifo_name)) scr_LogPrint(LPRINT_LOGNORM, "Reopening fifo failed! Fifo will not work from now!"); return FALSE; } return TRUE; } static void fifo_destroy_callback(gpointer data) { GIOChannel *channel = (GIOChannel *)data; g_io_channel_unref(channel); channel = NULL; } static gboolean check_fifo(const char *name) { struct stat finfo; if (stat(name, &finfo) == -1) { /* some unknown error */ if (errno != ENOENT) return FALSE; /* fifo not yet exists */ if (mkfifo(name, S_IRUSR|S_IWUSR) != -1) return check_fifo(name); else return FALSE; } /* file exists */ if (S_ISFIFO(finfo.st_mode)) return TRUE; else return FALSE; } static gboolean attach_fifo(const char *name) { GSource *source; int fd = open (name, O_RDONLY|O_NONBLOCK); if (fd == -1) return FALSE; if (fifo_channel) g_io_channel_unref(fifo_channel); fifo_channel = g_io_channel_unix_new(fd); g_io_channel_set_flags(fifo_channel, G_IO_FLAG_NONBLOCK, NULL); g_io_channel_set_encoding(fifo_channel, NULL, NULL); g_io_channel_set_close_on_unref(fifo_channel, TRUE); source = g_io_create_watch(fifo_channel, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL); g_source_set_callback(source, (GSourceFunc)fifo_callback, (gpointer)fifo_channel, (GDestroyNotify)fifo_destroy_callback); g_source_attach(source, main_context); return TRUE; } void fifo_deinit(void) { unsetenv(FIFO_ENV_NAME); if (fifo_channel) g_source_remove_by_user_data(fifo_channel); /* channel itself should be destroyed by destruction callback */ /* destroy open fifo */ if (fifo_name) { /* well, that may create fifo, and then unlink, * but at least we will not destroy non-fifo data */ if (check_fifo(fifo_name)) unlink(fifo_name); g_free(fifo_name); fifo_name = NULL; } } // fifo_init_internal(path) // If path is NULL, reopen existing fifo, else open anew. static int fifo_init_internal(const char *fifo_path) { if (fifo_path) { fifo_deinit(); fifo_name = expand_filename(fifo_path); if (!check_fifo(fifo_name)) { scr_LogPrint(LPRINT_LOGNORM, "WARNING: Cannot create the FIFO. " "%s already exists and is not a pipe", fifo_name); g_free(fifo_name); fifo_name = NULL; return -1; } } else if (fifo_name) g_source_remove_by_user_data(fifo_channel); else return -1; if (!attach_fifo(fifo_name)) { scr_LogPrint(LPRINT_LOGNORM, "Error: Cannot open fifo"); return -1; } setenv(FIFO_ENV_NAME, fifo_name, 1); scr_LogPrint(LPRINT_LOGNORM, "FIFO initialized (%s)", fifo_path); return 1; } static gchar *fifo_guard(const gchar *key, const gchar *new_value) { if (new_value) fifo_init_internal(new_value); else fifo_deinit(); return g_strdup(new_value); } // Returns 1 in case of success, -1 on error int fifo_init(void) { const char *path = settings_opt_get("fifo_name"); static gboolean guard_installed = FALSE; if (!guard_installed) if (!(guard_installed = settings_set_guard("fifo_name", fifo_guard))) scr_LogPrint(LPRINT_DEBUG, "fifo: BUG: Cannot install option guard!"); if (path) return fifo_init_internal(path); return 1; } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/fifo.h000066400000000000000000000003321216603513500156540ustar00rootroot00000000000000#ifndef __MCABBER_FIFO_H__ #define __MCABBER_FIFO_H__ 1 int fifo_init(void); void fifo_deinit(void); #endif /* __MCABBER_FIFO_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/hbuf.c000066400000000000000000000450001216603513500156510ustar00rootroot00000000000000/* * hbuf.c -- History buffer implementation * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include "hbuf.h" #include "utils.h" #include "utf8.h" #include "screen.h" /* This is a private structure type */ typedef struct { char *ptr; char *ptr_end; // beginning of the block char *ptr_end_alloc; // end of the current persistent block guchar flags; // XXX This should certainly be a pointer, and be allocated only when needed // (for ex. when HBB_FLAG_PERSISTENT is set). struct { // hbuf_line_info time_t timestamp; unsigned mucnicklen; guint flags; gpointer xep184; } prefix; } hbuf_block; // do_wrap(p_hbuf, first_hbuf_elt, width) // Wrap hbuf lines with the specified width. // '\n' are handled by this routine (they are removed and persistent lines // are created). // All hbuf elements are processed, starting from first_hbuf_elt. static inline void do_wrap(GList **p_hbuf, GList *first_hbuf_elt, unsigned int width) { GList *curr_elt = first_hbuf_elt; // Let's add non-persistent blocs if necessary // - If there are '\n' in the string // - If length > width (and width != 0) while (curr_elt) { hbuf_block *hbuf_b_curr, *hbuf_b_prev; char *c, *end; char *br = NULL; // break pointer char *cr = NULL; // CR pointer unsigned int cur_w = 0; // We want to break where we can find a space char or a CR hbuf_b_curr = (hbuf_block*)(curr_elt->data); hbuf_b_prev = hbuf_b_curr; c = hbuf_b_curr->ptr; while (*c && (!width || cur_w <= width)) { if (*c == '\n') { br = cr = c; *c = 0; break; } if (iswblank(get_char(c))) br = c; cur_w += get_char_width(c); c = next_char(c); } if (cr || (*c && cur_w > width)) { if (!br || br == hbuf_b_curr->ptr) br = c; else br = next_char(br); end = hbuf_b_curr->ptr_end; hbuf_b_curr->ptr_end = br; // Create another block hbuf_b_curr = g_new0(hbuf_block, 1); // The block must be persistent after a CR if (cr) { hbuf_b_curr->ptr = hbuf_b_prev->ptr_end + 1; // == cr+1 hbuf_b_curr->flags = HBB_FLAG_PERSISTENT; } else { hbuf_b_curr->ptr = hbuf_b_prev->ptr_end; // == br hbuf_b_curr->flags = 0; } hbuf_b_curr->ptr_end = end; hbuf_b_curr->ptr_end_alloc = hbuf_b_prev->ptr_end_alloc; // This is OK because insert_before(NULL) == append(): *p_hbuf = g_list_insert_before(*p_hbuf, curr_elt->next, hbuf_b_curr); } curr_elt = g_list_next(curr_elt); } } // hbuf_add_line(p_hbuf, text, prefix_flags, width, maxhbufblocks) // Add a line to the given buffer. If width is not null, then lines are // wrapped at this length. // maxhbufblocks is the maximum number of hbuf blocks we can allocate. If // null, there is no limit. If non-null, it should be >= 2. // // Note 1: Splitting according to width won't work if there are tabs; they // should be expanded before. // Note 2: width does not include the ending \0. void hbuf_add_line(GList **p_hbuf, const char *text, time_t timestamp, guint prefix_flags, guint width, guint maxhbufblocks, unsigned mucnicklen, gpointer xep184) { GList *curr_elt; char *line; guint hbb_blocksize, textlen; hbuf_block *hbuf_block_elt; if (!text) return; prefix_flags |= (xep184 ? HBB_PREFIX_RECEIPT : 0); textlen = strlen(text); hbb_blocksize = MAX(textlen+1, HBB_BLOCKSIZE); hbuf_block_elt = g_new0(hbuf_block, 1); hbuf_block_elt->prefix.timestamp = timestamp; hbuf_block_elt->prefix.flags = prefix_flags; hbuf_block_elt->prefix.mucnicklen = mucnicklen; hbuf_block_elt->prefix.xep184 = xep184; if (!*p_hbuf) { hbuf_block_elt->ptr = g_new(char, hbb_blocksize); if (!hbuf_block_elt->ptr) { g_free(hbuf_block_elt); return; } hbuf_block_elt->flags = HBB_FLAG_ALLOC | HBB_FLAG_PERSISTENT; hbuf_block_elt->ptr_end_alloc = hbuf_block_elt->ptr + hbb_blocksize; } else { hbuf_block *hbuf_b_prev; // Set p_hbuf to the end of the list, to speed up history loading // (or CPU time will be used by g_list_last() for each line) *p_hbuf = g_list_last(*p_hbuf); hbuf_b_prev = (*p_hbuf)->data; hbuf_block_elt->ptr = hbuf_b_prev->ptr_end; hbuf_block_elt->flags = HBB_FLAG_PERSISTENT; hbuf_block_elt->ptr_end_alloc = hbuf_b_prev->ptr_end_alloc; } *p_hbuf = g_list_append(*p_hbuf, hbuf_block_elt); if (hbuf_block_elt->ptr + textlen >= hbuf_block_elt->ptr_end_alloc) { // Too long for the current allocated bloc, we need another one if (!maxhbufblocks || textlen >= HBB_BLOCKSIZE) { // No limit, let's allocate a new block // If the message text is big, we won't bother to reuse an old block // as well (it could be too small and cause a segfault). hbuf_block_elt->ptr = g_new0(char, hbb_blocksize); hbuf_block_elt->ptr_end_alloc = hbuf_block_elt->ptr + hbb_blocksize; // XXX We should check the return value. } else { GList *hbuf_head, *hbuf_elt; hbuf_block *hbuf_b_elt; guint n = 0; hbuf_head = g_list_first(*p_hbuf); // We need at least 2 allocated blocks if (maxhbufblocks == 1) maxhbufblocks = 2; // Let's count the number of allocated areas for (hbuf_elt = hbuf_head; hbuf_elt; hbuf_elt = g_list_next(hbuf_elt)) { hbuf_b_elt = (hbuf_block*)(hbuf_elt->data); if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) n++; } // If we can't allocate a new area, reuse the previous block(s) if (n < maxhbufblocks) { hbuf_block_elt->ptr = g_new0(char, hbb_blocksize); hbuf_block_elt->ptr_end_alloc = hbuf_block_elt->ptr + hbb_blocksize; } else { // Let's use an old block, and free the extra blocks if needed char *allocated_block = NULL; char *end_of_allocated_block = NULL; while (n >= maxhbufblocks) { int start_of_block = 1; for (hbuf_elt = hbuf_head; hbuf_elt; hbuf_elt = hbuf_head) { hbuf_b_elt = (hbuf_block*)(hbuf_elt->data); if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) { if (start_of_block-- == 0) break; if (n == maxhbufblocks) { allocated_block = hbuf_b_elt->ptr; end_of_allocated_block = hbuf_b_elt->ptr_end_alloc; } else { g_free(hbuf_b_elt->ptr); } } g_free(hbuf_b_elt); hbuf_head = *p_hbuf = g_list_delete_link(hbuf_head, hbuf_elt); } n--; } memset(allocated_block, 0, end_of_allocated_block-allocated_block); hbuf_block_elt->ptr = allocated_block; hbuf_block_elt->ptr_end_alloc = end_of_allocated_block; } } hbuf_block_elt->flags = HBB_FLAG_ALLOC | HBB_FLAG_PERSISTENT; } line = hbuf_block_elt->ptr; // Ok, now we can copy the text.. strcpy(line, text); hbuf_block_elt->ptr_end = line + textlen + 1; curr_elt = g_list_last(*p_hbuf); // Wrap lines and handle CRs ('\n') do_wrap(p_hbuf, curr_elt, width); } // hbuf_free() // Destroys all hbuf list. void hbuf_free(GList **p_hbuf) { hbuf_block *hbuf_b_elt; GList *hbuf_elt; GList *first_elt = g_list_first(*p_hbuf); for (hbuf_elt = first_elt; hbuf_elt; hbuf_elt = g_list_next(hbuf_elt)) { hbuf_b_elt = (hbuf_block*)(hbuf_elt->data); if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) { g_free(hbuf_b_elt->ptr); } g_free(hbuf_b_elt); } g_list_free(first_elt); *p_hbuf = NULL; } // hbuf_rebuild() // Rebuild all hbuf list, with the new width. // If width == 0, lines are not wrapped. void hbuf_rebuild(GList **p_hbuf, unsigned int width) { GList *first_elt, *curr_elt, *next_elt; hbuf_block *hbuf_b_curr, *hbuf_b_next; // *p_hbuf needs to be the head of the list first_elt = *p_hbuf = g_list_first(*p_hbuf); // #1 Remove non-persistent blocks (ptr_end should be updated!) curr_elt = first_elt; while (curr_elt) { next_elt = g_list_next(curr_elt); // Last element? if (!next_elt) break; hbuf_b_curr = (hbuf_block*)(curr_elt->data); hbuf_b_next = (hbuf_block*)(next_elt->data); // Is next line not-persistent? if (!(hbuf_b_next->flags & HBB_FLAG_PERSISTENT)) { hbuf_b_curr->ptr_end = hbuf_b_next->ptr_end; g_free(hbuf_b_next); curr_elt = g_list_delete_link(curr_elt, next_elt); } else curr_elt = next_elt; } // #2 Go back to head and create non-persistent blocks when needed if (width) do_wrap(p_hbuf, first_elt, width); } // hbuf_previous_persistent() // Returns the previous persistent block (line). If the given line is // persistent, then it is returned. // This function is used for example when resizing a buffer. If the top of the // screen is on a non-persistent block, then a screen resize could destroy this // line... GList *hbuf_previous_persistent(GList *l_line) { hbuf_block *hbuf_b_elt; while (l_line) { hbuf_b_elt = (hbuf_block*)l_line->data; if (hbuf_b_elt->flags & HBB_FLAG_PERSISTENT && (hbuf_b_elt->flags & ~HBB_PREFIX_READMARK)) return l_line; l_line = g_list_previous(l_line); } return NULL; } // hbuf_get_lines(hbuf, n) // Returns an array of n hbb_line pointers // (The first line will be the line currently pointed by hbuf) // Note: The caller should free the array, the hbb_line pointers and the // text pointers after use. hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n) { unsigned int i; hbuf_block *blk; guint last_persist_prefixflags = 0; GList *last_persist; // last persistent flags hbb_line **array, **array_elt; hbb_line *prev_array_elt = NULL; // To be able to correctly highlight multi-line messages, // we need to look at the last non-null prefix, which should be the first // line of the message. We also need to check if there's a readmark flag // somewhere in the message. last_persist = hbuf_previous_persistent(hbuf); while (last_persist) { blk = (hbuf_block*)last_persist->data; if ((blk->flags & HBB_FLAG_PERSISTENT) && blk->prefix.flags) { // This can be either the beginning of the message, // or a persistent line with a readmark flag (or both). if (blk->prefix.flags & ~HBB_PREFIX_READMARK) { // First message line last_persist_prefixflags |= blk->prefix.flags; break; } else { // Not the first line, but we need to keep the readmark flag last_persist_prefixflags = blk->prefix.flags; } } last_persist = g_list_previous(last_persist); } array = g_new0(hbb_line*, n); array_elt = array; for (i = 0 ; i < n ; i++) { if (hbuf) { int maxlen; blk = (hbuf_block*)(hbuf->data); maxlen = blk->ptr_end - blk->ptr; *array_elt = (hbb_line*)g_new(hbb_line, 1); (*array_elt)->timestamp = blk->prefix.timestamp; (*array_elt)->flags = blk->prefix.flags; (*array_elt)->mucnicklen = blk->prefix.mucnicklen; (*array_elt)->text = g_strndup(blk->ptr, maxlen); if ((blk->flags & HBB_FLAG_PERSISTENT) && (blk->prefix.flags & ~HBB_PREFIX_READMARK)) { // This is a new message: persistent block flag and no prefix flag // (except a possible readmark flag) last_persist_prefixflags = blk->prefix.flags; } else { // Propagate highlighting flags (*array_elt)->flags |= last_persist_prefixflags & (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT | HBB_PREFIX_INFO | HBB_PREFIX_IN | HBB_PREFIX_READMARK); // Continuation of a message - omit the prefix (*array_elt)->flags |= HBB_PREFIX_CONT; (*array_elt)->mucnicklen = 0; // The nick is in the first one // If there is a readmark on this line, update last_persist_prefixflags if (blk->flags & HBB_FLAG_PERSISTENT) last_persist_prefixflags |= blk->prefix.flags & HBB_PREFIX_READMARK; // Remove readmark flag from the previous line if (prev_array_elt && last_persist_prefixflags & HBB_PREFIX_READMARK) prev_array_elt->flags &= ~HBB_PREFIX_READMARK; } prev_array_elt = *array_elt; hbuf = g_list_next(hbuf); } else break; array_elt++; } return array; } // hbuf_search(hbuf, direction, string) // Look backward/forward for a line containing string in the history buffer // Search starts at hbuf, and goes forward if direction == 1, backward if -1 GList *hbuf_search(GList *hbuf, int direction, const char *string) { hbuf_block *blk; for (;;) { if (direction > 0) hbuf = g_list_next(hbuf); else hbuf = g_list_previous(hbuf); if (!hbuf) break; blk = (hbuf_block*)(hbuf->data); // XXX blk->ptr is (maybe) not really correct, because the match should // not be after ptr_end. We should check that... if (strcasestr(blk->ptr, string)) break; } return hbuf; } // hbuf_jump_date(hbuf, t) // Return a pointer to the first line after date t in the history buffer GList *hbuf_jump_date(GList *hbuf, time_t t) { hbuf_block *blk; hbuf = g_list_first(hbuf); for ( ; hbuf && g_list_next(hbuf); hbuf = g_list_next(hbuf)) { blk = (hbuf_block*)(hbuf->data); if (blk->prefix.timestamp >= t) break; } return hbuf; } // hbuf_jump_percent(hbuf, pc) // Return a pointer to the line at % pc of the history buffer GList *hbuf_jump_percent(GList *hbuf, int pc) { guint hlen; hbuf = g_list_first(hbuf); hlen = g_list_length(hbuf); return g_list_nth(hbuf, pc*hlen/100); } // hbuf_jump_readmark(hbuf) // Return a pointer to the line following the readmark // or NULL if no mark was found. GList *hbuf_jump_readmark(GList *hbuf) { hbuf_block *blk; GList *r = NULL; hbuf = g_list_last(hbuf); for ( ; hbuf; hbuf = g_list_previous(hbuf)) { blk = (hbuf_block*)(hbuf->data); if (blk->prefix.flags & HBB_PREFIX_READMARK) return r; if ((blk->flags & HBB_FLAG_PERSISTENT) && (blk->prefix.flags & ~HBB_PREFIX_READMARK)) r = hbuf; } return NULL; } // hbuf_dump_to_file(hbuf, filename) // Save the buffer to a file. void hbuf_dump_to_file(GList *hbuf, const char *filename) { hbuf_block *blk; hbb_line line; guint last_persist_prefixflags = 0; guint prefixwidth; char pref[96]; FILE *fp; struct stat statbuf; if (!stat(filename, &statbuf)) { scr_LogPrint(LPRINT_NORMAL, "The file already exists."); return; } fp = fopen(filename, "w"); if (!fp) { scr_LogPrint(LPRINT_NORMAL, "Unable to open the file."); return; } prefixwidth = scr_getprefixwidth(); prefixwidth = MIN(prefixwidth, sizeof pref); for (hbuf = g_list_first(hbuf); hbuf; hbuf = g_list_next(hbuf)) { int maxlen; blk = (hbuf_block*)(hbuf->data); maxlen = blk->ptr_end - blk->ptr; memset(&line, 0, sizeof(line)); line.timestamp = blk->prefix.timestamp; line.flags = blk->prefix.flags; line.mucnicklen = blk->prefix.mucnicklen; line.text = g_strndup(blk->ptr, maxlen); if ((blk->flags & HBB_FLAG_PERSISTENT) && (blk->prefix.flags & ~HBB_PREFIX_READMARK)) { last_persist_prefixflags = blk->prefix.flags; } else { // Propagate necessary highlighting flags line.flags |= last_persist_prefixflags & (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT | HBB_PREFIX_INFO | HBB_PREFIX_IN); // Continuation of a message - omit the prefix line.flags |= HBB_PREFIX_CONT; line.mucnicklen = 0; // The nick is in the first one } scr_line_prefix(&line, pref, prefixwidth); fprintf(fp, "%s%s\n", pref, line.text); } fclose(fp); return; } // hbuf_remove_receipt(hbuf, xep184) // Remove the Receipt Flag for the message with the given xep184 id // Returns TRUE if it was found and removed, otherwise FALSE gboolean hbuf_remove_receipt(GList *hbuf, gconstpointer xep184) { hbuf_block *blk; hbuf = g_list_last(hbuf); for ( ; hbuf; hbuf = g_list_previous(hbuf)) { blk = (hbuf_block*)(hbuf->data); if (!g_strcmp0(blk->prefix.xep184, xep184)) { g_free(blk->prefix.xep184); blk->prefix.xep184 = NULL; blk->prefix.flags ^= HBB_PREFIX_RECEIPT; return TRUE; } } return FALSE; } // hbuf_set_readmark(hbuf, action) // Set/Reset the readmark Flag // If action is TRUE, set a mark to the latest line, // if action is FALSE, remove a previous readmark flag. void hbuf_set_readmark(GList *hbuf, gboolean action) { hbuf_block *blk; if (!hbuf) return; hbuf = hbuf_previous_persistent(g_list_last(hbuf)); if (action) { // Add a readmark flag blk = (hbuf_block*)(hbuf->data); blk->prefix.flags |= HBB_PREFIX_READMARK; // Shift hbuf in order to remove previous flags // (maybe it can be optimized out, if there's no risk // we have several marks) hbuf = g_list_previous(hbuf); } // Remove old mark for ( ; hbuf; hbuf = g_list_previous(hbuf)) { blk = (hbuf_block*)(hbuf->data); if (blk->prefix.flags & HBB_PREFIX_READMARK) { blk->prefix.flags &= ~HBB_PREFIX_READMARK; break; } } } // hbuf_remove_trailing_readmark(hbuf) // Unset the buffer readmark if it is on the last line void hbuf_remove_trailing_readmark(GList *hbuf) { hbuf_block *blk; if (!hbuf) return; hbuf = g_list_last(hbuf); blk = (hbuf_block*)(hbuf->data); blk->prefix.flags &= ~HBB_PREFIX_READMARK; } // hbuf_get_blocks_number() // Returns the number of allocated hbuf_block's. guint hbuf_get_blocks_number(GList *hbuf) { hbuf_block *hbuf_b_elt; guint count = 0U; for (hbuf = g_list_first(hbuf); hbuf; hbuf = g_list_next(hbuf)) { hbuf_b_elt = (hbuf_block*)(hbuf->data); if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) count++; } return count; } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/hbuf.h000066400000000000000000000040741216603513500156640ustar00rootroot00000000000000#ifndef __MCABBER_HBUF_H__ #define __MCABBER_HBUF_H__ 1 #include #include // With current implementation a message must fit in a hbuf block, // so we shouldn't choose a too small size. #define HBB_BLOCKSIZE 8192 // > 20 please // Flags: // - ALLOC: the ptr data has been allocated, it can be freed // - PERSISTENT: this is a new history line #define HBB_FLAG_ALLOC 1 #define HBB_FLAG_PERSISTENT 2 #define HBB_PREFIX_IN (1U<<0) #define HBB_PREFIX_OUT (1U<<1) #define HBB_PREFIX_STATUS (1U<<2) #define HBB_PREFIX_AUTH (1U<<3) #define HBB_PREFIX_INFO (1U<<4) #define HBB_PREFIX_ERR (1U<<5) #define HBB_PREFIX_NOFLAG (1U<<6) #define HBB_PREFIX_HLIGHT_OUT (1U<<7) #define HBB_PREFIX_HLIGHT (1U<<8) #define HBB_PREFIX_NONE (1U<<9) #define HBB_PREFIX_SPECIAL (1U<<10) #define HBB_PREFIX_PGPCRYPT (1U<<11) #define HBB_PREFIX_OTRCRYPT (1U<<12) #define HBB_PREFIX_CONT (1U<<13) #define HBB_PREFIX_RECEIPT (1U<<14) #define HBB_PREFIX_READMARK (1U<<15) typedef struct { time_t timestamp; guint flags; unsigned mucnicklen; char *text; } hbb_line; void hbuf_add_line(GList **p_hbuf, const char *text, time_t timestamp, guint prefix_flags, guint width, guint maxhbufblocks, unsigned mucnicklen, gpointer xep184); void hbuf_free(GList **p_hbuf); void hbuf_rebuild(GList **p_hbuf, unsigned int width); GList *hbuf_previous_persistent(GList *l_line); hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n); GList *hbuf_search(GList *hbuf, int direction, const char *string); GList *hbuf_jump_date(GList *hbuf, time_t t); GList *hbuf_jump_percent(GList *hbuf, int pc); GList *hbuf_jump_readmark(GList *hbuf); gboolean hbuf_remove_receipt(GList *hbuf, gconstpointer xep184); void hbuf_set_readmark(GList *hbuf, gboolean action); void hbuf_remove_trailing_readmark(GList *hbuf); void hbuf_dump_to_file(GList *hbuf, const char *filename); guint hbuf_get_blocks_number(GList *p_hbuf); #endif /* __MCABBER_HBUF_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/help.c000066400000000000000000000206041216603513500156600ustar00rootroot00000000000000/* * help.c -- Help command * * Copyright (C) 2006-2010 Mikael Berthe * Copyright (C) 2009 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /* * How it works * * Main calls help_init, that installs option guards. These guards do * nothing, but set help_dirs_stalled flag. When user issues help command, * it checks, if help_dirs_stalled flag is set, and if it is, it calls * init_help_dirs before performing help search. * * Options: * lang List of semicolon-separated language codes. If unset, will * be detected from locale, with fallback to english. * help_dirs List of semicolon-seaparated directories, where search for * help (in language subdirectories) will be performed. * Defaults to DATA_DIR/mcabber/help. * help_to_current Print help to current buddy's buffer. * * XXX: * Remove command list from hlp.txt and print detected list of all help * topics? */ #include #include #include #include #include #include "logprint.h" #include "screen.h" #include "hbuf.h" #include "settings.h" #include "utils.h" static GSList *help_dirs = NULL; static gboolean help_dirs_stalled = TRUE; void free_help_dirs(void) { GSList *hel; for (hel = help_dirs; hel; hel = hel->next) g_free(hel->data); g_slist_free(help_dirs); help_dirs = NULL; } void dir_push_languages(const char *langs, const char *dir) { const char *lstart = langs; const char *lend; char *path = expand_filename(dir); for (lend = strchr(lstart, ';'); lend; lend = strchr(lstart, ';')) { char *lang = g_strndup(lstart, lend - lstart); char *dir = g_strdup_printf("%s/%s", path, lang); help_dirs = g_slist_append(help_dirs, dir); g_free(lang); lstart = lend + 1; } { // finishing element char *dir = g_strdup_printf("%s/%s", path, lstart); help_dirs = g_slist_append(help_dirs, dir); } g_free(path); } void init_help_dirs(void) { const char *paths; const char *langs; char lang[6]; if (help_dirs) free_help_dirs(); // initialize variables paths = settings_opt_get("help_dirs"); if (!paths || !*paths) #ifdef DATA_DIR paths = DATA_DIR "/mcabber/help"; #else paths = "/usr/local/share/mcabber/help;/usr/share/mcabber/help"; #endif langs = settings_opt_get("lang"); if (!langs || !*langs) { char *locale = setlocale(LC_MESSAGES, NULL); // XXX crude method to distinguish between xx_XX xx xx@xxx // and C POSIX NULL etc. if (locale && isalpha(locale[0]) && isalpha(locale[1]) && !isalpha(locale[2])) { lang[0] = locale[0]; lang[1] = locale[1]; if (lang[0] == 'e' && lang[1] == 'n') lang[2] = '\0'; else { lang[2] = ';'; lang[3] = 'e'; lang[4] = 'n'; lang[5] = '\0'; } langs = lang; } else langs = "en"; } { // parse const char *pstart = paths; const char *pend; for (pend = strchr(pstart, ';'); pend; pend = strchr(pstart, ';')) { char *path = g_strndup(pstart, pend - pstart); dir_push_languages(langs, path); g_free(path); pstart = pend + 1; } // last element dir_push_languages(langs, pstart); } help_dirs_stalled = FALSE; } static gboolean do_help_in_dir(const char *arg, const char *path, const char *jid) { char *fname; GIOChannel *channel; GString *line; int lines = 0; if (arg && *arg) fname = g_strdup_printf("%s/hlp_%s.txt", path, arg); else fname = g_strdup_printf("%s/hlp.txt", path); channel = g_io_channel_new_file(fname, "r", NULL); if (!channel) return FALSE; line = g_string_new(NULL); while (TRUE) { gsize endpos; GIOStatus ret; ret = g_io_channel_read_line_string(channel, line, &endpos, NULL); if (ret != G_IO_STATUS_NORMAL) // XXX G_IO_STATUS_AGAIN? break; line->str[endpos] = '\0'; if (jid) scr_WriteIncomingMessage(jid, line->str, 0, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); else scr_LogPrint(LPRINT_NORMAL, "%s", line->str); ++lines; } g_io_channel_unref(channel); g_string_free(line, TRUE); if (!lines) return FALSE; if (!jid) { scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } return TRUE; } void help_process(char *arg) { gchar *string; const char *jid = NULL; gboolean done = FALSE; if (help_dirs_stalled) init_help_dirs(); { // check input char *c; for (c = arg; *c; ++c) if (!isalnum(*c) && *c != '-' && *c != '_') { scr_LogPrint(LPRINT_NORMAL, "Wrong help expression, " "it can contain only alphbetic, numeric" " characters and symbols '-' and '_'."); return; } string = g_strdup(arg); mc_strtolower(string); } if (settings_opt_get_int("help_to_current") && CURRENT_JID) jid = CURRENT_JID; { // search GSList *hel; for (hel = help_dirs; hel && !done; hel = hel->next) { char *dir = (char *)hel->data; done = do_help_in_dir(string, dir, jid); } } if (!done && string && *string) { // match and print any similar topics GSList *hel; GSList *matches = NULL; for (hel = help_dirs; hel; hel = hel->next) { const char *path = (const char *)hel->data; DIR *dd = opendir(path); if (dd) { struct dirent *file; for (file = readdir(dd); file; file = readdir(dd)) { const char *name = file->d_name; if (name && name[0] == 'h' && name[1] == 'l' && name[2] == 'p' && name[3] == '_') { const char *nstart = name + 4; const char *nend = strrchr(nstart, '.'); if (nend) { gsize len = nend - nstart; if (g_strstr_len(nstart, len, string)) { gchar *match = g_strndup(nstart, len); if (!g_slist_find_custom(matches, match, (GCompareFunc)strcmp)) matches = g_slist_append(matches, match); else g_free(match); done = TRUE; } } } } closedir(dd); } } if (done) { GString *message = g_string_new("No exact match found. " "Keywords, that contain this word:"); GSList *wel; for (wel = matches; wel; wel = wel->next) { gchar *word = (gchar *)wel->data; g_string_append_printf(message, " %s,", word); g_free(wel->data); } message->str[message->len - 1] = '.'; g_slist_free(matches); { char *msg = g_string_free(message, FALSE); if (jid) scr_WriteIncomingMessage(jid, msg, 0, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); else scr_LogPrint(LPRINT_NORMAL, "%s", msg); g_free(msg); } } } if (!done) { if (jid) // XXX scr_WriteIncomingMessage(jid, "No help found.", 0, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); else scr_LogPrint(LPRINT_NORMAL, "No help found."); } g_free(string); } static gchar *help_guard(const gchar *key, const gchar *new_value) { help_dirs_stalled = TRUE; return g_strdup(new_value); } void help_init(void) { settings_set_guard("lang", help_guard); settings_set_guard("help_dirs", help_guard); } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/help.h000066400000000000000000000004311216603513500156610ustar00rootroot00000000000000#ifndef __MCABBER_HELP_H__ #define __MCABBER_HELP_H__ 1 void free_help_dirs(void); void init_help_dirs(void); void help_process(char *string); void help_init(void); #endif /* __MCABBER_HELP_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/histolog.c000066400000000000000000000355231216603513500165660ustar00rootroot00000000000000/* * histolog.c -- File history handling * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #include #include #include #include "histolog.h" #include "hbuf.h" #include "utils.h" #include "screen.h" #include "settings.h" #include "utils.h" #include "roster.h" #include "xmpp.h" static guint UseFileLogging; static guint FileLoadLogs; static char *RootDir; // user_histo_file(jid) // Returns history filename for the given jid // Note: the caller *must* free the filename after use (if not null). static char *user_histo_file(const char *bjid) { char *filename; char *lowerid; if (!(UseFileLogging || FileLoadLogs)) return NULL; if (!g_strcmp0(bjid, ".") || !g_strcmp0(bjid, "..") || strchr(bjid, '/')) return NULL; lowerid = g_strdup(bjid); if (!lowerid) return NULL; mc_strtolower(lowerid); filename = g_strdup_printf("%s%s", RootDir, lowerid); g_free(lowerid); return filename; } char *hlog_get_log_jid(const char *bjid) { struct stat bufstat; char *path; char *log_jid = NULL; path = user_histo_file(bjid); while (path) { if (lstat(path, &bufstat) != 0) break; if (S_ISLNK(bufstat.st_mode)) { g_free(log_jid); log_jid = g_new0(char, bufstat.st_size+1); if (readlink(path, log_jid, bufstat.st_size) < 0) return NULL; g_free(path); path = user_histo_file(log_jid); } else break; } g_free(path); return log_jid; } // write_histo_line() // Adds a history (multi-)line to the jid's history logfile static void write_histo_line(const char *bjid, time_t timestamp, guchar type, guchar info, const char *data) { guint len = 0; FILE *fp; time_t ts; const char *p; char *filename; char str_ts[20]; int err; if (!UseFileLogging) return; // Do not log status messages when 'logging_ignore_status' is set if (type == 'S' && settings_opt_get_int("logging_ignore_status")) return; filename = user_histo_file(bjid); // If timestamp is null, get current date if (timestamp) ts = timestamp; else time(&ts); if (!data) data = ""; // Count number of extra lines for (p=data ; *p ; p++) if (*p == '\n') len++; /* Line format: "TI yyyymmddThh:mm:ssZ LLL [data]" * T=Type, I=Info, yyyymmddThh:mm:ssZ=date, LLL=0-padded-len * * Types: * - M message Info: S (send) R (receive) I (info) * - S status Info: [_ofdnai] * We don't check them, we trust the caller. * (Info messages are not sent nor received, they're generated * locally by mcabber.) */ fp = fopen(filename, "a"); g_free(filename); if (!fp) { scr_LogPrint(LPRINT_LOGNORM, "Unable to write history " "(cannot open logfile)"); return; } to_iso8601(str_ts, ts); err = fprintf(fp, "%c%c %-18.18s %03d %s\n", type, info, str_ts, len, data); fclose(fp); if (err < 0) { scr_LogPrint(LPRINT_LOGNORM, "Error while writing to log file: %s", strerror(errno)); } } // hlog_read_history() // Reads the jid's history logfile void hlog_read_history(const char *bjid, GList **p_buddyhbuf, guint width) { char *filename; guchar type, info; char *data, *tail; guint data_size; char *xtext; time_t timestamp; guint prefix_flags; guint len; FILE *fp; struct stat bufstat; guint err = 0; guint ln = 0; // line number time_t starttime; int max_num_of_blocks; if (!FileLoadLogs) return; if ((roster_gettype(bjid) & ROSTER_TYPE_ROOM) && (settings_opt_get_int("load_muc_logs") != 1)) return; data_size = HBB_BLOCKSIZE+32; data = g_new(char, data_size); if (!data) { scr_LogPrint(LPRINT_LOGNORM, "Not enough memory to read history file"); return; } filename = user_histo_file(bjid); fp = fopen(filename, "r"); g_free(filename); if (!fp) { g_free(data); return; } // If file is large (> 3MB here), display a message to inform the user // (it can take a while...) if (!fstat(fileno(fp), &bufstat)) { if (bufstat.st_size > 3145728) { scr_LogPrint(LPRINT_NORMAL, "Reading <%s> history file...", bjid); scr_do_update(); } } max_num_of_blocks = get_max_history_blocks(); starttime = 0L; if (settings_opt_get_int("max_history_age") > 0) { int maxdays = settings_opt_get_int("max_history_age"); time(&starttime); if (maxdays >= starttime/86400L) starttime = 0L; else starttime -= maxdays * 86400L; } /* See write_histo_line() for line format... */ while (!feof(fp)) { guint dataoffset = 25; guint noeol; if (fgets(data, data_size-1, fp) == NULL) break; ln++; while (1) { for (tail = data; *tail; tail++) ; noeol = (*(tail-1) != '\n'); if (!noeol) break; /* TODO: duplicated code... could do better... */ if (tail == data + data_size-2) { // The buffer is too small to contain the whole line. // Let's allocate some more space. if (!max_num_of_blocks || data_size/HBB_BLOCKSIZE < 5U*max_num_of_blocks) { guint toffset = tail - data; // Allocate one more block. data_size = HBB_BLOCKSIZE * (1 + data_size/HBB_BLOCKSIZE); data = g_renew(char, data, data_size); // Update the tail pointer, as the data may have been moved. tail = data + toffset; if (fgets(tail, data_size-1 - (tail-data), fp) == NULL) break; } else { scr_LogPrint(LPRINT_LOGNORM, "Line too long in history file!"); ln--; break; } } } type = data[0]; info = data[1]; if ((type != 'M' && type != 'S') || ((data[11] != 'T') || (data[20] != 'Z') || (data[21] != ' ') || (data[25] != ' ' && data[26] != ' '))) { if (!err) { scr_LogPrint(LPRINT_LOGNORM, "Error in history file format (%s), l.%u", bjid, ln); err = 1; } continue; } // The number of lines can be written with 3 or 4 bytes. if (data[25] != ' ') dataoffset = 26; data[21] = data[dataoffset] = 0; timestamp = from_iso8601(&data[3], 1); len = (guint) atoi(&data[22]); // Some checks if (((type == 'M') && (info != 'S' && info != 'R' && info != 'I')) || ((type == 'S') && (!strchr("_OFDNAI", info)))) { if (!err) { scr_LogPrint(LPRINT_LOGNORM, "Error in history file format (%s), l.%u", bjid, ln); err = 1; } continue; } while (len--) { ln++; if (fgets(tail, data_size-1 - (tail-data), fp) == NULL) break; while (*tail) tail++; noeol = (*(tail-1) != '\n'); if (tail == data + data_size-2 && (len || noeol)) { // The buffer is too small to contain the whole message. // Let's allocate some more space. if (!max_num_of_blocks || data_size/HBB_BLOCKSIZE < 5U*max_num_of_blocks) { guint toffset = tail - data; // If the line hasn't been read completely and we reallocate the // buffer, we want to read one more time. if (noeol) len++; // Allocate one more block. data_size = HBB_BLOCKSIZE * (1 + data_size/HBB_BLOCKSIZE); data = g_renew(char, data, data_size); // Update the tail pointer, as the data may have been moved. tail = data + toffset; } else { // There will probably be a parse error on next read, because // this message hasn't been read entirely. scr_LogPrint(LPRINT_LOGNORM, "Message too big in history file!"); } } } // Remove last CR (we keep it if the line is empty, too) if ((tail > data+dataoffset+1) && (*(tail-1) == '\n')) *(tail-1) = 0; // Check if the data is older than max_history_age if (starttime) { if (timestamp > starttime) starttime = 0L; // From now on, load everything else continue; } if (type == 'M') { char *converted; if (info == 'S') { prefix_flags = HBB_PREFIX_OUT | HBB_PREFIX_HLIGHT_OUT; } else { prefix_flags = HBB_PREFIX_IN; if (info == 'I') prefix_flags = HBB_PREFIX_INFO; } converted = from_utf8(&data[dataoffset+1]); if (converted) { xtext = ut_expand_tabs(converted); // Expand tabs hbuf_add_line(p_buddyhbuf, xtext, timestamp, prefix_flags, width, max_num_of_blocks, 0, NULL); if (xtext != converted) g_free(xtext); g_free(converted); } err = 0; } } fclose(fp); g_free(data); } // hlog_enable() // Enable logging to files. If root_dir is NULL, then $HOME/.mcabber is used. // If loadfiles is TRUE, we will try to load buddies history logs from file. void hlog_enable(guint enable, const char *root_dir, guint loadfiles) { UseFileLogging = enable; FileLoadLogs = loadfiles; if (enable || loadfiles) { if (root_dir) { char *xp_root_dir; int l = strlen(root_dir); if (l < 1) { scr_LogPrint(LPRINT_LOGNORM, "Error: logging dir name too short"); UseFileLogging = FileLoadLogs = FALSE; return; } xp_root_dir = expand_filename(root_dir); // RootDir must be slash-terminated if (root_dir[l-1] == '/') { RootDir = xp_root_dir; } else { RootDir = g_strdup_printf("%s/", xp_root_dir); g_free(xp_root_dir); } } else { char *home = getenv("HOME"); const char *dir = "/.mcabber/histo/"; RootDir = g_strdup_printf("%s%s", home, dir); } // Check directory permissions (should not be readable by group/others) if (checkset_perm(RootDir, TRUE) == -1) { // The directory does not actually exists g_free(RootDir); RootDir = NULL; scr_LogPrint(LPRINT_LOGNORM, "ERROR: Cannot access " "history log directory, logging DISABLED"); UseFileLogging = FileLoadLogs = FALSE; } } else { // Disable history logging g_free(RootDir); RootDir = NULL; } } guint hlog_is_enabled(void) { return UseFileLogging; } inline void hlog_write_message(const char *bjid, time_t timestamp, int sent, const char *msg) { guchar info; /* sent=1 message sent by mcabber * sent=0 message received by mcabber * sent=-1 local info message */ if (sent == 1) info = 'S'; else if (sent == 0) info = 'R'; else info = 'I'; write_histo_line(bjid, timestamp, 'M', info, msg); } inline void hlog_write_status(const char *bjid, time_t timestamp, enum imstatus status, const char *status_msg) { // XXX Check status value? write_histo_line(bjid, timestamp, 'S', toupper(imstatus2char[status]), status_msg); } // hlog_save_state() // If enabled, save the current state of the roster // (i.e. pending messages) to a temporary file. void hlog_save_state(void) { gpointer unread_ptr, first_unread; const char *bjid; char *statefile_xp; FILE *fp; const char *statefile = settings_opt_get("statefile"); if (!statefile || !UseFileLogging) return; statefile_xp = expand_filename(statefile); fp = fopen(statefile_xp, "w"); if (!fp) { scr_LogPrint(LPRINT_NORMAL, "Cannot open state file [%s]", strerror(errno)); goto hlog_save_state_return; } if (!xmpp_is_online()) { // We're not connected. Let's use the unread_jids hash. GList *unread_jid = unread_jid_get_list(); unread_ptr = unread_jid; for ( ; unread_jid ; unread_jid = g_list_next(unread_jid)) fprintf(fp, "%s\n", (char*)unread_jid->data); g_list_free(unread_ptr); goto hlog_save_state_return; } if (!current_buddy) // Safety check -- shouldn't happen. goto hlog_save_state_return; // We're connected. Let's use unread_msg(). unread_ptr = first_unread = unread_msg(NULL); if (!first_unread) goto hlog_save_state_return; do { guint type = buddy_gettype(unread_ptr); if (type & (ROSTER_TYPE_USER|ROSTER_TYPE_AGENT)) { bjid = buddy_getjid(unread_ptr); if (bjid) fprintf(fp, "%s\n", bjid); } unread_ptr = unread_msg(unread_ptr); } while (unread_ptr && unread_ptr != first_unread); hlog_save_state_return: if (fp) { long filelen = ftell(fp); fclose(fp); if (!filelen) unlink(statefile_xp); } g_free(statefile_xp); } // hlog_load_state() // If enabled, load the current state of the roster // (i.e. pending messages) from a temporary file. // This function adds the JIDs to the unread_jids hash table, // so it should only be called at startup. void hlog_load_state(void) { char bjid[1024]; char *statefile_xp; FILE *fp; const char *statefile = settings_opt_get("statefile"); if (!statefile || !UseFileLogging) return; statefile_xp = expand_filename(statefile); fp = fopen(statefile_xp, "r"); if (fp) { char *eol; while (!feof(fp)) { if (fgets(bjid, sizeof bjid, fp) == NULL) break; // Let's remove the trailing newline. // Also remove whitespace, if the file as been (badly) manually modified. for (eol = bjid; *eol; eol++) ; for (eol--; eol >= bjid && (*eol == '\n' || *eol == ' '); *eol-- = 0) ; // Safety checks... if (!bjid[0]) continue; if (check_jid_syntax(bjid)) { scr_LogPrint(LPRINT_LOGNORM, "ERROR: Invalid JID in state file. Corrupted file?"); break; } // Display a warning if there are pending messages but the user // won't see them because load_log isn't set. if (!FileLoadLogs) { scr_LogPrint(LPRINT_LOGNORM, "WARNING: unread message from <%s>.", bjid); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } // Add the JID to unread_jids. It will be used when the contact is // added to the roster. unread_jid_add(bjid); } fclose(fp); } g_free(statefile_xp); } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/histolog.h000066400000000000000000000013131216603513500165610ustar00rootroot00000000000000#ifndef __MCABBER_HISTOLOG_H__ #define __MCABBER_HISTOLOG_H__ 1 #include #include void hlog_enable(guint enable, const char *root_dir, guint loadfile); char *hlog_get_log_jid(const char *bjid); void hlog_read_history(const char *bjid, GList **p_buddyhbuf, guint width); void hlog_write_message(const char *bjid, time_t timestamp, int sent, const char *msg); void hlog_write_status(const char *bjid, time_t timestamp, enum imstatus status, const char *status_msg); void hlog_save_state(void); void hlog_load_state(void); #endif /* __MCABBER_HISTOLOG_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/hooks.c000066400000000000000000000620161216603513500160560ustar00rootroot00000000000000/* * hooks.c -- Hooks layer * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include "hooks.h" #include "screen.h" #include "roster.h" #include "histolog.h" #include "hbuf.h" #include "settings.h" #include "utils.h" #include "utf8.h" #include "commands.h" #include "main.h" #ifdef MODULES_ENABLE #include typedef struct { hk_handler_t handler; gint priority; gpointer userdata; guint hid; } hook_list_data_t; static GHashTable *hk_handler_hash = NULL; // _new_hook_id() // Return a unique Hook Id static guint _new_hook_id(void) { static guint hidcounter; return ++hidcounter; } // _new_hook_queue(hookname) // Create a new hash table entry with a GSList pointer for the specified hook static GSList **_new_hook_queue(const gchar *hookname) { GSList **p; // Create the hash table if needed. if (!hk_handler_hash) { hk_handler_hash = g_hash_table_new_full(&g_str_hash, &g_str_equal, &g_free, &g_free); if (!hk_handler_hash) { scr_log_print(LPRINT_LOGNORM, "Couldn't create hook hash table!"); return NULL; } } // Add a queue for the requested hook p = g_new(GSList*, 1); *p = NULL; g_hash_table_insert(hk_handler_hash, g_strdup(hookname), p); return p; } static gint _hk_compare_prio(hook_list_data_t *a, hook_list_data_t *b) { if (a->priority > b->priority) return 1; return 0; } // hk_add_handler(handler, hookname, priority, userdata) // Create a hook handler and a hook hash entry if needed. // Return the handler id. guint hk_add_handler(hk_handler_t handler, const gchar *hookname, gint priority, gpointer userdata) { GSList **hqueue = NULL; hook_list_data_t *h = g_new(hook_list_data_t, 1); h->handler = handler; h->priority = priority; h->userdata = userdata; h->hid = _new_hook_id(); if (hk_handler_hash) hqueue = g_hash_table_lookup(hk_handler_hash, hookname); if (!hqueue) hqueue = _new_hook_queue(hookname); if (!hqueue) return 0; *hqueue = g_slist_insert_sorted(*hqueue, h, (GCompareFunc)_hk_compare_prio); return h->hid; } static gint _hk_queue_search_cb(hook_list_data_t *a, guint *hid) { if (a->hid == *hid) return 0; return 1; } // hk_del_handler(hookname, hook_id) // Remove the handler with specified hook id from the hookname queue. // The hash entry is removed if the queue is empty. void hk_del_handler(const gchar *hookname, guint hid) { GSList **hqueue; GSList *el; if (!hid) return; hqueue = g_hash_table_lookup(hk_handler_hash, hookname); if (!hqueue) { scr_log_print(LPRINT_LOGNORM, "*ERROR*: Couldn't remove hook handler!"); return; } el = g_slist_find_custom(*hqueue, &hid, (GCompareFunc)_hk_queue_search_cb); if (el) { g_free(el->data); *hqueue = g_slist_delete_link(*hqueue, el); // Remove hook hash table entry if the hook queue is empty if (!*hqueue) g_hash_table_remove(hk_handler_hash, hookname); } } // hk_run_handlers(hookname, args) // Process all hooks for the "hookname" event. // Note that the processing is interrupted as soon as one of the handlers // do not return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS (i.e. 0). guint hk_run_handlers(const gchar *hookname, hk_arg_t *args) { GSList **hqueue; GSList *h; guint ret = 0; if (!hk_handler_hash) return 0; hqueue = g_hash_table_lookup(hk_handler_hash, hookname); if (!hqueue) return 0; // Should we use a special code? for (h = *hqueue; h; h = g_slist_next(h)) { hook_list_data_t *data = h->data; ret = (data->handler)(hookname, args, data->userdata); if (ret) break; } return ret; } #endif static char *extcmd; static const char *COMMAND_ME = "/me "; void hk_message_in(const char *bjid, const char *resname, time_t timestamp, const char *msg, LmMessageSubType type, guint encrypted) { int new_guy = FALSE; int is_groupchat = FALSE; // groupchat message int is_room = FALSE; // window is a room window int log_muc_conf = FALSE; int active_window = FALSE; int message_flags = 0; guint rtype = ROSTER_TYPE_USER; char *wmsg = NULL, *bmsg = NULL, *mmsg = NULL; GSList *roster_usr; unsigned mucnicklen = 0; const char *ename = NULL; gboolean attention = FALSE, mucprivmsg = FALSE; gboolean error_msg_subtype = (type == LM_MESSAGE_SUB_TYPE_ERROR); #ifdef MODULES_ENABLE gchar strdelay[32]; if (timestamp) to_iso8601(strdelay, timestamp); else strdelay[0] = '\0'; #endif if (encrypted == ENCRYPTED_PGP) message_flags |= HBB_PREFIX_PGPCRYPT; else if (encrypted == ENCRYPTED_OTR) message_flags |= HBB_PREFIX_OTRCRYPT; if (type == LM_MESSAGE_SUB_TYPE_GROUPCHAT) { rtype = ROSTER_TYPE_ROOM; is_groupchat = TRUE; log_muc_conf = settings_opt_get_int("log_muc_conf"); if (!resname) { message_flags = HBB_PREFIX_INFO | HBB_PREFIX_NOFLAG; resname = ""; wmsg = bmsg = g_strdup_printf("~ %s", msg); } else { wmsg = bmsg = g_strdup_printf("<%s> %s", resname, msg); mucnicklen = strlen(resname) + 2; if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) wmsg = mmsg = g_strdup_printf("*%s %s", resname, msg+4); } } else { bmsg = g_strdup(msg); if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { gchar *shortid = g_strdup(bjid); if (settings_opt_get_int("buddy_me_fulljid") == FALSE) { gchar *p = strchr(shortid, '@'); // Truncate the jid if (p) *p = '\0'; } wmsg = mmsg = g_strdup_printf("*%s %s", shortid, msg+4); g_free(shortid); } else wmsg = (char*) msg; } #ifdef MODULES_ENABLE { guint h_result; hk_arg_t args[] = { { "jid", bjid }, { "resource", resname }, { "message", msg }, { "groupchat", is_groupchat ? "true" : "false" }, { "delayed", strdelay }, { "error", error_msg_subtype ? "true" : "false" }, { NULL, NULL }, }; h_result = hk_run_handlers(HOOK_PRE_MESSAGE_IN, args); if (h_result == HOOK_HANDLER_RESULT_NO_MORE_HANDLER_DROP_DATA) { scr_LogPrint(LPRINT_DEBUG, "Message dropped (hook result)."); g_free(bmsg); g_free(mmsg); return; } } #endif // If this user isn't in the roster, we add it roster_usr = roster_find(bjid, jidsearch, 0); if (!roster_usr) { new_guy = TRUE; roster_usr = roster_add_user(bjid, NULL, NULL, rtype, sub_none, -1); if (!roster_usr) { // Shouldn't happen... scr_LogPrint(LPRINT_LOGNORM, "ERROR: unable to add buddy!"); g_free(bmsg); g_free(mmsg); return; } } else if (is_groupchat) { // Make sure the type is ROOM buddy_settype(roster_usr->data, ROSTER_TYPE_ROOM); } is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM); if (is_room) { if (!is_groupchat) { // This is a private message from a room participant g_free(bmsg); if (!resname) { resname = ""; wmsg = bmsg = g_strdup(msg); } else { wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { g_free(mmsg); wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); } mucprivmsg = TRUE; } message_flags |= HBB_PREFIX_HLIGHT; } else { // This is a regular chatroom message. const char *nick = buddy_getnickname(roster_usr->data); if (nick) { // Let's see if we are the message sender, in which case we'll // highlight it. if (resname && !strcmp(resname, nick)) { message_flags |= HBB_PREFIX_HLIGHT_OUT; } else { // We're not the sender. Can we see our nick? const char *msgptr = msg; while ((msgptr = strcasestr(msgptr, nick)) != NULL) { const char *leftb, *rightb; // The message contains our nick. Let's check it's not // in the middle of another word (i.e. preceded/followed // immediately by an alphanumeric character or an underscore. rightb = msgptr+strlen(nick); if (msgptr == msg) leftb = NULL; else leftb = prev_char((char*)msgptr, msg); msgptr = next_char((char*)msgptr); // Check left boundary if (leftb && (iswalnum(get_char(leftb)) || get_char(leftb) == '_')) continue; // Check right boundary if (!iswalnum(get_char(rightb)) && get_char(rightb) != '_') attention = TRUE; if (attention && !settings_opt_get_int("muc_disable_nick_hl")) message_flags |= HBB_PREFIX_HLIGHT; } } } } } else if (settings_opt_get_int("roster_autolock_resource")) { buddy_setactiveresource(roster_usr->data, resname); scr_update_chat_status(FALSE); } if (error_msg_subtype) { message_flags = HBB_PREFIX_ERR | HBB_PREFIX_IN; scr_LogPrint(LPRINT_LOGNORM, "Error message received from <%s>", bjid); } // Note: the hlog_write should not be called first, because in some // cases scr_write_incoming_message() will load the history and we'd // have the message twice... scr_write_incoming_message(bjid, wmsg, timestamp, message_flags, mucnicklen); // Set urgent (a.k.a. "attention") flag { guint uip; if (is_groupchat) { if (attention) uip = ROSTER_UI_PRIO_MUC_HL_MESSAGE; else uip = ROSTER_UI_PRIO_MUC_MESSAGE; } else { if (mucprivmsg) uip = ROSTER_UI_PRIO_MUC_PRIV_MESSAGE; else if (attention) uip = ROSTER_UI_PRIO_ATTENTION_MESSAGE; else uip = ROSTER_UI_PRIO_PRIVATE_MESSAGE; } scr_setattentionflag_if_needed(bjid, FALSE, uip, prio_max); } // We don't log the modified message, but the original one if (wmsg == mmsg) wmsg = bmsg; // - We don't log the message if it is an error message // - We don't log the message if it is a private conf. message // - We don't log the message if it is groupchat message and the log_muc_conf // option is off (and it is not a history line) if (!(message_flags & HBB_PREFIX_ERR) && (!is_room || (is_groupchat && log_muc_conf && !timestamp))) hlog_write_message(bjid, timestamp, 0, wmsg); if (settings_opt_get_int("events_ignore_active_window") && current_buddy && scr_get_chatmode()) { gpointer bud = BUDDATA(current_buddy); if (bud) { const char *cjid = buddy_getjid(bud); if (cjid && !strcasecmp(cjid, bjid)) active_window = TRUE; } } if (settings_opt_get_int("eventcmd_use_nickname")) ename = roster_getname(bjid); // Display the sender in the log window if ((!is_groupchat) && !(message_flags & HBB_PREFIX_ERR) && settings_opt_get_int("log_display_sender")) { const char *name = roster_getname(bjid); if (!name) name = ""; scr_LogPrint(LPRINT_NORMAL, "Message received from %s <%s/%s>", name, bjid, (resname ? resname : "")); } #ifdef MODULES_ENABLE { hk_arg_t args[] = { { "jid", bjid }, { "resource", resname }, { "message", msg }, { "groupchat", is_groupchat ? "true" : "false" }, { "attention", attention ? "true" : "false" }, { "delayed", strdelay }, { "error", error_msg_subtype ? "true" : "false" }, { NULL, NULL }, }; hk_run_handlers(HOOK_POST_MESSAGE_IN, args); } #endif // External command // - We do not call hk_ext_cmd() for history lines in MUC // - We do call hk_ext_cmd() for private messages in a room // - We do call hk_ext_cmd() for messages to the current window if (!active_window && ((is_groupchat && !timestamp) || !is_groupchat)) hk_ext_cmd(ename ? ename : bjid, (is_groupchat ? 'G' : 'M'), 'R', wmsg); // Beep, if enabled: // - if it's a private message // - if it's a public message and it's highlighted if (settings_opt_get_int("beep_on_message")) { if ((!is_groupchat && !(message_flags & HBB_PREFIX_ERR)) || (is_groupchat && (message_flags & HBB_PREFIX_HLIGHT))) scr_beep(); } // We need to update the roster if the sender is unknown or // if the sender is offline/invisible and a filter is set. if (new_guy || (buddy_getstatus(roster_usr->data, NULL) == offline && buddylist_isset_filter())) { update_roster = TRUE; } g_free(bmsg); g_free(mmsg); } // hk_message_out() // nick should be set for private messages in a chat room, and null for // normal messages. void hk_message_out(const char *bjid, const char *nick, time_t timestamp, const char *msg, guint encrypted, gpointer xep184) { char *wmsg = NULL, *bmsg = NULL, *mmsg = NULL; guint cryptflag = 0; if (nick) { wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg); if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { const char *mynick = roster_getnickname(bjid); wmsg = mmsg = g_strdup_printf("PRIV#<%s> *%s %s", nick, (mynick ? mynick : "me"), msg+4); } } else { wmsg = (char*)msg; if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { char *myid = jid_get_username(settings_opt_get("jid")); if (myid) { wmsg = mmsg = g_strdup_printf("*%s %s", myid, msg+4); g_free(myid); } } } // Note: the hlog_write should not be called first, because in some // cases scr_write_outgoing_message() will load the history and we'd // have the message twice... if (encrypted == ENCRYPTED_PGP) cryptflag = HBB_PREFIX_PGPCRYPT; else if (encrypted == ENCRYPTED_OTR) cryptflag = HBB_PREFIX_OTRCRYPT; scr_write_outgoing_message(bjid, wmsg, cryptflag, xep184); // We don't log private messages if (!nick) hlog_write_message(bjid, timestamp, 1, msg); #ifdef MODULES_ENABLE { hk_arg_t args[] = { { "jid", bjid }, { "message", wmsg }, { NULL, NULL }, }; hk_run_handlers(HOOK_MESSAGE_OUT, args); // TODO: check (and use) return value } #endif // External command hk_ext_cmd(bjid, 'M', 'S', NULL); g_free(bmsg); g_free(mmsg); } void hk_statuschange(const char *bjid, const char *resname, gchar prio, time_t timestamp, enum imstatus status, const char *status_msg) { int st_in_buf; enum imstatus oldstat; char *bn; char *logsmsg; const char *rn = (resname ? resname : ""); const char *ename = NULL; if (settings_opt_get_int("eventcmd_use_nickname")) ename = roster_getname(bjid); oldstat = roster_getstatus(bjid, resname); st_in_buf = settings_opt_get_int("show_status_in_buffer"); if (settings_opt_get_int("log_display_presence")) { int buddy_format = settings_opt_get_int("buddy_format"); bn = NULL; if (buddy_format) { const char *name = roster_getname(bjid); if (name && strcmp(name, bjid)) { if (buddy_format == 1) bn = g_strdup_printf("%s <%s/%s>", name, bjid, rn); else if (buddy_format == 2) bn = g_strdup_printf("%s/%s", name, rn); else if (buddy_format == 3) bn = g_strdup_printf("%s", name); } } if (!bn) bn = g_strdup_printf("<%s/%s>", bjid, rn); logsmsg = g_strdup(status_msg ? status_msg : ""); replace_nl_with_dots(logsmsg); scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", imstatus2char[oldstat], imstatus2char[status], bn, logsmsg); g_free(logsmsg); g_free(bn); } if (st_in_buf == 2 || (st_in_buf == 1 && (status == offline || oldstat == offline))) { // Write the status change in the buddy's buffer, only if it already exists if (scr_buddy_buffer_exists(bjid)) { bn = g_strdup_printf("Buddy status has changed: [%c>%c] %s", imstatus2char[oldstat], imstatus2char[status], ((status_msg) ? status_msg : "")); scr_write_incoming_message(bjid, bn, timestamp, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); g_free(bn); } } roster_setstatus(bjid, rn, prio, status, status_msg, timestamp, role_none, affil_none, NULL); buddylist_build(); scr_draw_roster(); hlog_write_status(bjid, timestamp, status, status_msg); #ifdef MODULES_ENABLE { char os[2] = " \0"; char ns[2] = " \0"; hk_arg_t args[] = { { "jid", bjid }, { "resource", rn }, { "old_status", os }, { "new_status", ns }, { "message", status_msg ? status_msg : "" }, { NULL, NULL }, }; os[0] = imstatus2char[oldstat]; ns[0] = imstatus2char[status]; hk_run_handlers(HOOK_STATUS_CHANGE, args); } #endif // External command hk_ext_cmd(ename ? ename : bjid, 'S', imstatus2char[status], NULL); } void hk_mystatuschange(time_t timestamp, enum imstatus old_status, enum imstatus new_status, const char *msg) { scr_LogPrint(LPRINT_LOGNORM, "Your status has been set: [%c>%c] %s", imstatus2char[old_status], imstatus2char[new_status], (msg ? msg : "")); #ifdef MODULES_ENABLE { char ns[2] = " \0"; hk_arg_t args[] = { { "new_status", ns }, { "message", msg ? msg : "" }, { NULL, NULL }, }; ns[0] = imstatus2char[new_status]; hk_run_handlers(HOOK_MY_STATUS_CHANGE, args); } #endif //hlog_write_status(NULL, 0, status); } void hk_postconnect(void) { const char *hook_command; char *cmdline; #ifdef MODULES_ENABLE { hk_arg_t args[] = { { NULL, NULL }, }; hk_run_handlers(HOOK_POST_CONNECT, args); } #endif hook_command = settings_opt_get("hook-post-connect"); if (!hook_command) return; scr_LogPrint(LPRINT_LOGNORM, "Running hook-post-connect..."); cmdline = from_utf8(hook_command); if (process_command(cmdline, TRUE) == 255) mcabber_set_terminate_ui(); g_free(cmdline); } void hk_predisconnect(void) { const char *hook_command; char *cmdline; #ifdef MODULES_ENABLE { hk_arg_t args[] = { { NULL, NULL }, }; hk_run_handlers(HOOK_PRE_DISCONNECT, args); } #endif hook_command = settings_opt_get("hook-pre-disconnect"); if (!hook_command) return; scr_LogPrint(LPRINT_LOGNORM, "Running hook-pre-disconnect..."); cmdline = from_utf8(hook_command); if (process_command(cmdline, TRUE) == 255) mcabber_set_terminate_ui(); g_free(cmdline); } void hk_unread_list_change(guint unread_count, guint attention_count, guint muc_unread, guint muc_attention) { // Previous static variables are initialized with an unlikely value static guint prev_unread = 65535; static guint prev_attention = 65535; static guint prev_muc_unread = 65535; static guint prev_muc_attention = 65535; gchar *str_unread; // Do not call the handlers if the unread values haven't changed if (unread_count == prev_unread && attention_count == prev_attention && muc_unread == prev_muc_unread && muc_attention == prev_muc_attention) return; #ifdef MODULES_ENABLE { str_unread = g_strdup_printf("%u", unread_count); gchar *str_attention = g_strdup_printf("%u", attention_count); gchar *str_muc_unread = g_strdup_printf("%u", muc_unread); gchar *str_muc_attention = g_strdup_printf("%u", muc_attention); hk_arg_t args[] = { { "unread", str_unread }, // All unread { "attention", str_attention }, // Attention (private) { "muc_unread", str_muc_unread }, // MUC unread { "muc_attention", str_muc_attention }, // MUC attention (highlight) { NULL, NULL }, }; hk_run_handlers(HOOK_UNREAD_LIST_CHANGE, args); g_free(str_unread); g_free(str_attention); g_free(str_muc_unread); g_free(str_muc_attention); } #endif prev_unread = unread_count; prev_attention = attention_count; prev_muc_unread = muc_unread; prev_muc_attention = muc_attention; /* Call external command */ str_unread = g_strdup_printf("%u %u %u %u", unread_count, attention_count, muc_unread, muc_attention); hk_ext_cmd("", 'U', (guchar)MIN(255, unread_count), str_unread); g_free(str_unread); } // hk_presence_subscription_request(jid, message) // Return non-zero if mcabber should stop processing the subscription request guint hk_subscription(LmMessageSubType mstype, const gchar *bjid, const gchar *msg) { #ifdef MODULES_ENABLE guint h_result; const char *stype; if (mstype == LM_MESSAGE_SUB_TYPE_SUBSCRIBE) stype = "subscribe"; else if (mstype == LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE) stype = "unsubscribe"; else if (mstype == LM_MESSAGE_SUB_TYPE_SUBSCRIBED) stype = "subscribed"; else if (mstype == LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED) stype = "unsubscribed"; else return 0; // Should not happen { hk_arg_t args[] = { { "type", stype }, { "jid", bjid }, { "message", msg ? msg : "" }, { NULL, NULL }, }; h_result = hk_run_handlers(HOOK_SUBSCRIPTION, args); } if (h_result != HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS) { scr_LogPrint(LPRINT_DEBUG, "Subscription message ignored (hook result)."); return h_result; } #endif return 0; } /* External commands */ // hk_ext_cmd_init() // Initialize external command variable. // Can be called with parameter NULL to reset and free memory. void hk_ext_cmd_init(const char *command) { if (extcmd) { g_free(extcmd); extcmd = NULL; } if (command) extcmd = expand_filename(command); } // hk_ext_cmd() // Launch an external command (process) for the given event. // For now, data should be NULL. void hk_ext_cmd(const char *bjid, guchar type, guchar info, const char *data) { pid_t pid; const char *arg_type = NULL; const char *arg_info = NULL; const char *arg_data = NULL; char status_str[2]; char *datafname = NULL; if (!extcmd) return; // Prepare arg_* (external command parameters) switch (type) { case 'M': /* Normal message */ arg_type = "MSG"; if (info == 'R') arg_info = "IN"; else if (info == 'S') arg_info = "OUT"; break; case 'G': /* Groupchat message */ arg_type = "MSG"; arg_info = "MUC"; break; case 'S': /* Status change */ arg_type = "STATUS"; if (strchr(imstatus2char, tolower(info))) { status_str[0] = toupper(info); status_str[1] = 0; arg_info = status_str; } break; case 'U': /* Unread buffer count */ arg_type = "UNREAD"; arg_info = data; break; default: return; } if (!arg_type || !arg_info) return; if (strchr("MG", type) && data && settings_opt_get_int("event_log_files")) { int fd; const char *prefix; char *prefix_xp = NULL; char *data_locale; data_locale = from_utf8(data); prefix = settings_opt_get("event_log_dir"); if (prefix) prefix = prefix_xp = expand_filename(prefix); else prefix = ut_get_tmpdir(); datafname = g_strdup_printf("%s/mcabber-%d.XXXXXX", prefix, getpid()); g_free(prefix_xp); // XXX Some old systems may require us to set umask first. fd = mkstemp(datafname); if (fd == -1) { g_free(datafname); datafname = NULL; scr_LogPrint(LPRINT_LOGNORM, "Unable to create temp file for external command."); } else { size_t data_locale_len = strlen(data_locale); ssize_t a = write(fd, data_locale, data_locale_len); ssize_t b = write(fd, "\n", 1); if ((size_t)a != data_locale_len || b != 1) { g_free(datafname); datafname = NULL; scr_LogPrint(LPRINT_LOGNORM, "Unable to write to temp file for external command."); } close(fd); arg_data = datafname; } g_free(data_locale); } if ((pid=fork()) == -1) { scr_LogPrint(LPRINT_LOGNORM, "Fork error, cannot launch external command."); g_free(datafname); return; } if (pid == 0) { // child // Close standard file descriptors close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); if (execl(extcmd, extcmd, arg_type, arg_info, bjid, arg_data, (char *)NULL) == -1) { // scr_LogPrint(LPRINT_LOGNORM, "Cannot execute external command."); exit(1); } } g_free(datafname); } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/hooks.h000066400000000000000000000051401216603513500160560ustar00rootroot00000000000000#ifndef __MCABBER_HOOKS_H__ #define __MCABBER_HOOKS_H__ 1 #include #include #include // These two defines are used by hk_message_{in,out} arguments #define ENCRYPTED_PGP 1 #define ENCRYPTED_OTR 2 #include #ifdef MODULES_ENABLE #include // Core hooks #define HOOK_PRE_MESSAGE_IN "hook-pre-message-in" #define HOOK_POST_MESSAGE_IN "hook-post-message-in" #define HOOK_MESSAGE_OUT "hook-message-out" #define HOOK_STATUS_CHANGE "hook-status-change" #define HOOK_MY_STATUS_CHANGE "hook-my-status-change" #define HOOK_POST_CONNECT "hook-post-connect" #define HOOK_PRE_DISCONNECT "hook-pre-disconnect" #define HOOK_UNREAD_LIST_CHANGE "hook-unread-list-change" #define HOOK_SUBSCRIPTION "hook-subscription" typedef enum { HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS = 0, HOOK_HANDLER_RESULT_NO_MORE_HANDLER, HOOK_HANDLER_RESULT_NO_MORE_HANDLER_DROP_DATA, } hk_handler_result; typedef struct { const char *name; const char *value; } hk_arg_t; typedef guint (*hk_handler_t) (const gchar *hookname, hk_arg_t *args, gpointer userdata); guint hk_add_handler(hk_handler_t handler, const gchar *hookname, gint priority, gpointer userdata); void hk_del_handler(const gchar *hookname, guint hid); guint hk_run_handlers(const gchar *hookname, hk_arg_t *args); #endif void hk_message_in(const char *bjid, const char *resname, time_t timestamp, const char *msg, LmMessageSubType type, guint encrypted); void hk_message_out(const char *bjid, const char *nickname, time_t timestamp, const char *msg, guint encrypted, gpointer xep184); void hk_statuschange(const char *bjid, const char *resname, gchar prio, time_t timestamp, enum imstatus status, char const *status_msg); void hk_mystatuschange(time_t timestamp, enum imstatus old_status, enum imstatus new_status, const char *msg); void hk_postconnect(void); void hk_predisconnect(void); void hk_unread_list_change(guint unread_count, guint attention_count, guint muc_unread, guint muc_attention); guint hk_subscription(LmMessageSubType mstype, const gchar *bjid, const gchar *msg); void hk_ext_cmd_init(const char *command); void hk_ext_cmd(const char *bjid, guchar type, guchar info, const char *data); #endif /* __MCABBER_HOOKS_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/logprint.h000066400000000000000000000014001216603513500165640ustar00rootroot00000000000000#ifndef __MCABBER_LOGPRINT_H__ #define __MCABBER_LOGPRINT_H__ 1 #include // Flags for scr_LogPrint() #define LPRINT_NORMAL 1U // Display in log window #define LPRINT_LOG 2U // Log to file (if enabled) #define LPRINT_DEBUG 4U // Debug message (log if enabled) #define LPRINT_NOTUTF8 8U // Do not convert from UTF-8 to locale // For convenience... #define LPRINT_LOGNORM (LPRINT_NORMAL|LPRINT_LOG) void scr_print_logwindow(const char *string); void scr_log_print(unsigned int flag, const char *fmt, ...) G_GNUC_PRINTF (2, 3); void scr_do_update(void); // For backward compatibility: #define scr_LogPrint scr_log_print #endif /* __MCABBER_LOGPRINT_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/main.c000066400000000000000000000316431216603513500156610ustar00rootroot00000000000000/* * main.c * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #include #include #include #include #include #include "caps.h" #include "screen.h" #include "settings.h" #include "roster.h" #include "commands.h" #include "histolog.h" #include "hooks.h" #include "utils.h" #include "pgp.h" #include "otr.h" #include "xmpp.h" #include "help.h" #include "events.h" #ifndef MODULES_ENABLE # include "fifo.h" #endif #ifdef MODULES_ENABLE # include "compl.h" # include "modules.h" #endif #ifdef ENABLE_HGCSET # include "hgcset.h" #endif #ifndef WAIT_ANY # define WAIT_ANY -1 #endif static unsigned int terminate_ui; GMainContext *main_context; static struct termios *backup_termios; char *mcabber_version(void) { char *ver; #ifdef HGCSET ver = g_strdup_printf("%s (%s)", PACKAGE_VERSION, HGCSET); #else ver = g_strdup(PACKAGE_VERSION); #endif return ver; } static void mcabber_terminate(const char *msg) { #ifndef MODULES_ENABLE fifo_deinit(); #endif xmpp_disconnect(); scr_terminate_curses(); // Restore term settings, if needed. if (backup_termios) tcsetattr(fileno(stdin), TCSAFLUSH, backup_termios); if (msg) fprintf(stderr, "%s\n", msg); printf("Bye!\n"); exit(EXIT_SUCCESS); } void sig_handler(int signum) { if (signum == SIGCHLD) { int status; pid_t pid; do { pid = waitpid (WAIT_ANY, &status, WNOHANG); // Check the exit status value if 'eventcmd_checkstatus' is set if (settings_opt_get_int("eventcmd_checkstatus")) { if (pid > 0) { // exit status 2 -> beep if (WIFEXITED(status) && WEXITSTATUS(status) == 2) { scr_beep(); } } } } while (pid > 0); signal(SIGCHLD, sig_handler); } else if (signum == SIGTERM) { mcabber_terminate("Killed by SIGTERM"); } else if (signum == SIGINT) { mcabber_terminate("Killed by SIGINT"); #ifdef USE_SIGWINCH } else if (signum == SIGWINCH) { if (scr_curses_status()) ungetch(KEY_RESIZE); #endif } else { scr_LogPrint(LPRINT_LOGNORM, "Caught signal: %d", signum); } } // ask_password(what) // Return the password, or NULL. // The string must be freed after use. static char *ask_password(const char *what) { char *password, *p; size_t passsize = 128; struct termios orig, new; password = g_new0(char, passsize); /* Turn echoing off and fail if we can't. */ if (tcgetattr(fileno(stdin), &orig) != 0) return NULL; backup_termios = &orig; new = orig; new.c_lflag &= ~ECHO; if (tcsetattr(fileno(stdin), TCSAFLUSH, &new) != 0) return NULL; /* Read the password. */ printf("Please enter %s: ", what); if (fgets(password, passsize, stdin) == NULL) return NULL; /* Restore terminal. */ tcsetattr(fileno(stdin), TCSAFLUSH, &orig); printf("\n"); backup_termios = NULL; for (p = (char*)password; *p; p++) ; for ( ; p > (char*)password ; p--) if (*p == '\n' || *p == '\r') *p = 0; return password; } static void credits(void) { const char *v_fmt = "MCabber %s -- Email: mcabber [at] lilotux [dot] net\n"; char *v = mcabber_version(); printf(v_fmt, v); scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, v_fmt, v); g_free(v); } static void compile_options(void) { puts("Installation data directory: " DATA_DIR "\n"); #ifdef HAVE_UNICODE puts("Compiled with unicode support."); #endif #ifdef MODULES_ENABLE printf("Compiled with modules support. (API %s:%d-%d)\n", MCABBER_BRANCH, MCABBER_API_MIN, MCABBER_API_VERSION); # ifdef PKGLIB_DIR puts("Modules directory: " PKGLIB_DIR); # endif #endif #ifdef HAVE_GPGME puts("Compiled with GPG support."); #endif #ifdef HAVE_LIBOTR puts("Compiled with OTR support."); #endif #ifdef WITH_ENCHANT puts("Compiled with Enchant support."); #endif #ifdef WITH_ASPELL puts("Compiled with Aspell support."); #endif #ifdef ENABLE_DEBUG puts("Compiled with debugging support."); #endif } static void main_init_pgp(void) { #ifdef HAVE_GPGME const char *pk, *pp; char *typed_passwd = NULL; char *p; bool pgp_invalid = FALSE; bool pgp_agent; int retries; p = getenv("GPG_AGENT_INFO"); pgp_agent = (p && strchr(p, ':')); pk = settings_opt_get("pgp_private_key"); pp = settings_opt_get("pgp_passphrase"); if (settings_opt_get("pgp_passphrase_retries")) retries = settings_opt_get_int("pgp_passphrase_retries"); else retries = 2; if (!pk) { scr_LogPrint(LPRINT_LOGNORM, "WARNING: unknown PGP private key"); pgp_invalid = TRUE; } else if (!(pp || pgp_agent)) { // Request PGP passphrase pp = typed_passwd = ask_password("your PGP passphrase"); } gpg_init(pk, pp); // Erase password from the settings array if (pp) { memset((char*)pp, 0, strlen(pp)); if (typed_passwd) g_free(typed_passwd); else settings_set(SETTINGS_TYPE_OPTION, "pgp_passphrase", NULL); } if (!pgp_agent && pk && pp && gpg_test_passphrase()) { // Let's check the pasphrase int i; for (i = 1; retries < 0 || i <= retries; i++) { typed_passwd = ask_password("your PGP passphrase"); // Ask again... if (typed_passwd) { gpg_set_passphrase(typed_passwd); memset(typed_passwd, 0, strlen(typed_passwd)); g_free(typed_passwd); } if (!gpg_test_passphrase()) break; // Ok } if (i > retries) pgp_invalid = TRUE; } if (pgp_invalid) scr_LogPrint(LPRINT_LOGNORM, "WARNING: PGP key/pass invalid"); #else /* not HAVE_GPGME */ scr_LogPrint(LPRINT_LOGNORM, "WARNING: not compiled with PGP support"); #endif /* HAVE_GPGME */ } void mcabber_set_terminate_ui(void) { terminate_ui = TRUE; } typedef struct { GSource source; GPollFD pollfd; } mcabber_source_t; static gboolean mcabber_source_prepare(GSource *source, gint *timeout) { *timeout = -1; return FALSE; } static gboolean mcabber_source_check(GSource *source) { mcabber_source_t *mc_source = (mcabber_source_t *) source; gushort revents = mc_source->pollfd.revents; if (revents) return TRUE; return FALSE; } static gboolean keyboard_activity(void) { keycode kcode; if (terminate_ui) { return FALSE; } scr_do_update(); scr_getch(&kcode); while (kcode.value != ERR) { scr_process_key(kcode); scr_getch(&kcode); } scr_check_auto_away(FALSE); return TRUE; } static gboolean mcabber_source_dispatch(GSource *source, GSourceFunc callback, gpointer udata) { return keyboard_activity(); } static GSourceFuncs mcabber_source_funcs = { mcabber_source_prepare, mcabber_source_check, mcabber_source_dispatch, NULL, NULL, NULL }; int main(int argc, char **argv) { char *configFile = NULL; const char *optstring; int optval, optval2; int ret; credits(); signal(SIGTERM, sig_handler); signal(SIGINT, sig_handler); signal(SIGCHLD, sig_handler); #ifdef USE_SIGWINCH signal(SIGWINCH, sig_handler); #endif signal(SIGPIPE, SIG_IGN); /* Parse command line options */ while (1) { int c = getopt(argc, argv, "hVf:"); if (c == -1) { break; } else switch (c) { case 'h': case '?': printf("Usage: %s [-h|-V|-f mcabberrc_file]\n\n", argv[0]); return (c == 'h' ? 0 : -1); case 'V': compile_options(); return 0; case 'f': configFile = g_strdup(optarg); break; } } if (optind < argc) { fprintf(stderr, "Usage: %s [-h|-V|-f mcabberrc_file]\n\n", argv[0]); return -1; } /* Initialize command system, roster and default key bindings */ compl_init_system(); cmd_init(); roster_init(); settings_init(); scr_init_bindings(); caps_init(); #ifdef MODULES_ENABLE modules_init(); #endif /* Initialize charset */ scr_init_locale_charset(); ut_init_debug(); help_init(); /* Parsing config file... */ ret = cfg_read_file(configFile, TRUE); /* free() configFile if it has been allocated during options parsing */ g_free(configFile); /* Leave if there was an error in the config. file */ if (ret == -2) exit(EXIT_FAILURE); /* Display configuration settings */ { const char *p; if ((p = settings_opt_get("server")) != NULL) scr_log_print(LPRINT_NORMAL, "Server: %s", p); if ((p = settings_opt_get("jid")) != NULL) { scr_log_print(LPRINT_NORMAL, "User JID: %s", p); } else if (settings_opt_get("username")) { /* TODO: remove after 0.10.2/3 */ scr_log_print(LPRINT_NORMAL, "** ERROR: The JID is missing, but " "the variable 'username' is defined in your " "configuration file.\n" "** Please update your configuration file and set " "the 'jid' variable."); } if (settings_opt_get("ssl_verify")) { // Deprecated option /* TODO: remove after 0.10.2/3 */ scr_log_print(LPRINT_NORMAL, "** ERROR: The option ssl_verify is deprecated.\n" "** Please update your configuration file and use " "the 'ssl_ignore_checks' variable."); } } /* If no password is stored, we ask for it before entering ncurses mode -- unless the username is unknown. */ if (settings_opt_get("jid") && !settings_opt_get("password")) { char *pwd = ask_password("your Jabber password"); settings_set(SETTINGS_TYPE_OPTION, "password", pwd); g_free(pwd); } /* Initialize PGP system We do it before ncurses initialization because we may need to request a passphrase. */ if (settings_opt_get_int("pgp")) main_init_pgp(); /* Initialize N-Curses */ scr_LogPrint(LPRINT_DEBUG, "Initializing N-Curses..."); scr_init_curses(); scr_draw_main_window(TRUE); optval = (settings_opt_get_int("logging") > 0); optval2 = (settings_opt_get_int("load_logs") > 0); if (optval || optval2) hlog_enable(optval, settings_opt_get("logging_dir"), optval2); #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) /* Initialize spelling */ if (settings_opt_get_int("spell_enable")) { spellcheck_init(); } #endif optstring = settings_opt_get("events_command"); if (optstring) hk_ext_cmd_init(optstring); optstring = settings_opt_get("roster_display_filter"); if (optstring) scr_roster_display(optstring); // Empty filter isn't allowed... if (!buddylist_get_filter()) scr_roster_display("*"); chatstates_disabled = settings_opt_get_int("disable_chatstates"); #ifndef MODULES_ENABLE /* Initialize FIFO named pipe */ fifo_init(); #endif /* Load previous roster state */ hlog_load_state(); main_context = g_main_context_default(); if (ret < 0) { scr_LogPrint(LPRINT_NORMAL, "No configuration file has been found."); scr_show_buddy_window(); } else { /* Connection */ if (xmpp_connect()) scr_show_buddy_window(); } // Initial drawing scr_draw_roster(); scr_do_update(); { // add keypress processing source GSource *mc_source = g_source_new(&mcabber_source_funcs, sizeof(mcabber_source_t)); GPollFD *mc_pollfd = &(((mcabber_source_t *)mc_source)->pollfd); mc_pollfd->fd = STDIN_FILENO; mc_pollfd->events = POLLIN|POLLERR|POLLPRI; mc_pollfd->revents = 0; g_source_add_poll(mc_source, mc_pollfd); g_source_attach(mc_source, main_context); scr_LogPrint(LPRINT_DEBUG, "Entering into main loop..."); while(!terminate_ui) { if (g_main_context_iteration(main_context, TRUE) == FALSE) keyboard_activity(); if (update_roster) scr_draw_roster(); scr_do_update(); } g_source_destroy(mc_source); g_source_unref(mc_source); } evs_deinit(); #ifdef MODULES_ENABLE modules_deinit(); #endif #ifndef MODULES_ENABLE fifo_deinit(); #endif #ifdef HAVE_LIBOTR otr_terminate(); #endif xmpp_disconnect(); #ifdef HAVE_GPGME gpg_terminate(); #endif #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) /* Deinitialize spelling */ if (settings_opt_get_int("spell_enable")) spellcheck_deinit(); #endif scr_terminate_curses(); /* Save pending message state */ hlog_save_state(); caps_free(); printf("\n\nThanks for using mcabber!\n"); return 0; } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/main.h000066400000000000000000000003711216603513500156600ustar00rootroot00000000000000#ifndef __MCABBER_MAIN_H__ #define __MCABBER_MAIN_H__ 1 extern GMainContext *main_context; void mcabber_set_terminate_ui(void); char *mcabber_version(void); #endif /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/modules.c000066400000000000000000000311731216603513500164030ustar00rootroot00000000000000/* * modules.c -- Modules handling * * Copyright (C) 2010 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include "settings.h" #include "config.h" #include "modules.h" #include "screen.h" #include "utils.h" // Registry of loaded modules GSList *loaded_modules = NULL; const gchar *mcabber_branch = MCABBER_BRANCH; const guint mcabber_api_version = MCABBER_API_VERSION; static gint module_list_comparator(gconstpointer arg1, gconstpointer arg2) { const loaded_module_t *module = arg1; const char *name = arg2; return g_strcmp0(module->name, name); } // module_load(modulename, manual, force) // Tries to load specified module and any modules, that this module // depends on. Returns NULL on success or constant error string in a // case of error. Error message not necessarily indicates error. const gchar *module_load(const gchar *arg, gboolean manual, gboolean force) { GModule *mod; module_info_t *info; if (!arg || !*arg) return "Missing module name"; { // Check if module is already loaded GSList *lmod = g_slist_find_custom(loaded_modules, arg, module_list_comparator); if (lmod) { loaded_module_t *module = lmod->data; if (manual) { if (!module->locked) { module->locked = TRUE; module->refcount += 1; return force ? NULL : "Module is already automatically loaded, " "marked as manually loaded"; } else return force ? NULL : "Module is already loaded"; } else { module->refcount += 1; return NULL; } } } { // Load module gchar *mdir = expand_filename(settings_opt_get("modules_dir")); gchar *path = g_module_build_path(mdir ? mdir : PKGLIB_DIR, arg); g_free(mdir); mod = g_module_open(path, G_MODULE_BIND_LAZY); g_free(path); if (!mod) return g_module_error(); } { // Obtain module information structures list gchar *varname = g_strdup_printf("info_%s", arg); gpointer var = NULL; // convert to a valid symbol name g_strcanon(varname, "abcdefghijklmnopqrstuvwxyz0123456789", '_'); if (!g_module_symbol(mod, varname, &var)) { if (!force) { g_free(varname); if(!g_module_close(mod)) scr_LogPrint(LPRINT_LOGNORM, "Error closing module: %s.", g_module_error()); return "Module provides no information structure"; } scr_LogPrint(LPRINT_LOGNORM, "Forced to ignore error: " "Module provides no information structure."); } g_free(varname); info = var; } // Find appropriate info struct if (info) { while (info) { if (!info->branch || !*(info->branch)) { scr_LogPrint(LPRINT_DEBUG, "No branch name, " "skipping info chunk."); } else if (strcmp(info->branch, mcabber_branch)) { scr_LogPrint(LPRINT_DEBUG, "Unhandled branch %s, " "skipping info chunk.", info->branch); } else if (info->api > mcabber_api_version || info->api < MCABBER_API_MIN) { // XXX force? if(!g_module_close(mod)) scr_LogPrint(LPRINT_LOGNORM, "Error closing module: %s.", g_module_error()); return "Incompatible mcabber API version"; } else break; info = info->next; } if (!info) { // XXX force? if(!g_module_close(mod)) scr_LogPrint(LPRINT_LOGNORM, "Error closing module: %s.", g_module_error()); return "No supported mcabber branch description found"; } } // Load dependencies if (info && info->requires) { const gchar **dep; GSList *deps = NULL; for (dep = info->requires; *dep; ++dep) { const gchar *err = module_load(*dep, FALSE, FALSE); if (err) { GSList *mel; scr_LogPrint(LPRINT_LOGNORM, "Error loading dependency module %s: %s.", *dep, err); // Unload already loaded dependencies for (mel = deps; mel; mel = mel->next) { gchar *ldmname = mel->data; err = module_unload(ldmname, FALSE, FALSE); scr_LogPrint(LPRINT_LOGNORM, "Error unloading dependency module %s: %s.", ldmname, err); g_free(ldmname); } g_slist_free(deps); // Unload module if (!g_module_close(mod)) scr_LogPrint(LPRINT_LOGNORM, "Error unloading module %s: %s.", arg, g_module_error()); return "Dependency problems"; } deps = g_slist_append(deps, (gpointer) *dep); } g_slist_free(deps); } { // Register module loaded_module_t *module = g_new(loaded_module_t, 1); module->refcount = 1; module->locked = manual; module->name = g_strdup(arg); module->module = mod; module->info = info; loaded_modules = g_slist_prepend(loaded_modules, module); } // Run initialization routine if (info && info->init) info->init(); // XXX Run hk_loaded_module hook (and move this line there) scr_LogPrint(LPRINT_LOGNORM, "Loaded module %s.", arg); return NULL; } // module_unload(modulename, manual, force) // Unload specified module and any automatically loaded modules // that are no more required. const gchar *module_unload(const gchar *arg, gboolean manual, gboolean force) { GSList *lmod; loaded_module_t *module; module_info_t *info; if (!arg || !*arg) return "Missing module name"; lmod = g_slist_find_custom(loaded_modules, arg, module_list_comparator); if (!lmod) return "Module not found"; module = lmod->data; // Check if user can unload this module if (manual) { if (!module->locked) { if (force) scr_LogPrint(LPRINT_LOGNORM, "Forced to ignore error: " "Manually unloading automatically loaded module."); else return "Module is not loaded manually"; } module->locked = FALSE; } // Check refcount module->refcount -= 1; if (module->refcount > 0) { if (force) scr_LogPrint(LPRINT_LOGNORM, "Forced to ignore error: " "Refcount is not zero (%u).", module->refcount); else return manual ? "Module is required by some other modules" : NULL; } info = module->info; // Run uninitialization routine if (info && info->uninit) info->uninit(); // Unload dependencies if (info && info->requires) { const gchar **dep; for (dep = info->requires; *dep; ++dep) { const gchar *err = module_unload(*dep, FALSE, FALSE); if (err) // XXX scr_LogPrint(LPRINT_LOGNORM, "Error unloading automatically loaded module %s: %s.", *dep, err); } } // XXX Prevent uninitialization routine and dep unloading to be performed again module->info = NULL; // Unload module if (!g_module_close(module->module)) return g_module_error(); // XXX destroy structure? // Destroy structure loaded_modules = g_slist_delete_link(loaded_modules, lmod); // Output this here, as arg may point to module->name scr_LogPrint(LPRINT_LOGNORM, "Unloaded module %s.", module->name); g_free(module->name); g_free(module); return NULL; } // module_list_print(void) // Prints into status buffer and log list of the currently loaded // modules. void module_list_print(void) { GSList *mel; gsize maxlen = 0; gchar *format; GString *message; guint module_count = 0; if (!loaded_modules) { scr_LogPrint(LPRINT_LOGNORM, "No modules loaded."); return; } // Count maximum module name length for (mel = loaded_modules; mel; mel = mel -> next) { loaded_module_t *module = mel->data; gsize len = strlen(module->name); if (len > maxlen) maxlen = len; module_count++; } // Create format string format = g_strdup_printf("%%-%us %%2u (%%c)", (unsigned)maxlen); // Fill the message to be printed message = g_string_new("Loaded modules:\n"); for (mel = loaded_modules; mel; mel = mel -> next) { loaded_module_t *module = mel->data; g_string_append_printf(message, format, module->name, module->refcount, module->locked ? 'M' : 'A'); if (module->info) { module_info_t *info = module->info; // Module version if (info->version) { g_string_append(message, " version: "); g_string_append(message, info->version); } // Module dependencies if (info->requires && *(info->requires)) { const gchar **dep; g_string_append(message, " depends: "); for (dep = info->requires; *dep; ++dep) { g_string_append(message, *dep); g_string_append(message, ", "); } // Chop extra ", " g_string_truncate(message, message->len - 2); } } g_string_append_c(message, '\n'); } // Chop extra "\n" g_string_truncate(message, message->len - 1); scr_LogPrint(LPRINT_NORMAL, "%s", message->str); if (module_count + 1 > scr_getlogwinheight()) { scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } g_string_free(message, TRUE); g_free(format); } // module_info_print(name) // Prints info about specific module void module_info_print(const gchar *name) { GSList *lmod; loaded_module_t *module; module_info_t *info; if (!name || !name[0]) { scr_LogPrint(LPRINT_NORMAL, "Please specify a module name."); return; } lmod = g_slist_find_custom(loaded_modules, name, module_list_comparator); if (!lmod) { scr_LogPrint(LPRINT_NORMAL, "Module %s not found.", name); return; } module = lmod->data; info = module->info; scr_LogPrint(LPRINT_NORMAL, "Module %s", module->name); scr_LogPrint(LPRINT_NORMAL, " Location: %s", g_module_name(module->module)); scr_LogPrint(LPRINT_NORMAL, " Loaded: %s", module->locked ? "Manually" : "Automatically"); scr_LogPrint(LPRINT_NORMAL, " Reference count: %u", module->refcount); if (info) { if (info->version) scr_LogPrint(LPRINT_NORMAL, " Version: %s", info->version); scr_LogPrint(LPRINT_NORMAL, " API: %s:%u", info->branch, info->api); if (info->requires && *(info->requires)) { GString *message = g_string_new("Depends on: "); const gchar **dep; for (dep = info->requires; *dep; ++dep) { g_string_append(message, *dep); g_string_append(message, ", "); } // Chop last ", " g_string_truncate(message, message->len - 2); scr_LogPrint(LPRINT_NORMAL, " %s", message->str); g_string_free(message, TRUE); } if (info->description) scr_LogPrint(LPRINT_NORMAL, " Description: %s", info->description); } scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } // modules_init() // Initializes module system. void modules_init(void) { } // modules_deinit() // Unloads all the modules. void modules_deinit(void) { GSList *mel; // We need only manually loaded modules for (mel = loaded_modules; mel; mel = mel->next) { loaded_module_t *module = mel->data; if (module->locked) break; } while (mel) { loaded_module_t *module = mel->data; const gchar *err; // Find next manually loaded module to treat for (mel = mel->next; mel; mel = mel->next) { loaded_module_t *module = mel->data; if (module->locked) break; } // Unload module scr_LogPrint(LPRINT_LOGNORM, "Unloading module %s.", module->name); err = module_unload(module->name, TRUE, FALSE); if (err) scr_LogPrint(LPRINT_LOGNORM, "* Module unloading failed: %s.", err); } } /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ mcabber-0.10.2/mcabber/modules.h000066400000000000000000000047561216603513500164170ustar00rootroot00000000000000#ifndef __MCABBER_MODULES_H__ #define __MCABBER_MODULES_H__ 1 #include #include #include // MCABBER_BRANCH, MCABBER_API_VERSION // Module loading process looks like this: // check, if module is loaded // load module (+ run g_module_check_init) // check _info variable // check version // load dependencies // run initialization callback // module loaded // ... // run uninitialization callback // unload module (+ run g_module_unload) // unload dependencies // module unloaded typedef void (*module_init_t)(void); typedef void (*module_uninit_t)(void); // Structure, that module should provide typedef struct module_info_struct module_info_t; struct module_info_struct { const gchar *branch; // Contains mcabber branch name, that this module is written to work with guint api; // Mcabber branch api version, that module is supposed to work with const gchar *version; // Module version string. Optional. const gchar *description; // Module description. Can contain multiple lines. const gchar **requires; // NULL-terminated list of module names, that must be loaded before this module module_init_t init; // Initialization callback to be called after all dependencies will be loaded module_uninit_t uninit; // Uninitialization callback to be called before module unloading module_info_t *next; // If module supports multiple branches, it can provide several branch structs. }; const gchar *module_load(const gchar *name, gboolean manual, gboolean force); const gchar *module_unload(const gchar *name, gboolean manual, gboolean force); // Grey zone (these symbols are semi-private and are exposed only for compatibility modules) // Information about loaded module typedef struct { guint refcount; // Reference count gboolean locked; // If true, one of references is manual gchar *name; // Module name GModule *module; // Module object module_info_t *info; // Module information struct. May be NULL! } loaded_module_t; // Registry of loaded modules extern GSList *loaded_modules; // Should be considered mcabber private and not a part of api void module_list_print(void); void module_info_print(const gchar *name); void modules_init(void); void modules_deinit(void); #endif /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/nohtml.c000066400000000000000000000100201216603513500162200ustar00rootroot00000000000000/* * nohtml.c -- (X)HTML helper functions * * Copyright (C) 2008,2009 Mikael Berthe * Some portions come from the jabberd project, see below. * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * * Some parts come from libjabber/str.c: * Copyright (c) 1999-2002 Jabber.com, Inc. All Rights Reserved. Contact * information for Jabber.com, Inc. is available at http://www.jabber.com/. * Portions Copyright (c) 1998-1999 Jeremie Miller. */ #include #include #include /* html_strip(htmlbuf) * Remove html entities from htmlbuf and try to convert it to plain text. * The caller must g_free the string after use. * Code mostly derived from strunescape(), in libjabber. */ char *html_strip(const char *htmlbuf) { int i, j=0; char *nohtml; if (!htmlbuf) return(NULL); nohtml = g_strdup(htmlbuf); if (!strchr(htmlbuf, '&') && !strchr(htmlbuf, '<')) return(nohtml); for (i = 0; i < (int)strlen(htmlbuf); i++) { if (htmlbuf[i] == '&') { if (!strncmp(&htmlbuf[i],"&",5)) { nohtml[j] = '&'; i += 4; } else if (!strncmp(&htmlbuf[i],""", 6)) { nohtml[j] = '\"'; i += 5; } else if (!strncmp(&htmlbuf[i],"'", 6)) { nohtml[j] = '\''; i += 5; } else if (!strncmp(&htmlbuf[i],"<", 4)) { nohtml[j] = '<'; i += 3; } else if (!strncmp(&htmlbuf[i],">", 4)) { nohtml[j] = '>'; i += 3; } } else if (!strncmp(&htmlbuf[i],"
", 4) || !strncmp(&htmlbuf[i],"
", 5)) { nohtml[j] = '\n'; i += (htmlbuf[i+3] == '/' ? 4 : 3); } else if (htmlbuf[i] == '<') { /* Let's strip all unknown tags */ j--; while (htmlbuf[++i] != '>'); } else nohtml[j] = htmlbuf[i]; j++; } nohtml[j] = '\0'; return nohtml; } /* html_escape(text) * Add (x)html entities to the text. * The caller must g_free the string after use. * Code mostly derived from strescape(), in libjabber. */ char *html_escape(const char *text) { int i, j; int oldlen, newlen; char *html; if (!text) return(NULL); oldlen = newlen = strlen(text); for (i = 0; i < oldlen; i++) { switch(text[i]) { case '&': newlen += 5; break; case '\'': newlen += 6; break; case '\"': newlen += 6; break; case '<': newlen += 4; break; case '>': newlen += 4; break; case '\n': newlen += 5; } } if (oldlen == newlen) return g_strdup(text); html = g_new0(char, newlen+1); for (i = j = 0; i < oldlen; i++) { switch(text[i]) { case '&': memcpy(&html[j], "&", 5); j += 5; break; case '\'': memcpy(&html[j], "'", 6); j += 6; break; case '\"': memcpy(&html[j], """, 6); j += 6; break; case '<': memcpy(&html[j], "<", 4); j += 4; break; case '>': memcpy(&html[j], ">", 4); j += 4; break; case '\n': memcpy(&html[j], "
", 5); j += 5; break; default: html[j++] = text[i]; } } return html; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/nohtml.h000066400000000000000000000003631216603513500162360ustar00rootroot00000000000000#ifndef __MCABBER_NOHTML_H__ #define __MCABBER_NOHTML_H__ 1 char *html_strip(const char *buf); char *html_escape(const char *text); #endif /* __MCABBER_NOHTML_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/otr.c000066400000000000000000000600351216603513500155360ustar00rootroot00000000000000/* * otr.c -- Off-The-Record Messaging for mcabber * * Copyright (C) 2007-2009 Frank Zschockelt * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #ifdef HAVE_LIBOTR #include "hbuf.h" #include "logprint.h" #include "nohtml.h" #include "otr.h" #include "roster.h" #include "screen.h" #include "settings.h" #include "utils.h" #include "xmpp.h" #define OTR_PROTOCOL_NAME "jabber" static OtrlUserState userstate = NULL; static char *account = NULL; static char *keyfile = NULL; static char *fprfile = NULL; static int otr_is_enabled = FALSE; static OtrlPolicy cb_policy (void *opdata, ConnContext *ctx); static void cb_create_privkey (void *opdata, const char *accountname, const char *protocol); static int cb_is_logged_in (void *opdata, const char *accountname, const char *protocol, const char *recipient); static void cb_inject_message (void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message); static void cb_notify (void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary); static int cb_display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg); static void cb_update_context_list(void *opdata); static const char *cb_protocol_name (void *opdata, const char *protocol); static void cb_protocol_name_free (void *opdata, const char *protocol_name); static void cb_new_fingerprint (void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]); static void cb_write_fingerprints (void *opdata); static void cb_gone_secure (void *opdata, ConnContext *context); static void cb_gone_insecure (void *opdata, ConnContext *context); static void cb_still_secure (void *opdata, ConnContext *context, int is_reply); static void cb_log_message (void *opdata, const char *message); static int cb_max_message_size (void *opdata, ConnContext *context); static OtrlMessageAppOps ops = { cb_policy, cb_create_privkey, cb_is_logged_in, cb_inject_message, cb_notify, cb_display_otr_message, cb_update_context_list, cb_protocol_name, cb_protocol_name_free, cb_new_fingerprint, cb_write_fingerprints, cb_gone_secure, cb_gone_insecure, cb_still_secure, cb_log_message, cb_max_message_size, NULL, /*account_name*/ NULL /*account_name_free*/ }; static void otr_message_disconnect(ConnContext *ctx); static ConnContext *otr_get_context(const char *buddy); static void otr_startstop(const char *buddy, int start); static void otr_handle_smp_tlvs(OtrlTLV *tlvs, ConnContext *ctx); static char *otr_get_dir(void); void otr_init(const char *fjid) { char *root; if (userstate) // already initialised return; otr_is_enabled = !!settings_opt_get_int("otr"); if (!otr_is_enabled) return; OTRL_INIT; userstate = otrl_userstate_create(); root = otr_get_dir(); account = jidtodisp(fjid); keyfile = g_strdup_printf("%s%s.key", root, account); fprfile = g_strdup_printf("%s%s.fpr", root, account); g_free(root); if (otrl_privkey_read(userstate, keyfile)){ scr_LogPrint(LPRINT_LOGNORM, "Could not read OTR key from %s", keyfile); cb_create_privkey(NULL, account, OTR_PROTOCOL_NAME); } if (otrl_privkey_read_fingerprints(userstate, fprfile, NULL, NULL)){ scr_LogPrint(LPRINT_LOGNORM, "Could not read OTR fingerprints from %s", fprfile); } } void otr_terminate(void) { ConnContext *ctx; if (!otr_is_enabled) return; for (ctx = userstate->context_root; ctx; ctx = ctx->next) if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) otr_message_disconnect(ctx); g_free(account); account = NULL; /* XXX This #ifdef is a quick workaround: when mcabber * is linked to both gnutls and libotr, libgcrypt will * segfault when we call otrl_userstate_free(). * This is reported to be a bug in libgcrypt :-/ * Mikael */ #if defined(HAVE_GNUTLS) && !defined(HAVE_OPENSSL) // TODO: broken now if (!settings_opt_get_int("ssl")) #endif otrl_userstate_free(userstate); userstate = NULL; g_free(keyfile); keyfile = NULL; } static char *otr_get_dir(void) { const char *configured_dir = settings_opt_get("otr_dir"); if (configured_dir && *configured_dir) { char *xp_conf_dir; int l; xp_conf_dir = expand_filename(configured_dir); // The path must be slash-terminated l = strlen(xp_conf_dir); if (xp_conf_dir[l-1] != '/') { char *xp_conf_dir_tmp = xp_conf_dir; xp_conf_dir = g_strdup_printf("%s/", xp_conf_dir_tmp); g_free(xp_conf_dir_tmp); } return xp_conf_dir; } else { return expand_filename("~/.mcabber/otr/"); } } static ConnContext *otr_get_context(const char *buddy) { int null = 0; ConnContext *ctx; char *lowcasebuddy = g_strdup(buddy); mc_strtolower(lowcasebuddy); ctx = otrl_context_find(userstate, lowcasebuddy, account, OTR_PROTOCOL_NAME, 1, &null, NULL, NULL); g_free(lowcasebuddy); return ctx; } static void otr_message_disconnect(ConnContext *ctx) { if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) cb_gone_insecure(NULL, ctx); otrl_message_disconnect(userstate, &ops, NULL, ctx->accountname, ctx->protocol, ctx->username); } static void otr_startstop(const char *buddy, int start) { char *msg = NULL; ConnContext *ctx = otr_get_context(buddy); if (!userstate || !ctx) return; if (start && ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) otr_message_disconnect(ctx); if (start) { OtrlPolicy policy = cb_policy(NULL, ctx); if (policy == plain) { scr_LogPrint(LPRINT_LOGNORM, "The OTR policy for this user is set to" " plain. You have to change it first."); return; } msg = otrl_proto_default_query_msg(ctx->accountname, policy); cb_inject_message(NULL, ctx->accountname, ctx->protocol, ctx->username, msg); free (msg); } else otr_message_disconnect(ctx); } void otr_establish(const char *buddy) { otr_startstop(buddy, 1); } void otr_disconnect(const char *buddy) { otr_startstop(buddy, 0); } void otr_fingerprint(const char *buddy, const char *trust) { char fpr[45], *tr; ConnContext *ctx = otr_get_context(buddy); if (!userstate || !ctx) return; if (!ctx->active_fingerprint || !ctx->active_fingerprint->fingerprint) { scr_LogPrint(LPRINT_LOGNORM, "No active fingerprint - start OTR for this buddy first."); return; } otrl_privkey_hash_to_human(fpr, ctx->active_fingerprint->fingerprint); if (trust) { if (strcmp(fpr, trust) == 0) otrl_context_set_trust(ctx->active_fingerprint, "trust"); else otrl_context_set_trust(ctx->active_fingerprint, NULL); } tr = ctx->active_fingerprint->trust; scr_LogPrint(LPRINT_LOGNORM, "%s [%44s]: %s", ctx->username, fpr, tr && *tr ? "trusted" : "untrusted"); cb_write_fingerprints(NULL); } static void otr_handle_smp_tlvs(OtrlTLV *tlvs, ConnContext *ctx) { OtrlTLV *tlv = NULL; char *sbuf = NULL; NextExpectedSMP nextMsg = ctx->smstate->nextExpected; tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1); if (tlv) { if (nextMsg != OTRL_SMP_EXPECT1) otr_smp_abort(ctx->username); else { sbuf = g_strdup_printf("OTR: Received SMP Initiation. " "Answer with /otr smpr %s $secret", ctx->username); } } tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP2); if (tlv) { if (nextMsg != OTRL_SMP_EXPECT2) otr_smp_abort(ctx->username); else { sbuf = g_strdup("OTR: Received SMP Response."); /* If we received TLV2, we will send TLV3 and expect TLV4 */ ctx->smstate->nextExpected = OTRL_SMP_EXPECT4; } } tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP3); if (tlv) { if (nextMsg != OTRL_SMP_EXPECT3) otr_smp_abort(ctx->username); else { /* If we received TLV3, we will send TLV4 * We will not expect more messages, so prepare for next SMP */ ctx->smstate->nextExpected = OTRL_SMP_EXPECT1; /* Report result to user */ if (ctx->active_fingerprint && ctx->active_fingerprint->trust && *ctx->active_fingerprint->trust != '\0') sbuf = g_strdup("OTR: SMP succeeded"); else sbuf = g_strdup("OTR: SMP failed"); } } tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP4); if (tlv) { if (nextMsg != OTRL_SMP_EXPECT4) otr_smp_abort(ctx->username); else { /* We will not expect more messages, so prepare for next SMP */ ctx->smstate->nextExpected = OTRL_SMP_EXPECT1; /* Report result to user */ if (ctx->active_fingerprint && ctx->active_fingerprint->trust && *ctx->active_fingerprint->trust != '\0') sbuf = g_strdup("OTR: SMP succeeded"); else sbuf = g_strdup("OTR: SMP failed"); } } tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP_ABORT); if (tlv) { /* The message we are waiting for will not arrive, so reset * and prepare for the next SMP */ sbuf = g_strdup("OTR: SMP aborted by your buddy"); ctx->smstate->nextExpected = OTRL_SMP_EXPECT1; } if (sbuf) { scr_WriteIncomingMessage(ctx->username, sbuf, 0, HBB_PREFIX_INFO, 0); g_free(sbuf); } } /* * returns whether a otr_message was received * sets *otr_data to NULL, when it was an internal otr message */ int otr_receive(char **otr_data, const char *buddy, int *free_msg) { int ignore_message; char *newmessage = NULL; OtrlTLV *tlvs = NULL; OtrlTLV *tlv = NULL; ConnContext *ctx; ctx = otr_get_context(buddy); *free_msg = 0; ignore_message = otrl_message_receiving(userstate, &ops, NULL, ctx->accountname, ctx->protocol, ctx->username, *otr_data, &newmessage, &tlvs,NULL, NULL); tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED); if (tlv) { /* Notify the user that the other side disconnected. */ if (ctx) { cb_gone_insecure(NULL, ctx); otr_disconnect(ctx->username); } } otr_handle_smp_tlvs(tlvs, ctx); if (tlvs != NULL) otrl_tlv_free(tlvs); if (ignore_message) *otr_data = NULL; if (!ignore_message && newmessage) { *free_msg = 1; *otr_data = html_strip(newmessage); otrl_message_free(newmessage); if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) return 1; } return 0; } int otr_send(char **msg, const char *buddy) { gcry_error_t err; char *newmessage = NULL; char *htmlmsg; ConnContext *ctx = otr_get_context(buddy); if (ctx->msgstate == OTRL_MSGSTATE_PLAINTEXT) err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname, ctx->protocol, ctx->username, *msg, NULL, &newmessage, NULL, NULL); else { htmlmsg = html_escape(*msg); err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname, ctx->protocol, ctx->username, htmlmsg, NULL, &newmessage, NULL, NULL); g_free(htmlmsg); } if (err) *msg = NULL; /*something went wrong, don't send the plain-message! */ if (!err && newmessage) { *msg = g_strdup(newmessage); otrl_message_free(newmessage); if (cb_policy(NULL, ctx) & OTRL_POLICY_REQUIRE_ENCRYPTION || ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) return 1; } return 0; } /* Prints OTR connection state */ void otr_print_info(const char *buddy) { const char *state, *auth, *policy; ConnContext *ctx = otr_get_context(buddy); OtrlPolicy p = cb_policy(ctx->app_data, ctx); if (!userstate || !ctx) return; switch (ctx->msgstate) { case OTRL_MSGSTATE_PLAINTEXT: state = "plaintext"; break; case OTRL_MSGSTATE_ENCRYPTED: switch (ctx->protocol_version) { case 1: state = "encrypted V1"; break; case 2: state = "encrypted V2"; break; default:state = "encrypted"; }; break; case OTRL_MSGSTATE_FINISHED: state = "finished"; break; default: state = "unknown state"; } switch (ctx->auth.authstate) { case OTRL_AUTHSTATE_NONE: switch (ctx->otr_offer) { case OFFER_NOT: auth = "no offer sent"; break; case OFFER_SENT: auth = "offer sent"; break; case OFFER_ACCEPTED: auth = "offer accepted"; break; case OFFER_REJECTED: auth = "offer rejected"; break; default: auth = "unknown auth"; } break; case OTRL_AUTHSTATE_AWAITING_DHKEY: auth = "awaiting D-H key"; break; case OTRL_AUTHSTATE_AWAITING_REVEALSIG: auth = "awaiting reveal signature"; break; case OTRL_AUTHSTATE_AWAITING_SIG: auth = "awaiting signature"; break; case OTRL_AUTHSTATE_V1_SETUP: auth = "v1 setup"; break; default: auth = "unknown auth"; } if (p == OTRL_POLICY_NEVER) policy = "plain"; else if (p == (OTRL_POLICY_OPPORTUNISTIC & ~OTRL_POLICY_ALLOW_V1)) policy = "opportunistic"; else if (p == (OTRL_POLICY_MANUAL & ~OTRL_POLICY_ALLOW_V1)) policy = "manual"; else if (p == (OTRL_POLICY_ALWAYS & ~OTRL_POLICY_ALLOW_V1)) policy = "always"; else policy = "unknown"; scr_LogPrint(LPRINT_LOGNORM, "%s: %s (%s) [%s]", ctx->username, state, auth, policy); } static ConnContext *otr_context_encrypted(const char *buddy) { ConnContext *ctx = otr_get_context(buddy); if (!userstate || !ctx || ctx->msgstate != OTRL_MSGSTATE_ENCRYPTED){ scr_LogPrint(LPRINT_LOGNORM, "You have to start an OTR channel with %s before you can " "use SMP.", buddy); return NULL; } return ctx; } void otr_smp_query(const char *buddy, const char *secret) { ConnContext *ctx = otr_context_encrypted(buddy); if (!secret) { scr_LogPrint(LPRINT_LOGNORM, "Using SMP without a secret isn't a good idea."); return; } if (ctx) { otrl_message_initiate_smp(userstate, &ops, NULL, ctx, (const unsigned char *)secret, strlen(secret)); scr_WriteIncomingMessage(ctx->username, "OTR: Socialist Millionaires' Protocol " "initiated.", 0, HBB_PREFIX_INFO, 0); } } void otr_smp_respond(const char *buddy, const char *secret) { ConnContext *ctx = otr_context_encrypted(buddy); if (!secret) { scr_LogPrint(LPRINT_LOGNORM, "Using SMP without a secret isn't a good idea."); return; } if (ctx) { if (!ctx->smstate->secret) { scr_LogPrint(LPRINT_LOGNORM, "Don't call smpr until you have received an SMP " "Initiation!"); return; } otrl_message_respond_smp(userstate, &ops, NULL, ctx, (const unsigned char *)secret, strlen(secret)); scr_WriteIncomingMessage(ctx->username, "OTR: Socialist Millionaires' Protocol: " "response sent", 0, HBB_PREFIX_INFO, 0); } } void otr_smp_abort(const char *buddy) { ConnContext *ctx = otr_context_encrypted(buddy); if (ctx) { otrl_message_abort_smp(userstate, &ops, NULL, ctx); scr_WriteIncomingMessage(ctx->username, "OTR: Socialist Millionaires' Protocol aborted.", 0, HBB_PREFIX_INFO, 0); } } void otr_key(void) { OtrlPrivKey *key; char readable[45] = ""; if(!userstate) return; for (key = userstate->privkey_root; key; key = key->next) { otrl_privkey_fingerprint(userstate, readable, key->accountname, key->protocol); scr_LogPrint(LPRINT_LOGNORM, "%s: %s", key->accountname, readable); } } /* Return the OTR policy for the given context. */ static OtrlPolicy cb_policy(void *opdata, ConnContext *ctx) { enum otr_policy p = settings_otr_getpolicy(NULL); if(ctx) if(settings_otr_getpolicy(ctx->username)) p = settings_otr_getpolicy(ctx->username); switch (p) { case plain: return OTRL_POLICY_NEVER; case opportunistic: return OTRL_POLICY_OPPORTUNISTIC & ~OTRL_POLICY_ALLOW_V1; case manual: return OTRL_POLICY_MANUAL & ~OTRL_POLICY_ALLOW_V1; case always: return OTRL_POLICY_ALWAYS & ~OTRL_POLICY_ALLOW_V1; } return OTRL_POLICY_MANUAL & ~OTRL_POLICY_ALLOW_V1; } /* Create a private key for the given accountname/protocol if * desired. */ static void cb_create_privkey(void *opdata, const char *accountname, const char *protocol) { gcry_error_t e; char *root; scr_LogPrint(LPRINT_LOGNORM, "Generating new OTR key for %s. This may take a while...", accountname); scr_do_update(); e = otrl_privkey_generate(userstate, keyfile, accountname, protocol); if (e) { root = otr_get_dir(); scr_LogPrint(LPRINT_LOGNORM, "OTR key generation failed! Please mkdir " "%s if you want to use otr encryption.", root); g_free(root); } else scr_LogPrint(LPRINT_LOGNORM, "OTR key generated."); } /* Report whether you think the given user is online. Return 1 if * you think he is, 0 if you think he isn't, -1 if you're not sure. * If you return 1, messages such as heartbeats or other * notifications may be sent to the user, which could result in "not * logged in" errors if you're wrong. */ static int cb_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) { int ret = (roster_getstatus(recipient, NULL) != offline); return ret; } /* Send the given IM to the given recipient from the given * accountname/protocol. */ static void cb_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) { if (roster_gettype(recipient) == ROSTER_TYPE_USER) xmpp_send_msg(recipient, message, ROSTER_TYPE_USER, "", TRUE, NULL, LM_MESSAGE_SUB_TYPE_NOT_SET, NULL); } /* Display a notification message for a particular * accountname / protocol / username conversation. */ static void cb_notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary) { char *type; char *sbuf = NULL; switch (level) { case OTRL_NOTIFY_ERROR: type = "error"; break; case OTRL_NOTIFY_WARNING: type = "warning"; break; case OTRL_NOTIFY_INFO: type = "info"; break; default: type = "unknown"; } sbuf = g_strdup_printf("OTR %s:%s\n%s\n%s",type,title, primary, secondary); scr_WriteIncomingMessage(username, sbuf, 0, HBB_PREFIX_INFO, 0); g_free(sbuf); } /* Display an OTR control message for a particular * accountname / protocol / username conversation. Return 0 if you are able * to successfully display it. If you return non-0 (or if this * function is NULL), the control message will be displayed inline, * as a received message, or else by using the above notify() * callback. */ static int cb_display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg) { char *strippedmsg = html_strip(msg); scr_WriteIncomingMessage(username, strippedmsg, 0, HBB_PREFIX_INFO, 0); g_free(strippedmsg); return 0; } /* When the list of ConnContexts changes (including a change in * state), this is called so the UI can be updated. */ static void cb_update_context_list(void *opdata) { /*maybe introduce new status characters for mcabber, * then use this function (?!)*/ } /* Return a newly allocated string containing a human-friendly name * for the given protocol id */ static const char *cb_protocol_name(void *opdata, const char *protocol) { return protocol; } /* Deallocate a string allocated by protocol_name */ static void cb_protocol_name_free (void *opdata, const char *protocol_name) { /* We didn't allocated memory, so we don't have to free anything :p */ } /* A new fingerprint for the given user has been received. */ static void cb_new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) { char *sbuf = NULL; char readable[45]; otrl_privkey_hash_to_human(readable, fingerprint); sbuf = g_strdup_printf("OTR: new fingerprint: %s", readable); scr_WriteIncomingMessage(username, sbuf, 0, HBB_PREFIX_INFO, 0); g_free(sbuf); } /* The list of known fingerprints has changed. Write them to disk. */ static void cb_write_fingerprints(void *opdata) { otrl_privkey_write_fingerprints(userstate, fprfile); } /* A ConnContext has entered a secure state. */ static void cb_gone_secure(void *opdata, ConnContext *context) { scr_WriteIncomingMessage(context->username, "OTR: channel established", 0, HBB_PREFIX_INFO, 0); } /* A ConnContext has left a secure state. */ static void cb_gone_insecure(void *opdata, ConnContext *context) { scr_WriteIncomingMessage(context->username, "OTR: channel closed", 0, HBB_PREFIX_INFO, 0); } /* We have completed an authentication, using the D-H keys we * already knew. is_reply indicates whether we initiated the AKE. */ static void cb_still_secure(void *opdata, ConnContext *context, int is_reply) { scr_WriteIncomingMessage(context->username, "OTR: channel reestablished", 0, HBB_PREFIX_INFO, 0); } /* Log a message. The passed message will end in "\n". */ static void cb_log_message(void *opdata, const char *message) { scr_LogPrint(LPRINT_DEBUG, "OTR: %s", message); } /* Find the maximum message size supported by this protocol. */ static int cb_max_message_size(void *opdata, ConnContext *context) { return 8192; } int otr_enabled(void) { return otr_is_enabled; } #else /* !HAVE_LIBOTR */ int otr_enabled(void) { return FALSE; } #endif /* HAVE_LIBOTR */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/otr.h000066400000000000000000000017361216603513500155460ustar00rootroot00000000000000#ifndef __MCABBER_OTR_H__ #define __MCABBER_OTR_H__ 1 #include #ifdef HAVE_LIBOTR #include #include #include enum otr_policy { plain, opportunistic, manual, always }; void otr_init(const char *jid); void otr_terminate(void); void otr_establish (const char * buddy); void otr_disconnect (const char * buddy); void otr_fingerprint(const char * buddy, const char * trust); void otr_print_info (const char * buddy); void otr_smp_query (const char * buddy, const char * secret); void otr_smp_respond(const char * buddy, const char * secret); void otr_smp_abort (const char * buddy); void otr_key (void); int otr_receive (char **otr_data, const char * buddy, int * free_msg); int otr_send (char **msg, const char *buddy); #endif /* HAVE_LIBOTR */ int otr_enabled (void); #endif /* __MCABBER_OTR_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/pgp.c000066400000000000000000000314101216603513500155130ustar00rootroot00000000000000/* * pgp.c -- PGP utility functions * * Copyright (C) 2006-2009 Mikael Berthe * Some parts inspired by centericq (impgp.cc) * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #ifdef HAVE_GPGME #include #include #include #include #include #include #include "pgp.h" #include "logprint.h" #define MIN_GPGME_VERSION "1.0.0" static struct gpg_struct { int enabled; char *private_key; char *passphrase; } gpg; // gpg_init(priv_key, passphrase) // Initialize the GPG sub-systems. This function must be invoked early. // Note: priv_key & passphrase are optional, they can be set later. // This function returns 0 if gpgme is available and initialized; // if not it returns the gpgme error code. int gpg_init(const char *priv_key, const char *passphrase) { gpgme_error_t err; // Check for version and OpenPGP protocol support. if (!gpgme_check_version(MIN_GPGME_VERSION)) { scr_LogPrint(LPRINT_LOGNORM, "GPGME initialization error: Bad library version"); return -1; } err = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP); if (err) { scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME initialization error: %s", gpgme_strerror(err)); return err; } // Set the locale information. gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); // Store private data. gpg_set_private_key(priv_key); gpg_set_passphrase(passphrase); gpg.enabled = 1; return 0; } // gpg_terminate() // Destroy data and free memory. void gpg_terminate(void) { gpg.enabled = 0; gpg_set_passphrase(NULL); gpg_set_private_key(NULL); } // gpg_set_passphrase(passphrase) // Set the current passphrase (use NULL to erase it). void gpg_set_passphrase(const char *passphrase) { // Remove current passphrase if (gpg.passphrase) { ssize_t len = strlen(gpg.passphrase); memset(gpg.passphrase, 0, len); munlock(gpg.passphrase, len); g_free(gpg.passphrase); } if (passphrase) { gpg.passphrase = g_strdup(passphrase); mlock(gpg.passphrase, strlen(gpg.passphrase)); } else { gpg.passphrase = NULL; } } // gpg_set_private_key(keyid) // Set the current private key id (use NULL to unset it). void gpg_set_private_key(const char *priv_keyid) { g_free(gpg.private_key); if (priv_keyid) gpg.private_key = g_strdup(priv_keyid); else gpg.private_key = NULL; } // strip_header_footer(data) // Remove PGP header & footer from data. // Return a new string, or NULL. // The string must be freed by the caller with g_free() when no longer needed. static char *strip_header_footer(const char *data) { char *p, *q; if (!data) return NULL; // p: beginning of real data // q: end of real data // Strip header (to the first empty line) p = strstr(data, "\n\n"); if (!p) return g_strdup(data); // Strip footer // We want to remove the last lines, until the line beginning with a '-' p += 2; for (q = p ; *q; q++) ; // (q is at the end of data now) for (q--; q > p && (*q != '\n' || *(q+1) != '-'); q--) ; if (q <= p) return NULL; // Shouldn't happen... return g_strndup(p, q-p); } // GCC ignores casts to void, thus we need to hack around that static inline void ignore(void*x) {} // passphrase_cb() // GPGME passphrase callback function. static gpgme_error_t passphrase_cb(void *hook, const char *uid_hint, const char *passphrase_info, int prev_was_bad, int fd) { ssize_t len; // Abort if we do not have the password. if (!gpg.passphrase) { ignore((void*)write(fd, "\n", 1)); // We have an error anyway, thus it does // not matter if we fail again. return gpg_error(GPG_ERR_CANCELED); } // Write the passphrase to the file descriptor. len = strlen(gpg.passphrase); if (write(fd, gpg.passphrase, len) != len) return gpg_error(GPG_ERR_CANCELED); if (write(fd, "\n", 1) != 1) return gpg_error(GPG_ERR_CANCELED); return 0; // Success } // gpg_verify(gpg_data, text, *sigsum) // Verify that gpg_data is a correct signature for text. // Return the key id (or fingerprint), and set *sigsum to // the gpgme signature summary value. // The returned string must be freed with g_free() after use. char *gpg_verify(const char *gpg_data, const char *text, gpgme_sigsum_t *sigsum) { gpgme_ctx_t ctx; gpgme_data_t data_sign, data_text; char *data; char *verified_key = NULL; gpgme_key_t key; gpgme_error_t err; const char prefix[] = "-----BEGIN PGP SIGNATURE-----\n\n"; const char suffix[] = "\n-----END PGP SIGNATURE-----\n"; // Reset the summary. *sigsum = 0; if (!gpg.enabled) return NULL; err = gpgme_new(&ctx); if (err) { scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME error: %s", gpgme_strerror(err)); return NULL; } gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); // Surround the given data with the prefix & suffix data = g_new(char, sizeof(prefix) + sizeof(suffix) + strlen(gpg_data)); strcpy(data, prefix); strcat(data, gpg_data); strcat(data, suffix); err = gpgme_data_new_from_mem(&data_sign, data, strlen(data), 0); if (!err) { err = gpgme_data_new_from_mem(&data_text, text, strlen(text), 0); if (!err) { err = gpgme_op_verify(ctx, data_sign, data_text, 0); if (!err) { gpgme_verify_result_t vr = gpgme_op_verify_result(ctx); if (vr && vr->signatures) { char *r = vr->signatures->fpr; // Found the fingerprint. Let's try to get the key id. if (!gpgme_get_key(ctx, r, &key, 0) && key) { r = key->subkeys->keyid; gpgme_key_release(key); } // r is a static variable, let's copy it. verified_key = g_strdup(r); *sigsum = vr->signatures->summary; // For some reason summary could be 0 when status is 0 too, // which means the signature is valid... if (!*sigsum && !vr->signatures->status) *sigsum = GPGME_SIGSUM_GREEN; } } gpgme_data_release(data_text); } gpgme_data_release(data_sign); } if (err) scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME verification error: %s", gpgme_strerror(err)); gpgme_release(ctx); g_free(data); return verified_key; } // gpg_sign(gpg_data) // Return a signature of gpg_data (or NULL). // The returned string must be freed with g_free() after use. char *gpg_sign(const char *gpg_data) { gpgme_ctx_t ctx; gpgme_data_t in, out; char *p; char *signed_data = NULL; size_t nread; gpgme_key_t key; gpgme_error_t err; if (!gpg.enabled || !gpg.private_key) return NULL; err = gpgme_new(&ctx); if (err) { scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME error: %s", gpgme_strerror(err)); return NULL; } gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); gpgme_set_textmode(ctx, 0); gpgme_set_armor(ctx, 1); p = getenv("GPG_AGENT_INFO"); if (!(p && strchr(p, ':'))) gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); err = gpgme_get_key(ctx, gpg.private_key, &key, 1); if (err || !key) { scr_LogPrint(LPRINT_LOGNORM, "GPGME error: private key not found"); gpgme_release(ctx); return NULL; } gpgme_signers_clear(ctx); gpgme_signers_add(ctx, key); gpgme_key_release(key); err = gpgme_data_new_from_mem(&in, gpg_data, strlen(gpg_data), 0); if (!err) { err = gpgme_data_new(&out); if (!err) { err = gpgme_op_sign(ctx, in, out, GPGME_SIG_MODE_DETACH); if (!err) { signed_data = gpgme_data_release_and_get_mem(out, &nread); if (signed_data) { // We need to add a trailing NULL char *dd = g_strndup(signed_data, nread); free(signed_data); signed_data = strip_header_footer(dd); g_free(dd); } } else { gpgme_data_release(out); } } gpgme_data_release(in); } if (err && err != GPG_ERR_CANCELED) scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME signature error: %s", gpgme_strerror(err)); gpgme_release(ctx); return signed_data; } // gpg_decrypt(gpg_data) // Return decrypted gpg_data (or NULL). // The returned string must be freed with g_free() after use. char *gpg_decrypt(const char *gpg_data) { gpgme_ctx_t ctx; gpgme_data_t in, out; char *p, *data; char *decrypted_data = NULL; size_t nread; gpgme_error_t err; const char prefix[] = "-----BEGIN PGP MESSAGE-----\n\n"; const char suffix[] = "\n-----END PGP MESSAGE-----\n"; if (!gpg.enabled) return NULL; err = gpgme_new(&ctx); if (err) { scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME error: %s", gpgme_strerror(err)); return NULL; } gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); p = getenv("GPG_AGENT_INFO"); if (!(p && strchr(p, ':'))) gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); // Surround the given data with the prefix & suffix data = g_new(char, sizeof(prefix) + sizeof(suffix) + strlen(gpg_data)); strcpy(data, prefix); strcat(data, gpg_data); strcat(data, suffix); err = gpgme_data_new_from_mem(&in, data, strlen(data), 0); if (!err) { err = gpgme_data_new(&out); if (!err) { err = gpgme_op_decrypt(ctx, in, out); if (!err) { decrypted_data = gpgme_data_release_and_get_mem(out, &nread); if (decrypted_data) { // We need to add a trailing NULL char *dd = g_strndup(decrypted_data, nread); free(decrypted_data); decrypted_data = dd; } } else { gpgme_data_release(out); } } gpgme_data_release(in); } if (err && err != GPG_ERR_CANCELED) scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME decryption error: %s", gpgme_strerror(err)); gpgme_release(ctx); g_free(data); return decrypted_data; } // gpg_encrypt(gpg_data, keyid) // Return encrypted gpg_data with the key keyid (or NULL). // The returned string must be freed with g_free() after use. char *gpg_encrypt(const char *gpg_data, const char *keyid) { gpgme_ctx_t ctx; gpgme_data_t in, out; char *encrypted_data = NULL, *edata; size_t nread; gpgme_key_t key; gpgme_error_t err; if (!gpg.enabled) return NULL; err = gpgme_new(&ctx); if (err) { scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME error: %s", gpgme_strerror(err)); return NULL; } gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); gpgme_set_textmode(ctx, 0); gpgme_set_armor(ctx, 1); err = gpgme_get_key(ctx, keyid, &key, 0); if (!err && key) { gpgme_key_t keys[] = { key, 0 }; err = gpgme_data_new_from_mem(&in, gpg_data, strlen(gpg_data), 0); if (!err) { err = gpgme_data_new(&out); if (!err) { err = gpgme_op_encrypt(ctx, keys, GPGME_ENCRYPT_ALWAYS_TRUST, in, out); if (!err) encrypted_data = gpgme_data_release_and_get_mem(out, &nread); else gpgme_data_release(out); } gpgme_data_release(in); } gpgme_key_release(key); } else { scr_LogPrint(LPRINT_LOGNORM, "GPGME encryption error: key not found"); err = 0; } if (err && err != GPG_ERR_CANCELED) scr_LogPrint(LPRINT_LOGNORM|LPRINT_NOTUTF8, "GPGME encryption error: %s", gpgme_strerror(err)); gpgme_release(ctx); edata = strip_header_footer(encrypted_data); if (encrypted_data) free(encrypted_data); return edata; } // gpg_test_passphrase() // Test the current gpg.passphrase with gpg.private_key. // If the test doesn't succeed, the passphrase is cleared and a non-null // value is returned. int gpg_test_passphrase(void) { char *s; if (!gpg.private_key) return -1; // No private key... s = gpg_sign("test"); if (s) { free(s); return 0; // Ok, test successful } // The passphrase is wrong (if provided) gpg_set_passphrase(NULL); return -1; } int gpg_enabled(void) { return gpg.enabled; } #else /* not HAVE_GPGME */ int gpg_enabled(void) { return 0; } #endif /* HAVE_GPGME */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/pgp.h000066400000000000000000000014341216603513500155230ustar00rootroot00000000000000#ifndef __MCABBER_PGP_H__ #define __MCABBER_PGP_H__ 1 #include #ifdef HAVE_GPGME #define GPGME_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1 #include int gpg_init(const char *priv_key, const char *passphrase); void gpg_terminate(void); void gpg_set_passphrase(const char *passphrase); void gpg_set_private_key(const char *priv_keyid); char *gpg_verify(const char *gpg_data, const char *text, gpgme_sigsum_t *sigsum); char *gpg_sign(const char *gpg_data); char *gpg_decrypt(const char *gpg_data); char *gpg_encrypt(const char *gpg_data, const char *keyid); int gpg_test_passphrase(void); #endif /* HAVE_GPGME */ int gpg_enabled(void); #endif /* __MCABBER_PGP_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/roster.c000066400000000000000000001400061216603513500162450ustar00rootroot00000000000000/* * roster.c -- Local roster implementation * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include "roster.h" #include "utils.h" #include "hooks.h" extern void hlog_save_state(void); char *strrole[] = { /* Should match enum in roster.h */ "none", "moderator", "participant", "visitor" }; char *straffil[] = { /* Should match enum in roster.h */ "none", "owner", "admin", "member", "outcast" }; char *strprintstatus[] = { /* Should match enum in roster.h */ "default", "none", "in_and_out", "all" }; char *strautowhois[] = { /* Should match enum in roster.h */ "default", "off", "on", }; char *strflagjoins[] = { /* Should match enum in roster.h */ "default", "none", "joins", "all" }; /* Resource structure */ typedef struct { gchar *name; gchar prio; enum imstatus status; gchar *status_msg; time_t status_timestamp; enum imrole role; enum imaffiliation affil; gchar *realjid; /* for chatrooms, if buddy's real jid is known */ guint events; char *caps; #ifdef XEP0022 struct xep0022 xep22; #endif #ifdef XEP0085 struct xep0085 xep85; #endif #ifdef HAVE_GPGME struct pgp_data pgpdata; #endif } res; /* This is a private structure type for the roster */ typedef struct { gchar *name; gchar *jid; guint type; enum subscr subscription; GSList *resource; res *active_resource; /* For groupchats */ gchar *nickname; gchar *topic; guint inside_room; guint print_status; guint auto_whois; guint flag_joins; /* on_server is TRUE if the item is present on the server roster */ guint on_server; /* To keep track of last status message */ gchar *offline_status_message; /* Flag used for the UI */ guint flags; guint ui_prio; // Boolean, positive if "attention" is requested // list: user -> points to his group; group -> points to its users list GSList *list; } roster; /* ### Variables ### */ static guchar display_filter; static GSList *groups; static GSList *unread_list; static GHashTable *unread_jids; GList *buddylist; GList *current_buddy; GList *alternate_buddy; GList *last_activity_buddy; static roster roster_special; static int unread_jid_del(const char *jid); #define DFILTER_ALL 63 #define DFILTER_ONLINE 62 /* ### Initialization ### */ void roster_init(void) { roster_special.name = SPECIAL_BUFFER_STATUS_ID; roster_special.type = ROSTER_TYPE_SPECIAL; } /* ### Resources functions ### */ static inline void free_resource_data(res *p_res) { if (!p_res) return; g_free((gchar*)p_res->status_msg); g_free((gchar*)p_res->name); g_free((gchar*)p_res->realjid); #ifdef XEP0022 g_free(p_res->xep22.last_msgid_sent); g_free(p_res->xep22.last_msgid_rcvd); #endif #ifdef HAVE_GPGME g_free(p_res->pgpdata.sign_keyid); #endif g_free(p_res->caps); g_free(p_res); } static void free_all_resources(GSList **reslist) { GSList *lip; for (lip = *reslist; lip ; lip = g_slist_next(lip)) free_resource_data((res*)lip->data); // Free all nodes but the first (which is static) g_slist_free(*reslist); *reslist = NULL; } // Resources are sorted in ascending order static gint resource_compare_prio(res *a, res *b) { if (a->prio < b->prio) return -1; else return 1; } // get_resource(rost, resname) // Return a pointer to the resource with name resname, in rost's resources list // - if rost has no resources, return NULL // - if resname is defined, return the match or NULL // - if resname is NULL, the last resource is returned, currently // This could change in the future, because we should return the best one // (priority? last used? and fall back to the first resource) // static res *get_resource(roster *rost, const char *resname) { GSList *p; res *r = NULL; for (p = rost->resource; p; p = g_slist_next(p)) { r = p->data; if (resname && !strcmp(r->name, resname)) return r; } // The last resource is one of the resources with the highest priority, // however, we don't know if it is the more-recently-used. if (!resname) return r; return NULL; } // get_or_add_resource(rost, resname, priority) // - if there is a "resname" resource in rost's resources, return a pointer // on this resource // - if not, add the resource, set the name, and return a pointer on this // new resource static res *get_or_add_resource(roster *rost, const char *resname, gchar prio) { GSList *p; res *nres; if (!resname) return NULL; for (p = rost->resource; p; p = g_slist_next(p)) { res *r = p->data; if (!strcmp(r->name, resname)) { if (prio != r->prio) { r->prio = prio; rost->resource = g_slist_sort(rost->resource, (GCompareFunc)&resource_compare_prio); } return r; } } // Resource not found nres = g_new0(res, 1); nres->name = g_strdup(resname); nres->prio = prio; rost->resource = g_slist_insert_sorted(rost->resource, nres, (GCompareFunc)&resource_compare_prio); return nres; } static void del_resource(roster *rost, const char *resname) { GSList *p; GSList *p_res_elt = NULL; res *p_res; if (!resname) return; for (p = rost->resource; p; p = g_slist_next(p)) { res *r = p->data; if (!strcmp(r->name, resname)) p_res_elt = p; } if (!p_res_elt) return; // Resource not found p_res = p_res_elt->data; // Keep a copy of the status message when a buddy goes offline if (g_slist_length(rost->resource) == 1) { g_free(rost->offline_status_message); rost->offline_status_message = p_res->status_msg; p_res->status_msg = NULL; } if (rost->active_resource == p_res) rost->active_resource = NULL; // Free allocations and delete resource node free_resource_data(p_res); rost->resource = g_slist_delete_link(rost->resource, p_res_elt); return; } /* ### Roster functions ### */ static inline void free_roster_user_data(roster *roster_usr) { if (!roster_usr) return; g_free((gchar*)roster_usr->jid); //g_free((gchar*)roster_usr->active_resource); g_free((gchar*)roster_usr->name); g_free((gchar*)roster_usr->nickname); g_free((gchar*)roster_usr->topic); g_free((gchar*)roster_usr->offline_status_message); free_all_resources(&roster_usr->resource); g_free(roster_usr); } // Comparison function used to search in the roster (compares jids and types) static gint roster_compare_jid_type(roster *a, roster *b) { if (! (a->type & b->type)) return -1; // arbitrary (but should be != 0, of course) return strcasecmp(a->jid, b->jid); } // Comparison function used to search in the roster (compares names and types) static gint roster_compare_name_type(roster *a, roster *b) { if (! (a->type & b->type)) return -1; // arbitrary (but should be != 0, of course) return strcmp(a->name, b->name); } // Comparison function used to sort the roster (by name) static gint roster_compare_name(roster *a, roster *b) { return strcmp(a->name, b->name); } // Finds a roster element (user, group, agent...), by jid or name // If roster_type is 0, returns match of any type. // Returns the roster GSList element, or NULL if jid/name not found GSList *roster_find(const char *jidname, enum findwhat type, guint roster_type) { GSList *sl_roster_elt = groups; GSList *resource; roster sample; GCompareFunc comp; if (!jidname) return NULL; if (!roster_type) roster_type = ROSTER_TYPE_USER | ROSTER_TYPE_ROOM | ROSTER_TYPE_AGENT | ROSTER_TYPE_GROUP; sample.type = roster_type; if (type == jidsearch) { sample.jid = (gchar*)jidname; comp = (GCompareFunc)&roster_compare_jid_type; } else if (type == namesearch) { sample.name = (gchar*)jidname; comp = (GCompareFunc)&roster_compare_name_type; } else return NULL; // Should not happen... while (sl_roster_elt) { roster *roster_elt = (roster*)sl_roster_elt->data; if (roster_type & ROSTER_TYPE_GROUP) { if ((type == namesearch) && !strcmp(jidname, roster_elt->name)) return sl_roster_elt; } resource = g_slist_find_custom(roster_elt->list, &sample, comp); if (resource) return resource; sl_roster_elt = g_slist_next(sl_roster_elt); } return NULL; } // Returns pointer to new group, or existing group with that name GSList *roster_add_group(const char *name) { roster *roster_grp; GSList *p_group; // #1 Check name doesn't already exist p_group = roster_find(name, namesearch, ROSTER_TYPE_GROUP); if (!p_group) { // #2 Create the group node roster_grp = g_new0(roster, 1); roster_grp->name = g_strdup(name); roster_grp->type = ROSTER_TYPE_GROUP; // #3 Insert (sorted) groups = g_slist_insert_sorted(groups, roster_grp, (GCompareFunc)&roster_compare_name); p_group = roster_find(name, namesearch, ROSTER_TYPE_GROUP); } return p_group; } // Comparison function used to sort the unread list by ui (attn) priority static gint _roster_compare_uiprio(roster *a, roster *b) { return (b->ui_prio - a->ui_prio); } // Returns a pointer to the new user, or existing user with that name // Note: if onserver is -1, the flag won't be changed. GSList *roster_add_user(const char *jid, const char *name, const char *group, guint type, enum subscr esub, gint onserver) { roster *roster_usr; roster *my_group; GSList *slist; if ((type != ROSTER_TYPE_USER) && (type != ROSTER_TYPE_ROOM) && (type != ROSTER_TYPE_AGENT)) { // XXX Error message? return NULL; } // Let's be arbitrary: default group has an empty name (""). if (!group) group = ""; // #1 Check this user doesn't already exist slist = roster_find(jid, jidsearch, 0); if (slist) { char *oldgroupname; // That's an update roster_usr = slist->data; roster_usr->subscription = esub; if (onserver >= 0) buddy_setonserverflag(slist->data, onserver); if (name) buddy_setname(slist->data, (char*)name); // Let's check if the group name has changed oldgroupname = ((roster*)((GSList*)roster_usr->list)->data)->name; if (group && strcmp(oldgroupname, group)) { buddy_setgroup(slist->data, (char*)group); // Note: buddy_setgroup() updates the user lists so we cannot // use slist anymore. return roster_find(jid, jidsearch, 0); } return slist; } // #2 add group if necessary slist = roster_add_group(group); if (!slist) return NULL; my_group = (roster*)slist->data; // #3 Create user node roster_usr = g_new0(roster, 1); roster_usr->jid = g_strdup(jid); if (name) { roster_usr->name = g_strdup(name); } else { gchar *p, *str = g_strdup(jid); p = strchr(str, JID_RESOURCE_SEPARATOR); if (p) *p = '\0'; roster_usr->name = g_strdup(str); g_free(str); } if (unread_jid_del(jid)) { roster_usr->flags |= ROSTER_FLAG_MSG; // Append the roster_usr to unread_list unread_list = g_slist_insert_sorted(unread_list, roster_usr, (GCompareFunc)&_roster_compare_uiprio); } roster_usr->type = type; roster_usr->subscription = esub; roster_usr->list = slist; // (my_group SList element) if (onserver == 1) roster_usr->on_server = TRUE; // #4 Insert node (sorted) my_group->list = g_slist_insert_sorted(my_group->list, roster_usr, (GCompareFunc)&roster_compare_name); return roster_find(jid, jidsearch, type); } // Removes user (jid) from roster, frees allocated memory void roster_del_user(const char *jid) { GSList *sl_user, *sl_group; GSList **sl_group_listptr; roster *roster_usr; GSList *node; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM); if (sl_user == NULL) return; roster_usr = (roster*)sl_user->data; // Remove (if present) from unread messages list node = g_slist_find(unread_list, roster_usr); if (node) unread_list = g_slist_delete_link(unread_list, node); // If there is a pending unread message, keep track of it if (roster_usr->flags & ROSTER_FLAG_MSG) unread_jid_add(roster_usr->jid); sl_group = roster_usr->list; // Let's free roster_usr memory (jid, name, status message...) free_roster_user_data(roster_usr); // That's a little complex, we need to dereference twice sl_group_listptr = &((roster*)(sl_group->data))->list; *sl_group_listptr = g_slist_delete_link(*sl_group_listptr, sl_user); // We need to rebuild the list if (current_buddy) buddylist_build(); // TODO What we could do, too, is to check if the deleted node is // current_buddy, in which case we could move current_buddy to the // previous (or next) node. } // Free all roster data and call buddylist_build() to free the buddylist. void roster_free(void) { GSList *sl_grp = groups; // Free unread_list if (unread_list) { g_slist_free(unread_list); unread_list = NULL; } // Walk through groups while (sl_grp) { roster *roster_grp = (roster*)sl_grp->data; GSList *sl_usr = roster_grp->list; // Walk through this group users while (sl_usr) { roster *roster_usr = (roster*)sl_usr->data; // If there is a pending unread message, keep track of it if (roster_usr->flags & ROSTER_FLAG_MSG) unread_jid_add(roster_usr->jid); // Free roster_usr data (jid, name, status message...) free_roster_user_data(roster_usr); sl_usr = g_slist_next(sl_usr); } // Free group's users list if (roster_grp->list) g_slist_free(roster_grp->list); // Free group's name and jid g_free((gchar*)roster_grp->jid); g_free((gchar*)roster_grp->name); g_free(roster_grp); sl_grp = g_slist_next(sl_grp); } // Free groups list if (groups) { g_slist_free(groups); groups = NULL; // Update (i.e. free) buddylist if (buddylist) buddylist_build(); } } // roster_setstatus() // Note: resname, role, affil and realjid are for room members only void roster_setstatus(const char *jid, const char *resname, gchar prio, enum imstatus bstat, const char *status_msg, time_t status_time, enum imrole role, enum imaffiliation affil, const char *realjid) { GSList *sl_user; roster *roster_usr; res *p_res; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); // If we can't find it, we add it if (sl_user == NULL) sl_user = roster_add_user(jid, NULL, NULL, ROSTER_TYPE_USER, sub_none, -1); // If there is no resource name, we can leave now if (!resname) return; roster_usr = (roster*)sl_user->data; // New or updated resource p_res = get_or_add_resource(roster_usr, resname, prio); p_res->status = bstat; if (p_res->status_msg) { g_free((gchar*)p_res->status_msg); p_res->status_msg = NULL; } if (status_msg) p_res->status_msg = g_strdup(status_msg); if (!status_time) time(&status_time); p_res->status_timestamp = status_time; p_res->role = role; p_res->affil = affil; if (p_res->realjid) { g_free((gchar*)p_res->realjid); p_res->realjid = NULL; } if (realjid) p_res->realjid = g_strdup(realjid); // If bstat is offline, we MUST delete the resource, actually if (bstat == offline) { del_resource(roster_usr, resname); return; } } // roster_setflags() // Set one or several flags to value (TRUE/FALSE) void roster_setflags(const char *jid, guint flags, guint value) { GSList *sl_user; roster *roster_usr; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); if (sl_user == NULL) return; roster_usr = (roster*)sl_user->data; if (value) roster_usr->flags |= flags; else roster_usr->flags &= ~flags; } // roster_unread_check() static void roster_unread_check(void) { guint unread_count = 0; gpointer unread_ptr, first_unread; guint muc_unread = 0, muc_attention = 0; guint attention_count = 0; unread_ptr = first_unread = unread_msg(NULL); if (first_unread) { do { guint type = buddy_gettype(unread_ptr); unread_count++; if (type & ROSTER_TYPE_ROOM) { muc_unread++; if (buddy_getuiprio(unread_ptr) >= ROSTER_UI_PRIO_MUC_HL_MESSAGE) muc_attention++; } else { if (buddy_getuiprio(unread_ptr) >= ROSTER_UI_PRIO_ATTENTION_MESSAGE) attention_count++; } unread_ptr = unread_msg(unread_ptr); } while (unread_ptr && unread_ptr != first_unread); } hk_unread_list_change(unread_count, attention_count, muc_unread, muc_attention); } // roster_msg_setflag() // Set the ROSTER_FLAG_MSG to the given value for the given jid. // It will update the buddy's group message flag. // Update the unread messages list too. void roster_msg_setflag(const char *jid, guint special, guint value) { GSList *sl_user; roster *roster_usr, *roster_grp; int new_roster_item = FALSE; guint unread_list_modified = FALSE; if (special) { //sl_user = roster_find(jid, namesearch, ROSTER_TYPE_SPECIAL); //if (!sl_user) return; //roster_usr = (roster*)sl_user->data; roster_usr = &roster_special; if (value) { if (!(roster_usr->flags & ROSTER_FLAG_MSG)) unread_list_modified = TRUE; roster_usr->flags |= ROSTER_FLAG_MSG; // Append the roster_usr to unread_list, but avoid duplicates if (!g_slist_find(unread_list, roster_usr)) unread_list = g_slist_insert_sorted(unread_list, roster_usr, (GCompareFunc)&_roster_compare_uiprio); } else { if (roster_usr->flags & ROSTER_FLAG_MSG) unread_list_modified = TRUE; roster_usr->flags &= ~ROSTER_FLAG_MSG; roster_usr->ui_prio = 0; if (unread_list) { GSList *node = g_slist_find(unread_list, roster_usr); if (node) unread_list = g_slist_delete_link(unread_list, node); } } goto roster_msg_setflag_return; } sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); // If we can't find it, we add it if (sl_user == NULL) { sl_user = roster_add_user(jid, NULL, NULL, ROSTER_TYPE_USER, sub_none, -1); new_roster_item = TRUE; } roster_usr = (roster*)sl_user->data; roster_grp = (roster*)roster_usr->list->data; if (value) { if (!(roster_usr->flags & ROSTER_FLAG_MSG)) unread_list_modified = TRUE; // Message flag is TRUE. This is easy, we just have to set both flags // to TRUE... roster_usr->flags |= ROSTER_FLAG_MSG; roster_grp->flags |= ROSTER_FLAG_MSG; // group // Append the roster_usr to unread_list, but avoid duplicates if (!g_slist_find(unread_list, roster_usr)) unread_list = g_slist_insert_sorted(unread_list, roster_usr, (GCompareFunc)&_roster_compare_uiprio); } else { // Message flag is FALSE. guint msg = FALSE; if (roster_usr->flags & ROSTER_FLAG_MSG) unread_list_modified = TRUE; roster_usr->flags &= ~ROSTER_FLAG_MSG; roster_usr->ui_prio = 0; if (unread_list) { GSList *node = g_slist_find(unread_list, roster_usr); if (node) unread_list = g_slist_delete_link(unread_list, node); } // For the group value we need to watch all buddies in this group; // if one is flagged, then the group will be flagged. // I will re-use sl_user and roster_usr here, as they aren't used // anymore. sl_user = roster_grp->list; while (sl_user) { roster_usr = (roster*)sl_user->data; if (roster_usr->flags & ROSTER_FLAG_MSG) { msg = TRUE; break; } sl_user = g_slist_next(sl_user); } if (!msg) roster_grp->flags &= ~ROSTER_FLAG_MSG; else roster_grp->flags |= ROSTER_FLAG_MSG; // Actually the "else" part is useless, because the group // ROSTER_FLAG_MSG should already be set... } if (buddylist && (new_roster_item || !g_list_find(buddylist, roster_usr))) buddylist_build(); roster_msg_setflag_return: if (unread_list_modified) { hlog_save_state(); roster_unread_check(); } } // roster_setuiprio(jid, special, prio_value, action) // Set the "attention" priority value for the given roster item. // Note that this function doesn't create the roster item if it doesn't exist. void roster_setuiprio(const char *jid, guint special, guint value, enum setuiprio_ops action) { guint oldval, newval; roster *roster_usr; if (special) { roster_usr = &roster_special; } else { GSList *sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); if (!sl_user) return; roster_usr = (roster*)sl_user->data; } oldval = roster_usr->ui_prio; if (action == prio_max) newval = MAX(oldval, value); else if (action == prio_inc) newval = oldval + value; else // prio_set newval = value; roster_usr->ui_prio = newval; unread_list = g_slist_sort(unread_list, (GCompareFunc)&_roster_compare_uiprio); roster_unread_check(); } guint roster_getuiprio(const char *jid, guint special) { roster *roster_usr; GSList *sl_user; if (special) { roster_usr = &roster_special; return roster_usr->ui_prio; } sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); if (!sl_user) return 0; roster_usr = (roster*)sl_user->data; return roster_usr->ui_prio; } const char *roster_getname(const char *jid) { GSList *sl_user; roster *roster_usr; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); if (sl_user == NULL) return NULL; // Not in the roster... roster_usr = (roster*)sl_user->data; return roster_usr->name; } const char *roster_getnickname(const char *jid) { GSList *sl_user; roster *roster_usr; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); if (sl_user == NULL) return NULL; // Not in the roster... roster_usr = (roster*)sl_user->data; return roster_usr->nickname; } void roster_settype(const char *jid, guint type) { GSList *sl_user; roster *roster_usr; if ((sl_user = roster_find(jid, jidsearch, 0)) == NULL) return; roster_usr = (roster*)sl_user->data; roster_usr->type = type; } enum imstatus roster_getstatus(const char *jid, const char *resname) { GSList *sl_user; roster *roster_usr; res *p_res; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (sl_user == NULL) return offline; // Not in the roster, anyway... roster_usr = (roster*)sl_user->data; p_res = get_resource(roster_usr, resname); if (p_res) return p_res->status; return offline; } const char *roster_getstatusmsg(const char *jid, const char *resname) { GSList *sl_user; roster *roster_usr; res *p_res; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (sl_user == NULL) return NULL; // Not in the roster, anyway... roster_usr = (roster*)sl_user->data; p_res = get_resource(roster_usr, resname); if (p_res) return p_res->status_msg; return roster_usr->offline_status_message; } char roster_getprio(const char *jid, const char *resname) { GSList *sl_user; roster *roster_usr; res *p_res; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (sl_user == NULL) return offline; // Not in the roster, anyway... roster_usr = (roster*)sl_user->data; p_res = get_resource(roster_usr, resname); if (p_res) return p_res->prio; return 0; } guint roster_gettype(const char *jid) { GSList *sl_user; roster *roster_usr; if ((sl_user = roster_find(jid, jidsearch, 0)) == NULL) return 0; roster_usr = (roster*)sl_user->data; return roster_usr->type; } guint roster_getsubscription(const char *jid) { GSList *sl_user; roster *roster_usr; if ((sl_user = roster_find(jid, jidsearch, 0)) == NULL) return 0; roster_usr = (roster*)sl_user->data; return roster_usr->subscription; } // roster_unsubscribed() // We have lost buddy's presence updates; this function clears the status // message, sets the buddy offline and frees the resources void roster_unsubscribed(const char *jid) { GSList *sl_user; roster *roster_usr; sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (sl_user == NULL) return; roster_usr = (roster*)sl_user->data; free_all_resources(&roster_usr->resource); } /* ### BuddyList functions ### */ // buddylist_set_hide_offline_buddies(hide) // "hide" values: 1=hide 0=show_all -1=invert void buddylist_set_hide_offline_buddies(int hide) { if (hide < 0) { // NEG (invert) if (display_filter == DFILTER_ALL) display_filter = DFILTER_ONLINE; else display_filter = DFILTER_ALL; } else if (hide == 0) { // FALSE (don't hide -- andfo_) display_filter = DFILTER_ALL; } else { // TRUE (hide -- andfo) display_filter = DFILTER_ONLINE; } } int buddylist_isset_filter(void) { return (display_filter != DFILTER_ALL); } int buddylist_is_status_filtered(enum imstatus status) { return display_filter & (1 << status); } void buddylist_set_filter(guchar filter) { display_filter = filter; } guchar buddylist_get_filter(void) { return display_filter; } // buddylist_build() // Creates the buddylist from the roster entries. void buddylist_build(void) { GSList *sl_roster_elt = groups; roster *roster_elt; roster *roster_current_buddy = NULL; roster *roster_alternate_buddy = NULL; roster *roster_last_activity_buddy = NULL; int shrunk_group; // We need to remember which buddy is selected. if (current_buddy) roster_current_buddy = BUDDATA(current_buddy); current_buddy = NULL; if (alternate_buddy) roster_alternate_buddy = BUDDATA(alternate_buddy); alternate_buddy = NULL; if (last_activity_buddy) roster_last_activity_buddy = BUDDATA(last_activity_buddy); last_activity_buddy = NULL; // Destroy old buddylist if (buddylist) { g_list_free(buddylist); buddylist = NULL; } buddylist = g_list_append(buddylist, &roster_special); // Create the new list while (sl_roster_elt) { GSList *sl_roster_usrelt; roster *roster_usrelt; guint pending_group = TRUE; roster_elt = (roster*) sl_roster_elt->data; shrunk_group = roster_elt->flags & ROSTER_FLAG_HIDE; sl_roster_usrelt = roster_elt->list; while (sl_roster_usrelt) { roster_usrelt = (roster*) sl_roster_usrelt->data; // Buddy will be added if either: // - buddy's status matches the display_filter // - buddy has a lock (for example the buddy window is currently open) // - buddy has a pending (non-read) message // - group isn't hidden (shrunk) // - this is the current_buddy if (roster_usrelt == roster_current_buddy || buddylist_is_status_filtered(buddy_getstatus((gpointer)roster_usrelt, NULL)) || (buddy_getflags((gpointer)roster_usrelt) & (ROSTER_FLAG_LOCK | ROSTER_FLAG_USRLOCK | ROSTER_FLAG_MSG))) { // This user should be added. Maybe the group hasn't been added yet? if (pending_group) { // It hasn't been done yet buddylist = g_list_append(buddylist, roster_elt); pending_group = FALSE; } // Add user // XXX Should we add the user if there is a message and // the group is shrunk? If so, we'd need to check LOCK flag too, // perhaps... if (!shrunk_group) buddylist = g_list_append(buddylist, roster_usrelt); } sl_roster_usrelt = g_slist_next(sl_roster_usrelt); } sl_roster_elt = g_slist_next(sl_roster_elt); } // Check if we can find our saved current_buddy... if (roster_current_buddy) current_buddy = g_list_find(buddylist, roster_current_buddy); if (roster_alternate_buddy) alternate_buddy = g_list_find(buddylist, roster_alternate_buddy); if (roster_last_activity_buddy) last_activity_buddy = g_list_find(buddylist, roster_last_activity_buddy); // current_buddy initialization if (!current_buddy || (g_list_position(buddylist, current_buddy) == -1)) current_buddy = g_list_first(buddylist); } // buddy_hide_group(roster, hide) // "hide" values: 1=hide 0=show_all -1=invert void buddy_hide_group(gpointer rosterdata, int hide) { roster *roster_usr = rosterdata; if (hide > 0) // TRUE (hide) roster_usr->flags |= ROSTER_FLAG_HIDE; else if (hide < 0) // NEG (invert) roster_usr->flags ^= ROSTER_FLAG_HIDE; else // FALSE (don't hide) roster_usr->flags &= ~ROSTER_FLAG_HIDE; } const char *buddy_getjid(gpointer rosterdata) { roster *roster_usr = rosterdata; if (!rosterdata) return NULL; return roster_usr->jid; } // buddy_setgroup() // Change the group of current buddy // // Note: buddy_setgroup() updates the user lists. // void buddy_setgroup(gpointer rosterdata, char *newgroupname) { roster *roster_usr = rosterdata; GSList **sl_group; GSList *sl_newgroup; roster *my_newgroup; // A group has no group :) if (roster_usr->type & ROSTER_TYPE_GROUP) return; // Add newgroup if necessary if (!newgroupname) newgroupname = ""; sl_newgroup = roster_add_group(newgroupname); if (!sl_newgroup) return; my_newgroup = (roster*)sl_newgroup->data; // Remove the buddy from current group sl_group = &((roster*)((GSList*)roster_usr->list)->data)->list; *sl_group = g_slist_remove(*sl_group, rosterdata); // Remove old group if it is empty if (!*sl_group) { roster *roster_grp = (roster*)((GSList*)roster_usr->list)->data; g_free((gchar*)roster_grp->jid); g_free((gchar*)roster_grp->name); g_free(roster_grp); groups = g_slist_remove(groups, roster_grp); } // Add the buddy to its new group roster_usr->list = sl_newgroup; // (my_newgroup SList element) my_newgroup->list = g_slist_insert_sorted(my_newgroup->list, roster_usr, (GCompareFunc)&roster_compare_name); buddylist_build(); } void buddy_setname(gpointer rosterdata, char *newname) { roster *roster_usr = rosterdata; GSList **sl_group; // TODO For groups, we need to check for unicity // However, renaming a group boils down to moving all its buddies to // another group, so calling this function is not really necessary... if (roster_usr->type & ROSTER_TYPE_GROUP) return; if (roster_usr->name) { g_free((gchar*)roster_usr->name); roster_usr->name = NULL; } if (newname) roster_usr->name = g_strdup(newname); // We need to resort the group list sl_group = &((roster*)((GSList*)roster_usr->list)->data)->list; *sl_group = g_slist_sort(*sl_group, (GCompareFunc)&roster_compare_name); buddylist_build(); } const char *buddy_getname(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->name; } // buddy_setnickname(buddy, newnickname) // Only for chatrooms void buddy_setnickname(gpointer rosterdata, const char *newname) { roster *roster_usr = rosterdata; if (!(roster_usr->type & ROSTER_TYPE_ROOM)) return; // XXX Error message? if (roster_usr->nickname) { g_free((gchar*)roster_usr->nickname); roster_usr->nickname = NULL; } if (newname) roster_usr->nickname = g_strdup(newname); } const char *buddy_getnickname(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->nickname; } // buddy_setinsideroom(buddy, inside) // Only for chatrooms void buddy_setinsideroom(gpointer rosterdata, guint inside) { roster *roster_usr = rosterdata; if (!(roster_usr->type & ROSTER_TYPE_ROOM)) return; roster_usr->inside_room = inside; } guint buddy_getinsideroom(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->inside_room; } // buddy_settopic(buddy, newtopic) // Only for chatrooms void buddy_settopic(gpointer rosterdata, const char *newtopic) { roster *roster_usr = rosterdata; if (!(roster_usr->type & ROSTER_TYPE_ROOM)) return; if (roster_usr->topic) { g_free((gchar*)roster_usr->topic); roster_usr->topic = NULL; } if (newtopic) roster_usr->topic = g_strdup(newtopic); } const char *buddy_gettopic(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->topic; } void buddy_setprintstatus(gpointer rosterdata, enum room_printstatus pstatus) { roster *roster_usr = rosterdata; roster_usr->print_status = pstatus; } enum room_printstatus buddy_getprintstatus(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->print_status; } void buddy_setautowhois(gpointer rosterdata, enum room_autowhois awhois) { roster *roster_usr = rosterdata; roster_usr->auto_whois = awhois; } enum room_autowhois buddy_getautowhois(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->auto_whois; } void buddy_setflagjoins(gpointer rosterdata, enum room_flagjoins fjoins) { roster *roster_usr = rosterdata; roster_usr->flag_joins = fjoins; } enum room_flagjoins buddy_getflagjoins(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->flag_joins; } // buddy_getgroupname() // Returns a pointer on buddy's group name. const char *buddy_getgroupname(gpointer rosterdata) { roster *roster_usr = rosterdata; if (roster_usr->type & ROSTER_TYPE_GROUP) return roster_usr->name; if (roster_usr->type & ROSTER_TYPE_SPECIAL) return NULL; // This is a user return ((roster*)((GSList*)roster_usr->list)->data)->name; } // buddy_getgroup() // Returns a pointer on buddy's group. gpointer buddy_getgroup(gpointer rosterdata) { roster *roster_usr = rosterdata; if (roster_usr->type & ROSTER_TYPE_GROUP) return rosterdata; if (roster_usr->type & ROSTER_TYPE_SPECIAL) return NULL; // This is a user return (gpointer)((GSList*)roster_usr->list)->data; } void buddy_settype(gpointer rosterdata, guint type) { roster *roster_usr = rosterdata; roster_usr->type = type; } guint buddy_gettype(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->type; } guint buddy_getsubscription(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->subscription; } enum imstatus buddy_getstatus(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->status; return offline; } const char *buddy_getstatusmsg(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->status_msg; return roster_usr->offline_status_message; } time_t buddy_getstatustime(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->status_timestamp; return 0; } gchar buddy_getresourceprio(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->prio; return 0; } guint buddy_resource_getevents(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->events; return ROSTER_EVENT_NONE; } void buddy_resource_setevents(gpointer rosterdata, const char *resname, guint events) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) p_res->events = events; } char *buddy_resource_getcaps(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->caps; return NULL; } void buddy_resource_setcaps(gpointer rosterdata, const char *resname, const char *caps) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) { g_free(p_res->caps); p_res->caps = g_strdup(caps); } } struct xep0022 *buddy_resource_xep22(gpointer rosterdata, const char *resname) { #ifdef XEP0022 roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return &p_res->xep22; #endif return NULL; } struct xep0085 *buddy_resource_xep85(gpointer rosterdata, const char *resname) { #ifdef XEP0085 roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return &p_res->xep85; #endif return NULL; } struct pgp_data *buddy_resource_pgp(gpointer rosterdata, const char *resname) { #ifdef HAVE_GPGME roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return &p_res->pgpdata; #endif return NULL; } enum imrole buddy_getrole(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->role; return role_none; } enum imaffiliation buddy_getaffil(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->affil; return affil_none; } const char *buddy_getrjid(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) return p_res->realjid; return NULL; } // buddy_getresources(roster_data) // Return a singly-linked-list of resource names // Note: the caller should free the list (and data) after use // If roster_data is null, the current buddy is selected GSList *buddy_getresources(gpointer rosterdata) { roster *roster_usr = rosterdata; GSList *reslist = NULL, *lp; if (!roster_usr) { if (!current_buddy) return NULL; roster_usr = BUDDATA(current_buddy); } for (lp = roster_usr->resource; lp; lp = g_slist_next(lp)) reslist = g_slist_append(reslist, g_strdup(((res*)lp->data)->name)); return reslist; } // buddy_getresources_locale(roster_data) // Same as buddy_getresources() but names are converted to user's locale // Note: the caller should free the list (and data) after use GSList *buddy_getresources_locale(gpointer rosterdata) { GSList *reslist, *lp; reslist = buddy_getresources(rosterdata); // Convert each item to UI's locale for (lp = reslist; lp; lp = g_slist_next(lp)) { gchar *oldname = lp->data; lp->data = from_utf8(oldname); if (lp->data) g_free(oldname); else lp->data = oldname; } return reslist; } // buddy_getactiveresource(roster_data) // Returns name of active (selected for chat) resource const char *buddy_getactiveresource(gpointer rosterdata) { roster *roster_usr = rosterdata; res *resource; if (!roster_usr) { if (!current_buddy) return NULL; roster_usr = BUDDATA(current_buddy); } resource = roster_usr->active_resource; if (!resource) return NULL; return resource->name; } void buddy_setactiveresource(gpointer rosterdata, const char *resname) { roster *roster_usr = rosterdata; res *p_res = NULL; if (resname) p_res = get_resource(roster_usr, resname); roster_usr->active_resource = p_res; } /* // buddy_isresource(roster_data) // Return true if there is at least one resource // (which means, for a room, that it isn't empty) int buddy_isresource(gpointer rosterdata) { roster *roster_usr = rosterdata; if (!roster_usr) return FALSE; if (roster_usr->resource) return TRUE; return FALSE; } */ // buddy_resource_setname(roster_data, oldname, newname) // Useful for nickname change in a MUC room void buddy_resource_setname(gpointer rosterdata, const char *resname, const char *newname) { roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) { if (p_res->name) { g_free((gchar*)p_res->name); p_res->name = NULL; } if (newname) p_res->name = g_strdup(newname); } } // buddy_del_all_resources() // Remove all resources from the specified buddy void buddy_del_all_resources(gpointer rosterdata) { roster *roster_usr = rosterdata; while (roster_usr->resource) { res *r = roster_usr->resource->data; del_resource(roster_usr, r->name); } } // buddy_setflags() // Set one or several flags to value (TRUE/FALSE) void buddy_setflags(gpointer rosterdata, guint flags, guint value) { roster *roster_usr = rosterdata; if (value) roster_usr->flags |= flags; else roster_usr->flags &= ~flags; } guint buddy_getflags(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->flags; } guint buddy_getuiprio(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->ui_prio; } // buddy_setonserverflag() // Set the on_server flag void buddy_setonserverflag(gpointer rosterdata, guint onserver) { roster *roster_usr = rosterdata; roster_usr->on_server = onserver; } guint buddy_getonserverflag(gpointer rosterdata) { roster *roster_usr = rosterdata; return roster_usr->on_server; } // buddy_search_jid(jid) // Look for a buddy with specified jid. // Search begins at buddylist; if no match is found in the the buddylist, // return NULL; GList *buddy_search_jid(const char *jid) { GList *buddy; roster *roster_usr; if (!buddylist) return NULL; for (buddy = buddylist; buddy; buddy = g_list_next(buddy)) { roster_usr = (roster*)buddy->data; if (roster_usr->jid && !strcasecmp(roster_usr->jid, jid)) return buddy; } return NULL; } // buddy_search(string) // Look for a buddy whose name or jid contains string. // Search begins at current_buddy; if no match is found in the the buddylist, // return NULL; GList *buddy_search(char *string) { GList *buddy = current_buddy; roster *roster_usr; if (!buddylist || !current_buddy) return NULL; for (;;) { gchar *jid_locale, *name_locale; char *found = NULL; buddy = g_list_next(buddy); if (!buddy) buddy = buddylist; roster_usr = (roster*)buddy->data; jid_locale = from_utf8(roster_usr->jid); if (jid_locale) { found = strcasestr(jid_locale, string); g_free(jid_locale); if (found) return buddy; } name_locale = from_utf8(roster_usr->name); if (name_locale) { found = strcasestr(name_locale, string); g_free(name_locale); if (found) return buddy; } if (buddy == current_buddy) return NULL; // Back to the beginning, and no match found } } // foreach_buddy(roster_type, pfunction, param) // Call pfunction(buddy, param) for each buddy from the roster with // type matching roster_type. void foreach_buddy(guint roster_type, void (*pfunc)(gpointer rosterdata, void *param), void *param) { GSList *sl_roster_elt = groups; roster *roster_elt; GSList *sl_roster_usrelt; roster *roster_usrelt; while (sl_roster_elt) { // group list loop roster_elt = (roster*) sl_roster_elt->data; if (roster_elt->type & ROSTER_TYPE_SPECIAL) continue; // Skip special items sl_roster_usrelt = roster_elt->list; while (sl_roster_usrelt) { // user list loop roster_usrelt = (roster*) sl_roster_usrelt->data; if (roster_usrelt->type & roster_type) pfunc(roster_usrelt, param); sl_roster_usrelt = g_slist_next(sl_roster_usrelt); } sl_roster_elt = g_slist_next(sl_roster_elt); } } // foreach_group_member(group, pfunction, param) // Call pfunction(buddy, param) for each buddy in the specified group. void foreach_group_member(gpointer groupdata, void (*pfunc)(gpointer rosterdata, void *param), void *param) { roster *roster_elt; GSList *sl_roster_usrelt; roster *roster_usrelt; roster_elt = groupdata; if (!(roster_elt->type & ROSTER_TYPE_GROUP)) return; sl_roster_usrelt = roster_elt->list; while (sl_roster_usrelt) { // user list loop GSList *next_sl_usrelt; roster_usrelt = (roster*) sl_roster_usrelt->data; next_sl_usrelt = g_slist_next(sl_roster_usrelt); pfunc(roster_usrelt, param); sl_roster_usrelt = next_sl_usrelt; } } // compl_list(type) // Returns a list of jid's or groups. (For commands completion) // type: ROSTER_TYPE_USER (jid's) or ROSTER_TYPE_GROUP (group names) // The list should be freed by the caller after use. GSList *compl_list(guint type) { GSList *list = NULL; GSList *sl_roster_elt = groups; roster *roster_elt; GSList *sl_roster_usrelt; roster *roster_usrelt; while (sl_roster_elt) { // group list loop roster_elt = (roster*) sl_roster_elt->data; if (roster_elt->type & ROSTER_TYPE_SPECIAL) continue; // Skip special items if (type == ROSTER_TYPE_GROUP) { // (group names) if (roster_elt->name && *(roster_elt->name)) list = g_slist_append(list, from_utf8(roster_elt->name)); } else { // ROSTER_TYPE_USER (jid) (or agent, or chatroom...) sl_roster_usrelt = roster_elt->list; while (sl_roster_usrelt) { // user list loop roster_usrelt = (roster*) sl_roster_usrelt->data; if (roster_usrelt->jid) list = g_slist_append(list, from_utf8(roster_usrelt->jid)); sl_roster_usrelt = g_slist_next(sl_roster_usrelt); } } sl_roster_elt = g_slist_next(sl_roster_elt); } return list; } // unread_msg(rosterdata) // Return the next buddy with an unread message. If the parameter is NULL, // return the first buddy with an unread message. gpointer unread_msg(gpointer rosterdata) { GSList *unread, *next_unread; if (!unread_list) return NULL; // First unread message if (!rosterdata) return unread_list->data; unread = g_slist_find(unread_list, rosterdata); if (!unread) return unread_list->data; next_unread = g_slist_next(unread); if (next_unread) return next_unread->data; return unread_list->data; } /* ### "unread_jids" functions ### * * The unread_jids hash table is used to keep track of the buddies with * unread messages when a disconnection occurs. * When removing a buddy with an unread message from the roster, the * jid should be added to the unread_jids table. When adding a buddy to * the roster, we check if (s)he had a pending unread message. */ // unread_jid_add(jid) // Add jid to the unread_jids hash table void unread_jid_add(const char *jid) { if (!unread_jids) { // Initialize unread_jids hash table unread_jids = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); } // The 2nd unread_jids is an arbitrary non-null pointer: g_hash_table_insert(unread_jids, g_strdup(jid), unread_jids); } // unread_jid_del(jid) // Return TRUE if jid is found in the table (and remove it), FALSE if not static int unread_jid_del(const char *jid) { if (!unread_jids) return FALSE; return g_hash_table_remove(unread_jids, jid); } // Helper function for unread_jid_get_list() static void add_to_unreadjids(gpointer key, gpointer value, gpointer udata) { GList **listp = udata; *listp = g_list_append(*listp, key); } // unread_jid_get_list() // Return the JID list. // The content of the list should not be modified or freed. // The caller should call g_list_free() after use. GList *unread_jid_get_list(void) { GList *list = NULL; if (!unread_jids) return NULL; // g_hash_table_get_keys() is only in glib >= 2.14 //return g_hash_table_get_keys(unread_jids); g_hash_table_foreach(unread_jids, add_to_unreadjids, &list); return list; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/roster.h000066400000000000000000000225021216603513500162520ustar00rootroot00000000000000#ifndef __MCABBER_ROSTER_H__ #define __MCABBER_ROSTER_H__ 1 #include #include #include #include #define SPECIAL_BUFFER_STATUS_ID "[status]" // Default UI priorities #define ROSTER_UI_PRIO_MUC_MESSAGE 20 #define ROSTER_UI_PRIO_MUC_HL_MESSAGE 30 #define ROSTER_UI_PRIO_MUC_PRIV_MESSAGE 40 #define ROSTER_UI_PRIO_PRIVATE_MESSAGE 50 #define ROSTER_UI_PRIO_ATTENTION_MESSAGE 100 #define ROSTER_UI_PRIO_STATUS_WIN_MESSAGE 500 enum imstatus { offline, available, freeforchat, dontdisturb, notavail, away, invisible, imstatus_size }; extern char imstatus2char[]; // Should match enum above enum imrole { role_none, role_moderator, role_participant, role_visitor, imrole_size }; extern char *strrole[]; // Should match enum above enum imaffiliation { affil_none, affil_owner, affil_admin, affil_member, affil_outcast, imaffiliation_size }; extern char *straffil[]; // Should match enum above enum subscr { sub_none = 0, sub_pending = 1, sub_to = 1 << 1, sub_from = 1 << 2, sub_both = sub_to|sub_from, sub_remove = 1 << 3 }; enum findwhat { jidsearch, namesearch }; enum setuiprio_ops { prio_set, // Set priority prio_max, // Set priority to max(specified, current) prio_inc, // Increment priority }; extern char *strprintstatus[]; // Note: do not change the ordering as these values are visible // to the user (option 'muc_print_status')! enum room_printstatus { status_default, status_none, status_in_and_out, status_all }; extern char *strautowhois[]; enum room_autowhois { autowhois_default, autowhois_off, autowhois_on }; extern char *strflagjoins[]; enum room_flagjoins { flagjoins_default, flagjoins_none, flagjoins_joins, flagjoins_all }; struct role_affil { enum { type_role, type_affil } type; union { enum imrole role; enum imaffiliation affil; } val; }; // Roster_type is a set of flags, so values should be 2^n #define ROSTER_TYPE_USER 1U #define ROSTER_TYPE_GROUP (1U<<1) #define ROSTER_TYPE_AGENT (1U<<2) #define ROSTER_TYPE_ROOM (1U<<3) #define ROSTER_TYPE_SPECIAL (1U<<4) // Flags: #define ROSTER_FLAG_MSG 1U // Message not read #define ROSTER_FLAG_HIDE (1U<<1) // Group hidden (or buddy window closed) #define ROSTER_FLAG_LOCK (1U<<2) // Node should not be removed from buddylist #define ROSTER_FLAG_USRLOCK (1U<<3) // Node should not be removed from buddylist // ROSTER_FLAG_LOCAL (1U<<4) // Buddy not on server's roster (??) // #define XEP0022 (Officially obsoleted by XMPP Council) #define XEP0085 struct xep0022 { guint support; guint last_state_sent; gchar *last_msgid_sent; guint last_state_rcvd; gchar *last_msgid_rcvd; }; struct xep0085 { guint support; guint last_state_sent; guint last_state_rcvd; }; enum chatstate_support { CHATSTATES_SUPPORT_UNKNOWN = 0, CHATSTATES_SUPPORT_PROBED, CHATSTATES_SUPPORT_NONE, CHATSTATES_SUPPORT_OK }; struct pgp_data { gchar *sign_keyid; // KeyId used by the contact to sign their presence/msg #ifdef HAVE_GPGME gpgme_sigsum_t last_sigsum; // Last signature summary #endif }; /* Message event and chat state flags */ #define ROSTER_EVENT_NONE 0U /* XEP-22 Message Events */ #define ROSTER_EVENT_OFFLINE (1U<<0) #define ROSTER_EVENT_DELIVERED (1U<<1) #define ROSTER_EVENT_DISPLAYED (1U<<2) /* XEP-22 & XEP-85 */ #define ROSTER_EVENT_COMPOSING (1U<<3) /* XEP-85 Chat State Notifications */ #define ROSTER_EVENT_ACTIVE (1U<<4) #define ROSTER_EVENT_PAUSED (1U<<5) #define ROSTER_EVENT_INACTIVE (1U<<6) #define ROSTER_EVENT_GONE (1U<<7) extern GList *buddylist; extern GList *current_buddy; extern GList *alternate_buddy; extern GList *last_activity_buddy; // Macros... #define BUDDATA(glist_node) ((glist_node)->data) #define CURRENT_JID buddy_getjid(BUDDATA(current_buddy)) // Prototypes... void roster_init(void); GSList *roster_add_group(const char *name); GSList *roster_add_user(const char *jid, const char *name, const char *group, guint type, enum subscr esub, gint on_server); GSList *roster_find(const char *jidname, enum findwhat type, guint roster_type); void roster_del_user(const char *jid); void roster_free(void); void roster_setstatus(const char *jid, const char *resname, gchar prio, enum imstatus bstat, const char *status_msg, time_t timestamp, enum imrole role, enum imaffiliation affil, const char *realjid); void roster_setflags(const char *jid, guint flags, guint value); void roster_msg_setflag(const char *jid, guint special, guint value); void roster_setuiprio(const char *jid, guint special, guint value, enum setuiprio_ops action); guint roster_getuiprio(const char *jid, guint special); const char *roster_getname(const char *jid); const char *roster_getnickname(const char *jid); void roster_settype(const char *jid, guint type); enum imstatus roster_getstatus(const char *jid, const char *resname); const char *roster_getstatusmsg(const char *jid, const char *resname); char roster_getprio(const char *jid, const char *resname); guint roster_gettype(const char *jid); guint roster_getsubscription(const char *jid); void roster_unsubscribed(const char *jid); void buddylist_build(void); void buddy_hide_group(gpointer rosterdata, int hide); void buddylist_set_hide_offline_buddies(int hide); int buddylist_isset_filter(void); int buddylist_is_status_filtered(enum imstatus status); void buddylist_set_filter(guchar); guchar buddylist_get_filter(void); const char *buddy_getjid(gpointer rosterdata); void buddy_setname(gpointer rosterdata, char *newname); const char *buddy_getname(gpointer rosterdata); void buddy_setnickname(gpointer rosterdata, const char *newname); const char *buddy_getnickname(gpointer rosterdata); void buddy_setinsideroom(gpointer rosterdata, guint inside); guint buddy_getinsideroom(gpointer rosterdata); void buddy_settopic(gpointer rosterdata, const char *newtopic); const char *buddy_gettopic(gpointer rosterdata); void buddy_setprintstatus(gpointer rosterdata, enum room_printstatus); enum room_printstatus buddy_getprintstatus(gpointer rosterdata); void buddy_setautowhois(gpointer rosterdata, enum room_autowhois); enum room_autowhois buddy_getautowhois(gpointer rosterdata); void buddy_setflagjoins(gpointer rosterdata, enum room_flagjoins); enum room_flagjoins buddy_getflagjoins(gpointer rosterdata); void buddy_settype(gpointer rosterdata, guint type); guint buddy_gettype(gpointer rosterdata); guint buddy_getsubscription(gpointer rosterdata); void buddy_setgroup(gpointer rosterdata, char *newgroupname); const char *buddy_getgroupname(gpointer rosterdata); gpointer buddy_getgroup(gpointer rosterdata); enum imstatus buddy_getstatus(gpointer rosterdata, const char *resname); const char *buddy_getstatusmsg(gpointer rosterdata, const char *resname); time_t buddy_getstatustime(gpointer rosterdata, const char *resname); gchar buddy_getresourceprio(gpointer rosterdata, const char *resname); //int buddy_isresource(gpointer rosterdata); GSList *buddy_getresources(gpointer rosterdata); GSList *buddy_getresources_locale(gpointer rosterdata); const char *buddy_getactiveresource(gpointer rosterdata); void buddy_setactiveresource(gpointer rosterdata, const char *resname); void buddy_resource_setname(gpointer rosterdata, const char *resname, const char *newname); void buddy_resource_setevents(gpointer rosterdata, const char *resname, guint event); guint buddy_resource_getevents(gpointer rosterdata, const char *resname); void buddy_resource_setcaps(gpointer rosterdata, const char *resname, const char *caps); char *buddy_resource_getcaps(gpointer rosterdata, const char *resname); struct xep0022 *buddy_resource_xep22(gpointer rosterdata, const char *resname); struct xep0085 *buddy_resource_xep85(gpointer rosterdata, const char *resname); struct pgp_data *buddy_resource_pgp(gpointer rosterdata, const char *resname); enum imrole buddy_getrole(gpointer rosterdata, const char *resname); enum imaffiliation buddy_getaffil(gpointer rosterdata, const char *resname); const char *buddy_getrjid(gpointer rosterdata, const char *resname); void buddy_del_all_resources(gpointer rosterdata); void buddy_setflags(gpointer rosterdata, guint flags, guint value); guint buddy_getflags(gpointer rosterdata); guint buddy_getuiprio(gpointer rosterdata); void buddy_setonserverflag(gpointer rosterdata, guint onserver); guint buddy_getonserverflag(gpointer rosterdata); GList *buddy_search_jid(const char *jid); GList *buddy_search(char *string); void foreach_buddy(guint roster_type, void (*pfunc)(gpointer rosterdata, void *param), void *param); void foreach_group_member(gpointer groupdata, void (*pfunc)(gpointer rosterdata, void *param), void *param); gpointer unread_msg(gpointer rosterdata); void unread_jid_add(const char *jid); GList *unread_jid_get_list(void); GSList *compl_list(guint type); #endif /* __MCABBER_ROSTER_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/screen.c000066400000000000000000003572331216603513500162220ustar00rootroot00000000000000/* * screen.c -- UI stuff * * Copyright (C) 2005-2010 Mikael Berthe * Parts of this file come from the Cabber project * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #include #include #ifdef USE_SIGWINCH # include # include # include #endif #ifdef HAVE_LOCALCHARSET_H # include #else # include #endif #ifdef WITH_ENCHANT # include #else # ifdef WITH_ASPELL # include # endif #endif #include "screen.h" #include "utf8.h" #include "hbuf.h" #include "commands.h" #include "compl.h" #include "roster.h" #include "histolog.h" #include "settings.h" #include "utils.h" #include "xmpp.h" #include "main.h" #define get_color(col) (COLOR_PAIR(col)|COLOR_ATTRIB[col]) #define compose_color(col) (COLOR_PAIR(col->color_pair)|col->color_attrib) #define DEFAULT_LOG_WIN_HEIGHT (5+2) #define DEFAULT_ROSTER_WIDTH 24 #define CHAT_WIN_HEIGHT (maxY-1-Log_Win_Height) const char *LocaleCharSet = "C"; static unsigned short int Log_Win_Height; static unsigned short int Roster_Width; static gboolean colors_stalled = FALSE; // Default attention sign trigger levels static guint ui_attn_sign_prio_level_muc = ROSTER_UI_PRIO_MUC_HL_MESSAGE; static guint ui_attn_sign_prio_level = ROSTER_UI_PRIO_ATTENTION_MESSAGE; static inline void check_offset(int); static void scr_cancel_current_completion(void); static void scr_end_current_completion(void); static void scr_insert_text(const char*); static void scr_handle_tab(void); #if defined XEP0022 || defined XEP0085 static gboolean scr_chatstates_timeout(); #endif #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) static void spellcheck(char *, char *); #endif static GHashTable *winbufhash; typedef struct { GList *hbuf; GList *top; // If top is NULL, we'll display the last lines char cleared; // For ex, user has issued a /clear command... char lock; } buffdata; typedef struct { WINDOW *win; PANEL *panel; buffdata *bd; } winbuf; struct dimensions { int l; int c; }; static WINDOW *rosterWnd, *chatWnd, *activechatWnd, *inputWnd, *logWnd; static WINDOW *mainstatusWnd, *chatstatusWnd; static PANEL *rosterPanel, *chatPanel, *activechatPanel, *inputPanel; static PANEL *mainstatusPanel, *chatstatusPanel; static PANEL *logPanel; static int maxY, maxX; static int prev_chatwidth; static winbuf *statusWindow; static winbuf *currentWindow; static GList *statushbuf; static int roster_hidden; static int chatmode; static int multimode; static char *multiline, *multimode_subj; static int roster_no_leading_space; static bool Curses; static bool log_win_on_top; static bool roster_win_on_right; static guint autoaway_source = 0; static char inputLine[INPUTLINE_LENGTH+1]; #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) static char maskLine[INPUTLINE_LENGTH+1]; #endif static char *ptr_inputline; static short int inputline_offset; static int completion_started; static GList *cmdhisto; static GList *cmdhisto_cur; static guint cmdhisto_nblines; static char cmdhisto_backup[INPUTLINE_LENGTH+1]; static int chatstate; /* (0=active, 1=composing, 2=paused) */ static bool lock_chatstate; static time_t chatstate_timestamp; static guint chatstate_timeout_id = 0; int update_roster; int utf8_mode; gboolean chatstates_disabled; gboolean Autoaway; #define MAX_KEYSEQ_LENGTH 8 typedef struct { char *seqstr; guint mkeycode; gint value; } keyseq; GSList *keyseqlist; static void add_keyseq(char *seqstr, guint mkeycode, gint value); static void scr_write_in_window(const char *winId, const char *text, time_t timestamp, unsigned int prefix_flags, int force_show, unsigned mucnicklen, gpointer xep184); static void scr_write_message(const char *bjid, const char *text, time_t timestamp, guint prefix_flags, unsigned mucnicklen, gpointer xep184); inline void scr_update_buddy_window(void); inline void scr_set_chatmode(int enable); #define SPELLBADCHAR 5 #ifdef WITH_ENCHANT EnchantBroker *spell_broker; EnchantDict *spell_checker; #endif #ifdef WITH_ASPELL AspellConfig *spell_config; AspellSpeller *spell_checker; #endif typedef struct { int color_pair; int color_attrib; } ccolor; typedef struct { char *status, *wildcard; ccolor *color; GPatternSpec *compiled; } rostercolor; static GSList *rostercolrules = NULL; static GHashTable *muccolors = NULL, *nickcolors = NULL; typedef struct { bool manual; // Manually set? ccolor *color; } nickcolor; static int nickcolcount = 0; static ccolor ** nickcols = NULL; static muccoltype glob_muccol = MC_OFF; /* Functions */ static int find_color(const char *name) { int result; if (!strcmp(name, "default")) return -1; if (!strcmp(name, "black")) return COLOR_BLACK; if (!strcmp(name, "red")) return COLOR_RED; if (!strcmp(name, "green")) return COLOR_GREEN; if (!strcmp(name, "yellow")) return COLOR_YELLOW; if (!strcmp(name, "blue")) return COLOR_BLUE; if (!strcmp(name, "magenta")) return COLOR_MAGENTA; if (!strcmp(name, "cyan")) return COLOR_CYAN; if (!strcmp(name, "white")) return COLOR_WHITE; // Directly support 256-color values result = atoi(name); if (result > 0 && (result < COLORS || !Curses)) return result; scr_LogPrint(LPRINT_LOGNORM, "ERROR: Wrong color: %s", name); return -1; } static ccolor *get_user_color(const char *color) { bool isbright = FALSE; int cl; ccolor *ccol; if (!strncmp(color, "bright", 6)) { isbright = TRUE; color += 6; } cl = find_color(color); if (cl < 0) return NULL; ccol = g_new0(ccolor, 1); ccol->color_attrib = isbright ? A_BOLD : A_NORMAL; ccol->color_pair = cl + COLOR_max; // User colors come after the internal ones return ccol; } static void ensure_string_htable(GHashTable **table, GDestroyNotify value_destroy_func) { if (*table) // Have it already return; *table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, value_destroy_func); } // Sets the coloring mode for given MUC // The MUC room does not need to be in the roster at that time // muc - the JID of room // type - the new type void scr_muc_color(const char *muc, muccoltype type) { gchar *muclow = g_utf8_strdown(muc, -1); if (type == MC_REMOVE) { // Remove it if (strcmp(muc, "*")) { if (muccolors && g_hash_table_lookup(muccolors, muclow)) g_hash_table_remove(muccolors, muclow); } else { scr_LogPrint(LPRINT_NORMAL, "Can not remove global coloring mode"); } g_free(muclow); } else { // Add or overwrite if (strcmp(muc, "*")) { muccoltype *value = g_new(muccoltype, 1); *value = type; ensure_string_htable(&muccolors, g_free); g_hash_table_replace(muccolors, muclow, value); } else { glob_muccol = type; g_free(muclow); } } // Need to redraw? if (chatmode && ((buddy_search_jid(muc) == current_buddy) || !strcmp(muc, "*"))) scr_update_buddy_window(); } // Sets the color for nick in MUC // If color is "-", the color is marked as automaticly assigned and is // not used if the room is in the "preset" mode void scr_muc_nick_color(const char *nick, const char *color) { char *snick, *mnick; bool need_update = FALSE; snick = g_strdup_printf("<%s>", nick); mnick = g_strdup_printf("*%s ", nick); if (!strcmp(color, "-")) { // Remove the color if (nickcolors) { nickcolor *nc = g_hash_table_lookup(nickcolors, snick); if (nc) { // Have this nick already nc->manual = FALSE; nc = g_hash_table_lookup(nickcolors, mnick); assert(nc); // Must have both at the same time nc->manual = FALSE; }// Else -> no color saved, nothing to delete } g_free(snick); // They are not saved in the hash g_free(mnick); need_update = TRUE; } else { ccolor *cl = get_user_color(color); if (!cl) { scr_LogPrint(LPRINT_NORMAL, "No such color name"); g_free(snick); g_free(mnick); } else { nickcolor *nc = g_new(nickcolor, 1); ensure_string_htable(&nickcolors, NULL); nc->manual = TRUE; nc->color = cl; // Free the struct, if any there already g_free(g_hash_table_lookup(nickcolors, mnick)); // Save the new ones g_hash_table_replace(nickcolors, mnick, nc); g_hash_table_replace(nickcolors, snick, nc); need_update = TRUE; } } if (need_update && chatmode && (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_ROOM)) scr_update_buddy_window(); } static void free_rostercolrule(rostercolor *col) { g_free(col->status); g_free(col->wildcard); g_free(col->color); g_pattern_spec_free(col->compiled); g_free(col); } // Removes all roster coloring rules void scr_roster_clear_color(void) { GSList *head; for (head = rostercolrules; head; head = g_slist_next(head)) { free_rostercolrule(head->data); } g_slist_free(rostercolrules); rostercolrules = NULL; } // Adds, modifies or removes roster coloring rule // color set to "-" removes the rule, // otherwise it is modified (if exists) or added // // Returns weather it was successfull (therefore the roster should be // redrawed) or not. If it failed, for example because of invalid color // name, it also prints the error. bool scr_roster_color(const char *status, const char *wildcard, const char *color) { GSList *head; GSList *found = NULL; for (head = rostercolrules; head; head = g_slist_next(head)) { rostercolor *rc = head->data; if ((!strcmp(status, rc->status)) && (!strcmp(wildcard, rc->wildcard))) { found = head; break; } } if (!strcmp(color,"-")) { // Delete the rule if (found) { free_rostercolrule(found->data); rostercolrules = g_slist_delete_link(rostercolrules, found); return TRUE; } else { scr_LogPrint(LPRINT_NORMAL, "No such color rule, nothing removed"); return FALSE; } } else { ccolor *cl = get_user_color(color); if (!cl) { scr_LogPrint(LPRINT_NORMAL, "No such color name"); return FALSE; } if (found) { rostercolor *rc = found->data; g_free(rc->color); rc->color = cl; } else { rostercolor *rc = g_new(rostercolor, 1); rc->status = g_strdup(status); rc->wildcard = g_strdup(wildcard); rc->compiled = g_pattern_spec_new(wildcard); rc->color = cl; rostercolrules = g_slist_prepend(rostercolrules, rc); } return TRUE; } } static void parse_colors(void) { const char *colors[] = { "", "", "general", "msgout", "msghl", "status", "log", "roster", "rostersel", "rosterselmsg", "rosternewmsg", "info", "msgin", "readmark", NULL }; const char *color; const char *background = settings_opt_get("color_background"); const char *backselected = settings_opt_get("color_bgrostersel"); const char *backstatus = settings_opt_get("color_bgstatus"); char *tmp; int i; // Initialize color attributes memset(COLOR_ATTRIB, 0, sizeof(COLOR_ATTRIB)); // Default values if (!background) background = "black"; if (!backselected) backselected = "cyan"; if (!backstatus) backstatus = "blue"; for (i=0; colors[i]; i++) { tmp = g_strdup_printf("color_%s", colors[i]); color = settings_opt_get(tmp); g_free(tmp); if (color) { if (!strncmp(color, "bright", 6)) { COLOR_ATTRIB[i+1] = A_BOLD; color += 6; } } switch (i + 1) { case 1: init_pair(1, COLOR_BLACK, COLOR_WHITE); break; case 2: init_pair(2, COLOR_WHITE, COLOR_BLACK); break; case COLOR_GENERAL: init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE), find_color(background)); break; case COLOR_MSGOUT: init_pair(i+1, ((color) ? find_color(color) : COLOR_CYAN), find_color(background)); break; case COLOR_MSGHL: init_pair(i+1, ((color) ? find_color(color) : COLOR_YELLOW), find_color(background)); break; case COLOR_STATUS: init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE), find_color(backstatus)); break; case COLOR_LOG: init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE), find_color(background)); break; case COLOR_ROSTER: init_pair(i+1, ((color) ? find_color(color) : COLOR_GREEN), find_color(background)); break; case COLOR_ROSTERSEL: init_pair(i+1, ((color) ? find_color(color) : COLOR_BLUE), find_color(backselected)); break; case COLOR_ROSTERSELNMSG: init_pair(i+1, ((color) ? find_color(color) : COLOR_RED), find_color(backselected)); break; case COLOR_ROSTERNMSG: init_pair(i+1, ((color) ? find_color(color) : COLOR_RED), find_color(background)); break; case COLOR_INFO: init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE), find_color(background)); break; case COLOR_MSGIN: init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE), find_color(background)); break; case COLOR_READMARK: init_pair(i+1, ((color) ? find_color(color) : COLOR_RED), find_color(background)); break; } } for (i = COLOR_max; i < (COLOR_max + COLORS); i++) init_pair(i, i-COLOR_max, find_color(background)); if (!nickcols) { char *ncolors = g_strdup(settings_opt_get("nick_colors")); if (ncolors) { char *ncolor_start, *ncolor_end; ncolor_start = ncolor_end = ncolors; while (*ncolor_end) ncolor_end++; while (ncolors < ncolor_end && *ncolors) { if ((*ncolors == ' ') || (*ncolors == '\t')) { ncolors++; } else { char *end = ncolors; ccolor *cl; while (*end && (*end != ' ') && (*end != '\t')) end++; *end = '\0'; cl = get_user_color(ncolors); if (!cl) { scr_LogPrint(LPRINT_NORMAL, "Unknown color %s", ncolors); } else { nickcols = g_realloc(nickcols, (++nickcolcount) * sizeof *nickcols); nickcols[nickcolcount-1] = cl; } ncolors = end+1; } } g_free(ncolor_start); } if (!nickcols) { // Fallback to have something nickcolcount = 1; nickcols = g_new(ccolor*, 1); *nickcols = g_new(ccolor, 1); (*nickcols)->color_pair = COLOR_GENERAL; (*nickcols)->color_attrib = A_NORMAL; } } colors_stalled = FALSE; } static void init_keycodes(void) { add_keyseq("O5A", MKEY_EQUIV, 521); // Ctrl-Up add_keyseq("O5B", MKEY_EQUIV, 514); // Ctrl-Down add_keyseq("O5C", MKEY_EQUIV, 518); // Ctrl-Right add_keyseq("O5D", MKEY_EQUIV, 516); // Ctrl-Left add_keyseq("O6A", MKEY_EQUIV, 520); // Shift-Up add_keyseq("O6B", MKEY_EQUIV, 513); // Shift-Down add_keyseq("O6C", MKEY_EQUIV, 402); // Shift-Right add_keyseq("O6D", MKEY_EQUIV, 393); // Shift-Left add_keyseq("O2A", MKEY_EQUIV, 520); // Shift-Up add_keyseq("O2B", MKEY_EQUIV, 513); // Shift-Down add_keyseq("O2C", MKEY_EQUIV, 402); // Shift-Right add_keyseq("O2D", MKEY_EQUIV, 393); // Shift-Left add_keyseq("[5^", MKEY_CTRL_PGUP, 0); // Ctrl-PageUp add_keyseq("[6^", MKEY_CTRL_PGDOWN, 0); // Ctrl-PageDown add_keyseq("[5@", MKEY_CTRL_SHIFT_PGUP, 0); // Ctrl-Shift-PageUp add_keyseq("[6@", MKEY_CTRL_SHIFT_PGDOWN, 0); // Ctrl-Shift-PageDown add_keyseq("[7@", MKEY_CTRL_SHIFT_HOME, 0); // Ctrl-Shift-Home add_keyseq("[8@", MKEY_CTRL_SHIFT_END, 0); // Ctrl-Shift-End add_keyseq("[8^", MKEY_CTRL_END, 0); // Ctrl-End add_keyseq("[7^", MKEY_CTRL_HOME, 0); // Ctrl-Home add_keyseq("[2^", MKEY_CTRL_INS, 0); // Ctrl-Insert add_keyseq("[3^", MKEY_CTRL_DEL, 0); // Ctrl-Delete // Xterm add_keyseq("[1;5A", MKEY_EQUIV, 521); // Ctrl-Up add_keyseq("[1;5B", MKEY_EQUIV, 514); // Ctrl-Down add_keyseq("[1;5C", MKEY_EQUIV, 518); // Ctrl-Right add_keyseq("[1;5D", MKEY_EQUIV, 516); // Ctrl-Left add_keyseq("[1;6A", MKEY_EQUIV, 520); // Ctrl-Shift-Up add_keyseq("[1;6B", MKEY_EQUIV, 513); // Ctrl-Shift-Down add_keyseq("[1;6C", MKEY_EQUIV, 402); // Ctrl-Shift-Right add_keyseq("[1;6D", MKEY_EQUIV, 393); // Ctrl-Shift-Left add_keyseq("[1;6H", MKEY_CTRL_SHIFT_HOME, 0); // Ctrl-Shift-Home add_keyseq("[1;6F", MKEY_CTRL_SHIFT_END, 0); // Ctrl-Shift-End add_keyseq("[1;2A", MKEY_EQUIV, 521); // Shift-Up add_keyseq("[1;2B", MKEY_EQUIV, 514); // Shift-Down add_keyseq("[5;5~", MKEY_CTRL_PGUP, 0); // Ctrl-PageUp add_keyseq("[6;5~", MKEY_CTRL_PGDOWN, 0); // Ctrl-PageDown add_keyseq("[1;5F", MKEY_CTRL_END, 0); // Ctrl-End add_keyseq("[1;5H", MKEY_CTRL_HOME, 0); // Ctrl-Home add_keyseq("[2;5~", MKEY_CTRL_INS, 0); // Ctrl-Insert add_keyseq("[3;5~", MKEY_CTRL_DEL, 0); // Ctrl-Delete // PuTTY add_keyseq("[A", MKEY_EQUIV, 521); // Ctrl-Up add_keyseq("[B", MKEY_EQUIV, 514); // Ctrl-Down add_keyseq("[C", MKEY_EQUIV, 518); // Ctrl-Right add_keyseq("[D", MKEY_EQUIV, 516); // Ctrl-Left // screen add_keyseq("Oa", MKEY_EQUIV, 521); // Ctrl-Up add_keyseq("Ob", MKEY_EQUIV, 514); // Ctrl-Down add_keyseq("Oc", MKEY_EQUIV, 518); // Ctrl-Right add_keyseq("Od", MKEY_EQUIV, 516); // Ctrl-Left add_keyseq("[a", MKEY_EQUIV, 520); // Shift-Up add_keyseq("[b", MKEY_EQUIV, 513); // Shift-Down add_keyseq("[c", MKEY_EQUIV, 402); // Shift-Right add_keyseq("[d", MKEY_EQUIV, 393); // Shift-Left add_keyseq("[5$", MKEY_SHIFT_PGUP, 0); // Shift-PageUp add_keyseq("[6$", MKEY_SHIFT_PGDOWN, 0); // Shift-PageDown // VT100 add_keyseq("[H", MKEY_EQUIV, KEY_HOME); // Home add_keyseq("[F", MKEY_EQUIV, KEY_END); // End // Konsole Linux add_keyseq("[1~", MKEY_EQUIV, KEY_HOME); // Home add_keyseq("[4~", MKEY_EQUIV, KEY_END); // End } // scr_init_bindings() // Create default key bindings // Return 0 if error and 1 if none void scr_init_bindings(void) { GString *sbuf = g_string_new(""); // Common backspace key codes: 8, 127 settings_set(SETTINGS_TYPE_BINDING, "8", "iline char_bdel"); // Ctrl-h settings_set(SETTINGS_TYPE_BINDING, "127", "iline char_bdel"); g_string_printf(sbuf, "%d", KEY_BACKSPACE); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline char_bdel"); g_string_printf(sbuf, "%d", KEY_DC); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline char_fdel"); g_string_printf(sbuf, "%d", KEY_LEFT); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline bchar"); g_string_printf(sbuf, "%d", KEY_RIGHT); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline fchar"); settings_set(SETTINGS_TYPE_BINDING, "7", "iline compl_cancel"); // Ctrl-g g_string_printf(sbuf, "%d", KEY_UP); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline hist_beginning_search_bwd"); g_string_printf(sbuf, "%d", KEY_DOWN); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline hist_beginning_search_fwd"); g_string_printf(sbuf, "%d", KEY_PPAGE); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster up"); g_string_printf(sbuf, "%d", KEY_NPAGE); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster down"); g_string_printf(sbuf, "%d", KEY_HOME); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline iline_start"); settings_set(SETTINGS_TYPE_BINDING, "1", "iline iline_start"); // Ctrl-a g_string_printf(sbuf, "%d", KEY_END); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline iline_end"); settings_set(SETTINGS_TYPE_BINDING, "5", "iline iline_end"); // Ctrl-e // Ctrl-o (accept-line-and-down-history): settings_set(SETTINGS_TYPE_BINDING, "15", "iline iline_accept_down_hist"); settings_set(SETTINGS_TYPE_BINDING, "21", "iline iline_bdel"); // Ctrl-u g_string_printf(sbuf, "%d", KEY_EOL); settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline iline_fdel"); settings_set(SETTINGS_TYPE_BINDING, "11", "iline iline_fdel"); // Ctrl-k settings_set(SETTINGS_TYPE_BINDING, "16", "buffer up"); // Ctrl-p settings_set(SETTINGS_TYPE_BINDING, "14", "buffer down"); // Ctrl-n settings_set(SETTINGS_TYPE_BINDING, "20", "iline char_swap"); // Ctrl-t settings_set(SETTINGS_TYPE_BINDING, "23", "iline word_bdel"); // Ctrl-w settings_set(SETTINGS_TYPE_BINDING, "M98", "iline bword"); // Meta-b settings_set(SETTINGS_TYPE_BINDING, "M102", "iline fword"); // Meta-f settings_set(SETTINGS_TYPE_BINDING, "M100", "iline word_fdel"); // Meta-d // Ctrl-Left (2 codes): settings_set(SETTINGS_TYPE_BINDING, "515", "iline bword"); settings_set(SETTINGS_TYPE_BINDING, "516", "iline bword"); // Ctrl-Right (2 codes): settings_set(SETTINGS_TYPE_BINDING, "517", "iline fword"); settings_set(SETTINGS_TYPE_BINDING, "518", "iline fword"); settings_set(SETTINGS_TYPE_BINDING, "12", "screen_refresh"); // Ctrl-l settings_set(SETTINGS_TYPE_BINDING, "27", "chat_disable --show-roster");// Esc settings_set(SETTINGS_TYPE_BINDING, "M27", "chat_disable"); // Esc-Esc settings_set(SETTINGS_TYPE_BINDING, "4", "iline send_multiline"); // Ctrl-d settings_set(SETTINGS_TYPE_BINDING, "M117", "iline word_upcase"); // Meta-u settings_set(SETTINGS_TYPE_BINDING, "M108", "iline word_downcase"); // Meta-l settings_set(SETTINGS_TYPE_BINDING, "M99", "iline word_capit"); // Meta-c settings_set(SETTINGS_TYPE_BINDING, "265", "help"); // Bind F1 to help... g_string_free(sbuf, TRUE); } // is_speckey(key) // Return TRUE if key is a special code, i.e. no char should be displayed on // the screen. It's not very nice, it's a workaround for the systems where // isprint(KEY_PPAGE) returns TRUE... static int is_speckey(int key) { switch (key) { case 127: case 393: case 402: case KEY_BACKSPACE: case KEY_DC: case KEY_LEFT: case KEY_RIGHT: case KEY_UP: case KEY_DOWN: case KEY_PPAGE: case KEY_NPAGE: case KEY_HOME: case KEY_END: case KEY_EOL: return TRUE; } // Fn keys if (key >= 265 && key < 265+12) return TRUE; // Special key combinations if (key >= 513 && key <= 521) return TRUE; return FALSE; } void scr_init_locale_charset(void) { setlocale(LC_ALL, ""); #ifdef HAVE_LOCALCHARSET_H LocaleCharSet = locale_charset(); #else LocaleCharSet = nl_langinfo(CODESET); #endif utf8_mode = (strcmp(LocaleCharSet, "UTF-8") == 0); } gboolean scr_curses_status(void) { return Curses; } static gchar *scr_color_guard(const gchar *key, const gchar *new_value) { if (g_strcmp0(settings_opt_get(key), new_value)) colors_stalled = TRUE; return g_strdup(new_value); } void scr_init_curses(void) { /* Key sequences initialization */ init_keycodes(); initscr(); raw(); noecho(); nonl(); intrflush(stdscr, FALSE); start_color(); use_default_colors(); #ifdef NCURSES_MOUSE_VERSION if (settings_opt_get_int("use_mouse")) mousemask(ALL_MOUSE_EVENTS, NULL); #endif if (settings_opt_get("escdelay")) { #ifdef HAVE_ESCDELAY ESCDELAY = (unsigned) settings_opt_get_int("escdelay"); #else scr_LogPrint(LPRINT_LOGNORM, "ERROR: no ESCDELAY support."); #endif } parse_colors(); settings_set_guard("color_background", scr_color_guard); settings_set_guard("color_general", scr_color_guard); settings_set_guard("color_info", scr_color_guard); settings_set_guard("color_msgin", scr_color_guard); settings_set_guard("color_msgout", scr_color_guard); settings_set_guard("color_msghl", scr_color_guard); settings_set_guard("color_bgstatus", scr_color_guard); settings_set_guard("color_status", scr_color_guard); settings_set_guard("color_log", scr_color_guard); settings_set_guard("color_roster", scr_color_guard); settings_set_guard("color_bgrostersel", scr_color_guard); settings_set_guard("color_rostersel", scr_color_guard); settings_set_guard("color_rosterselmsg", scr_color_guard); settings_set_guard("color_rosternewmsg", scr_color_guard); getmaxyx(stdscr, maxY, maxX); Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT; // Note scr_draw_main_window() should be called early after scr_init_curses() // to update Log_Win_Height and set max{X,Y} inputLine[0] = 0; ptr_inputline = inputLine; Curses = TRUE; return; } void scr_terminate_curses(void) { if (!Curses) return; clear(); refresh(); endwin(); Curses = FALSE; return; } void scr_beep(void) { beep(); } // This and following belongs to dynamic setting of time prefix static const char *timeprefixes[] = { "%m-%d %H:%M ", "%H:%M ", " " }; static const char *spectimeprefixes[] = { "%m-%d %H:%M:%S ", "%H:%M:%S ", " " }; static int timepreflengths[] = { // (length of the corresponding timeprefix + 5) 17, 11, 6 }; static const char *gettprefix(void) { guint n = settings_opt_get_int("time_prefix"); return timeprefixes[(n < 3 ? n : 0)]; } static const char *getspectprefix(void) { guint n = settings_opt_get_int("time_prefix"); return spectimeprefixes[(n < 3 ? n : 0)]; } guint scr_getprefixwidth(void) { guint n = settings_opt_get_int("time_prefix"); return timepreflengths[(n < 3 ? n : 0)]; } guint scr_gettextwidth(void) { return maxX - Roster_Width - scr_getprefixwidth(); } guint scr_gettextheight(void) { // log window, two status bars and one input line return maxY - Log_Win_Height - 3; } guint scr_getlogwinheight(void) { if (Log_Win_Height >= 2) return Log_Win_Height - 2; return 0; } // scr_print_logwindow(string) // Display the string in the log window. // Note: The string must be in the user's locale! void scr_print_logwindow(const char *string) { time_t timestamp; char strtimestamp[64]; timestamp = time(NULL); strftime(strtimestamp, 48, "[%H:%M:%S]", localtime(×tamp)); if (Curses) { wprintw(logWnd, "\n%s %s", strtimestamp, string); update_panels(); } else { printf("%s %s\n", strtimestamp, string); } } // scr_log_print(...) // Display a message in the log window and in the status buffer. // Add the message to the tracelog file if the log flag is set. // This function will convert from UTF-8 unless the LPRINT_NOTUTF8 flag is set. void scr_log_print(unsigned int flag, const char *fmt, ...) { time_t timestamp; char strtimestamp[64]; char *buffer, *btext; char *convbuf1 = NULL, *convbuf2 = NULL; va_list ap; if (!(flag & ~LPRINT_NOTUTF8)) return; // Shouldn't happen timestamp = time(NULL); strftime(strtimestamp, 48, "[%H:%M:%S]", localtime(×tamp)); va_start(ap, fmt); btext = g_strdup_vprintf(fmt, ap); va_end(ap); if (flag & LPRINT_NORMAL) { char *buffer_locale; char *buf_specialwindow; buffer = g_strdup_printf("%s %s", strtimestamp, btext); // Convert buffer to current locale for wprintw() if (!(flag & LPRINT_NOTUTF8)) buffer_locale = convbuf1 = from_utf8(buffer); else buffer_locale = buffer; if (!buffer_locale) { wprintw(logWnd, "\n%s*Error: cannot convert string to locale.", strtimestamp); update_panels(); g_free(buffer); g_free(btext); return; } // For the special status buffer, we need utf-8, but without the timestamp if (flag & LPRINT_NOTUTF8) buf_specialwindow = convbuf2 = to_utf8(btext); else buf_specialwindow = btext; if (Curses) { wprintw(logWnd, "\n%s", buffer_locale); update_panels(); scr_write_in_window(NULL, buf_specialwindow, timestamp, HBB_PREFIX_SPECIAL, FALSE, 0, NULL); } else { printf("%s\n", buffer_locale); // ncurses are not initialized yet, so we call directly hbuf routine hbuf_add_line(&statushbuf, buf_specialwindow, timestamp, HBB_PREFIX_SPECIAL, 0, 0, 0, NULL); } g_free(convbuf1); g_free(convbuf2); g_free(buffer); } if (flag & (LPRINT_LOG|LPRINT_DEBUG)) { strftime(strtimestamp, 23, "[%Y-%m-%d %H:%M:%S]", localtime(×tamp)); buffer = g_strdup_printf("%s %s\n", strtimestamp, btext); ut_write_log(flag, buffer); g_free(buffer); } g_free(btext); } static winbuf *scr_search_window(const char *winId, int special) { char *id; winbuf *wbp; if (special) return statusWindow; // Only one special window atm. if (!winId) return NULL; id = g_strdup(winId); mc_strtolower(id); wbp = g_hash_table_lookup(winbufhash, id); g_free(id); return wbp; } int scr_buddy_buffer_exists(const char *bjid) { return (scr_search_window(bjid, FALSE) != NULL); } // scr_new_buddy(title, dontshow) // Note: title (aka winId/jid) can be NULL for special buffers static winbuf *scr_new_buddy(const char *title, int dont_show) { winbuf *tmp; tmp = g_new0(winbuf, 1); tmp->win = activechatWnd; tmp->panel = activechatPanel; if (!dont_show) { currentWindow = tmp; } else { if (currentWindow) top_panel(currentWindow->panel); else top_panel(chatPanel); } update_panels(); // If title is NULL, this is a special buffer if (title) { char *id; id = hlog_get_log_jid(title); if (id) { winbuf *wb = scr_search_window(id, FALSE); if (!wb) wb = scr_new_buddy(id, TRUE); tmp->bd=wb->bd; g_free(id); } else { // Load buddy history from file (if enabled) tmp->bd = g_new0(buffdata, 1); hlog_read_history(title, &tmp->bd->hbuf, maxX - Roster_Width - scr_getprefixwidth()); // Set a readmark to separate new content hbuf_set_readmark(tmp->bd->hbuf, TRUE); } id = g_strdup(title); mc_strtolower(id); g_hash_table_insert(winbufhash, id, tmp); } else { tmp->bd = g_new0(buffdata, 1); } return tmp; } // scr_line_prefix(line, pref, preflen) // Use data from the hbb_line structure and write the prefix // to pref (not exceeding preflen, trailing null byte included). void scr_line_prefix(hbb_line *line, char *pref, guint preflen) { char date[64]; if (line->timestamp && !(line->flags & (HBB_PREFIX_SPECIAL|HBB_PREFIX_CONT))) { strftime(date, 30, gettprefix(), localtime(&line->timestamp)); } else strcpy(date, " "); if (!(line->flags & HBB_PREFIX_CONT)) { if (line->flags & HBB_PREFIX_INFO) { char dir = '*'; if (line->flags & HBB_PREFIX_IN) dir = '<'; else if (line->flags & HBB_PREFIX_OUT) dir = '>'; g_snprintf(pref, preflen, "%s*%c* ", date, dir); } else if (line->flags & HBB_PREFIX_ERR) { char dir = '#'; if (line->flags & HBB_PREFIX_IN) dir = '<'; else if (line->flags & HBB_PREFIX_OUT) dir = '>'; g_snprintf(pref, preflen, "%s#%c# ", date, dir); } else if (line->flags & HBB_PREFIX_IN) { char cryptflag; if (line->flags & HBB_PREFIX_PGPCRYPT) cryptflag = '~'; else if (line->flags & HBB_PREFIX_OTRCRYPT) cryptflag = 'O'; else cryptflag = '='; g_snprintf(pref, preflen, "%s<%c= ", date, cryptflag); } else if (line->flags & HBB_PREFIX_OUT) { char cryptflag, receiptflag; if (line->flags & HBB_PREFIX_PGPCRYPT) cryptflag = '~'; else if (line->flags & HBB_PREFIX_OTRCRYPT) cryptflag = 'O'; else cryptflag = '-'; if (line->flags & HBB_PREFIX_RECEIPT) receiptflag = 'r'; else receiptflag = '-'; g_snprintf(pref, preflen, "%s%c%c> ", date, receiptflag, cryptflag); } else if (line->flags & HBB_PREFIX_SPECIAL) { strftime(date, 30, getspectprefix(), localtime(&line->timestamp)); g_snprintf(pref, preflen, "%s ", date); } else { g_snprintf(pref, preflen, "%s ", date); } } else { g_snprintf(pref, preflen, " "); } } // scr_update_window() // (Re-)Display the given chat window. static void scr_update_window(winbuf *win_entry) { int n, mark_offset = 0; guint prefixwidth; char pref[96]; hbb_line **lines, *line; GList *hbuf_head; int color = COLOR_GENERAL; bool readmark = FALSE; bool skipline = FALSE; prefixwidth = scr_getprefixwidth(); prefixwidth = MIN(prefixwidth, sizeof pref); // Should the window be empty? if (win_entry->bd->cleared) { werase(win_entry->win); return; } // win_entry->bd->top is the top message of the screen. If it set to NULL, // we are displaying the last messages. // We will show the last CHAT_WIN_HEIGHT lines. // Let's find out where it begins. if (!win_entry->bd->top || (g_list_position(g_list_first(win_entry->bd->hbuf), win_entry->bd->top) == -1)) { // Move up CHAT_WIN_HEIGHT lines win_entry->bd->hbuf = g_list_last(win_entry->bd->hbuf); hbuf_head = win_entry->bd->hbuf; win_entry->bd->top = NULL; // (Just to make sure) n = 0; while (hbuf_head && (n < CHAT_WIN_HEIGHT-1) && g_list_previous(hbuf_head)) { hbuf_head = g_list_previous(hbuf_head); n++; } // If the buffer is locked, remember current "top" line for the next time. if (win_entry->bd->lock) win_entry->bd->top = hbuf_head; } else hbuf_head = win_entry->bd->top; // Get the last CHAT_WIN_HEIGHT lines. lines = hbuf_get_lines(hbuf_head, CHAT_WIN_HEIGHT); if (CHAT_WIN_HEIGHT > 1) { // Do we have a read mark? for (n = 0; n < CHAT_WIN_HEIGHT; n++) { line = *(lines+n); if (line) { if (line->flags & HBB_PREFIX_READMARK) { // If this is not the last line, we'll display a mark if (n+1 < CHAT_WIN_HEIGHT && *(lines+n+1)) { readmark = TRUE; skipline = TRUE; mark_offset = -1; } } } else if (readmark) { // There will be empty lines, so we don't need to skip the first line skipline = FALSE; mark_offset = 0; } } } // Display the lines for (n = 0 ; n < CHAT_WIN_HEIGHT; n++) { int winy = n + mark_offset; wmove(win_entry->win, winy, 0); line = *(lines+n); if (line) { if (skipline) goto scr_update_window_skipline; if (line->flags & HBB_PREFIX_HLIGHT_OUT) color = COLOR_MSGOUT; else if (line->flags & HBB_PREFIX_HLIGHT) color = COLOR_MSGHL; else if (line->flags & HBB_PREFIX_INFO) color = COLOR_INFO; else if (line->flags & HBB_PREFIX_IN) color = COLOR_MSGIN; else color = COLOR_GENERAL; if (color != COLOR_GENERAL) wattrset(win_entry->win, get_color(color)); // Generate the prefix area and display it scr_line_prefix(line, pref, prefixwidth); wprintw(win_entry->win, pref); // Make sure we are at the right position wmove(win_entry->win, winy, prefixwidth-1); // The MUC nick - overwrite with proper color if (line->mucnicklen) { char *mucjid; char tmp; nickcolor *actual = NULL; muccoltype type, *typetmp; // Store the char after the nick tmp = line->text[line->mucnicklen]; type = glob_muccol; // Terminate the string after the nick line->text[line->mucnicklen] = '\0'; mucjid = g_utf8_strdown(CURRENT_JID, -1); if (muccolors) { typetmp = g_hash_table_lookup(muccolors, mucjid); if (typetmp) type = *typetmp; } g_free(mucjid); // Need to generate a color for the specified nick? if ((type == MC_ALL) && (!nickcolors || !g_hash_table_lookup(nickcolors, line->text))) { char *snick, *mnick; nickcolor *nc; const char *p = line->text; unsigned int nicksum = 0; snick = g_strdup(line->text); mnick = g_strdup(line->text); nc = g_new(nickcolor, 1); ensure_string_htable(&nickcolors, NULL); while (*p) nicksum += *p++; nc->color = nickcols[nicksum % nickcolcount]; nc->manual = FALSE; *snick = '<'; snick[strlen(snick)-1] = '>'; *mnick = '*'; mnick[strlen(mnick)-1] = ' '; // Insert them g_hash_table_insert(nickcolors, snick, nc); g_hash_table_insert(nickcolors, mnick, nc); } if (nickcolors) actual = g_hash_table_lookup(nickcolors, line->text); if (actual && ((type == MC_ALL) || (actual->manual)) && (line->flags & HBB_PREFIX_IN) && (!(line->flags & HBB_PREFIX_HLIGHT_OUT))) wattrset(win_entry->win, compose_color(actual->color)); wprintw(win_entry->win, "%s", line->text); // Return the char line->text[line->mucnicklen] = tmp; // Return the color back wattrset(win_entry->win, get_color(color)); } // Display text line wprintw(win_entry->win, "%s", line->text+line->mucnicklen); wclrtoeol(win_entry->win); scr_update_window_skipline: skipline = FALSE; if (readmark && line->flags & HBB_PREFIX_READMARK) { int i, w; mark_offset++; // Display the mark winy = n + mark_offset; wmove(win_entry->win, winy, 0); color = COLOR_READMARK; wattrset(win_entry->win, get_color(color)); g_snprintf(pref, prefixwidth, " == "); wprintw(win_entry->win, pref); w = scr_gettextwidth() / 3; for (i=0; iwin, "== "); wclrtoeol(win_entry->win); wattrset(win_entry->win, get_color(COLOR_GENERAL)); } // Restore default ("general") color if (color != COLOR_GENERAL) wattrset(win_entry->win, get_color(COLOR_GENERAL)); g_free(line->text); g_free(line); } else { wclrtobot(win_entry->win); break; } } g_free(lines); } static winbuf *scr_create_window(const char *winId, int special, int dont_show) { if (special) { if (!statusWindow) { statusWindow = scr_new_buddy(NULL, dont_show); statusWindow->bd->hbuf = statushbuf; } return statusWindow; } else { return scr_new_buddy(winId, dont_show); } } // scr_show_window() // Display the chat window with the given identifier. // "special" must be true if this is a special buffer window. static void scr_show_window(const char *winId, int special) { winbuf *win_entry; win_entry = scr_search_window(winId, special); if (!win_entry) { win_entry = scr_create_window(winId, special, FALSE); } top_panel(win_entry->panel); currentWindow = win_entry; chatmode = TRUE; if (!win_entry->bd->lock) roster_msg_setflag(winId, special, FALSE); if (!special) roster_setflags(winId, ROSTER_FLAG_LOCK, TRUE); update_roster = TRUE; // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); top_panel(inputPanel); } // scr_show_buddy_window() // Display the chat window buffer for the current buddy. void scr_show_buddy_window(void) { const gchar *bjid; if (!current_buddy) { bjid = NULL; } else { bjid = CURRENT_JID; if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL) { scr_show_window(buddy_getname(BUDDATA(current_buddy)), TRUE); return; } } if (!bjid) { top_panel(chatPanel); top_panel(inputPanel); currentWindow = NULL; return; } scr_show_window(bjid, FALSE); } // scr_update_buddy_window() // (Re)Display the current window. // If chatmode is enabled, call scr_show_buddy_window(), // else display the chat window. inline void scr_update_buddy_window(void) { if (chatmode) { scr_show_buddy_window(); return; } top_panel(chatPanel); top_panel(inputPanel); } // scr_write_in_window() // Write some text in the winId window (this usually is a jid). // Use winId == NULL for the special status buffer. // Lines are splitted when they are too long to fit in the chat window. // If this window doesn't exist, it is created. static void scr_write_in_window(const char *winId, const char *text, time_t timestamp, unsigned int prefix_flags, int force_show, unsigned mucnicklen, gpointer xep184) { winbuf *win_entry; char *text_locale; int dont_show = FALSE; int special; guint num_history_blocks; bool setmsgflg = FALSE; char *nicktmp, *nicklocaltmp; // Look for the window entry. special = (winId == NULL); win_entry = scr_search_window(winId, special); // Do we have to really show the window? if (!chatmode) dont_show = TRUE; else if ((!force_show) && ((!currentWindow || (currentWindow != win_entry)))) dont_show = TRUE; // If the window entry doesn't exist yet, let's create it. if (!win_entry) { win_entry = scr_create_window(winId, special, dont_show); } // The message must be displayed -> update top pointer if (win_entry->bd->cleared) win_entry->bd->top = g_list_last(win_entry->bd->hbuf); // Make sure we do not free the buffer while it's locked or when // top is set. if (win_entry->bd->lock || win_entry->bd->top) num_history_blocks = 0U; else num_history_blocks = get_max_history_blocks(); text_locale = from_utf8(text); // Convert the nick alone and compute its length if (mucnicklen) { nicktmp = g_strndup(text, mucnicklen); nicklocaltmp = from_utf8(nicktmp); if (nicklocaltmp) mucnicklen = strlen(nicklocaltmp); g_free(nicklocaltmp); g_free(nicktmp); } hbuf_add_line(&win_entry->bd->hbuf, text_locale, timestamp, prefix_flags, maxX - Roster_Width - scr_getprefixwidth(), num_history_blocks, mucnicklen, xep184); g_free(text_locale); if (win_entry->bd->cleared) { win_entry->bd->cleared = FALSE; if (g_list_next(win_entry->bd->top)) win_entry->bd->top = g_list_next(win_entry->bd->top); } // Make sure the last line appears in the window; update top if necessary if (!win_entry->bd->lock && win_entry->bd->top) { int dist; GList *first = g_list_first(win_entry->bd->hbuf); dist = g_list_position(first, g_list_last(win_entry->bd->hbuf)) - g_list_position(first, win_entry->bd->top); if (dist >= CHAT_WIN_HEIGHT) win_entry->bd->top = NULL; } if (!dont_show) { if (win_entry->bd->lock) setmsgflg = TRUE; else // If this is an outgoing message, remove the readmark if (!special && (prefix_flags & (HBB_PREFIX_OUT|HBB_PREFIX_HLIGHT_OUT))) hbuf_set_readmark(win_entry->bd->hbuf, FALSE); // Show and refresh the window top_panel(win_entry->panel); scr_update_window(win_entry); top_panel(inputPanel); update_panels(); } else if (!(prefix_flags & HBB_PREFIX_NOFLAG)) { setmsgflg = TRUE; } if (setmsgflg && !special) { if (special && !winId) winId = SPECIAL_BUFFER_STATUS_ID; roster_msg_setflag(winId, special, TRUE); update_roster = TRUE; } } // scr_update_main_status(forceupdate) // Redraw the main (bottom) status line. // You can set forceupdate to FALSE in order to optimize screen refresh // if you call top_panel()/update_panels() later. void scr_update_main_status(int forceupdate) { char *sm = from_utf8(xmpp_getstatusmsg()); const char *info = settings_opt_get("info"); guint prio = 0; gpointer unread_ptr; char unreadchar; unread_ptr = unread_msg(NULL); if (unread_ptr) { prio = buddy_getuiprio(unread_ptr); // If there's an unerad buffer but no priority set, let's consider the // priority is 1. if (!prio && buddy_getflags(unread_ptr) & ROSTER_FLAG_MSG) prio = 1; } // Status bar unread message flag if (prio >= ROSTER_UI_PRIO_MUC_HL_MESSAGE) unreadchar = '!'; else if (prio > 0) unreadchar = '#'; else unreadchar = ' '; werase(mainstatusWnd); if (info) { char *info_locale = from_utf8(info); mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s %s", unreadchar, imstatus2char[xmpp_getstatus()], info_locale, (sm ? sm : "")); g_free(info_locale); } else mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", unreadchar, imstatus2char[xmpp_getstatus()], (sm ? sm : "")); if (forceupdate) { top_panel(inputPanel); update_panels(); } g_free(sm); } // scr_draw_main_window() // Set fullinit to TRUE to also create panels. Set it to FALSE for a resize. // // I think it could be improved a _lot_ but I'm really not an ncurses // expert... :-\ Mikael. // void scr_draw_main_window(unsigned int fullinit) { int requested_size; gchar *ver, *message; int chat_y_pos, chatstatus_y_pos, log_y_pos; int roster_x_pos, chat_x_pos; roster_no_leading_space = settings_opt_get_int("roster_no_leading_space"); Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT; requested_size = settings_opt_get_int("log_win_height"); if (requested_size > 0) { if (maxY > requested_size + 3) Log_Win_Height = requested_size + 2; else Log_Win_Height = ((maxY > 5) ? (maxY - 2) : 3); } else if (requested_size < 0) { Log_Win_Height = 3; } if (maxY < Log_Win_Height+2) { if (maxY < 5) { Log_Win_Height = 3; maxY = Log_Win_Height+2; } else { Log_Win_Height = maxY - 2; } } if (roster_hidden) { Roster_Width = 0; } else { requested_size = settings_opt_get_int("roster_width"); if (requested_size > 1) Roster_Width = requested_size; else if (requested_size == 1) Roster_Width = 2; else Roster_Width = DEFAULT_ROSTER_WIDTH; } log_win_on_top = (settings_opt_get_int("log_win_on_top") == 1); roster_win_on_right = (settings_opt_get_int("roster_win_on_right") == 1); if (log_win_on_top) { chat_y_pos = Log_Win_Height-1; log_y_pos = 0; chatstatus_y_pos = Log_Win_Height-2; } else { chat_y_pos = 0; log_y_pos = CHAT_WIN_HEIGHT+1; chatstatus_y_pos = CHAT_WIN_HEIGHT; } if (roster_win_on_right) { roster_x_pos = maxX - Roster_Width; chat_x_pos = 0; } else { roster_x_pos = 0; chat_x_pos = Roster_Width; } if (fullinit) { if (!winbufhash) winbufhash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); /* Create windows */ rosterWnd = newwin(CHAT_WIN_HEIGHT, Roster_Width, chat_y_pos, roster_x_pos); chatWnd = newwin(CHAT_WIN_HEIGHT, maxX - Roster_Width, chat_y_pos, chat_x_pos); activechatWnd = newwin(CHAT_WIN_HEIGHT, maxX - Roster_Width, chat_y_pos, chat_x_pos); logWnd = newwin(Log_Win_Height-2, maxX, log_y_pos, 0); chatstatusWnd = newwin(1, maxX, chatstatus_y_pos, 0); mainstatusWnd = newwin(1, maxX, maxY-2, 0); inputWnd = newwin(1, maxX, maxY-1, 0); if (!rosterWnd || !chatWnd || !logWnd || !inputWnd) { scr_terminate_curses(); fprintf(stderr, "Cannot create windows!\n"); exit(EXIT_FAILURE); } wbkgd(rosterWnd, get_color(COLOR_GENERAL)); wbkgd(chatWnd, get_color(COLOR_GENERAL)); wbkgd(activechatWnd, get_color(COLOR_GENERAL)); wbkgd(logWnd, get_color(COLOR_GENERAL)); wbkgd(chatstatusWnd, get_color(COLOR_STATUS)); wbkgd(mainstatusWnd, get_color(COLOR_STATUS)); wattrset(logWnd, get_color(COLOR_LOG)); } else { /* Resize/move windows */ wresize(rosterWnd, CHAT_WIN_HEIGHT, Roster_Width); wresize(chatWnd, CHAT_WIN_HEIGHT, maxX - Roster_Width); wresize(logWnd, Log_Win_Height-2, maxX); mvwin(chatWnd, chat_y_pos, chat_x_pos); mvwin(rosterWnd, chat_y_pos, roster_x_pos); mvwin(logWnd, log_y_pos, 0); // Resize & move chat status window wresize(chatstatusWnd, 1, maxX); mvwin(chatstatusWnd, chatstatus_y_pos, 0); // Resize & move main status window wresize(mainstatusWnd, 1, maxX); mvwin(mainstatusWnd, maxY-2, 0); // Resize & move input line window wresize(inputWnd, 1, maxX); mvwin(inputWnd, maxY-1, 0); werase(chatWnd); } /* Draw/init windows */ ver = mcabber_version(); message = g_strdup_printf("MCabber version %s.\n", ver); mvwprintw(chatWnd, 0, 0, message); mvwprintw(chatWnd, 1, 0, "http://mcabber.com/"); g_free(ver); g_free(message); // Auto-scrolling in log window scrollok(logWnd, TRUE); if (fullinit) { // Enable keypad (+ special keys) keypad(inputWnd, TRUE); #ifdef __MirBSD__ wtimeout(inputWnd, 50 /* ms */); #else nodelay(inputWnd, TRUE); #endif // Create panels rosterPanel = new_panel(rosterWnd); chatPanel = new_panel(chatWnd); activechatPanel = new_panel(activechatWnd); logPanel = new_panel(logWnd); chatstatusPanel = new_panel(chatstatusWnd); mainstatusPanel = new_panel(mainstatusWnd); inputPanel = new_panel(inputWnd); // Build the buddylist at least once, to make sure the special buffer // is added buddylist_build(); // Init prev_chatwidth; this variable will be used to prevent us // from rewrapping buffers when the width doesn't change. prev_chatwidth = maxX - Roster_Width - scr_getprefixwidth(); // Wrap existing status buffer lines hbuf_rebuild(&statushbuf, prev_chatwidth); #ifndef UNICODE if (utf8_mode) scr_LogPrint(LPRINT_NORMAL, "WARNING: Compiled without full UTF-8 support!"); #endif } else { // Update panels replace_panel(rosterPanel, rosterWnd); replace_panel(chatPanel, chatWnd); replace_panel(logPanel, logWnd); replace_panel(chatstatusPanel, chatstatusWnd); replace_panel(mainstatusPanel, mainstatusWnd); replace_panel(inputPanel, inputWnd); } // We'll need to redraw the roster update_roster = TRUE; return; } static void resize_win_buffer(gpointer key, gpointer value, gpointer data) { winbuf *wbp = value; struct dimensions *dim = data; int chat_x_pos, chat_y_pos; int new_chatwidth; if (!(wbp && wbp->win)) return; if (log_win_on_top) chat_y_pos = Log_Win_Height-1; else chat_y_pos = 0; if (roster_win_on_right) chat_x_pos = 0; else chat_x_pos = Roster_Width; // Resize/move buddy window wresize(wbp->win, dim->l, dim->c); mvwin(wbp->win, chat_y_pos, chat_x_pos); werase(wbp->win); // If a panel exists, replace the old window with the new if (wbp->panel) replace_panel(wbp->panel, wbp->win); // Redo line wrapping wbp->bd->top = hbuf_previous_persistent(wbp->bd->top); new_chatwidth = maxX - Roster_Width - scr_getprefixwidth(); if (new_chatwidth != prev_chatwidth) hbuf_rebuild(&wbp->bd->hbuf, new_chatwidth); } // scr_Resize() // Function called when the window is resized. // - Resize windows // - Rewrap lines in each buddy buffer void scr_Resize(void) { struct dimensions dim; // First, update the global variables getmaxyx(stdscr, maxY, maxX); // scr_draw_main_window() will take care of maxY and Log_Win_Height // Make sure the cursor stays inside the window check_offset(0); // Resize windows and update panels scr_draw_main_window(FALSE); // Resize all buddy windows dim.l = CHAT_WIN_HEIGHT; dim.c = maxX - Roster_Width; if (dim.c < 1) dim.c = 1; // Resize all buffers g_hash_table_foreach(winbufhash, resize_win_buffer, &dim); // Resize/move special status buffer if (statusWindow) resize_win_buffer(NULL, statusWindow, &dim); // Update prev_chatwidth, now that all buffers have been resized prev_chatwidth = maxX - Roster_Width - scr_getprefixwidth(); // Refresh current buddy window if (chatmode) scr_show_buddy_window(); } // scr_update_chat_status(forceupdate) // Redraw the buddy status bar. // Set forceupdate to TRUE if update_panels() must be called. void scr_update_chat_status(int forceupdate) { unsigned short btype, isgrp, ismuc, isspe; const char *btypetext = "Unknown"; const char *fullname; char *fullnameres = NULL; const char *activeres; const char *msg = NULL; char status; char *buf, *buf_locale; // Usually we need to update the bottom status line too, // at least to refresh the pending message flag. scr_update_main_status(FALSE); // Clear the line werase(chatstatusWnd); if (!current_buddy) { if (forceupdate) { update_panels(); } return; } fullname = buddy_getname(BUDDATA(current_buddy)); btype = buddy_gettype(BUDDATA(current_buddy)); isgrp = ismuc = isspe = 0; if (btype & ROSTER_TYPE_USER) { btypetext = "Buddy"; } else if (btype & ROSTER_TYPE_GROUP) { btypetext = "Group"; isgrp = 1; } else if (btype & ROSTER_TYPE_AGENT) { btypetext = "Agent"; } else if (btype & ROSTER_TYPE_ROOM) { btypetext = "Room"; ismuc = 1; } else if (btype & ROSTER_TYPE_SPECIAL) { btypetext = "Special buffer"; isspe = 1; } if (chatmode) { wprintw(chatstatusWnd, "~"); } else { unsigned short bflags = buddy_getflags(BUDDATA(current_buddy)); if (bflags & ROSTER_FLAG_MSG) { // There is an unread message from the current buddy wprintw(chatstatusWnd, "#"); } } if (chatmode && !isgrp) { winbuf *win_entry; win_entry = scr_search_window(buddy_getjid(BUDDATA(current_buddy)), isspe); if (win_entry && win_entry->bd->lock) mvwprintw(chatstatusWnd, 0, 0, "*"); } if (isgrp || isspe) { buf_locale = from_utf8(fullname); mvwprintw(chatstatusWnd, 0, 5, "%s: %s", btypetext, buf_locale); g_free(buf_locale); if (forceupdate) { update_panels(); } return; } status = '?'; activeres = buddy_getactiveresource(BUDDATA(current_buddy)); if (ismuc) { if (buddy_getinsideroom(BUDDATA(current_buddy))) status = 'C'; else status = 'x'; } else if (xmpp_getstatus() != offline) { enum imstatus budstate; budstate = buddy_getstatus(BUDDATA(current_buddy), activeres); if (budstate < imstatus_size) status = imstatus2char[budstate]; } // No status message for MUC rooms if (!ismuc) { if (activeres) { fullnameres = g_strdup_printf("%s/%s", fullname, activeres); fullname = fullnameres; msg = buddy_getstatusmsg(BUDDATA(current_buddy), activeres); } else { GSList *resources, *p_res, *p_next_res; resources = buddy_getresources(BUDDATA(current_buddy)); for (p_res = resources ; p_res ; p_res = p_next_res) { p_next_res = g_slist_next(p_res); // Store the status message of the latest resource (highest priority) if (!p_next_res) msg = buddy_getstatusmsg(BUDDATA(current_buddy), p_res->data); g_free(p_res->data); } g_slist_free(resources); } } else { msg = buddy_gettopic(BUDDATA(current_buddy)); } if (msg) buf = g_strdup_printf("[%c] %s: %s -- %s", status, btypetext, fullname, msg); else buf = g_strdup_printf("[%c] %s: %s", status, btypetext, fullname); replace_nl_with_dots(buf); buf_locale = from_utf8(buf); mvwprintw(chatstatusWnd, 0, 1, "%s", buf_locale); g_free(fullnameres); g_free(buf_locale); g_free(buf); // Display chatstates of the contact, if available. if (btype & ROSTER_TYPE_USER) { char eventchar = 0; guint event; // We specify active resource here, so when there is none then the resource // with the highest priority will be used. event = buddy_resource_getevents(BUDDATA(current_buddy), activeres); if (event == ROSTER_EVENT_ACTIVE) eventchar = 'A'; else if (event == ROSTER_EVENT_COMPOSING) eventchar = 'C'; else if (event == ROSTER_EVENT_PAUSED) eventchar = 'P'; else if (event == ROSTER_EVENT_INACTIVE) eventchar = 'I'; else if (event == ROSTER_EVENT_GONE) eventchar = 'G'; if (eventchar) mvwprintw(chatstatusWnd, 0, maxX-3, "[%c]", eventchar); } if (forceupdate) { update_panels(); } } void increment_if_buddy_not_filtered(gpointer rosterdata, void *param) { int *p = param; if (buddylist_is_status_filtered(buddy_getstatus(rosterdata, NULL))) *p=*p+1; } // scr_draw_roster() // Display the buddylist (not really the roster) on the screen void scr_draw_roster(void) { static int offset = 0; char *name, *rline; int maxx, maxy; GList *buddy; int i, n; int rOffset; int cursor_backup; char status, pending; enum imstatus currentstatus = xmpp_getstatus(); int x_pos; char *space; int prefix_length; // We can reset update_roster update_roster = FALSE; getmaxyx(rosterWnd, maxy, maxx); maxx--; // Last char is for vertical border cursor_backup = curs_set(0); if (!buddylist) offset = 0; else scr_update_chat_status(FALSE); // Cleanup of roster window werase(rosterWnd); if (Roster_Width) { int line_x_pos = roster_win_on_right ? 0 : Roster_Width-1; // Redraw the vertical line (not very good...) wattrset(rosterWnd, get_color(COLOR_GENERAL)); for (i=0 ; i < CHAT_WIN_HEIGHT ; i++) mvwaddch(rosterWnd, i, line_x_pos, ACS_VLINE); } // Leave now if buddylist is empty or the roster is hidden if (!buddylist || !Roster_Width) { update_panels(); curs_set(cursor_backup); return; } // Update offset if necessary // a) Try to show as many buddylist items as possible i = g_list_length(buddylist) - maxy; if (i < 0) i = 0; if (i < offset) offset = i; // b) Make sure the current_buddy is visible i = g_list_position(buddylist, current_buddy); if (i == -1) { // This is bad scr_LogPrint(LPRINT_NORMAL, "Doh! Can't find current selected buddy!!"); curs_set(cursor_backup); return; } else if (i < offset) { offset = i; } else if (i+1 > offset + maxy) { offset = i + 1 - maxy; } if (roster_win_on_right) x_pos = 1; // 1 char offset (vertical line) else x_pos = 0; space = g_new0(char, 2); if (roster_no_leading_space) { space[0] = '\0'; prefix_length = 6; } else { space[0] = ' '; prefix_length = 7; } name = g_new0(char, 4*Roster_Width); rline = g_new0(char, 4*Roster_Width+1); buddy = buddylist; rOffset = offset; for (i=0; i 0) { rOffset--; continue; } status = '?'; pending = ' '; resources = buddy_getresources(BUDDATA(buddy)); for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) { guint events = buddy_resource_getevents(BUDDATA(buddy), p_res ? p_res->data : ""); if ((events & ROSTER_EVENT_PAUSED) && pending != '+') pending = '.'; if (events & ROSTER_EVENT_COMPOSING) pending = '+'; g_free(p_res->data); } g_slist_free(resources); // Display message notice if there is a message flag, but not // for unfolded groups. if (ismsg && (!isgrp || ishid)) { pending = '#'; } if (ismuc) { if (buddy_getinsideroom(BUDDATA(buddy))) status = 'C'; else status = 'x'; } else if (currentstatus != offline) { enum imstatus budstate; budstate = buddy_getstatus(BUDDATA(buddy), NULL); if (budstate < imstatus_size) status = imstatus2char[budstate]; } if (buddy == current_buddy) { if (pending == '#') wattrset(rosterWnd, get_color(COLOR_ROSTERSELNMSG)); else wattrset(rosterWnd, get_color(COLOR_ROSTERSEL)); // The 3 following lines aim at coloring the whole line wmove(rosterWnd, i, x_pos); for (n = 0; n < maxx; n++) waddch(rosterWnd, ' '); } else { if (pending == '#') wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG)); else { int color = get_color(COLOR_ROSTER); if ((!isspe) && (!isgrp)) { // Look for color rules GSList *head; const char *bjid = buddy_getjid(BUDDATA(buddy)); for (head = rostercolrules; head; head = g_slist_next(head)) { rostercolor *rc = head->data; if (g_pattern_match_string(rc->compiled, bjid) && (!strcmp("*", rc->status) || strchr(rc->status, status))) { color = compose_color(rc->color); break; } } } wattrset(rosterWnd, color); } } if (Roster_Width > prefix_length) g_utf8_strncpy(name, buddy_getname(BUDDATA(buddy)), Roster_Width-prefix_length); else name[0] = 0; if (pending == '#') { // Attention sign? if ((ismuc && isurg >= ui_attn_sign_prio_level_muc) || (!ismuc && isurg >= ui_attn_sign_prio_level)) pending = '!'; } if (isgrp) { if (ishid) { int group_count = 0; foreach_group_member(BUDDATA(buddy), increment_if_buddy_not_filtered, &group_count); snprintf(rline, 4*Roster_Width, "%s%c+++ %s (%i)", space, pending, name, group_count); /* Do not display the item count if there isn't enough space */ if (g_utf8_strlen(rline, 4*Roster_Width) >= Roster_Width) snprintf(rline, 4*Roster_Width, "%s%c+++ %s", space, pending, name); } else snprintf(rline, 4*Roster_Width, "%s%c--- %s", space, pending, name); } else if (isspe) { snprintf(rline, 4*Roster_Width, "%s%c%s", space, pending, name); } else { char sepleft = '['; char sepright = ']'; if (btype & ROSTER_TYPE_USER) { guint subtype = buddy_getsubscription(BUDDATA(buddy)); if (status == '_' && !(subtype & sub_to)) status = '?'; if (!(subtype & sub_from)) { sepleft = '{'; sepright = '}'; } } snprintf(rline, 4*Roster_Width, "%s%c%c%c%c %s", space, pending, sepleft, status, sepright, name); } rline_locale = from_utf8(rline); mvwprintw(rosterWnd, i, x_pos, "%s", rline_locale); g_free(rline_locale); i++; } g_free(space); g_free(rline); g_free(name); top_panel(inputPanel); update_panels(); curs_set(cursor_backup); } // scr_roster_visibility(status) // Set the roster visibility: // status=1 Show roster // status=0 Hide roster // status=-1 Toggle roster status void scr_roster_visibility(int status) { int old_roster_status = roster_hidden; if (status > 0) roster_hidden = FALSE; else if (status == 0) roster_hidden = TRUE; else roster_hidden = !roster_hidden; if (roster_hidden != old_roster_status) { // Recalculate windows size and redraw scr_Resize(); redrawwin(stdscr); } } static void scr_write_message(const char *bjid, const char *text, time_t timestamp, guint prefix_flags, unsigned mucnicklen, gpointer xep184) { char *xtext; if (!timestamp) timestamp = time(NULL); xtext = ut_expand_tabs(text); // Expand tabs and filter out some chars scr_write_in_window(bjid, xtext, timestamp, prefix_flags, FALSE, mucnicklen, xep184); if (xtext != (char*)text) g_free(xtext); } // If prefix is NULL, HBB_PREFIX_IN is supposed. void scr_write_incoming_message(const char *jidfrom, const char *text, time_t timestamp, guint prefix, unsigned mucnicklen) { if (!(prefix & ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT)) prefix |= HBB_PREFIX_IN; scr_write_message(jidfrom, text, timestamp, prefix, mucnicklen, NULL); } void scr_write_outgoing_message(const char *jidto, const char *text, guint prefix, gpointer xep184) { GSList *roster_elt; roster_elt = roster_find(jidto, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM); scr_write_message(jidto, text, 0, prefix|HBB_PREFIX_OUT|HBB_PREFIX_HLIGHT_OUT, 0, xep184); // Show jidto's buffer unless the buddy is not in the buddylist if (roster_elt && g_list_position(buddylist, roster_elt->data) != -1) scr_show_window(jidto, FALSE); } void scr_remove_receipt_flag(const char *bjid, gconstpointer xep184) { winbuf *win_entry = scr_search_window(bjid, FALSE); if (win_entry && xep184) { hbuf_remove_receipt(win_entry->bd->hbuf, xep184); if (chatmode && (buddy_search_jid(bjid) == current_buddy)) scr_update_buddy_window(); } } static inline void set_autoaway(bool setaway) { static enum imstatus oldstatus; static char *oldmsg; Autoaway = setaway; if (setaway) { const char *msg, *prevmsg; oldstatus = xmpp_getstatus(); if (oldmsg) { g_free(oldmsg); oldmsg = NULL; } prevmsg = xmpp_getstatusmsg(); msg = settings_opt_get("message_autoaway"); if (!msg) msg = prevmsg; if (prevmsg) oldmsg = g_strdup(prevmsg); xmpp_setstatus(away, NULL, msg, FALSE); } else { // Back xmpp_setstatus(oldstatus, NULL, (oldmsg ? oldmsg : ""), FALSE); if (oldmsg) { g_free(oldmsg); oldmsg = NULL; } } } // set_chatstate(state) // Set the current chat state (0=active, 1=composing, 2=paused) // If the chat state has changed, call xmpp_send_chatstate() static void set_chatstate(int state) { #if defined XEP0022 || defined XEP0085 if (chatstates_disabled) return; if (!chatmode) state = 0; if (state != chatstate) { chatstate = state; if (current_buddy && buddy_gettype(BUDDATA(current_buddy)) == ROSTER_TYPE_USER) { guint jep_state; if (chatstate == 1) { if (chatstate_timeout_id == 0) chatstate_timeout_id = g_timeout_add_seconds(1, scr_chatstates_timeout, NULL); jep_state = ROSTER_EVENT_COMPOSING; } else if (chatstate == 2) jep_state = ROSTER_EVENT_PAUSED; else jep_state = ROSTER_EVENT_ACTIVE; xmpp_send_chatstate(BUDDATA(current_buddy), jep_state); } if (!chatstate) chatstate_timestamp = 0; } #endif } #if defined XEP0022 || defined XEP0085 static gboolean scr_chatstates_timeout(void) { time_t now; time(&now); // Check if we're currently composing... if (chatstate != 1 || !chatstate_timestamp) { chatstate_timeout_id = 0; return FALSE; } // If the timeout is reached, let's change the state right now. if (now >= chatstate_timestamp + COMPOSING_TIMEOUT) { chatstate_timestamp = now; set_chatstate(2); chatstate_timeout_id = 0; return FALSE; } return TRUE; } #endif static gboolean scr_autoaway_timeout_callback(gpointer data) { enum imstatus cur_st = xmpp_getstatus(); if (cur_st != available && cur_st != freeforchat) // Some non-user-originated status changes, let's wait more. // Maybe the proper fix for that will be set global variable // "autoaway_delayed" and check that variable in postconnect // hook (afaik, only source for such status changes are // error disconnects). return TRUE; set_autoaway(TRUE); // source will be destroyed after return autoaway_source = 0; return FALSE; } static void scr_reinstall_autoaway_timeout(void) { unsigned int autoaway_timeout = settings_opt_get_int("autoaway"); enum imstatus cur_st = xmpp_getstatus(); if (autoaway_source) { g_source_remove(autoaway_source); autoaway_source = 0; } if (autoaway_timeout && (cur_st == available || cur_st == freeforchat)) autoaway_source = g_timeout_add_seconds(autoaway_timeout, scr_autoaway_timeout_callback, NULL); } // Check if we should reset autoaway timeout source void scr_check_auto_away(int activity) { if (Autoaway && activity) { scr_reinstall_autoaway_timeout(); set_autoaway(FALSE); } else if (activity || !autoaway_source) scr_reinstall_autoaway_timeout(); } // set_current_buddy(newbuddy) // Set the current_buddy to newbuddy (if not NULL) // Lock the newbuddy, and unlock the previous current_buddy static void set_current_buddy(GList *newbuddy) { enum imstatus prev_st = imstatus_size; /* prev_st initialized to imstatus_size, which is used as "undef" value. * We are sure prev_st will get a different status value after the * buddy_getstatus() call. */ if (!current_buddy || !newbuddy) return; if (newbuddy == current_buddy) return; // We're moving to another buddy. We're thus inactive wrt current_buddy. set_chatstate(0); // We don't want the chatstate to be changed again right now. lock_chatstate = TRUE; prev_st = buddy_getstatus(BUDDATA(current_buddy), NULL); buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); if (chatmode) { scr_buffer_readmark(TRUE); alternate_buddy = current_buddy; } current_buddy = newbuddy; // Lock the buddy in the buddylist if we're in chat mode if (chatmode) { buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); // Remove the readmark if it is at the end of the buffer scr_buffer_readmark(-1); } // We should rebuild the buddylist but not everytime if (!(buddylist_get_filter() & 1<bd->top; if (updown == -1) { // UP n = 0; if (!hbuf_top) { hbuf_top = g_list_last(win_entry->bd->hbuf); if (!win_entry->bd->cleared) { if (!nblines) nbl = nbl*3 - 1; else nbl += CHAT_WIN_HEIGHT - 1; } else { win_entry->bd->cleared = FALSE; n++; // We'll scroll one line less } } for ( ; hbuf_top && n < nbl && g_list_previous(hbuf_top) ; n++) hbuf_top = g_list_previous(hbuf_top); win_entry->bd->top = hbuf_top; } else { // DOWN for (n=0 ; hbuf_top && n < nbl ; n++) hbuf_top = g_list_next(hbuf_top); win_entry->bd->top = hbuf_top; // Check if we are at the bottom for (n=0 ; hbuf_top && n < CHAT_WIN_HEIGHT-1 ; n++) hbuf_top = g_list_next(hbuf_top); if (!hbuf_top) win_entry->bd->top = NULL; // End reached } // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // scr_buffer_clear() // Clear the current buddy window (used for the /clear command) void scr_buffer_clear(void) { winbuf *win_entry; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; win_entry->bd->cleared = TRUE; win_entry->bd->top = NULL; // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // buffer_purge() // key: winId/jid // value: winbuf structure // data: int, set to 1 if the buffer should be closed. // NOTE: does not work for special buffers. static gboolean buffer_purge(gpointer key, gpointer value, gpointer data) { int *p_closebuf = data; winbuf *win_entry = value; gboolean retval = FALSE; // Delete the current hbuf hbuf_free(&win_entry->bd->hbuf); if (*p_closebuf) { GSList *roster_elt; retval = TRUE; roster_elt = roster_find(key, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); if (roster_elt) buddy_setactiveresource(roster_elt->data, NULL); } else { win_entry->bd->cleared = FALSE; win_entry->bd->top = NULL; } return retval; } // scr_buffer_purge(closebuf, jid) // Purge/Drop the current buddy buffer or jid's buffer if jid != NULL. // If closebuf is 1, close the buffer. void scr_buffer_purge(int closebuf, const char *jid) { winbuf *win_entry; guint isspe; guint *p_closebuf; const char *cjid; guint hold_chatmode = FALSE; if (jid) { cjid = jid; isspe = FALSE; // If closebuf is TRUE, it's probably better not to leave chat mode // if the change isn't related to the current buffer. if (closebuf && current_buddy) { if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL || strcasecmp(jid, CURRENT_JID)) hold_chatmode = TRUE; } } else { // Get win_entry if (!current_buddy) return; cjid = CURRENT_JID; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; } win_entry = scr_search_window(cjid, isspe); if (!win_entry) return; if (!isspe) { p_closebuf = g_new(guint, 1); *p_closebuf = closebuf; if(buffer_purge((gpointer)cjid, win_entry, p_closebuf)) g_hash_table_remove(winbufhash, cjid); roster_msg_setflag(cjid, FALSE, FALSE); g_free(p_closebuf); if (closebuf && !hold_chatmode) { scr_set_chatmode(FALSE); currentWindow = NULL; } } else { // (Special buffer) // Reset the current hbuf hbuf_free(&win_entry->bd->hbuf); // Currently it can only be the status buffer statushbuf = NULL; roster_msg_setflag(SPECIAL_BUFFER_STATUS_ID, TRUE, FALSE); win_entry->bd->cleared = FALSE; win_entry->bd->top = NULL; } update_roster = TRUE; // Refresh the window scr_update_buddy_window(); // Finished :) update_panels(); } // scr_buffer_purge_all(closebuf) // Purge all existing buffers. // If closebuf is 1, the buffers are closed. void scr_buffer_purge_all(int closebuf) { guint *p_closebuf; p_closebuf = g_new(guint, 1); *p_closebuf = closebuf; g_hash_table_foreach_remove(winbufhash, buffer_purge, p_closebuf); g_free(p_closebuf); if (closebuf) { scr_set_chatmode(FALSE); currentWindow = NULL; } // Refresh the window scr_update_buddy_window(); // Finished :) update_panels(); } // scr_buffer_scroll_lock(lock) // Lock/unlock the current buddy buffer // lock = 1 : lock // lock = 0 : unlock // lock = -1: toggle lock status void scr_buffer_scroll_lock(int lock) { winbuf *win_entry; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; if (lock == -1) lock = !win_entry->bd->lock; if (lock) { win_entry->bd->lock = TRUE; } else { win_entry->bd->lock = FALSE; if (isspe || (buddy_getflags(BUDDATA(current_buddy)) & ROSTER_FLAG_MSG)) win_entry->bd->top = NULL; } // If chatmode is disabled and we're at the bottom of the buffer, // we need to set the "top" line, so we need to call scr_show_buddy_window() // at least once. (Maybe it will cause a double refresh...) if (!chatmode && !win_entry->bd->top) { chatmode = TRUE; scr_show_buddy_window(); chatmode = FALSE; } // Refresh the window scr_update_buddy_window(); // Finished :) update_panels(); } // scr_buffer_readmark(action) // Update the readmark flag for the current buffer // If action = 1, set the readmark flag on the last message // If action = 0, reset the readmark flag // If action = -1, remove the readmark flag iff it is on the last line void scr_buffer_readmark(gchar action) { winbuf *win_entry; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; if (isspe) return; // Maybe not necessary win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; if (!win_entry->bd->lock) { if (action >= 0) hbuf_set_readmark(win_entry->bd->hbuf, action); else hbuf_remove_trailing_readmark(win_entry->bd->hbuf); } } // scr_buffer_top_bottom() // Jump to the head/tail of the current buddy window // (top if topbottom == -1, bottom topbottom == 1) void scr_buffer_top_bottom(int topbottom) { winbuf *win_entry; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; win_entry->bd->cleared = FALSE; if (topbottom == 1) win_entry->bd->top = NULL; else win_entry->bd->top = g_list_first(win_entry->bd->hbuf); // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // scr_buffer_search(direction, text) // Jump to the next line containing text // (backward search if direction == -1, forward if topbottom == 1) void scr_buffer_search(int direction, const char *text) { winbuf *win_entry; GList *current_line, *search_res; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; if (win_entry->bd->top) current_line = win_entry->bd->top; else current_line = g_list_last(win_entry->bd->hbuf); search_res = hbuf_search(current_line, direction, text); if (search_res) { win_entry->bd->cleared = FALSE; win_entry->bd->top = search_res; // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } else scr_LogPrint(LPRINT_NORMAL, "Search string not found."); } // scr_buffer_percent(n) // Jump to the specified position in the buffer, in % void scr_buffer_percent(int pc) { winbuf *win_entry; GList *search_res; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; if (pc < 0 || pc > 100) { scr_LogPrint(LPRINT_NORMAL, "Bad %% value"); return; } search_res = hbuf_jump_percent(win_entry->bd->hbuf, pc); win_entry->bd->cleared = FALSE; win_entry->bd->top = search_res; // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // scr_buffer_date(t) // Jump to the first line after date t in the buffer // t is a date in seconds since `00:00:00 1970-01-01 UTC' void scr_buffer_date(time_t t) { winbuf *win_entry; GList *search_res; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; search_res = hbuf_jump_date(win_entry->bd->hbuf, t); win_entry->bd->cleared = FALSE; win_entry->bd->top = search_res; if (!search_res) scr_log_print(LPRINT_NORMAL, "Date not found."); // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // scr_buffer_jump_readmark() // Jump to the buffer readmark, if there's one void scr_buffer_jump_readmark(void) { winbuf *win_entry; GList *search_res; guint isspe; // Get win_entry if (!current_buddy) return; isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; if (isspe) return; win_entry = scr_search_window(CURRENT_JID, isspe); if (!win_entry) return; search_res = hbuf_jump_readmark(win_entry->bd->hbuf); if (!search_res) { scr_log_print(LPRINT_NORMAL, "Readmark not found."); return; } win_entry->bd->cleared = FALSE; win_entry->bd->top = search_res; // Refresh the window scr_update_window(win_entry); // Finished :) update_panels(); } // scr_buffer_dump(filename) // Dump the current buffer content to the specified file. void scr_buffer_dump(const char *file) { char *extfname; if (!currentWindow) { scr_LogPrint(LPRINT_NORMAL, "No current buffer!"); return; } if (!file || !*file) { scr_LogPrint(LPRINT_NORMAL, "Missing parameter (file name)!"); return; } extfname = expand_filename(file); hbuf_dump_to_file(currentWindow->bd->hbuf, extfname); g_free(extfname); } // buffer_list() // key: winId/jid // value: winbuf structure // data: none. static void buffer_list(gpointer key, gpointer value, gpointer data) { GList *head; winbuf *win_entry = value; head = g_list_first(win_entry->bd->hbuf); scr_LogPrint(LPRINT_NORMAL, " %s (%u/%u)", (const char *) key, g_list_length(head), hbuf_get_blocks_number(head)); } void scr_buffer_list(void) { scr_LogPrint(LPRINT_NORMAL, "Buffer list:"); buffer_list("[status]", statusWindow, NULL); g_hash_table_foreach(winbufhash, buffer_list, NULL); scr_LogPrint(LPRINT_NORMAL, "End of buffer list."); scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); scr_setattentionflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE, ROSTER_UI_PRIO_STATUS_WIN_MESSAGE, prio_max); } // scr_set_chatmode() // Public function to (un)set chatmode... inline void scr_set_chatmode(int enable) { gboolean enter_chatmode = enable && chatmode == FALSE; chatmode = enable; scr_update_chat_status(TRUE); if (enter_chatmode) scr_buffer_readmark(-1); } // scr_get_chatmode() // Public function to get chatmode state. inline int scr_get_chatmode(void) { return chatmode; } // scr_get_multimode() // Public function to get multimode status... inline int scr_get_multimode(void) { return multimode; } // scr_setmsgflag_if_needed(jid) // Set the message flag unless we're already in the jid buffer window void scr_setmsgflag_if_needed(const char *bjid, int special) { const char *current_id; bool iscurrentlocked = FALSE; if (!bjid) return; if (current_buddy) { if (special) current_id = buddy_getname(BUDDATA(current_buddy)); else current_id = buddy_getjid(BUDDATA(current_buddy)); if (current_id) { winbuf *win_entry = scr_search_window(current_id, special); if (!win_entry) return; iscurrentlocked = win_entry->bd->lock; } } else { current_id = NULL; } if (!chatmode || !current_id || strcmp(bjid, current_id) || iscurrentlocked) { roster_msg_setflag(bjid, special, TRUE); update_roster = TRUE; } } // scr_setattentionflag_if_needed(bare_jid, special, value, action) // Set the attention flag unless we're already in the jid buffer window // TODO: avoid code duplication with scr_setmsgflag_if_needed() void scr_setattentionflag_if_needed(const char *bjid, int special, guint value, enum setuiprio_ops action) { const char *current_id; winbuf *wb; bool iscurrentlocked = FALSE; if (!bjid) return; wb = scr_search_window(bjid, special); if (!wb) return; if (current_buddy) { if (special) current_id = buddy_getname(BUDDATA(current_buddy)); else current_id = buddy_getjid(BUDDATA(current_buddy)); if (current_id) { winbuf *win_entry = scr_search_window(current_id, special); if (!win_entry) return; iscurrentlocked = win_entry->bd->lock; } } else { current_id = NULL; } if (!chatmode || !current_id || strcmp(bjid, current_id) || iscurrentlocked) { roster_setuiprio(bjid, special, value, action); update_roster = TRUE; } } // scr_set_multimode() // Public function to (un)set multimode... // Convention: // 0 = disabled / 1 = multimode / 2 = multimode verbatim (commands disabled) void scr_set_multimode(int enable, char *subject) { g_free(multiline); multiline = NULL; g_free(multimode_subj); if (enable && subject) multimode_subj = g_strdup(subject); else multimode_subj = NULL; multimode = enable; } // scr_get_multiline() // Public function to get the current multi-line. const char *scr_get_multiline(void) { if (multimode && multiline) return multiline; return NULL; } // scr_get_multimode_subj() // Public function to get the multi-line subject, if any. const char *scr_get_multimode_subj(void) { if (multimode) return multimode_subj; return NULL; } // scr_append_multiline(line) // Public function to append a line to the current multi-line message. // Skip empty leading lines. void scr_append_multiline(const char *line) { static int num; if (!multimode) { scr_LogPrint(LPRINT_NORMAL, "Error: Not in multi-line message mode!"); return; } if (multiline) { int len = strlen(multiline)+strlen(line)+2; if (len >= HBB_BLOCKSIZE - 1) { // We don't handle single messages with size > HBB_BLOCKSIZE // (see hbuf) scr_LogPrint(LPRINT_NORMAL, "Your multi-line message is too big, " "this line has not been added."); scr_LogPrint(LPRINT_NORMAL, "Please send this part now..."); return; } if (num >= MULTILINE_MAX_LINE_NUMBER) { // We don't allow too many lines; however the maximum is arbitrary // (It should be < 1000 yet) scr_LogPrint(LPRINT_NORMAL, "Your message has too many lines, " "this one has not been added."); scr_LogPrint(LPRINT_NORMAL, "Please send this part now..."); return; } multiline = g_renew(char, multiline, len); strcat(multiline, "\n"); strcat(multiline, line); num++; } else { // First message line (we skip leading empty lines) num = 0; if (line[0]) { multiline = g_strdup(line); num++; } else return; } scr_LogPrint(LPRINT_NORMAL|LPRINT_NOTUTF8, "Multi-line mode: line #%d added [%.25s...", num, line); } // scr_cmdhisto_addline() // Add a line to the inputLine history static void scr_cmdhisto_addline(char *line) { int max_histo_lines; if (!line || !*line) return; max_histo_lines = settings_opt_get_int("cmdhistory_lines"); if (max_histo_lines < 0) max_histo_lines = 1; if (max_histo_lines) while (cmdhisto_nblines >= (guint)max_histo_lines) { if (cmdhisto_cur && cmdhisto_cur == cmdhisto) break; g_free(cmdhisto->data); cmdhisto = g_list_delete_link(cmdhisto, cmdhisto); cmdhisto_nblines--; } cmdhisto = g_list_append(cmdhisto, g_strdup(line)); cmdhisto_nblines++; } // scr_cmdhisto_reset() // Reset the inputLine history static void scr_cmdhisto_reset(void) { while (cmdhisto_nblines) { g_free(cmdhisto->data); cmdhisto = g_list_delete_link(cmdhisto, cmdhisto); cmdhisto_nblines--; } cmdhisto_backup[0] = 0; cmdhisto_cur = NULL; } // scr_cmdhisto_prev() // Look for previous line beginning w/ the given mask in the inputLine history // Returns NULL if none found static const char *scr_cmdhisto_prev(char *mask, guint len) { GList *hl; if (!cmdhisto_cur) { hl = g_list_last(cmdhisto); if (hl) { // backup current line strncpy(cmdhisto_backup, mask, INPUTLINE_LENGTH); } } else { hl = g_list_previous(cmdhisto_cur); } while (hl) { if (!strncmp((char*)hl->data, mask, len)) { // Found a match cmdhisto_cur = hl; return (const char*)hl->data; } hl = g_list_previous(hl); } return NULL; } // scr_cmdhisto_next() // Look for next line beginning w/ the given mask in the inputLine history // Returns NULL if none found static const char *scr_cmdhisto_next(char *mask, guint len) { GList *hl; if (!cmdhisto_cur) return NULL; hl = cmdhisto_cur; while ((hl = g_list_next(hl)) != NULL) if (!strncmp((char*)hl->data, mask, len)) { // Found a match cmdhisto_cur = hl; return (const char*)hl->data; } // If the "backuped" line matches, we'll use it if (strncmp(cmdhisto_backup, mask, len)) return NULL; // No match cmdhisto_cur = NULL; return cmdhisto_backup; } static char *_strmove(char *dst, const char *src) { char *dest = dst; while ((*dest++ = *src++) != '\0') ; return dest; } // readline_transpose_chars() // Drag the character before point forward over the character at // point, moving point forward as well. If point is at the end of // the line, then this transposes the two characters before point. void readline_transpose_chars(void) { char *c1, *c2; unsigned a, b; if (ptr_inputline == inputLine) return; if (!*ptr_inputline) { // We're at EOL // If line is only 1 char long, nothing to do... if (ptr_inputline == prev_char(ptr_inputline, inputLine)) return; // Transpose the two previous characters c2 = prev_char(ptr_inputline, inputLine); c1 = prev_char(c2, inputLine); a = get_char(c1); b = get_char(c2); put_char(put_char(c1, b), a); } else { // Swap the two characters before the cursor and move right. c2 = ptr_inputline; c1 = prev_char(c2, inputLine); a = get_char(c1); b = get_char(c2); put_char(put_char(c1, b), a); check_offset(1); } } void readline_forward_kill_word(void) { char *c, *old = ptr_inputline; int spaceallowed = 1; if (! *ptr_inputline) return; for (c = ptr_inputline ; *c ; c = next_char(c)) { if (!iswalnum(get_char(c))) { if (iswblank(get_char(c))) { if (!spaceallowed) break; } else spaceallowed = 0; } else spaceallowed = 0; } // Modify the line for (;;) { *old = *c++; if (!*old++) break; } } // readline_backward_kill_word() // Kill the word before the cursor, in input line void readline_backward_kill_word(void) { char *c, *old = ptr_inputline; int spaceallowed = 1; if (ptr_inputline == inputLine) return; c = prev_char(ptr_inputline, inputLine); for ( ; c > inputLine ; c = prev_char(c, inputLine)) { if (!iswalnum(get_char(c))) { if (iswblank(get_char(c))) { if (!spaceallowed) break; } else spaceallowed = 0; } else spaceallowed = 0; } if (c == inputLine && *c == COMMAND_CHAR && old != c+1) { c = next_char(c); } else if (c != inputLine || iswblank(get_char(c))) { if ((c < prev_char(ptr_inputline, inputLine)) && (!iswalnum(get_char(c)))) c = next_char(c); } // Modify the line ptr_inputline = c; _strmove(ptr_inputline, old); check_offset(-1); } // readline_backward_word() // Move back to the start of the current or previous word void readline_backward_word(void) { int i = 0; if (ptr_inputline == inputLine) return; if (iswalnum(get_char(ptr_inputline)) && !iswalnum(get_char(prev_char(ptr_inputline, inputLine)))) i--; for ( ; ptr_inputline > inputLine; ptr_inputline = prev_char(ptr_inputline, inputLine)) { if (!iswalnum(get_char(ptr_inputline))) { if (i) { ptr_inputline = next_char(ptr_inputline); break; } } else i++; } check_offset(-1); } // readline_forward_word() // Move forward to the end of the next word void readline_forward_word(void) { int stopsymbol_allowed = 1; while (*ptr_inputline) { if (!iswalnum(get_char(ptr_inputline))) { if (!stopsymbol_allowed) break; } else stopsymbol_allowed = 0; ptr_inputline = next_char(ptr_inputline); } check_offset(1); } void readline_updowncase_word(int upcase) { int stopsymbol_allowed = 1; while (*ptr_inputline) { if (!iswalnum(get_char(ptr_inputline))) { if (!stopsymbol_allowed) break; } else { stopsymbol_allowed = 0; if (upcase) put_char(ptr_inputline, towupper(get_char(ptr_inputline))); else put_char(ptr_inputline, towlower(get_char(ptr_inputline))); } ptr_inputline = next_char(ptr_inputline); } check_offset(1); } void readline_capitalize_word(void) { int stopsymbol_allowed = 1; int upcased = 0; while (*ptr_inputline) { if (!iswalnum(get_char(ptr_inputline))) { if (!stopsymbol_allowed) break; } else { stopsymbol_allowed = 0; if (!upcased) { put_char(ptr_inputline, towupper(get_char(ptr_inputline))); upcased = 1; } else put_char(ptr_inputline, towlower(get_char(ptr_inputline))); } ptr_inputline = next_char(ptr_inputline); } check_offset(1); } void readline_backward_char(void) { if (ptr_inputline == (char*)&inputLine) return; ptr_inputline = prev_char(ptr_inputline, inputLine); check_offset(-1); } void readline_forward_char(void) { if (!*ptr_inputline) return; ptr_inputline = next_char(ptr_inputline); check_offset(1); } // readline_accept_line(down_history) // Validate current command line. // If down_history is true, load the next history line. int readline_accept_line(int down_history) { scr_check_auto_away(TRUE); last_activity_buddy = current_buddy; if (process_line(inputLine)) return 255; // Add line to history scr_cmdhisto_addline(inputLine); // Reset the line ptr_inputline = inputLine; *ptr_inputline = 0; inputline_offset = 0; if (down_history) { // Use next history line instead of a blank line const char *l = scr_cmdhisto_next("", 0); if (l) strcpy(inputLine, l); // Reset backup history line cmdhisto_backup[0] = 0; } else { // Reset history line pointer cmdhisto_cur = NULL; } return 0; } // readline_clear_history() // Clear command line history. void readline_clear_history(void) { scr_cmdhisto_reset(); } void readline_cancel_completion(void) { scr_cancel_current_completion(); scr_end_current_completion(); check_offset(-1); } void readline_do_completion(void) { int i, n; if (multimode != 2) { // Not in verbatim multi-line mode scr_handle_tab(); } else { // Verbatim multi-line mode: expand tab char tabstr[9]; n = 8 - (ptr_inputline - inputLine) % 8; for (i = 0; i < n; i++) tabstr[i] = ' '; tabstr[i] = '\0'; scr_insert_text(tabstr); } check_offset(0); } void readline_refresh_screen(void) { scr_check_auto_away(TRUE); parse_colors(); scr_Resize(); redrawwin(stdscr); } void readline_disable_chat_mode(guint show_roster) { scr_check_auto_away(TRUE); if (chatmode) scr_buffer_readmark(TRUE); currentWindow = NULL; chatmode = FALSE; if (current_buddy) buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); if (show_roster) scr_roster_visibility(1); scr_update_chat_status(FALSE); top_panel(chatPanel); top_panel(inputPanel); update_panels(); } void readline_hist_beginning_search_bwd(void) { const char *l = scr_cmdhisto_prev(inputLine, ptr_inputline-inputLine); if (l) strcpy(inputLine, l); } void readline_hist_beginning_search_fwd(void) { const char *l = scr_cmdhisto_next(inputLine, ptr_inputline-inputLine); if (l) strcpy(inputLine, l); } void readline_hist_prev(void) { const char *l = scr_cmdhisto_prev(inputLine, 0); if (l) { strcpy(inputLine, l); // Set the pointer at the EOL. // We have to move it to BOL first, because we could be too far already. readline_iline_start(); readline_iline_end(); } } void readline_hist_next(void) { const char *l = scr_cmdhisto_next(inputLine, 0); if (l) { strcpy(inputLine, l); // Set the pointer at the EOL. // We have to move it to BOL first, because we could be too far already. readline_iline_start(); readline_iline_end(); } } void readline_backward_kill_char(void) { char *src, *c; if (ptr_inputline == (char*)&inputLine) return; src = ptr_inputline; c = prev_char(ptr_inputline, inputLine); ptr_inputline = c; _strmove(ptr_inputline, src); check_offset(-1); } void readline_forward_kill_char(void) { if (!*ptr_inputline) return; _strmove(ptr_inputline, next_char(ptr_inputline)); } void readline_iline_start(void) { ptr_inputline = inputLine; inputline_offset = 0; } void readline_iline_end(void) { for (; *ptr_inputline; ptr_inputline++) ; check_offset(1); } void readline_backward_kill_iline(void) { char *dest = inputLine; if (ptr_inputline == inputLine) return; if (*dest == COMMAND_CHAR && ptr_inputline != dest+1) dest = next_char(dest); _strmove(dest, ptr_inputline); ptr_inputline = dest; inputline_offset = 0; } void readline_forward_kill_iline(void) { *ptr_inputline = 0; } void readline_send_multiline(void) { // Validate current multi-line if (multimode) process_command(mkcmdstr("msay send"), TRUE); } void readline_insert(const char *toinsert) { if (!toinsert || !*toinsert) return; scr_insert_text(toinsert); check_offset(0); } // which_row() // Tells which row our cursor is in, in the command line. // -2 -> normal text // -1 -> room: nickname completion // 0 -> command // 1 -> parameter 1 (etc.) // If > 0, then *p_row is set to the beginning of the row static int which_row(const char **p_row) { int row = -1; char *p; int quote = FALSE; // Not a command? if ((ptr_inputline == inputLine) || (inputLine[0] != COMMAND_CHAR)) { if (!current_buddy) return -2; if (buddy_gettype(BUDDATA(current_buddy)) == ROSTER_TYPE_ROOM) { *p_row = inputLine; return -1; } return -2; } // This is a command row = 0; for (p = inputLine ; p < ptr_inputline ; p = next_char(p)) { if (quote) { if (*p == '"' && *(p-1) != '\\') quote = FALSE; continue; } if (*p == '"' && *(p-1) != '\\') { quote = TRUE; } else if (*p == ' ') { if (*(p-1) != ' ') row++; *p_row = p+1; } } return row; } // scr_insert_text() // Insert the given text at the current cursor position. // The cursor is moved. We don't check if the cursor still is in the screen // after, the caller should do that. static void scr_insert_text(const char *text) { char tmpLine[INPUTLINE_LENGTH+1]; int len = strlen(text); // Check the line isn't too long if (strlen(inputLine) + len >= INPUTLINE_LENGTH) { scr_LogPrint(LPRINT_LOGNORM, "Cannot insert text, line too long."); return; } strcpy(tmpLine, ptr_inputline); strcpy(ptr_inputline, text); ptr_inputline += len; strcpy(ptr_inputline, tmpLine); } static void scr_cancel_current_completion(void); // scr_handle_tab() // Function called when tab is pressed. // Initiate or continue a completion... static void scr_handle_tab(void) { int nrow; const char *row; const char *cchar; guint compl_categ; row = inputLine; // (Kills a GCC warning) nrow = which_row(&row); // a) No completion if no leading slash ('cause not a command), // unless this is a room (then, it is a nickname completion) // b) We can't have more than 2 parameters (we use 2 flags) if ((nrow == -2) || (nrow == 3 && !completion_started) || nrow > 3) return; if (nrow == 0) { // Command completion row = next_char(inputLine); compl_categ = COMPL_CMD; } else if (nrow == -1) { // Nickname completion compl_categ = COMPL_RESOURCE; } else { // Other completion, depending on the command int alias = FALSE; cmd *com; char *xpline = expandalias(inputLine); com = cmd_get(xpline); if (xpline != inputLine) { // This is an alias, so we can't complete rows > 0 alias = TRUE; g_free(xpline); } if ((!com && (!alias || !completion_started)) || !row) { scr_LogPrint(LPRINT_NORMAL, "I cannot complete that..."); return; } if (!alias) compl_categ = com->completion_flags[nrow-1]; else compl_categ = 0; } if (!completion_started) { guint dynlist; GSList *list; if (!compl_categ) return; // Nothing to complete list = compl_get_category_list(compl_categ, &dynlist); if (list) { guint n; char *prefix = g_strndup(row, ptr_inputline-row); // Init completion n = new_completion(prefix, list, (compl_categ == COMPL_RESOURCE ? settings_opt_get("muc_completion_suffix") : NULL)); g_free(prefix); if (n == 0 && nrow == -1) { // This is a MUC room and we can't complete from the beginning of the // line. Let's try a bit harder and complete the current word. row = prev_char(ptr_inputline, inputLine); while (row >= inputLine) { if (iswspace(get_char(row)) || get_char(row) == '(') { row = next_char((char*)row); break; } if (row == inputLine) break; row = prev_char((char*)row, inputLine); } // There's no need to try again if row == inputLine if (row > inputLine) { prefix = g_strndup(row, ptr_inputline-row); new_completion(prefix, list, NULL); g_free(prefix); } } // Free the list if it's a dynamic one if (dynlist) { GSList *slp; for (slp = list; slp; slp = g_slist_next(slp)) g_free(slp->data); g_slist_free(list); } // Now complete cchar = complete(); if (cchar) scr_insert_text(cchar); completion_started = TRUE; } } else { // Completion already initialized scr_cancel_current_completion(); // Now complete again cchar = complete(); if (cchar) scr_insert_text(cchar); } } static void scr_cancel_current_completion(void) { char *c; char *src = ptr_inputline; guint back = cancel_completion(); guint i; // Remove $back chars for (i = 0; i < back; i++) ptr_inputline = prev_char(ptr_inputline, inputLine); c = ptr_inputline; for ( ; *src ; ) *c++ = *src++; *c = 0; } static void scr_end_current_completion(void) { done_completion(); completion_started = FALSE; } // check_offset(int direction) // Check inputline_offset value, and make sure the cursor is inside the // screen. static inline void check_offset(int direction) { int i; char *c = &inputLine[inputline_offset]; // Left side if (inputline_offset && direction <= 0) { while (ptr_inputline <= c) { for (i = 0; i < 5; i++) c = prev_char(c, inputLine); if (c == inputLine) break; } } // Right side if (direction >= 0) { int delta = get_char_width(c); while (ptr_inputline > c) { c = next_char(c); delta += get_char_width(c); } c = &inputLine[inputline_offset]; while (delta >= maxX) { for (i = 0; i < 5; i++) { delta -= get_char_width(c); c = next_char(c); } } } inputline_offset = c - inputLine; } #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) // prints inputLine with underlined words when misspelled static inline void print_checked_line(void) { char *wprint_char_fmt = "%c"; int point; int nrchar = maxX; char *ptrCur = inputLine + inputline_offset; #ifdef UNICODE // We need this to display a single UTF-8 char... Any better solution? if (utf8_mode) wprint_char_fmt = "%lc"; #endif wmove(inputWnd, 0, 0); // problem with backspace while (*ptrCur && nrchar-- > 0) { point = ptrCur - inputLine; if (maskLine[point]) wattrset(inputWnd, A_UNDERLINE); wprintw(inputWnd, wprint_char_fmt, get_char(ptrCur)); wattrset(inputWnd, A_NORMAL); ptrCur = next_char(ptrCur); } } #endif static inline void refresh_inputline(void) { #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) if (settings_opt_get_int("spell_enable")) { memset(maskLine, 0, INPUTLINE_LENGTH+1); spellcheck(inputLine, maskLine); } print_checked_line(); wclrtoeol(inputWnd); if (*ptr_inputline) { // hack to set cursor pos. Characters can have different width, // so I know of no better way. char c = *ptr_inputline; *ptr_inputline = 0; print_checked_line(); *ptr_inputline = c; } #else mvwprintw(inputWnd, 0, 0, "%s", inputLine + inputline_offset); wclrtoeol(inputWnd); if (*ptr_inputline) { // hack to set cursor pos. Characters can have different width, // so I know of no better way. char c = *ptr_inputline; *ptr_inputline = 0; mvwprintw(inputWnd, 0, 0, "%s", inputLine + inputline_offset); *ptr_inputline = c; } #endif } void scr_handle_CtrlC(void) { if (!Curses) return; // Leave multi-line mode process_command(mkcmdstr("msay abort"), TRUE); // Same as Ctrl-g, now scr_cancel_current_completion(); scr_end_current_completion(); check_offset(-1); refresh_inputline(); } static void add_keyseq(char *seqstr, guint mkeycode, gint value) { keyseq *ks; // Let's make sure the length is correct if (strlen(seqstr) > MAX_KEYSEQ_LENGTH) { scr_LogPrint(LPRINT_LOGNORM, "add_keyseq(): key sequence is too long!"); return; } ks = g_new0(keyseq, 1); ks->seqstr = g_strdup(seqstr); ks->mkeycode = mkeycode; ks->value = value; keyseqlist = g_slist_append(keyseqlist, ks); } // match_keyseq(iseq, &ret) // Check if "iseq" is a known key escape sequence. // Return value: // -1 if "seq" matches no known sequence // 0 if "seq" could match 1 or more known sequences // >0 if "seq" matches a key sequence; the mkey code is returned // and *ret is set to the matching keyseq structure. static inline gint match_keyseq(int *iseq, keyseq **ret) { GSList *ksl; keyseq *ksp; char *p, c; int *i; int needmore = FALSE; for (ksl = keyseqlist; ksl; ksl = g_slist_next(ksl)) { ksp = ksl->data; p = ksp->seqstr; i = iseq; while (1) { c = (unsigned char)*i; if (!*p && !c) { // Match (*ret) = ksp; return ksp->mkeycode; } if (!c) { // iseq is too short needmore = TRUE; break; } else if (!*p || c != *p) { // This isn't a match break; } p++; i++; } } if (needmore) return 0; return -1; } static inline int match_utf8_keyseq(int *iseq) { int *strp = iseq; unsigned c = *strp++; unsigned mask = 0x80; int len = -1; while (c & mask) { mask >>= 1; len++; } if (len <= 0 || len > 4) return -1; c &= mask - 1; while ((*strp & 0xc0) == 0x80) { if (len-- <= 0) // can't happen return -1; c = (c << 6) | (*strp++ & 0x3f); } if (len) return 0; return c; } void scr_getch(keycode *kcode) { keyseq *mks = NULL; int ks[MAX_KEYSEQ_LENGTH+1]; int i; memset(kcode, 0, sizeof(keycode)); memset(ks, 0, sizeof(ks)); kcode->value = wgetch(inputWnd); if (utf8_mode) { bool ismeta = (kcode->value == 27); #ifdef NCURSES_MOUSE_VERSION bool ismouse = (kcode->value == KEY_MOUSE); if (ismouse) { MEVENT mouse; getmouse(&mouse); kcode->value = mouse.bstate; kcode->mcode = MKEY_MOUSE; return; } else if (ismeta) #else if (ismeta) #endif ks[0] = wgetch(inputWnd); else ks[0] = kcode->value; for (i = 0; i < MAX_KEYSEQ_LENGTH - 1; i++) { int match = match_utf8_keyseq(ks); if (match == -1) break; if (match > 0) { kcode->value = match; kcode->utf8 = 1; if (ismeta) kcode->mcode = MKEY_META; return; } ks[i + 1] = wgetch(inputWnd); if (ks[i + 1] == ERR) break; } while (i > 0) ungetch(ks[i--]); if (ismeta) ungetch(ks[0]); memset(ks, 0, sizeof(ks)); } if (kcode->value != 27) return; // Check for escape key sequence for (i=0; i < MAX_KEYSEQ_LENGTH; i++) { int match; ks[i] = wgetch(inputWnd); if (ks[i] == ERR) break; match = match_keyseq(ks, &mks); if (match == -1) { // No such key sequence. Let's increment i as it is a valid key. i++; break; } if (match > 0) { // We have a matching sequence kcode->mcode = mks->mkeycode; kcode->value = mks->value; return; } } // No match. Let's return a meta-key. if (i > 0) { kcode->mcode = MKEY_META; kcode->value = ks[0]; } if (i > 1) { // We need to push some keys back to the keyboard buffer while (i-- > 1) ungetch(ks[i]); } return; } void scr_do_update(void) { if (colors_stalled) parse_colors(); doupdate(); } static int bindcommand(keycode kcode) { gchar asciikey[16], asciicode[16]; const gchar *boundcmd; if (kcode.utf8) g_snprintf(asciicode, 15, "U%d", kcode.value); else g_snprintf(asciicode, 15, "%d", kcode.value); if (!kcode.mcode || kcode.mcode == MKEY_EQUIV) g_snprintf(asciikey, 15, "%s", asciicode); else if (kcode.mcode == MKEY_META) g_snprintf(asciikey, 15, "M%s", asciicode); else if (kcode.mcode == MKEY_MOUSE) g_snprintf(asciikey, 15, "p%s", asciicode); else g_snprintf(asciikey, 15, "MK%d", kcode.mcode); boundcmd = settings_get(SETTINGS_TYPE_BINDING, asciikey); if (boundcmd) { gchar *cmdline = from_utf8(boundcmd); scr_check_auto_away(TRUE); if (process_command(cmdline, TRUE)) return 255; // Quit g_free(cmdline); return 0; } scr_LogPrint(LPRINT_NORMAL, "Unknown key=%s", asciikey); #ifndef UNICODE if (utf8_mode) scr_LogPrint(LPRINT_NORMAL, "WARNING: Compiled without full UTF-8 support!"); #endif return -1; } // scr_process_key(key) // Handle the pressed key, in the command line (bottom). void scr_process_key(keycode kcode) { int key = kcode.value; int display_char = FALSE; lock_chatstate = FALSE; switch (kcode.mcode) { case 0: // key = kcode.value; break; case MKEY_EQUIV: // key = kcode.value; break; case MKEY_META: default: if (bindcommand(kcode) == 255) { mcabber_set_terminate_ui(); return; } key = ERR; // Do not process any further } if (kcode.utf8) { if (key != ERR && !kcode.mcode) display_char = TRUE; goto display; } switch (key) { case 0: case ERR: break; case 9: // Tab readline_do_completion(); break; case 13: // Enter case 343: // Enter on Maemo if (readline_accept_line(FALSE) == 255) { mcabber_set_terminate_ui(); return; } break; case 3: // Ctrl-C scr_handle_CtrlC(); break; case KEY_RESIZE: #ifdef USE_SIGWINCH { struct winsize size; if (ioctl(STDIN_FILENO, TIOCGWINSZ, &size) != -1) resizeterm(size.ws_row, size.ws_col); } #endif scr_Resize(); break; default: display_char = TRUE; } // switch display: if (display_char) { guint printable; if (kcode.utf8) { printable = iswprint(key); } else { #ifdef __CYGWIN__ printable = (isprint(key) || (key >= 161 && key <= 255)) && !is_speckey(key); #else printable = isprint(key) && !is_speckey(key); #endif } if (printable) { char tmpLine[INPUTLINE_LENGTH+1]; // Check the line isn't too long if (strlen(inputLine) + 4 > INPUTLINE_LENGTH) return; // Insert char strcpy(tmpLine, ptr_inputline); ptr_inputline = put_char(ptr_inputline, key); strcpy(ptr_inputline, tmpLine); check_offset(1); } else { // Look for a key binding. if (!kcode.utf8 && (bindcommand(kcode) == 255)) { mcabber_set_terminate_ui(); return; } } } if (completion_started && key != 9 && key != KEY_RESIZE) scr_end_current_completion(); refresh_inputline(); if (!lock_chatstate) { // Set chat state to composing (1) if the user is currently composing, // i.e. not an empty line and not a command line. if (inputLine[0] == 0 || inputLine[0] == COMMAND_CHAR) set_chatstate(0); else set_chatstate(1); if (chatstate) time(&chatstate_timestamp); } return; } #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) // initialization void spellcheck_init(void) { int spell_enable = settings_opt_get_int("spell_enable"); const char *spell_lang = settings_opt_get("spell_lang"); #ifdef WITH_ASPELL const char *spell_encoding = settings_opt_get("spell_encoding"); AspellCanHaveError *possible_err; #endif if (!spell_enable) return; #ifdef WITH_ENCHANT if (spell_checker) { enchant_broker_free_dict(spell_broker, spell_checker); enchant_broker_free(spell_broker); spell_checker = NULL; spell_broker = NULL; } #endif #ifdef WITH_ASPELL if (spell_checker) { delete_aspell_speller(spell_checker); delete_aspell_config(spell_config); spell_checker = NULL; spell_config = NULL; } #endif if (!spell_lang) { // Cannot initialize: language not specified scr_LogPrint(LPRINT_LOGNORM, "Error: Cannot initialize spell checker, language not specified."); scr_LogPrint(LPRINT_LOGNORM, "Please set the 'spell_lang' variable."); return; } #ifdef WITH_ENCHANT spell_broker = enchant_broker_init(); spell_checker = enchant_broker_request_dict(spell_broker, spell_lang); #endif #ifdef WITH_ASPELL spell_config = new_aspell_config(); if (spell_encoding) aspell_config_replace(spell_config, "encoding", spell_encoding); aspell_config_replace(spell_config, "lang", spell_lang); possible_err = new_aspell_speller(spell_config); if (aspell_error_number(possible_err) != 0) { spell_checker = NULL; delete_aspell_config(spell_config); spell_config = NULL; } else { spell_checker = to_aspell_speller(possible_err); } #endif } // Deinitialization of spellchecker void spellcheck_deinit(void) { if (spell_checker) { #ifdef WITH_ENCHANT enchant_broker_free_dict(spell_broker, spell_checker); #endif #ifdef WITH_ASPELL delete_aspell_speller(spell_checker); #endif spell_checker = NULL; } #ifdef WITH_ENCHANT if (spell_broker) { enchant_broker_free(spell_broker); spell_broker = NULL; } #endif #ifdef WITH_ASPELL if (spell_config) { delete_aspell_config(spell_config); spell_config = NULL; } #endif } #define spell_isalpha(c) (utf8_mode ? iswalpha(get_char(c)) : isalpha(*c)) // Spell checking function static void spellcheck(char *line, char *checked) { const char *start, *line_start; if (inputLine[0] == 0 || inputLine[0] == COMMAND_CHAR) return; line_start = line; while (*line) { if (!spell_isalpha(line)) { line = next_char(line); continue; } if (!strncmp(line, "http://", 7)) { line += 7; // : and / characters are 1 byte long in utf8, right? while (!strchr(" \t\r\n", *line)) line = next_char(line); // i think line++ would be fine here? continue; } if (!strncmp(line, "ftp://", 6)) { line += 6; while (!strchr(" \t\r\n", *line)) line = next_char(line); continue; } start = line; while (spell_isalpha(line)) line = next_char(line); if (spell_checker && #ifdef WITH_ENCHANT enchant_dict_check(spell_checker, start, line - start) != 0 #endif #ifdef WITH_ASPELL aspell_speller_check(spell_checker, start, line - start) == 0 #endif ) memset(&checked[start - line_start], SPELLBADCHAR, line - start); } } #endif /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/screen.h000066400000000000000000000135271216603513500162220ustar00rootroot00000000000000#ifndef __MCABBER_SCREEN_H__ #define __MCABBER_SCREEN_H__ 1 #include #include #if HAVE_NCURSESW_NCURSES_H # include # include #elif HAVE_NCURSES_NCURSES_H # include # include #else # include # include #endif #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) void spellcheck_init(void); void spellcheck_deinit(void); //static void spellcheck(char*, char*); #endif #include #include #include #define INPUTLINE_LENGTH 1024 // Only used in screen.c; this is the maximum line number // in a multi-line message. Should be < 1000 // Note: message length is limited by the HBB_BLOCKSIZE size too #define MULTILINE_MAX_LINE_NUMBER 299 // When chatstates are enabled, timeout (in seconds) before "composing" // becomes "paused" because of user inactivity. // Warning: setting this very low will cause more network traffic. #define COMPOSING_TIMEOUT 6L enum colors { COLOR_GENERAL = 3, COLOR_MSGOUT, COLOR_MSGHL, COLOR_STATUS, COLOR_LOG, COLOR_ROSTER, COLOR_ROSTERSEL, COLOR_ROSTERSELNMSG, COLOR_ROSTERNMSG, COLOR_INFO, COLOR_MSGIN, COLOR_READMARK, COLOR_max }; int COLOR_ATTRIB[COLOR_max]; extern int update_roster; extern gboolean chatstates_disabled; extern gboolean Autoaway; typedef struct { int value; int utf8; enum { MKEY_META = 1, MKEY_EQUIV, MKEY_CTRL_PGUP, MKEY_CTRL_PGDOWN, MKEY_SHIFT_PGUP, MKEY_SHIFT_PGDOWN, MKEY_CTRL_SHIFT_PGUP, MKEY_CTRL_SHIFT_PGDOWN, MKEY_CTRL_HOME, MKEY_CTRL_END, MKEY_CTRL_INS, MKEY_CTRL_DEL, MKEY_CTRL_SHIFT_HOME, MKEY_CTRL_SHIFT_END, MKEY_MOUSE } mcode; } keycode; typedef enum { MC_ALL, MC_PRESET, MC_OFF, MC_REMOVE } muccoltype; void scr_write_incoming_message(const char *jidfrom, const char *text, time_t timestamp, guint prefix, unsigned mucnicklen); void scr_write_outgoing_message(const char *jidto, const char *text, guint prefix, gpointer xep184); void scr_getch(keycode *kcode); void scr_process_key(keycode kcode); void scr_init_bindings(void); void scr_init_locale_charset(void); void scr_init_curses(void); void scr_terminate_curses(void); gboolean scr_curses_status(void); void scr_draw_main_window(unsigned int fullinit); void scr_draw_roster(void); void scr_update_main_status(int forceupdate); void scr_update_chat_status(int forceupdate); void scr_roster_visibility(int status); void scr_remove_receipt_flag(const char *jidto, gconstpointer xep184); void scr_show_buddy_window(void); int scr_buddy_buffer_exists(const char *jid); void scr_update_buddy_window(void); void scr_set_chatmode(int enable); int scr_get_chatmode(void); void scr_set_multimode(int enable, char *subject); int scr_get_multimode(void); void scr_setmsgflag_if_needed(const char *jid, int special); void scr_setattentionflag_if_needed(const char *bjid, int special, guint value, enum setuiprio_ops action); void scr_append_multiline(const char *line); const char *scr_get_multiline(void); const char *scr_get_multimode_subj(void); guint scr_getprefixwidth(void); guint scr_gettextwidth(void); guint scr_gettextheight(void); guint scr_getlogwinheight(void); void scr_line_prefix(hbb_line *line, char *prefix, guint preflen); void scr_beep(void); void scr_check_auto_away(int activity); // For commands... void scr_roster_top(void); void scr_roster_bottom(void); void scr_roster_up_down(int updown, unsigned int n); void scr_roster_prev_group(void); void scr_roster_next_group(void); void scr_roster_search(char *); void scr_roster_jump_jid(char *); void scr_roster_jump_alternate(void); void scr_roster_unread_message(int); void scr_roster_display(const char *); void scr_buffer_top_bottom(int topbottom); void scr_buffer_clear(void); void scr_buffer_scroll_lock(int lock); void scr_buffer_purge(int, const char*); void scr_buffer_purge_all(int); void scr_buffer_search(int direction, const char *text); void scr_buffer_percent(int pc); void scr_buffer_date(time_t t); void scr_buffer_dump(const char *file); void scr_buffer_list(void); void scr_buffer_scroll_up_down(int updown, unsigned int nblines); void scr_buffer_readmark(gchar action); void scr_buffer_jump_readmark(void); bool scr_roster_color(const char *status, const char *wildcard, const char *color); void scr_roster_clear_color(void); void scr_muc_color(const char *muc, muccoltype type); void scr_muc_nick_color(const char *nick, const char *color); void readline_transpose_chars(void); void readline_forward_kill_word(void); void readline_backward_kill_word(void); void readline_backward_word(void); void readline_forward_word(void); void readline_updowncase_word(int); void readline_capitalize_word(void); void readline_backward_char(void); void readline_forward_char(void); int readline_accept_line(int down_history); void readline_clear_history(void); void readline_cancel_completion(void); void readline_do_completion(void); void readline_refresh_screen(void); void readline_disable_chat_mode(guint show_roster); void readline_hist_beginning_search_bwd(void); void readline_hist_beginning_search_fwd(void); void readline_hist_prev(void); void readline_hist_next(void); void readline_backward_kill_char(void); void readline_forward_kill_char(void); void readline_iline_start(void); void readline_iline_end(void); void readline_backward_kill_iline(void); void readline_forward_kill_iline(void); void readline_send_multiline(void); void readline_insert(const char *toinsert); // For backward compatibility: #define scr_WriteIncomingMessage scr_write_incoming_message #define scr_WriteOutgoingMessage scr_write_outgoing_message #endif /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/settings.c000066400000000000000000000407141216603513500165740ustar00rootroot00000000000000/* * settings.c -- Configuration stuff * * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include "config.h" #include "settings.h" #include "commands.h" #include "logprint.h" #include "otr.h" #include "utils.h" #include "xmpp.h" #include "main.h" // Maximum line length // (probably best to use the same value as INPUTLINE_LENGTH) #define CONFLINE_LENGTH 1024 static GHashTable *option; static GHashTable *alias; static GHashTable *binding; static GHashTable *guards; #ifdef HAVE_GPGME /* PGP settings */ static GHashTable *pgpopt; typedef struct { gchar *pgp_keyid; /* KeyId the contact is supposed to use */ guint pgp_disabled; /* If TRUE, PGP is disabled for outgoing messages */ guint pgp_force; /* If TRUE, PGP is used w/o negotiation */ } T_pgpopt; #endif typedef struct { settings_guard_t guard; } installed_guard_t; #ifdef HAVE_LIBOTR static GHashTable *otrpolicy; static enum otr_policy default_policy; #endif static inline GHashTable *get_hash(guint type) { if (type == SETTINGS_TYPE_OPTION) return option; else if (type == SETTINGS_TYPE_ALIAS) return alias; else if (type == SETTINGS_TYPE_BINDING) return binding; #ifdef HAVE_LIBOTR else if (type == SETTINGS_TYPE_OTR) return otrpolicy; #endif return NULL; } /* -- */ void settings_init(void) { option = g_hash_table_new_full(&g_str_hash, &g_str_equal, &g_free, &g_free); alias = g_hash_table_new_full(&g_str_hash, &g_str_equal, &g_free, &g_free); binding = g_hash_table_new_full(&g_str_hash, &g_str_equal, &g_free, &g_free); guards = g_hash_table_new_full(&g_str_hash, &g_str_equal, &g_free, &g_free); #ifdef HAVE_GPGME pgpopt = g_hash_table_new(&g_str_hash, &g_str_equal); #endif #ifdef HAVE_LIBOTR otrpolicy = g_hash_table_new(&g_str_hash, &g_str_equal); #endif } // cfg_read_file(filename, mainfile) // Read and parse config file "filename". If filename is NULL, // try to open the configuration file at the default locations. // mainfile must be set to TRUE for the startup config file. // If mainfile is TRUE, the permissions of the configuration file will // be fixed if they're insecure. // int cfg_read_file(char *filename, guint mainfile) { static unsigned int runtime; FILE *fp; char *buf; char *line, *eol; unsigned int ln = 0; int err = 0; if (!filename) { // Use default config file locations char *home; GString *sfilename; if (!mainfile) { scr_LogPrint(LPRINT_LOGNORM, "No file name provided"); return -1; } home = getenv("HOME"); if (!home) { scr_LogPrint(LPRINT_LOG, "Can't find home dir!"); fprintf(stderr, "Can't find home dir!\n"); err = -1; goto cfg_read_file_return; } sfilename = g_string_new(""); g_string_printf(sfilename, "%s/.mcabber/mcabberrc", home); if ((fp = fopen(sfilename->str, "r")) == NULL) { // 2nd try... g_string_printf(sfilename, "%s/.mcabberrc", home); if ((fp = fopen(sfilename->str, "r")) == NULL) { fprintf(stderr, "Cannot open config file!\n"); g_string_free(sfilename, TRUE); err = -1; goto cfg_read_file_return; } } // Check configuration file permissions // As it could contain sensitive data, we make it user-readable only. checkset_perm(sfilename->str, TRUE); scr_LogPrint(LPRINT_LOGNORM, "Reading %s", sfilename->str); // Check mcabber dir. Here we just warn, we don't change the modes. g_string_printf(sfilename, "%s/.mcabber/", home); checkset_perm(sfilename->str, FALSE); g_string_free(sfilename, TRUE); } else { // filename was specified if ((fp = fopen(filename, "r")) == NULL) { const char *msg = "Cannot open configuration file"; if (mainfile) perror(msg); else scr_LogPrint(LPRINT_LOGNORM, "%s (%s).", msg, filename); err = -2; goto cfg_read_file_return; } // Check configuration file permissions (see above) // We don't change the permissions if that's not the main file. if (mainfile) checkset_perm(filename, TRUE); scr_LogPrint(LPRINT_LOGNORM, "Reading %s", filename); } buf = g_new(char, CONFLINE_LENGTH+1); while (fgets(buf+1, CONFLINE_LENGTH, fp) != NULL) { // The first char is reserved to add a '/', to make a command line line = buf+1; ln++; // Strip leading spaces while (isspace(*line)) line++; // Make eol point to the last char of the line for (eol = line ; *eol ; eol++) ; if (eol > line) eol--; // Strip trailing spaces while (eol > line && isspace(*eol)) *eol-- = 0; // Ignore empty lines and comments if ((*line == '\n') || (*line == '\0') || (*line == '#')) continue; // If we aren't in runtime (i.e. startup) we'll only accept "safe" commands if (!runtime) { const gchar *cmdend = strchr(line, ' '); gchar *cmdname = NULL; gboolean safe; if (cmdend) cmdname = g_strndup(line, cmdend - line); safe = cmd_is_safe(cmdname ? cmdname : line); g_free(cmdname); if (!safe) { scr_log_print(LPRINT_LOGNORM, "Error in configuration file (l. %d): " "this command can't be used here", ln); err++; continue; } } // Set the leading COMMAND_CHAR to build a command line // and process the command *(--line) = COMMAND_CHAR; if (process_command(line, TRUE) == 255) mcabber_set_terminate_ui(); } g_free(buf); fclose(fp); if (filename) scr_LogPrint(LPRINT_LOGNORM, "Loaded %s.", filename); cfg_read_file_return: // If we're done with the main file parsing, we can assume that // the next time this function is called will be at run time. if (mainfile) runtime = TRUE; return err; } // parse_assigment(assignment, pkey, pval) // Read assignment and split it to key, value // // If this is an assignment, the function will return TRUE and // set *pkey and *pval (*pval is set to NULL if value field is empty). // // If this isn't a assignment (no = char), the function will set *pval // to NULL and return FALSE. // // The caller should g_free() *pkey and *pval (if not NULL) after use. guint parse_assigment(gchar *assignment, gchar **pkey, gchar **pval) { char *key, *val, *t, *p; *pkey = *pval = NULL; key = assignment; // Remove leading spaces in option name while ((!isalnum(*key)) && (*key != '=') && *key) { key++; } if (!*key) return FALSE; // Empty assignment if (*key == '=') { return FALSE; } // Ok, key points to the option name for (val = key+1 ; *val && (*val != '=') ; val++) if (!isalnum(*val) && !isblank(*val) && (*val != '_') && (*val != '-')) { // Key should only have alnum chars... return FALSE; } // Remove trailing spaces in option name: for (t = val-1 ; t > key && isblank(*t) ; t--) ; // Check for embedded whitespace characters for (p = key; p < t; p++) { if (isblank(*p)) { // Name should not contain space chars... return FALSE; } } *pkey = g_strndup(key, t+1-key); if (!*val) return FALSE; // Not an assignment // Remove leading and trailing spaces in option value: for (val++; *val && isblank(*val) ; val++) ; for (t = val ; *t ; t++) ; for (t-- ; t >= val && isblank(*t) ; t--) ; if (t < val) return TRUE; // no value (variable reset for example) // If the value begins and ends with quotes ("), these quotes are // removed and whitespace is not stripped if ((t>val) && (*val == '"' && *t == '"')) { val++; t--; } *pval = g_strndup(val, t+1-val); return TRUE; } gboolean settings_set_guard(const gchar *key, settings_guard_t guard) { if (!guard) g_hash_table_remove(guards, key); else { installed_guard_t *iguard = g_hash_table_lookup(guards, key); if (iguard) return FALSE; iguard = g_new(installed_guard_t, 1); iguard->guard = guard; g_hash_table_insert(guards, g_strdup(key), iguard); } return TRUE; } void settings_del_guard(const gchar *key) { settings_set_guard(key, NULL); } void settings_opt_set_raw(const gchar *key, const gchar *value) { if (!value) g_hash_table_remove(option, key); else g_hash_table_insert(option, g_strdup(key), g_strdup(value)); } void settings_set(guint type, const gchar *key, const gchar *value) { GHashTable *hash; gchar *dup_value = NULL; installed_guard_t *guard = NULL; if (type == SETTINGS_TYPE_OPTION) { guard = g_hash_table_lookup(guards, key); if (guard) dup_value = guard->guard(key, value); } hash = get_hash(type); if (!hash) return; if (!value && !dup_value) g_hash_table_remove(hash, key); else if (!guard) g_hash_table_insert(hash, g_strdup(key), g_strdup(value)); else if (dup_value) g_hash_table_insert(hash, g_strdup(key), dup_value); else g_hash_table_remove(option, key); } void settings_del(guint type, const gchar *key) { settings_set(type, key, NULL); } const gchar *settings_get(guint type, const gchar *key) { GHashTable *hash; hash = get_hash(type); if (!hash) return NULL; return g_hash_table_lookup(hash, key); } int settings_get_int(guint type, const gchar *key) { const gchar *setval = settings_get(type, key); if (setval) return atoi(setval); return 0; } // settings_get_status_msg(status) // Return a string with the current status message: // - if there is a user-defined message ("message" option), // return this message // - if there is a user-defined message for the given status (and no // generic user message), it is returned // - if no message is found, return NULL const gchar *settings_get_status_msg(enum imstatus status) { const gchar *rstatus = settings_opt_get("message"); if (rstatus) return rstatus; switch(status) { case available: rstatus = settings_opt_get("message_avail"); break; case freeforchat: rstatus = settings_opt_get("message_free"); break; case dontdisturb: rstatus = settings_opt_get("message_dnd"); break; case notavail: rstatus = settings_opt_get("message_notavail"); break; case away: rstatus = settings_opt_get("message_away"); break; default: // offline, invisible break; } return rstatus; } // settings_foreach(type, pfunction, param) // Call pfunction(key, value, param) for each setting with requested type. void settings_foreach(guint type, void (*pfunc)(char *k, char *v, void *param), void *param) { GHashTable *hash; hash = get_hash(type); if (!hash) return; g_hash_table_foreach(hash, (GHFunc)pfunc, param); } // default_muc_nickname() // Return the user's default nickname // The caller should free the string after use char *default_muc_nickname(const char *roomid) { char *nick; nick = (char*)xmpp_get_bookmark_nick(roomid); if (nick) return g_strdup(nick); // We try the "nickname" option, then the username part of the jid. nick = (char*)settings_opt_get("nickname"); if (nick) return g_strdup(nick); nick = jid_get_username(settings_opt_get("jid")); return nick; } /* PGP settings */ // settings_pgp_setdisabled(jid, value) // Enable/disable PGP encryption for jid. // (Set value to TRUE to disable encryption) void settings_pgp_setdisabled(const char *bjid, guint value) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (!pgpdata) { // If value is 0, we do not need to create a structure (that's // the default value). if (value) { pgpdata = g_new0(T_pgpopt, 1); pgpdata->pgp_disabled = value; g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata); } } else { pgpdata->pgp_disabled = value; // We could remove the key/value if pgp_disabled is 0 and // pgp_keyid is NULL, actually. } #endif } // settings_pgp_getdisabled(jid) // Return TRUE if PGP encryption should be disabled for jid. guint settings_pgp_getdisabled(const char *bjid) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (pgpdata) return pgpdata->pgp_disabled; else return FALSE; // Default: not disabled #else return TRUE; // No PGP support, let's say it's disabled. #endif } // settings_pgp_setforce(jid, value) // Force (or not) PGP encryption for jid. // When value is TRUE, PGP support will be assumed for the remote client. void settings_pgp_setforce(const char *bjid, guint value) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (!pgpdata) { // If value is 0, we do not need to create a structure (that's // the default value). if (value) { pgpdata = g_new0(T_pgpopt, 1); pgpdata->pgp_force = value; g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata); } } else { pgpdata->pgp_force = value; } if (value && pgpdata && !pgpdata->pgp_keyid) scr_LogPrint(LPRINT_NORMAL, "Warning: the Key Id is not set!"); #endif } // settings_pgp_getforce(jid) // Return TRUE if PGP enforcement is set for jid. guint settings_pgp_getforce(const char *bjid) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (pgpdata) return pgpdata->pgp_force; else return FALSE; // Default #else return FALSE; // No PGP support #endif } // settings_pgp_setkeyid(jid, keyid) // Set the PGP KeyId for user jid. // Use keyid = NULL to erase the previous KeyId. void settings_pgp_setkeyid(const char *bjid, const char *keyid) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (!pgpdata) { // If keyid is NULL, we do not need to create a structure (that's // the default value). if (keyid) { pgpdata = g_new0(T_pgpopt, 1); pgpdata->pgp_keyid = g_strdup(keyid); g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata); } } else { g_free(pgpdata->pgp_keyid); if (keyid) pgpdata->pgp_keyid = g_strdup(keyid); else pgpdata->pgp_keyid = NULL; // We could remove the key/value if pgp_disabled is 0 and // pgp_keyid is NULL, actually. } #endif } // settings_pgp_getkeyid(jid) // Get the PGP KeyId for user jid. const char *settings_pgp_getkeyid(const char *bjid) { #ifdef HAVE_GPGME T_pgpopt *pgpdata; pgpdata = g_hash_table_lookup(pgpopt, bjid); if (pgpdata) return pgpdata->pgp_keyid; #endif return NULL; } /* otr settings */ #ifdef HAVE_LIBOTR static void remove_default_policies(char *k, char *policy, void *defaultp) { if (*(enum otr_policy *)policy == *(enum otr_policy *)defaultp) { g_free((enum otr_policy *) policy); g_hash_table_remove(otrpolicy, k); } } #endif void settings_otr_setpolicy(const char *bjid, guint value) { #ifdef HAVE_LIBOTR enum otr_policy *otrdata; if (!bjid) { default_policy = value; /* refresh hash */ settings_foreach(SETTINGS_TYPE_OTR, &remove_default_policies, &value); return; } otrdata = g_hash_table_lookup(otrpolicy, bjid); if (value == default_policy) { if (otrdata) { g_free(otrdata); g_hash_table_remove(otrpolicy, bjid); } } else if (otrdata) { *otrdata = value; } else { otrdata = g_new(enum otr_policy, 1); *otrdata = value; g_hash_table_insert(otrpolicy, g_strdup(bjid), otrdata); } #endif } guint settings_otr_getpolicy(const char *bjid) { #ifdef HAVE_LIBOTR enum otr_policy *otrdata; if (!bjid) return default_policy; otrdata = g_hash_table_lookup(otrpolicy, bjid); if (otrdata) return *otrdata; else return default_policy; #else return 0; #endif } guint get_max_history_blocks(void) { int max_num_of_blocks = settings_opt_get_int("max_history_blocks"); if (max_num_of_blocks < 0) max_num_of_blocks = 0; else if (max_num_of_blocks == 1) max_num_of_blocks = 2; return (guint)max_num_of_blocks; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/settings.h000066400000000000000000000042631216603513500166000ustar00rootroot00000000000000#ifndef __MCABBER_SETTINGS_H__ #define __MCABBER_SETTINGS_H__ 1 #include #include #include #include #ifndef isblank # define isblank(c) ((c) == 0x20 || (c) == 0x09) #endif #define SETTINGS_TYPE_OPTION 1 #define SETTINGS_TYPE_ALIAS 2 #define SETTINGS_TYPE_BINDING 3 #ifdef HAVE_LIBOTR #define SETTINGS_TYPE_OTR 4 #endif #define COMMAND_CHAR '/' #define COMMAND_CHARSTR "/" #define settings_opt_get(k) settings_get(SETTINGS_TYPE_OPTION, k) #define settings_opt_get_int(k) settings_get_int(SETTINGS_TYPE_OPTION, k) #define mkcmdstr(cmd) COMMAND_CHARSTR cmd typedef gchar *(*settings_guard_t)(const gchar *key, const gchar *new_value); void settings_init(void); int cfg_read_file(char *filename, guint mainfile); guint parse_assigment(gchar *assignment, gchar **pkey, gchar **pval); gboolean settings_set_guard(const gchar *key, settings_guard_t guard); void settings_del_guard(const gchar *key); void settings_opt_set_raw(const gchar *key, const gchar *value); void settings_set(guint type, const gchar *key, const gchar *value); void settings_del(guint type, const gchar *key); const gchar *settings_get(guint type, const gchar *key); int settings_get_int(guint type, const gchar *key); const gchar *settings_get_status_msg(enum imstatus status); void settings_foreach(guint type, void (*pfunc)(char *k, char *v, void *param), void *param); void settings_pgp_setdisabled(const char *bjid, guint value); guint settings_pgp_getdisabled(const char *bjid); void settings_pgp_setforce(const char *bjid, guint value); guint settings_pgp_getforce(const char *bjid); void settings_pgp_setkeyid(const char *bjid, const char *keyid); const char *settings_pgp_getkeyid(const char *bjid); #ifdef HAVE_LIBOTR guint settings_otr_getpolicy(const char *bjid); void settings_otr_setpolicy(const char *bjid, guint value); #endif guint get_max_history_blocks(void); char *default_muc_nickname(const char *roomid); const gchar *isbound(int key); #endif /* __MCABBER_SETTINGS_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/utf8.c000066400000000000000000000041541216603513500156200ustar00rootroot00000000000000/* * utf8.c -- UTF-8 routines * * Copyright (C) 2006 Reimar Döffinger * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include "utf8.h" char *prev_char(char *str, const char *limit) { if (str <= limit) return str; str--; if (utf8_mode) while ((str > limit) && ((*str & 0xc0) == 0x80)) str--; return str; } char *next_char(char *str) { if (!*str) return str; str++; if (utf8_mode) while ((*str & 0xc0) == 0x80) str++; return str; } unsigned get_char(const char *str) { unsigned char *strp = (unsigned char *)str; unsigned c = *strp++; unsigned mask = 0x80; int len = -1; if (!utf8_mode) return c; while (c & mask) { mask >>= 1; len++; } if (len <= 0 || len > 4) goto no_utf8; c &= mask - 1; while ((*strp & 0xc0) == 0x80) { if (len-- <= 0) goto no_utf8; c = (c << 6) | (*strp++ & 0x3f); } if (len) goto no_utf8; return c; no_utf8: return *str; } char *put_char(char *str, unsigned c) { int mask = 0xffffffc0; int i = 4; char code[5]; if (!utf8_mode || c < 128) { *str++ = c; return str; } while (c & mask) { code[i--] = 0x80 | (c & 0x3f); c >>= 6; mask >>= 1; if (i < 0) { *str++ = '?'; return str; } } code[i] = (mask << 1) | c; for (; i < 5; i++) *str++ = code[i]; return str; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/utf8.h000066400000000000000000000023131216603513500156200ustar00rootroot00000000000000#ifndef __MCABBER_UTF8_H__ #define __MCABBER_UTF8_H__ 1 #include #if defined HAVE_UNICODE && defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H # define UNICODE #endif #ifdef HAVE_WCHAR_H # include # define get_char_width(c) (utf8_mode ? wcwidth(get_char(c)) : 1) #else # define wcwidth(c) 1 # define get_char_width(c) 1 #endif #ifdef HAVE_WCTYPE_H # include /* The following bit is a hack for Solaris 8&9 systems that don't have * iswblank(). * For now i made sure it comes after wctype.h so it doesn't create * problems (wctype.h has calls to iswblank() before wctype() is declared). * (Sebastian Kayser) */ # ifndef HAVE_ISWBLANK # define iswblank(wc) iswctype(wc, wctype("blank")) # endif #else # define iswblank(c) (c == ' ') # define iswalnum(c) isalnum(c) # define iswprint(c) isprint(c) # define towupper(c) toupper(c) # define towlower(c) tolower(c) # define iswalpha(c) isalpha(c) #endif extern int utf8_mode; char *prev_char(char *str, const char *limit); char *next_char(char *str); unsigned get_char(const char *str); char *put_char(char *str, unsigned c); #endif /* __MCABBER_UTF8_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/utils.c000066400000000000000000000535161216603513500161000ustar00rootroot00000000000000/* * utils.c -- Various utility functions * * Copyright (C) 2005-2010 Mikael Berthe * Some of the ut_* functions are derived from Cabber debug/log code. * from_iso8601() comes from the Pidgin (libpurple) project. * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include #include #include #ifdef HAVE_LIBIDN #include #include static char idnprep[1024]; #endif #include #include /* For Cygwin (thanks go to Yitzchak Scott-Thoennes) */ #ifdef __CYGWIN__ # define timezonevar extern long timezone; #endif #include #include #include #include #include #include "utils.h" #include "logprint.h" #include "settings.h" #include "main.h" static int DebugEnabled; static char *FName; // jidtodisp(jid) // Strips the resource part from the jid // The caller should g_free the result after use. char *jidtodisp(const char *fjid) { char *ptr; char *alias; if (!fjid) { scr_LogPrint(LPRINT_LOGNORM, "** jidtodisp: NULL JID, " "this is probably a bug, please report!"); return NULL; } alias = g_strdup(fjid); if ((ptr = strchr(alias, JID_RESOURCE_SEPARATOR)) != NULL) { *ptr = 0; } return alias; } char *jid_get_username(const char *fjid) { char *ptr; char *username; username = g_strdup(fjid); if ((ptr = strchr(username, JID_DOMAIN_SEPARATOR)) != NULL) { *ptr = 0; } return username; } char *compose_jid(const char *username, const char *servername, const char *resource) { char *fjid; if (!strchr(username, JID_DOMAIN_SEPARATOR)) { fjid = g_strdup_printf("%s%c%s%c%s", username, JID_DOMAIN_SEPARATOR, servername, JID_RESOURCE_SEPARATOR, resource); } else { fjid = g_strdup_printf("%s%c%s", username, JID_RESOURCE_SEPARATOR, resource); } return fjid; } gboolean jid_equal(const char *jid1, const char *jid2) { char *a,*b; int ret; if (!jid1 && !jid2) return TRUE; if (!jid1 || !jid2) return FALSE; a = jidtodisp(jid1); b = jidtodisp(jid2); ret = strcasecmp(a, b); g_free(a); g_free(b); return (ret == 0) ? TRUE : FALSE; } // expand_filename(filename) // Expand "~/" with the $HOME env. variable in a file name. // The caller must free the string after use. char *expand_filename(const char *fname) { if (!fname) return NULL; if (!strncmp(fname, "~/", 2)) { char *homedir = getenv("HOME"); if (homedir) return g_strdup_printf("%s%s", homedir, fname+1); } return g_strdup(fname); } void fingerprint_to_hex(const unsigned char *fpr, char hex[49]) { int i; char *p; for (p = hex, i = 0; i < 15; i++, p+=3) g_sprintf(p, "%02X:", fpr[i]); g_sprintf(p, "%02X", fpr[i]); hex[48] = '\0'; } gboolean hex_to_fingerprint(const char *hex, char fpr[16]) { int i; char *p; if (strlen(hex) != 47) return FALSE; for (i = 0, p = (char*)hex; *p && *(p+1); i++, p += 3) fpr[i] = (char) g_ascii_strtoull (p, NULL, 16); return TRUE; } static gboolean tracelog_create(void) { FILE *fp; struct stat buf; int err; char *v; fp = fopen(FName, "a"); if (!fp) { scr_LogPrint(LPRINT_NORMAL, "ERROR: Cannot open tracelog file: %s!", strerror(errno)); return FALSE; } err = fstat(fileno(fp), &buf); if (err || buf.st_uid != geteuid()) { fclose(fp); if (err) scr_LogPrint(LPRINT_NORMAL, "ERROR: cannot stat the tracelog file: %s!", strerror(errno)); else scr_LogPrint(LPRINT_NORMAL, "ERROR: tracelog file does not belong to you!"); return FALSE; } fchmod(fileno(fp), S_IRUSR|S_IWUSR); v = mcabber_version(); fprintf(fp, "New trace log started. MCabber version %s\n" "----------------------\n", v); g_free(v); fclose(fp); return TRUE; } static gchar *tracelog_level_guard(const gchar *key, const gchar *new_value) { int new_level = 0; if (new_value) new_level = atoi(new_value); if (DebugEnabled < 1 && new_level > 0 && FName && !tracelog_create()) DebugEnabled = 0; else DebugEnabled = new_level; return g_strdup(new_value); } static gchar *tracelog_file_guard(const gchar *key, const gchar *new_value) { gchar *new_fname = NULL; if (new_value) new_fname = expand_filename(new_value); if (g_strcmp0(FName, new_fname)) { g_free(FName); FName = new_fname; if (DebugEnabled > 0 && !tracelog_create()) { g_free(FName); FName = NULL; } } else g_free(new_fname); return g_strdup(new_value); } // ut_init_debug() // Installs otpion guards before initial config file parsing. void ut_init_debug(void) { DebugEnabled = 0; FName = NULL; settings_set_guard("tracelog_level", tracelog_level_guard); settings_set_guard("tracelog_file", tracelog_file_guard); } void ut_write_log(unsigned int flag, const char *data) { if (!DebugEnabled || !FName) return; if (((DebugEnabled >= 2) && (flag & (LPRINT_LOG|LPRINT_DEBUG))) || ((DebugEnabled == 1) && (flag & LPRINT_LOG))) { FILE *fp = fopen(FName, "a+"); if (!fp) { scr_LogPrint(LPRINT_NORMAL, "ERROR: Cannot open tracelog file: %s.", strerror(errno)); return; } if (fputs(data, fp) == EOF) scr_LogPrint(LPRINT_NORMAL, "ERROR: Cannot write to tracelog file."); fclose(fp); } } // checkset_perm(name, setmode) // Check the permissions of the "name" file/dir // If setmode is true, correct the permissions if they are wrong // Return values: -1 == bad file/dir, 0 == success, 1 == cannot correct int checkset_perm(const char *name, unsigned int setmode) { int fd; struct stat buf; #ifdef __CYGWIN__ // Permission checking isn't efficient on Cygwin return 0; #endif fd = stat(name, &buf); if (fd == -1) return -1; if (buf.st_uid != geteuid()) { scr_LogPrint(LPRINT_LOGNORM, "Wrong file owner [%s]", name); return 1; } if (buf.st_mode & (S_IRGRP | S_IWGRP | S_IXGRP) || buf.st_mode & (S_IROTH | S_IWOTH | S_IXOTH)) { if (setmode) { mode_t newmode = 0; scr_LogPrint(LPRINT_LOGNORM, "Bad permissions [%s]", name); if (S_ISDIR(buf.st_mode)) newmode |= S_IXUSR; newmode |= S_IRUSR | S_IWUSR; if (chmod(name, newmode)) { scr_LogPrint(LPRINT_LOGNORM, "WARNING: Failed to correct permissions!"); return 1; } scr_LogPrint(LPRINT_LOGNORM, "Permissions have been corrected"); } else { scr_LogPrint(LPRINT_LOGNORM, "WARNING: Bad permissions [%s]", name); return 1; } } return 0; } const char *ut_get_tmpdir(void) { static const char *tmpdir; const char *tmpvars[] = { "MCABBERTMPDIR", "TMP", "TMPDIR", "TEMP" }; unsigned int i; if (tmpdir) return tmpdir; for (i = 0; i < (sizeof(tmpvars) / sizeof(const char *)); i++) { tmpdir = getenv(tmpvars[i]); if (tmpdir && tmpdir[0] && tmpdir[0] == '/' && tmpdir[1]) { // Looks ok. return tmpdir; } } // Default temporary directory tmpdir = "/tmp"; return tmpdir; } // to_iso8601(dststr, timestamp) // Convert timestamp to iso8601 format, and store it in dststr. // NOTE: dststr should be at last 19 chars long. // Return should be 0 int to_iso8601(char *dststr, time_t timestamp) { struct tm *tm_time; int ret; tm_time = gmtime(×tamp); ret = snprintf(dststr, 19, "%.4d%02d%02dT%02d:%02d:%02dZ", (int)(1900+tm_time->tm_year), tm_time->tm_mon+1, tm_time->tm_mday, tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); return ((ret == -1) ? -1 : 0); } // from_iso8601(timestamp, utc) // This function came from the Pidgin project, gaim_str_to_time(). // (Actually date may not be pure iso-8601) // Thanks, guys! // ** Modified by somian 10 Apr 2006 with advice from ysth. time_t from_iso8601(const char *timestamp, int utc) { struct tm t; time_t retval = 0; char buf[32]; char *c; int tzoff = 0; int hms_succ = 0; int tmpyear; time(&retval); localtime_r(&retval, &t); /* Reset time to midnight (00:00:00) */ t.tm_hour = t.tm_min = t.tm_sec = 0; snprintf(buf, sizeof(buf), "%s", timestamp); c = buf; /* 4 digit year */ if (!sscanf(c, "%04d", &tmpyear)) return 0; t.tm_year = tmpyear; c+=4; if (*c == '-') c++; t.tm_year -= 1900; /* 2 digit month */ if (!sscanf(c, "%02d", &t.tm_mon)) return 0; c+=2; if (*c == '-') c++; t.tm_mon -= 1; /* 2 digit day */ if (!sscanf(c, "%02d", &t.tm_mday)) return 0; c+=2; if (*c == 'T' || *c == '.') { /* we have more than a date, keep going */ c++; /* skip the "T" */ /* 2 digit hour */ if (sscanf(c, "%02d:%02d:%02d", &t.tm_hour, &t.tm_min, &t.tm_sec) == 3) { hms_succ = 1; c += 8; } else if (sscanf(c, "%02d%02d%02d", &t.tm_hour, &t.tm_min, &t.tm_sec) == 3) { hms_succ = 1; c += 6; } if (hms_succ) { int tzhrs, tzmins; if (*c == '.') /* dealing with precision we don't care about */ c += 4; if ((*c == '+' || *c == '-') && sscanf(c+1, "%02d:%02d", &tzhrs, &tzmins)) { tzoff = tzhrs*60*60 + tzmins*60; if (*c == '+') tzoff *= -1; } if (tzoff || utc) { #ifdef HAVE_TM_GMTOFF tzoff += t.tm_gmtoff; #else # ifdef HAVE_TIMEZONE tzset(); /* making sure */ tzoff -= timezone; # endif #endif } } } t.tm_isdst = -1; retval = mktime(&t); retval += tzoff; return retval; } /** * Derived from libjabber/jid.c, because the libjabber version is not * really convenient for our usage. * * Check if the full JID is valid * Return 0 if it is valid, non zero otherwise */ int check_jid_syntax(const char *fjid) { const char *str; const char *domain, *resource; int domlen; #ifdef HAVE_LIBIDN char *idnpp; int r; #endif if (!fjid) return 1; domain = strchr(fjid, JID_DOMAIN_SEPARATOR); /* the username is optional */ if (!domain) { domain = fjid; } else { /* node identifiers may not be longer than 1023 bytes */ if ((domain == fjid) || (domain-fjid > 1023)) return 1; domain++; #ifdef HAVE_LIBIDN idnpp = idnprep; str = fjid; while (*str != JID_DOMAIN_SEPARATOR) *idnpp++ = *str++; *idnpp = 0; r = stringprep(idnprep, 1023, 0, stringprep_xmpp_nodeprep); if (r != STRINGPREP_OK || !idnprep[0]) return 1; /* the username looks okay */ #else /* check for low and invalid ascii characters in the username */ for (str = fjid; *str != JID_DOMAIN_SEPARATOR; str++) { if (*str <= ' ' || *str == ':' || *str == JID_DOMAIN_SEPARATOR || *str == '<' || *str == '>' || *str == '\'' || *str == '"' || *str == '&') { return 1; } } /* the username is okay as far as we can tell without LIBIDN */ #endif } resource = strchr(domain, JID_RESOURCE_SEPARATOR); /* the resource is optional */ if (resource) { domlen = resource - domain; resource++; /* resources may not be longer than 1023 bytes */ if ((*resource == '\0') || strlen(resource) > 1023) return 1; #ifdef HAVE_LIBIDN strncpy(idnprep, resource, sizeof(idnprep)); r = stringprep(idnprep, 1023, 0, stringprep_xmpp_resourceprep); if (r != STRINGPREP_OK || !idnprep[0]) return 1; #endif } else { domlen = strlen(domain); } /* there must be a domain identifier */ if (domlen == 0) return 1; /* and it must not be longer than 1023 bytes */ if (domlen > 1023) return 1; /* /.+/ is not a valid domain name pattern */ for (str = domain; *str && *str != JID_RESOURCE_SEPARATOR; str++) if (*str != '.') break; if (!*str || *str == JID_RESOURCE_SEPARATOR) return 1; /* domain contains only dots */ #ifdef HAVE_LIBIDN idnpp = idnprep; str = domain; while (*str != '\0' && *str != JID_RESOURCE_SEPARATOR) *idnpp++ = *str++; *idnpp = 0; r = stringprep_nameprep(idnprep, 1023); if (r != STRINGPREP_OK || !idnprep[0]) return 1; if (idna_to_ascii_8z(idnprep, &idnpp, IDNA_USE_STD3_ASCII_RULES) != IDNA_SUCCESS) return 1; else free(idnpp); #else /* make sure the hostname is valid characters */ for (str = domain; *str != '\0' && *str != JID_RESOURCE_SEPARATOR; str++) { if (!(isalnum(*str) || *str == '.' || *str == '-' || *str == '_')) return 1; } #endif /* it's okay as far as we can tell */ return 0; } inline void mc_strtolower(char *str) { if (!str) return; for ( ; *str; str++) *str = tolower(*str); } // strip_arg_special_chars(string) // Remove quotes and backslashes before an escaped quote // Only quotes need a backslash // Ex.: ["a b"] -> [a b]; [a\"b] -> [a"b] void strip_arg_special_chars(char *s) { int instring = FALSE; int escape = FALSE; char *p; if (!s) return; for (p = s; *p; p++) { if (*p == '"') { if (!escape) { instring = !instring; strcpy(p, p+1); p--; } else escape = FALSE; } else if (*p == '\\') { if (!escape) { strcpy(p, p+1); p--; } escape = !escape; } else escape = FALSE; } } // split_arg(arg, n, preservelast) // Split the string arg into a maximum of n pieces, taking care of // double quotes. // Return a null-terminated array of strings. This array should be freed // by the caller after use, for example with free_arg_lst(). // If dontstriplast is true, the Nth argument isn't stripped (i.e. no // processing of quote chars) char **split_arg(const char *arg, unsigned int n, int dontstriplast) { char **arglst; const char *p, *start, *end; unsigned int i = 0; int instring = FALSE; int escape = FALSE; arglst = g_new0(char*, n+1); if (!arg || !n) return arglst; // Skip leading space for (start = arg; *start && *start == ' '; start++) ; // End of string pointer for (end = start; *end; end++) ; // Skip trailing space while (end > start+1 && *(end-1) == ' ') end--; for (p = start; p < end; p++) { if (*p == '"' && !escape) instring = !instring; if (*p == '\\' && !escape) escape = TRUE; else if (escape) escape = FALSE; if (*p == ' ' && !instring && i+1 < n) { // end of parameter *(arglst+i) = g_strndup(start, p-start); strip_arg_special_chars(*(arglst+i)); for (start = p+1; *start && *start == ' '; start++) ; p = start-1; i++; } } if (start < end) { *(arglst+i) = g_strndup(start, end-start); if (!dontstriplast || i+1 < n) strip_arg_special_chars(*(arglst+i)); } return arglst; } // free_arg_lst(arglst) // Free an array allocated by split_arg() void free_arg_lst(char **arglst) { char **arg_elt; for (arg_elt = arglst; *arg_elt; arg_elt++) g_free(*arg_elt); g_free(arglst); } // replace_nl_with_dots(bufstr) // Replace '\n' with "(...)" (or with a NUL if the string is too short) void replace_nl_with_dots(char *bufstr) { char *p = strchr(bufstr, '\n'); if (p) { if (strlen(p) >= 5) strcpy(p, "(...)"); else *p = 0; } } // ut_expand_tabs(text) // Expand tabs and filter out some bad chars in string text. // If there is no tab and no bad chars in the string, a pointer to text // is returned (be careful _not_ to free the pointer in this case). // If there are some tabs or bad chars, a new string with expanded chars // and no bad chars is returned; this is up to the caller to free this // string after use. char *ut_expand_tabs(const char *text) { char *xtext, *linestart; char *p, *q; guint n = 0, bc = 0; if (!text) return NULL; xtext = (char*)text; for (p=xtext; *p; p++) if (*p == '\t') n++; else if (*p == '\x0d') bc++; // XXX Are there other special chars we should filter out? if (!n && !bc) return (char*)text; xtext = g_new(char, strlen(text) + 1 + 8*n); p = (char*)text; q = linestart = xtext; do { if (*p == '\t') { do { *q++ = ' '; } while ((q-linestart)%8); } else if (*p != '\x0d') { *q++ = *p; if (*p =='\n') linestart = q; } } while (*p++); return xtext; } // ut_unescape_tabs_cr(text) // Expand CR or TAB character sequences (\n, \t) in string text. // If there is no CR/TAB in text, then the original pointer is returned // (be careful _not_ to free the pointer in this case). // If there are some unescaped sequences, a new string with those chars // replaced with real newline/tab characters is allocated; in this case // this is up to the caller to free this string after use. char *ut_unescape_tabs_cr(const char *text) { char *xtext, *linestart; char *p, *q; if (!text) return NULL; p = g_strstr_len(text, -1, "\\n"); if (!p) { p = g_strstr_len(text, -1, "\\t"); if (!p) return (char*)text; } xtext = g_new(char, strlen(text) + 1); p = (char*)text; q = linestart = xtext; do { if (*p == '\\') { if (*(p+1) == '\\' && (*(p+2) == 'n' || *(p+2) == 't')) { // This is an escaped CR sequence *q++ = '\\'; *q++ = 'n'; p += 2; continue; } if (*(p+1) == 'n' || *(p+1) == 't') { // This is a CR sequence p++; *q++ = (*p == 'n' ? '\n' : '\t'); continue; } } *q++ = *p; } while (*p++); return xtext; } /* Cygwin's newlib does not have strcasestr() */ /* The author of the code before the endif is * Jeffrey Stedfast * and this code is reusable in compliance with the GPL v2. -- somian */ #if !defined(HAVE_STRCASESTR) # define lowercase(c) (isupper ((int) (c)) ? tolower ((int) (c)) : (int) (c)) # define bm_index(c, icase) ((icase) ? lowercase (c) : (int) (c)) # define bm_equal(c1, c2, icase) ((icase) ? lowercase (c1) == lowercase (c2) : (c1) == (c2)) /* FIXME: this is just a guess... should really do some performace tests to get an accurate measure */ # define bm_optimal(hlen, nlen) (((hlen) ? (hlen) > 20 : 1) && (nlen) > 10 ? 1 : 0) static unsigned char * __boyer_moore (const unsigned char *haystack, size_t haystacklen, const unsigned char *needle, size_t needlelen, int icase) { register unsigned char *hc_ptr, *nc_ptr; unsigned char *he_ptr, *ne_ptr, *h_ptr; size_t skiptable[256], n; register int i; #ifdef BOYER_MOORE_CHECKS /* we don't need to do these checks since memmem/strstr/etc do it already */ /* if the haystack is shorter than the needle then we can't possibly match */ if (haystacklen < needlelen) return NULL; /* instant match if the pattern buffer is 0-length */ if (needlelen == 0) return (unsigned char *) haystack; #endif /* BOYER_MOORE_CHECKS */ /* set a pointer at the end of each string */ ne_ptr = (unsigned char *) needle + needlelen - 1; he_ptr = (unsigned char *) haystack + haystacklen - 1; /* create our skip table */ for (i = 0; i < 256; i++) skiptable[i] = needlelen; for (nc_ptr = (unsigned char *) needle; nc_ptr < ne_ptr; nc_ptr++) skiptable[bm_index (*nc_ptr, icase)] = (size_t) (ne_ptr - nc_ptr); h_ptr = (unsigned char *) haystack; while (haystacklen >= needlelen) { hc_ptr = h_ptr + needlelen - 1; /* set the haystack compare pointer */ nc_ptr = ne_ptr; /* set the needle compare pointer */ /* work our way backwards till they don't match */ for (i = 0; nc_ptr > (unsigned char *) needle; nc_ptr--, hc_ptr--, i++) if (!bm_equal (*nc_ptr, *hc_ptr, icase)) break; if (!bm_equal (*nc_ptr, *hc_ptr, icase)) { n = skiptable[bm_index (*hc_ptr, icase)]; if (n == needlelen && i) if (bm_equal (*ne_ptr, ((unsigned char *) needle)[0], icase)) n--; h_ptr += n; haystacklen -= n; } else return (unsigned char *) h_ptr; } return NULL; } /* * strcasestr: * @haystack: string to search * @needle: substring to search for * * Finds the first occurence of the substring @needle within the * string @haystack ignoring case. * * Returns a pointer to the beginning of the substring match within * @haystack, or NULL if the substring is not found. **/ char * strcasestr (const char *haystack, const char *needle) { register unsigned char *h, *n, *hc, *nc; size_t needlelen; needlelen = strlen (needle); if (needlelen == 0) { return (char *) haystack; } else if (bm_optimal (0, needlelen)) { return (char *) __boyer_moore ((const unsigned char *) haystack, strlen (haystack), (const unsigned char *) needle, needlelen, 1); } h = (unsigned char *) haystack; n = (unsigned char *) needle; while (*(h + needlelen - 1)) { if (lowercase (*h) == lowercase (*n)) { for (hc = h + 1, nc = n + 1; *hc && *nc; hc++, nc++) if (lowercase (*hc) != lowercase (*nc)) break; if (!*nc) return (char *) h; } h++; } return NULL; } #endif /* !HAVE_STRCASESTR */ // startswith(str, word, ignore_case) // Returns TRUE if string str starts with word. int startswith(const char *str, const char *word, guint ignore_case) { if (ignore_case && !strncasecmp(str, word, strlen(word))) return TRUE; else if (!ignore_case && !strncmp(str, word, strlen(word))) return TRUE; return FALSE; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/utils.h000066400000000000000000000034471216603513500161030ustar00rootroot00000000000000#ifndef __MCABBER_UTILS_H__ #define __MCABBER_UTILS_H__ 1 #include extern const char *LocaleCharSet; #define to_utf8(s) ((s) ? g_locale_to_utf8((s), -1, NULL,NULL,NULL) : NULL) #define from_utf8(s) ((s) ? g_convert_with_fallback((s), -1, LocaleCharSet, \ "UTF-8", NULL,NULL,NULL,NULL) : NULL) #define JID_RESOURCE_SEPARATOR '/' #define JID_RESOURCE_SEPARATORSTR "/" #define JID_DOMAIN_SEPARATOR '@' #define JID_DOMAIN_SEPARATORSTR "@" char *jidtodisp(const char *fjid); char *jid_get_username(const char *fjid); char *compose_jid(const char *username, const char *servername, const char *resource); gboolean jid_equal(const char *jid1, const char *jid2); void fingerprint_to_hex(const unsigned char *fpr, char hex[49]); gboolean hex_to_fingerprint(const char * hex, char fpr[16]); void ut_init_debug(void); void ut_write_log(unsigned int flag, const char *data); char *expand_filename(const char *fname); int checkset_perm(const char *name, unsigned int setmode); const char *ut_get_tmpdir(void); int to_iso8601(char *dststr, time_t timestamp); time_t from_iso8601(const char *timestamp, int utc); int check_jid_syntax(const char *fjid); void mc_strtolower(char *str); void strip_arg_special_chars(char *s); char **split_arg(const char *arg, unsigned int n, int dontstriplast); void free_arg_lst(char **arglst); void replace_nl_with_dots(char *bufstr); char *ut_expand_tabs(const char *text); char *ut_unescape_tabs_cr(const char *text); #if !defined (HAVE_STRCASESTR) char *strcasestr(const char *haystack, const char *needle); #endif int startswith(const char *str, const char *word, guint ignore_case); #endif // __MCABBER_UTILS_H__ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp.c000066400000000000000000002273651216603513500157310ustar00rootroot00000000000000/* * xmpp.c -- Jabber protocol handling * * Copyright (C) 2008-2010 Frank Zschockelt * Copyright (C) 2005-2010 Mikael Berthe * Parts come from the centericq project: * Copyright (C) 2002-2005 by Konstantin Klyagin * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include "xmpp.h" #include "xmpp_helper.h" #include "xmpp_iq.h" #include "xmpp_iqrequest.h" #include "xmpp_muc.h" #include "xmpp_s10n.h" #include "caps.h" #include "events.h" #include "histolog.h" #include "hooks.h" #include "otr.h" #include "roster.h" #include "screen.h" #include "settings.h" #include "utils.h" #include "main.h" #define RECONNECTION_TIMEOUT 60L LmConnection* lconnection = NULL; static guint AutoConnection; inline void update_last_use(void); inline gboolean xmpp_reconnect(); enum imstatus mystatus = offline; static enum imstatus mywantedstatus = available; gchar *mystatusmsg; char imstatus2char[imstatus_size+1] = { '_', 'o', 'f', 'd', 'n', 'a', 'i', '\0' }; char *imstatus_showmap[] = { "", "", "chat", "dnd", "xa", "away", "" }; LmMessageNode *bookmarks = NULL; LmMessageNode *rosternotes = NULL; static struct IqHandlers { const gchar *xmlns; LmHandleMessageFunction handler; } iq_handlers[] = { {NS_PING, &handle_iq_ping}, {NS_VERSION, &handle_iq_version}, {NS_TIME, &handle_iq_time}, {NS_ROSTER, &handle_iq_roster}, {NS_XMPP_TIME, &handle_iq_time202}, {NS_LAST, &handle_iq_last}, {NS_DISCO_INFO, &handle_iq_disco_info}, {NS_DISCO_ITEMS,&handle_iq_disco_items}, {NS_COMMANDS, &handle_iq_commands}, {NS_VCARD, &handle_iq_vcard}, {NULL, NULL} }; void update_last_use(void) { iqlast = time(NULL); } gboolean xmpp_is_online(void) { if (lconnection && lm_connection_is_authenticated(lconnection)) return TRUE; else return FALSE; } // Note: the caller should check the jid is correct void xmpp_addbuddy(const char *bjid, const char *name, const char *group) { LmMessageNode *query, *y; LmMessage *iq; LmMessageHandler *handler; char *cleanjid; if (!xmpp_is_online()) return; cleanjid = jidtodisp(bjid); // Stripping resource, just in case... // We don't check if the jabber user already exists in the roster, // because it allows to re-ask for notification. iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_ROSTER); y = lm_message_node_add_child(query, "item", NULL); lm_message_node_set_attribute(y, "jid", cleanjid); if (name) lm_message_node_set_attribute(y, "name", name); if (group) lm_message_node_add_child(y, "group", group); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_SUBSCRIBE); roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending, -1); g_free(cleanjid); buddylist_build(); update_roster = TRUE; } void xmpp_updatebuddy(const char *bjid, const char *name, const char *group) { LmMessage *iq; LmMessageHandler *handler; LmMessageNode *x; char *cleanjid; if (!xmpp_is_online()) return; // XXX We should check name's and group's correctness cleanjid = jidtodisp(bjid); // Stripping resource, just in case... iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); x = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(x, "xmlns", NS_ROSTER); x = lm_message_node_add_child(x, "item", NULL); lm_message_node_set_attribute(x, "jid", cleanjid); if (name) lm_message_node_set_attribute(x, "name", name); if (group) lm_message_node_add_child(x, "group", group); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); g_free(cleanjid); } void xmpp_delbuddy(const char *bjid) { LmMessageNode *y, *z; LmMessage *iq; LmMessageHandler *handler; char *cleanjid; if (!xmpp_is_online()) return; cleanjid = jidtodisp(bjid); // Stripping resource, just in case... // If the current buddy is an agent, unsubscribe from it if (roster_gettype(cleanjid) == ROSTER_TYPE_AGENT) { scr_LogPrint(LPRINT_LOGNORM, "Unregistering from the %s agent", cleanjid); iq = lm_message_new_with_sub_type(cleanjid, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); y = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(y, "xmlns", NS_REGISTER); lm_message_node_add_child(y, "remove", NULL); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); } // Cancel the subscriptions xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); // cancel "from" xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE); // cancel "to" // Ask for removal from roster iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); y = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(y, "xmlns", NS_ROSTER); z = lm_message_node_add_child(y, "item", NULL); lm_message_node_set_attributes(z, "jid", cleanjid, "subscription", "remove", NULL); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); roster_del_user(cleanjid); g_free(cleanjid); buddylist_build(); update_roster = TRUE; } void xmpp_request(const char *fjid, enum iqreq_type reqtype) { GSList *resources, *p_res; GSList *roster_elt; const char *strreqtype, *xmlns; gboolean vcard2user; if (reqtype == iqreq_version) { xmlns = NS_VERSION; strreqtype = "version"; } else if (reqtype == iqreq_time) { xmlns = NS_XMPP_TIME; strreqtype = "time"; } else if (reqtype == iqreq_last) { xmlns = NS_LAST; strreqtype = "last"; } else if (reqtype == iqreq_ping) { xmlns = NS_PING; strreqtype = "ping"; } else if (reqtype == iqreq_vcard) { xmlns = NS_VCARD; strreqtype = "vCard"; } else return; // Is it a vCard request to a regular user? // (vCard requests are sent to bare JIDs, except in MUC rooms...) vcard2user = (reqtype == iqreq_vcard && !roster_find(fjid, jidsearch, ROSTER_TYPE_ROOM)); if (strchr(fjid, JID_RESOURCE_SEPARATOR) || vcard2user) { // This is a full JID or a vCard request to a contact xmpp_iq_request(fjid, xmlns); scr_LogPrint(LPRINT_NORMAL, "Sent %s request to <%s>", strreqtype, fjid); return; } // The resource has not been specified roster_elt = roster_find(fjid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM); if (!roster_elt) { scr_LogPrint(LPRINT_NORMAL, "No known resource for <%s>...", fjid); xmpp_iq_request(fjid, xmlns); // Let's send a request anyway... scr_LogPrint(LPRINT_NORMAL, "Sent %s request to <%s>", strreqtype, fjid); return; } // Send a request to each resource resources = buddy_getresources(roster_elt->data); if (!resources) { scr_LogPrint(LPRINT_NORMAL, "No known resource for <%s>...", fjid); xmpp_iq_request(fjid, xmlns); // Let's send a request anyway... scr_LogPrint(LPRINT_NORMAL, "Sent %s request to <%s>", strreqtype, fjid); } for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) { gchar *fulljid; fulljid = g_strdup_printf("%s/%s", fjid, (char*)p_res->data); xmpp_iq_request(fulljid, xmlns); scr_LogPrint(LPRINT_NORMAL, "Sent %s request to <%s>", strreqtype, fulljid); g_free(fulljid); g_free(p_res->data); } g_slist_free(resources); } // xmpp_send_msg(jid, text, type, subject, // otrinject, *encrypted, type_overwrite) // When encrypted is not NULL, the function set *encrypted to 1 if the // message has been PGP-encrypted. If encryption enforcement is set and // encryption fails, *encrypted is set to -1. void xmpp_send_msg(const char *fjid, const char *text, int type, const char *subject, gboolean otrinject, gint *encrypted, LmMessageSubType type_overwrite, gpointer *xep184) { LmMessage *x; LmMessageSubType subtype; #ifdef HAVE_LIBOTR int otr_msg = 0; #endif char *barejid; #if defined HAVE_GPGME || defined XEP0022 || defined XEP0085 char *rname; GSList *sl_buddy; #endif #if defined XEP0022 || defined XEP0085 LmMessageNode *event; struct xep0085 *xep85 = NULL; #if defined XEP0022 guint use_xep85 = 0; #endif #endif gchar *enc = NULL; if (encrypted) *encrypted = 0; if (!xmpp_is_online()) return; if (!text && type == ROSTER_TYPE_USER) return; if (type_overwrite != LM_MESSAGE_SUB_TYPE_NOT_SET) subtype = type_overwrite; else { if (type == ROSTER_TYPE_ROOM) subtype = LM_MESSAGE_SUB_TYPE_GROUPCHAT; else subtype = LM_MESSAGE_SUB_TYPE_CHAT; } barejid = jidtodisp(fjid); #if defined HAVE_GPGME || defined HAVE_LIBOTR || \ defined XEP0022 || defined XEP0085 rname = strchr(fjid, JID_RESOURCE_SEPARATOR); sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); // If we can get a resource name, we use it. Else we use NULL, // which hopefully will give us the most likely resource. if (rname) rname++; #ifdef HAVE_LIBOTR if (otr_enabled() && !otrinject) { if (type == ROSTER_TYPE_USER) { otr_msg = otr_send((char **)&text, barejid); if (!text) { g_free(barejid); if (encrypted) *encrypted = -1; return; } } if (otr_msg && encrypted) *encrypted = ENCRYPTED_OTR; } #endif #ifdef HAVE_GPGME if (type == ROSTER_TYPE_USER && sl_buddy && gpg_enabled()) { if (!settings_pgp_getdisabled(barejid)) { // not disabled for this contact? guint force; struct pgp_data *res_pgpdata; force = settings_pgp_getforce(barejid); res_pgpdata = buddy_resource_pgp(sl_buddy->data, rname); if (force || (res_pgpdata && res_pgpdata->sign_keyid)) { /* Remote client has PGP support (we have a signature) * OR encryption is enforced (force = TRUE). * If the contact has a specific KeyId, we'll use it; * if not, we'll use the key used for the signature. * Both keys should match, in theory (cf. XEP-0027). */ const char *key; key = settings_pgp_getkeyid(barejid); if (!key && res_pgpdata) key = res_pgpdata->sign_keyid; if (key) enc = gpg_encrypt(text, key); if (!enc && force) { if (encrypted) *encrypted = -1; g_free(barejid); return; } } } } #endif // HAVE_GPGME #endif // HAVE_GPGME || defined XEP0022 || defined XEP0085 x = lm_message_new_with_sub_type(fjid, LM_MESSAGE_TYPE_MESSAGE, subtype); lm_message_node_add_child(x->node, "body", enc ? "This message is PGP-encrypted." : text); if (subject) lm_message_node_add_child(x->node, "subject", subject); if (enc) { LmMessageNode *y; y = lm_message_node_add_child(x->node, "x", enc); lm_message_node_set_attribute(y, "xmlns", NS_ENCRYPTED); if (encrypted) *encrypted = ENCRYPTED_PGP; g_free(enc); } // XEP-0184: Message Receipts if (sl_buddy && xep184 && caps_has_feature(buddy_resource_getcaps(sl_buddy->data, rname), NS_RECEIPTS, barejid)) { lm_message_node_set_attribute(lm_message_node_add_child(x->node, "request", NULL), "xmlns", NS_RECEIPTS); *xep184 = g_strdup(lm_message_get_id(x)); } g_free(barejid); #if defined XEP0022 || defined XEP0085 // If typing notifications are disabled, we can skip all this stuff... if (chatstates_disabled || type == ROSTER_TYPE_ROOM) goto xmpp_send_msg_no_chatstates; if (sl_buddy) xep85 = buddy_resource_xep85(sl_buddy->data, rname); #endif #ifdef XEP0085 /* XEP-0085 5.1 * "Until receiving a reply to the initial content message (or a standalone * notification) from the Contact, the User MUST NOT send subsequent chat * state notifications to the Contact." * In our implementation support is initially "unknown", then it's "probed" * and can become "ok". */ if (xep85 && (xep85->support == CHATSTATES_SUPPORT_OK || xep85->support == CHATSTATES_SUPPORT_UNKNOWN)) { event = lm_message_node_add_child(x->node, "active", NULL); lm_message_node_set_attribute(event, "xmlns", NS_CHATSTATES); if (xep85->support == CHATSTATES_SUPPORT_UNKNOWN) xep85->support = CHATSTATES_SUPPORT_PROBED; #ifdef XEP0022 else use_xep85 = 1; #endif xep85->last_state_sent = ROSTER_EVENT_ACTIVE; } #endif #ifdef XEP0022 /* XEP-22 * If the Contact supports XEP-0085, we do not use XEP-0022. * If not, we try to fall back to XEP-0022. */ if (!use_xep85) { struct xep0022 *xep22 = NULL; event = lm_message_node_add_child(x->node, "x", NULL); lm_message_node_set_attribute(event, "xmlns", NS_EVENT); lm_message_node_add_child(event, "composing", NULL); if (sl_buddy) xep22 = buddy_resource_xep22(sl_buddy->data, rname); if (xep22) xep22->last_state_sent = ROSTER_EVENT_ACTIVE; // An id is mandatory when using XEP-0022. if (text || subject) { const gchar *msgid = lm_message_get_id(x); // Let's update last_msgid_sent if (xep22) { g_free(xep22->last_msgid_sent); xep22->last_msgid_sent = g_strdup(msgid); } } } #endif xmpp_send_msg_no_chatstates: #ifdef WITH_DEPRECATED_STATUS_INVISIBLE if (mystatus != invisible) #endif update_last_use(); lm_connection_send(lconnection, x, NULL); lm_message_unref(x); } #ifdef XEP0085 // xmpp_send_xep85_chatstate() // Send a XEP-85 chatstate. static void xmpp_send_xep85_chatstate(const char *bjid, const char *resname, guint state) { LmMessage *m; LmMessageNode *event; GSList *sl_buddy; const char *chattag; char *rjid, *fjid = NULL; struct xep0085 *xep85 = NULL; if (!xmpp_is_online()) return; sl_buddy = roster_find(bjid, jidsearch, ROSTER_TYPE_USER); // If we have a resource name, we use it. Else we use NULL, // which hopefully will give us the most likely resource. if (sl_buddy) xep85 = buddy_resource_xep85(sl_buddy->data, resname); if (!xep85 || (xep85->support != CHATSTATES_SUPPORT_OK)) return; if (state == xep85->last_state_sent) return; if (state == ROSTER_EVENT_ACTIVE) chattag = "active"; else if (state == ROSTER_EVENT_COMPOSING) chattag = "composing"; else if (state == ROSTER_EVENT_PAUSED) chattag = "paused"; else { scr_LogPrint(LPRINT_LOGNORM, "Error: unsupported XEP-85 state (%d)", state); return; } xep85->last_state_sent = state; if (resname) fjid = g_strdup_printf("%s/%s", bjid, resname); rjid = resname ? fjid : (char*)bjid; m = lm_message_new_with_sub_type(rjid, LM_MESSAGE_TYPE_MESSAGE, LM_MESSAGE_SUB_TYPE_CHAT); event = lm_message_node_add_child(m->node, chattag, NULL); lm_message_node_set_attribute(event, "xmlns", NS_CHATSTATES); lm_connection_send(lconnection, m, NULL); lm_message_unref(m); g_free(fjid); } #endif #ifdef XEP0022 // xmpp_send_xep22_event() // Send a XEP-22 message event (delivered, composing...). static void xmpp_send_xep22_event(const char *fjid, guint type) { LmMessage *x; LmMessageNode *event; const char *msgid; char *rname, *barejid; GSList *sl_buddy; struct xep0022 *xep22 = NULL; guint xep22_state; if (!xmpp_is_online()) return; rname = strchr(fjid, JID_RESOURCE_SEPARATOR); barejid = jidtodisp(fjid); sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); g_free(barejid); // If we can get a resource name, we use it. Else we use NULL, // which hopefully will give us the most likely resource. if (rname) rname++; if (sl_buddy) xep22 = buddy_resource_xep22(sl_buddy->data, rname); if (!xep22) return; // XXX Maybe we could try harder (other resources?) msgid = xep22->last_msgid_rcvd; // For composing events (composing, active, inactive, paused...), // XEP22 only has 2 states; we'll use composing and active. if (type == ROSTER_EVENT_COMPOSING) xep22_state = ROSTER_EVENT_COMPOSING; else if (type == ROSTER_EVENT_ACTIVE || type == ROSTER_EVENT_PAUSED) xep22_state = ROSTER_EVENT_ACTIVE; else xep22_state = 0; // ROSTER_EVENT_NONE if (xep22_state) { // Do not re-send a same event if (xep22_state == xep22->last_state_sent) return; xep22->last_state_sent = xep22_state; } x = lm_message_new_with_sub_type(fjid, LM_MESSAGE_TYPE_MESSAGE, LM_MESSAGE_SUB_TYPE_CHAT); event = lm_message_node_add_child(x->node, "x", NULL); lm_message_node_set_attribute(event, "xmlns", NS_EVENT); if (type == ROSTER_EVENT_DELIVERED) lm_message_node_add_child(event, "delivered", NULL); else if (type == ROSTER_EVENT_COMPOSING) lm_message_node_add_child(event, "composing", NULL); lm_message_node_add_child(event, "id", msgid); lm_connection_send(lconnection, x, NULL); lm_message_unref(x); } #endif // xmpp_send_chatstate(buddy, state) // Send a chatstate or event (XEP-22/85) according to the buddy's capabilities. // The message is sent to one of the resources with the highest priority. #if defined XEP0022 || defined XEP0085 void xmpp_send_chatstate(gpointer buddy, guint chatstate) { const char *bjid; const char *activeres; #ifdef XEP0085 GSList *resources, *p_res, *p_next; struct xep0085 *xep85 = NULL; #endif #ifdef XEP0022 struct xep0022 *xep22; #endif bjid = buddy_getjid(buddy); if (!bjid) return; activeres = buddy_getactiveresource(buddy); #ifdef XEP0085 /* Send the chatstate to the last resource (which should have the highest priority). If chatstate is "active", send an "active" state to all resources which do not curently have this state. */ resources = buddy_getresources(buddy); for (p_res = resources ; p_res ; p_res = p_next) { p_next = g_slist_next(p_res); xep85 = buddy_resource_xep85(buddy, p_res->data); if (xep85 && xep85->support == CHATSTATES_SUPPORT_OK) { // If p_next is NULL, this is the highest (prio) resource, i.e. // the one we are probably writing to - unless there is defined an // active resource if (!g_strcmp0(p_res->data, activeres) || (!p_next && !activeres) || (xep85->last_state_sent != ROSTER_EVENT_ACTIVE && chatstate == ROSTER_EVENT_ACTIVE)) xmpp_send_xep85_chatstate(bjid, p_res->data, chatstate); } g_free(p_res->data); } g_slist_free(resources); // If the last resource had chatstates support when can return now, // we don't want to send a XEP22 event. if (xep85 && xep85->support == CHATSTATES_SUPPORT_OK) return; #endif #ifdef XEP0022 xep22 = buddy_resource_xep22(buddy, activeres); if (xep22 && xep22->support == CHATSTATES_SUPPORT_OK) { xmpp_send_xep22_event(bjid, chatstate); } #endif } #endif // chatstates_reset_probed(fulljid) // If the XEP has been probed for this contact, set it back to unknown so // that we probe it again. The parameter must be a full jid (w/ resource). #if defined XEP0022 || defined XEP0085 static void chatstates_reset_probed(const char *fulljid) { char *rname, *barejid; GSList *sl_buddy; struct xep0085 *xep85; struct xep0022 *xep22; rname = strchr(fulljid, JID_RESOURCE_SEPARATOR); if (!rname++) return; barejid = jidtodisp(fulljid); sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); g_free(barejid); if (!sl_buddy) return; xep85 = buddy_resource_xep85(sl_buddy->data, rname); xep22 = buddy_resource_xep22(sl_buddy->data, rname); if (xep85 && xep85->support == CHATSTATES_SUPPORT_PROBED) xep85->support = CHATSTATES_SUPPORT_UNKNOWN; if (xep22 && xep22->support == CHATSTATES_SUPPORT_PROBED) xep22->support = CHATSTATES_SUPPORT_UNKNOWN; } #endif #ifdef HAVE_GPGME // keys_mismatch(key, expectedkey) // Return TRUE if both keys are non-null and "expectedkey" doesn't match // the end of "key". // If one of the keys is null, return FALSE. // If expectedkey is less than 8 bytes long, return TRUE. // // Example: keys_mismatch("C9940A9BB0B92210", "B0B92210") will return FALSE. static bool keys_mismatch(const char *key, const char *expectedkey) { int lk, lek; if (!expectedkey || !key) return FALSE; lk = strlen(key); lek = strlen(expectedkey); // If the expectedkey is less than 8 bytes long, this is probably a // user mistake so we consider it's a mismatch. if (lek < 8) return TRUE; if (lek < lk) key += lk - lek; return strcasecmp(key, expectedkey); } #endif // check_signature(barejid, resourcename, xmldata, text) // Verify the signature (in xmldata) of "text" for the contact // barejid/resourcename. // xmldata is the 'jabber:x:signed' stanza. // If the key id is found, the contact's PGP data are updated. static void check_signature(const char *barejid, const char *rname, LmMessageNode *node, const char *text) { #ifdef HAVE_GPGME const char *p, *key; GSList *sl_buddy; struct pgp_data *res_pgpdata; gpgme_sigsum_t sigsum; // All parameters must be valid if (!(node && barejid && rname && text)) return; if (!gpg_enabled()) return; // Get the resource PGP data structure sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); if (!sl_buddy) return; res_pgpdata = buddy_resource_pgp(sl_buddy->data, rname); if (!res_pgpdata) return; if (!node->name || strcmp(node->name, "x")) // XXX: probably useless return; // We expect "" // Get signature p = lm_message_node_get_value(node); if (!p) return; key = gpg_verify(p, text, &sigsum); if (key) { const char *expectedkey; char *buf; g_free(res_pgpdata->sign_keyid); res_pgpdata->sign_keyid = (char *)key; res_pgpdata->last_sigsum = sigsum; if (sigsum & GPGME_SIGSUM_RED) { buf = g_strdup_printf("Bad signature from <%s/%s>", barejid, rname); scr_WriteIncomingMessage(barejid, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } // Verify that the key id is the one we expect. expectedkey = settings_pgp_getkeyid(barejid); if (keys_mismatch(key, expectedkey)) { buf = g_strdup_printf("Warning: The KeyId from <%s/%s> doesn't match " "the key you set up", barejid, rname); scr_WriteIncomingMessage(barejid, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } } #endif } static LmSSLResponse ssl_cb(LmSSL *ssl, LmSSLStatus status, gpointer ud) { switch (status) { case LM_SSL_STATUS_NO_CERT_FOUND: scr_LogPrint(LPRINT_LOGNORM, "No certificate found!"); break; case LM_SSL_STATUS_UNTRUSTED_CERT: scr_LogPrint(LPRINT_LOGNORM, "Certificate is not trusted!"); break; case LM_SSL_STATUS_CERT_EXPIRED: scr_LogPrint(LPRINT_LOGNORM, "Certificate has expired!"); break; case LM_SSL_STATUS_CERT_NOT_ACTIVATED: scr_LogPrint(LPRINT_LOGNORM, "Certificate has not been activated!"); break; case LM_SSL_STATUS_CERT_HOSTNAME_MISMATCH: scr_LogPrint(LPRINT_LOGNORM, "Certificate hostname does not match expected hostname!"); break; case LM_SSL_STATUS_CERT_FINGERPRINT_MISMATCH: { char fpr[49]; fingerprint_to_hex((const unsigned char*)lm_ssl_get_fingerprint(ssl), fpr); scr_LogPrint(LPRINT_LOGNORM, "Certificate fingerprint does not match expected fingerprint!"); scr_LogPrint(LPRINT_LOGNORM, "Remote fingerprint: %s", fpr); scr_LogPrint(LPRINT_LOGNORM, "Expected fingerprint: %s", settings_opt_get("ssl_fingerprint")); return LM_SSL_RESPONSE_STOP; break; } case LM_SSL_STATUS_GENERIC_ERROR: scr_LogPrint(LPRINT_LOGNORM, "Generic SSL error!"); break; default: scr_LogPrint(LPRINT_LOGNORM, "SSL error:%d", status); } if (settings_opt_get_int("ssl_ignore_checks")) return LM_SSL_RESPONSE_CONTINUE; return LM_SSL_RESPONSE_STOP; } static void connection_auth_cb(LmConnection *connection, gboolean success, gpointer user_data) { if (success) { xmpp_iq_request(NULL, NS_ROSTER); xmpp_request_storage("storage:bookmarks"); xmpp_request_storage("storage:rosternotes"); /* XXX Not needed before xmpp_setprevstatus() LmMessage *m; m = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_PRESENCE, LM_MESSAGE_SUB_TYPE_AVAILABLE); lm_connection_send(connection, m, NULL); lm_message_unref(m); */ xmpp_setprevstatus(); AutoConnection = TRUE; } else scr_LogPrint(LPRINT_LOGNORM, "Authentication failed"); } gboolean xmpp_reconnect() { if (!lconnection) xmpp_connect(); return FALSE; } static void _try_to_reconnect(void) { xmpp_disconnect(); if (AutoConnection) g_timeout_add_seconds(RECONNECTION_TIMEOUT + (random() % 90L), xmpp_reconnect, NULL); } static void connection_open_cb(LmConnection *connection, gboolean success, gpointer user_data) { GError *error = NULL; if (success) { const char *password, *resource; char *username; username = jid_get_username(settings_opt_get("jid")); password = settings_opt_get("password"); resource = strchr(lm_connection_get_jid(connection), JID_RESOURCE_SEPARATOR); if (resource) resource++; if (!lm_connection_authenticate(lconnection, username, password, resource, connection_auth_cb, NULL, FALSE, &error)) { scr_LogPrint(LPRINT_LOGNORM, "Failed to authenticate: %s", error->message); g_error_free (error); _try_to_reconnect(); } g_free(username); } else { scr_LogPrint(LPRINT_LOGNORM, "There was an error while connecting."); _try_to_reconnect(); } } static void connection_close_cb(LmConnection *connection, LmDisconnectReason reason, gpointer user_data) { const char *str; switch (reason) { case LM_DISCONNECT_REASON_OK: str = "LM_DISCONNECT_REASON_OK"; break; case LM_DISCONNECT_REASON_PING_TIME_OUT: str = "LM_DISCONNECT_REASON_PING_TIME_OUT"; break; case LM_DISCONNECT_REASON_HUP: str = "LM_DISCONNECT_REASON_HUP"; break; case LM_DISCONNECT_REASON_ERROR: str = "LM_DISCONNECT_REASON_ERROR"; break; case LM_DISCONNECT_REASON_UNKNOWN: default: str = "LM_DISCONNECT_REASON_UNKNOWN"; break; } if (reason != LM_DISCONNECT_REASON_OK) _try_to_reconnect(); // Free bookmarks if (bookmarks) lm_message_node_unref(bookmarks); bookmarks = NULL; // Free roster roster_free(); if (rosternotes) lm_message_node_unref(rosternotes); rosternotes = NULL; // Update display update_roster = TRUE; scr_update_buddy_window(); if (!reason) scr_LogPrint(LPRINT_LOGNORM, "Disconnected."); else scr_LogPrint(LPRINT_NORMAL, "Disconnected, reason: %d->'%s'", reason, str); xmpp_setstatus(offline, NULL, mystatusmsg, TRUE); } static void handle_state_events(const char *from, LmMessageNode *node) { #if defined XEP0022 || defined XEP0085 LmMessageNode *state_ns = NULL; char *rname, *bjid; GSList *sl_buddy; guint events; struct xep0022 *xep22 = NULL; struct xep0085 *xep85 = NULL; enum { XEP_none, XEP_85, XEP_22 } which_xep = XEP_none; rname = strchr(from, JID_RESOURCE_SEPARATOR); if (rname) ++rname; else rname = (char *)from + strlen(from); bjid = jidtodisp(from); sl_buddy = roster_find(bjid, jidsearch, ROSTER_TYPE_USER); g_free(bjid); /* XXX Actually that's wrong, since it filters out server "offline" messages (for XEP-0022). This XEP is (almost) deprecated so we don't really care. */ if (!sl_buddy) { return; } /* Let's see chich XEP the contact uses. If possible, we'll use XEP-85, if not we'll look for XEP-22 support. */ events = buddy_resource_getevents(sl_buddy->data, rname); xep85 = buddy_resource_xep85(sl_buddy->data, rname); if (xep85) { state_ns = lm_message_node_find_xmlns(node, NS_CHATSTATES); if (state_ns) which_xep = XEP_85; } if (which_xep != XEP_85) { /* Fall back to XEP-0022 */ xep22 = buddy_resource_xep22(sl_buddy->data, rname); if (xep22) { state_ns = lm_message_node_find_xmlns(node, NS_EVENT); if (state_ns) which_xep = XEP_22; } } if (!which_xep) { /* Sender does not use chat states */ return; } if (which_xep == XEP_85) { /* XEP-0085 */ xep85->support = CHATSTATES_SUPPORT_OK; if (!strcmp(state_ns->name, "composing")) { xep85->last_state_rcvd = ROSTER_EVENT_COMPOSING; } else if (!strcmp(state_ns->name, "active")) { xep85->last_state_rcvd = ROSTER_EVENT_ACTIVE; } else if (!strcmp(state_ns->name, "paused")) { xep85->last_state_rcvd = ROSTER_EVENT_PAUSED; } else if (!strcmp(state_ns->name, "inactive")) { xep85->last_state_rcvd = ROSTER_EVENT_INACTIVE; } else if (!strcmp(state_ns->name, "gone")) { xep85->last_state_rcvd = ROSTER_EVENT_GONE; } events = xep85->last_state_rcvd; } else { /* XEP-0022 */ #ifdef XEP0022 const char *body = lm_message_node_get_child_value(node, "body"); const char *msgid; xep22->support = CHATSTATES_SUPPORT_OK; xep22->last_state_rcvd = ROSTER_EVENT_NONE; msgid = lm_message_node_get_attribute(node, "id"); if (lm_message_node_get_child(state_ns, "composing")) { // Clear composing if the message contains a body if (body) events &= ~ROSTER_EVENT_COMPOSING; else events |= ROSTER_EVENT_COMPOSING; xep22->last_state_rcvd |= ROSTER_EVENT_COMPOSING; } else { events &= ~ROSTER_EVENT_COMPOSING; } // Cache the message id g_free(xep22->last_msgid_rcvd); if (msgid) xep22->last_msgid_rcvd = g_strdup(msgid); else xep22->last_msgid_rcvd = NULL; if (lm_message_node_get_child(state_ns, "delivered")) { xep22->last_state_rcvd |= ROSTER_EVENT_DELIVERED; // Do we have to send back an ACK? if (body) xmpp_send_xep22_event(from, ROSTER_EVENT_DELIVERED); } #endif } buddy_resource_setevents(sl_buddy->data, rname, events); update_roster = TRUE; #endif } static void gotmessage(LmMessageSubType type, const char *from, const char *body, const char *enc, const char *subject, time_t timestamp, LmMessageNode *node_signed) { char *bjid; const char *rname; char *decrypted_pgp = NULL; char *decrypted_otr = NULL; int otr_msg = 0, free_msg = 0; bjid = jidtodisp(from); rname = strchr(from, JID_RESOURCE_SEPARATOR); if (rname) rname++; #ifdef HAVE_GPGME if (enc && gpg_enabled()) { decrypted_pgp = gpg_decrypt(enc); if (decrypted_pgp) { body = decrypted_pgp; } } // Check signature of an unencrypted message if (node_signed && gpg_enabled()) check_signature(bjid, rname, node_signed, decrypted_pgp); #endif // Check for unexpected groupchat messages // If we receive a groupchat message from a room we're not a member of, // this is probably a server issue and the best we can do is to send // a type unavailable. if (type == LM_MESSAGE_SUB_TYPE_GROUPCHAT && !roster_getnickname(bjid)) { // It shouldn't happen, probably a server issue GSList *room_elt; char *mbuf; mbuf = g_strdup_printf("Unexpected groupchat packet!"); scr_LogPrint(LPRINT_LOGNORM, "%s", mbuf); scr_WriteIncomingMessage(bjid, mbuf, 0, HBB_PREFIX_INFO, 0); g_free(mbuf); // Send back an unavailable packet xmpp_setstatus(offline, bjid, "", TRUE); // MUC // Make sure this is a room (it can be a conversion user->room) room_elt = roster_find(bjid, jidsearch, 0); if (!room_elt) { roster_add_user(bjid, NULL, NULL, ROSTER_TYPE_ROOM, sub_none, -1); } else { buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); } buddylist_build(); scr_draw_roster(); goto gotmessage_return; } // We don't call the message_in hook if 'block_unsubscribed' is true and // this is a regular message from an unsubscribed user. // System messages (from our server) are allowed. if (settings_opt_get_int("block_unsubscribed") && (roster_gettype(bjid) != ROSTER_TYPE_ROOM) && !(roster_getsubscription(bjid) & sub_from) && (type != LM_MESSAGE_SUB_TYPE_GROUPCHAT)) { char *sbjid = jidtodisp(lm_connection_get_jid(lconnection)); const char *server = strchr(sbjid, JID_DOMAIN_SEPARATOR); if (server && g_strcmp0(server+1, bjid)) { scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", bjid); g_free(sbjid); goto gotmessage_return; } g_free(sbjid); } #ifdef HAVE_LIBOTR if (otr_enabled()) { decrypted_otr = (char*)body; otr_msg = otr_receive(&decrypted_otr, bjid, &free_msg); if (!decrypted_otr) { goto gotmessage_return; } body = decrypted_otr; } #endif { // format and pass message for further processing gchar *fullbody = NULL; guint encrypted; if (decrypted_pgp) encrypted = ENCRYPTED_PGP; else if (otr_msg) encrypted = ENCRYPTED_OTR; else encrypted = 0; if (subject) { if (body) fullbody = g_strdup_printf("[%s]\n%s", subject, body); else fullbody = g_strdup_printf("[%s]\n", subject); body = fullbody; } hk_message_in(bjid, rname, timestamp, body, type, encrypted); g_free(fullbody); } gotmessage_return: // Clean up and exit g_free(bjid); g_free(decrypted_pgp); if (free_msg) g_free(decrypted_otr); } static LmHandlerResult handle_messages(LmMessageHandler *handler, LmConnection *connection, LmMessage *m, gpointer user_data) { const char *p, *from=lm_message_get_from(m); char *bjid, *res; LmMessageNode *x; const char *body = NULL; const char *enc = NULL; const char *subject = NULL; time_t timestamp = 0L; LmMessageSubType mstype; mstype = lm_message_get_sub_type(m); body = lm_message_node_get_child_value(m->node, "body"); x = lm_message_node_find_xmlns(m->node, NS_ENCRYPTED); if (x && (p = lm_message_node_get_value(x)) != NULL) enc = p; // Get the bare-JID/room (bjid) and the resource/nickname (res) bjid = g_strdup(lm_message_get_from(m)); res = strchr(bjid, JID_RESOURCE_SEPARATOR); if (res) *res++ = 0; p = lm_message_node_get_child_value(m->node, "subject"); if (p != NULL) { if (mstype != LM_MESSAGE_SUB_TYPE_GROUPCHAT) { // Chat message subject = p; } else { // Room topic GSList *roombuddy; gchar *mbuf; const gchar *subj = p; // Set the new topic roombuddy = roster_find(bjid, jidsearch, 0); if (roombuddy) buddy_settopic(roombuddy->data, subj); // Display inside the room window if (!res) { // No specific resource (this is certainly history) if (*subj) mbuf = g_strdup_printf("The topic has been set to: %s", subj); else mbuf = g_strdup_printf("The topic has been cleared"); } else { if (*subj) mbuf = g_strdup_printf("%s has set the topic to: %s", res, subj); else mbuf = g_strdup_printf("%s has cleared the topic", res); } scr_WriteIncomingMessage(bjid, mbuf, 0, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); if (settings_opt_get_int("log_muc_conf")) hlog_write_message(bjid, 0, -1, mbuf); g_free(mbuf); // The topic is displayed in the chat status line, so refresh now. scr_update_chat_status(TRUE); } } // Timestamp? timestamp = lm_message_node_get_timestamp(m->node); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { x = lm_message_node_get_child(m->node, "error"); display_server_error(x, from); #if defined XEP0022 || defined XEP0085 // If the XEP85/22 support is probed, set it back to unknown so that // we probe it again. chatstates_reset_probed(from); #endif } else { handle_state_events(from, m->node); } if (from && (body || subject)) gotmessage(mstype, from, body, enc, subject, timestamp, lm_message_node_find_xmlns(m->node, NS_SIGNED)); // Report received message if message delivery receipt was requested if (lm_message_node_get_child(m->node, "request") && (roster_getsubscription(bjid) & sub_from)) { const gchar *mid; LmMessageNode *y; LmMessage *rcvd = lm_message_new(from, LM_MESSAGE_TYPE_MESSAGE); mid = lm_message_get_id(m); // For backward compatibility (XEP184 < v.1.1): lm_message_node_set_attribute(rcvd->node, "id", mid); y = lm_message_node_add_child(rcvd->node, "received", NULL); lm_message_node_set_attribute(y, "xmlns", NS_RECEIPTS); lm_message_node_set_attribute(y, "id", mid); lm_connection_send(connection, rcvd, NULL); lm_message_unref(rcvd); } { // xep184 receipt confirmation LmMessageNode *received = lm_message_node_get_child(m->node, "received"); if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"), NS_RECEIPTS)) { char *jid = jidtodisp(from); const char *id = lm_message_node_get_attribute(received, "id"); // This is for backward compatibility; if the remote client didn't add // the id as an attribute of the 'received' tag, we use the message id: if (!id) id = lm_message_get_id(m); scr_remove_receipt_flag(jid, id); g_free(jid); } } if (from) { x = lm_message_node_find_xmlns(m->node, NS_MUC_USER); if (x && !strcmp(x->name, "x")) got_muc_message(from, x, timestamp); x = lm_message_node_find_xmlns(m->node, NS_X_CONFERENCE); if (x && !strcmp(x->name, "x")) { const char *jid = lm_message_node_get_attribute(x, "jid"); if (jid) { const char *reason = lm_message_node_get_attribute(x, "reason"); const char *password = lm_message_node_get_attribute(x, "password"); // We won't send decline stanzas as it is a Direct Invitation got_invite(from, jid, reason, password, FALSE); } } } g_free(bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult cb_caps(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { char *ver = user_data; char *hash; const char *from = lm_message_get_from(m); char *bjid = jidtodisp(from); LmMessageSubType mstype = lm_message_get_sub_type(m); hash = strchr(ver, ','); if (hash) *hash++ = '\0'; if (mstype == LM_MESSAGE_SUB_TYPE_RESULT) { LmMessageNode *info; LmMessageNode *query = lm_message_node_get_child(m->node, "query"); if (caps_has_hash(ver, bjid)) goto caps_callback_return; caps_add(ver); info = lm_message_node_get_child(query, "identity"); while (info) { if (!g_strcmp0(info->name, "identity")) caps_add_identity(ver, lm_message_node_get_attribute(info, "category"), lm_message_node_get_attribute(info, "name"), lm_message_node_get_attribute(info, "type"), lm_message_node_get_attribute(info, "xml:lang")); info = info->next; } info = lm_message_node_get_child(query, "feature"); while (info) { if (!g_strcmp0(info->name, "feature")) caps_add_feature(ver, lm_message_node_get_attribute(info, "var")); info = info->next; } info = lm_message_node_get_child(query, "x"); { LmMessageNode *field; LmMessageNode *value; const char *formtype, *var; while (info) { if (!g_strcmp0(info->name, "x") && !g_strcmp0(lm_message_node_get_attribute(info, "type"), "result") && !g_strcmp0(lm_message_node_get_attribute(info, "xmlns"), "jabber:x:data")) { field = lm_message_node_get_child(info, "field"); formtype = NULL; while (field) { if (!g_strcmp0(field->name, "field") && !g_strcmp0(lm_message_node_get_attribute(field, "var"), "FORM_TYPE") && !g_strcmp0(lm_message_node_get_attribute(field, "type"), "hidden")) { value = lm_message_node_get_child(field, "value"); if (value) formtype = lm_message_node_get_value(value); } field = field->next; } if (formtype) { caps_add_dataform(ver, formtype); field = lm_message_node_get_child(info, "field"); while (field) { var = lm_message_node_get_attribute(field, "var"); if (!g_strcmp0(field->name, "field") && (g_strcmp0(var, "FORM_TYPE") || g_strcmp0(lm_message_node_get_attribute(field, "type"), "hidden"))) { value = lm_message_node_get_child(field, "value"); while (value) { if (!g_strcmp0(value->name, "value")) caps_add_dataform_field(ver, formtype, var, lm_message_node_get_value(value)); value = value->next; } } field = field->next; } } } info = info->next; } } if (caps_verify(ver, hash)) caps_copy_to_persistent(ver, lm_message_node_to_string(query)); else caps_move_to_local(ver, bjid); } caps_callback_return: g_free(bjid); g_free(ver); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult handle_presence(LmMessageHandler *handler, LmConnection *connection, LmMessage *m, gpointer user_data) { char *bjid; const char *from, *rname, *p=NULL, *ustmsg=NULL; enum imstatus ust; char bpprio; time_t timestamp = 0L; LmMessageNode *muc_packet, *caps; LmMessageSubType mstype = lm_message_get_sub_type(m); // Check for MUC presence packet muc_packet = lm_message_node_find_xmlns(m->node, NS_MUC_USER); from = lm_message_get_from(m); if (!from) { scr_LogPrint(LPRINT_LOGNORM, "Unexpected presence packet!"); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { display_server_error(lm_message_node_get_child(m->node, "error"), lm_message_get_from(m)); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } rname = strchr(from, JID_RESOURCE_SEPARATOR); if (rname) rname++; if (settings_opt_get_int("ignore_self_presence")) { const char *self_fjid = lm_connection_get_jid(connection); if (self_fjid && !strcasecmp(self_fjid, from)) { return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; // Ignoring self presence } } bjid = jidtodisp(from); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { LmMessageNode *x; scr_LogPrint(LPRINT_LOGNORM, "Error presence packet from <%s>", bjid); x = lm_message_node_find_child(m->node, "error"); display_server_error(x, from); // Let's check it isn't a nickname conflict. // XXX Note: We should handle the string condition. if ((p = lm_message_node_get_attribute(x, "code")) != NULL) { if (atoi(p) == 409) { // 409 = conflict (nickname is in use or registered by another user) // If we are not inside this room, we should reset the nickname GSList *room_elt = roster_find(bjid, jidsearch, 0); if (room_elt && !buddy_getinsideroom(room_elt->data)) buddy_setnickname(room_elt->data, NULL); } } g_free(bjid); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } p = lm_message_node_get_child_value(m->node, "priority"); if (p && *p) bpprio = (gchar)atoi(p); else bpprio = 0; ust = available; p = lm_message_node_get_child_value(m->node, "show"); if (p) { if (!strcmp(p, "away")) ust = away; else if (!strcmp(p, "dnd")) ust = dontdisturb; else if (!strcmp(p, "xa")) ust = notavail; else if (!strcmp(p, "chat")) ust = freeforchat; } if (mstype == LM_MESSAGE_SUB_TYPE_UNAVAILABLE) ust = offline; ustmsg = lm_message_node_get_child_value(m->node, "status"); if (ustmsg && !*ustmsg) ustmsg = NULL; // Timestamp? timestamp = lm_message_node_get_timestamp(m->node); if (muc_packet) { // This is a MUC presence message handle_muc_presence(from, muc_packet, bjid, rname, ust, ustmsg, timestamp, bpprio); } else { // Not a MUC message, so this is a regular buddy... // Call hk_statuschange() if status has changed or if the // status message is different const char *msg; msg = roster_getstatusmsg(bjid, rname); if ((ust != roster_getstatus(bjid, rname)) || (!ustmsg && msg && msg[0]) || (ustmsg && (!msg || strcmp(ustmsg, msg))) || (bpprio != roster_getprio(bjid, rname))) hk_statuschange(bjid, rname, bpprio, timestamp, ust, ustmsg); // Presence signature processing if (!ustmsg) ustmsg = ""; // Some clients omit the element :-( check_signature(bjid, rname, lm_message_node_find_xmlns(m->node, NS_SIGNED), ustmsg); } // XEP-0115 Entity Capabilities caps = lm_message_node_find_xmlns(m->node, NS_CAPS); if (caps && ust != offline) { const char *ver = lm_message_node_get_attribute(caps, "ver"); const char *hash = lm_message_node_get_attribute(caps, "hash"); GSList *sl_buddy = NULL; if (!hash) { // No support for legacy format goto handle_presence_return; } if (!ver || !g_strcmp0(ver, "") || !g_strcmp0(hash, "")) goto handle_presence_return; if (rname) sl_buddy = roster_find(bjid, jidsearch, ROSTER_TYPE_USER); // Only cache the caps if the user is on the roster if (sl_buddy && buddy_getonserverflag(sl_buddy->data)) { buddy_resource_setcaps(sl_buddy->data, rname, ver); if (!caps_has_hash(ver, bjid) && !caps_restore_from_persistent(ver)) { char *node; LmMessageHandler *handler; LmMessage *iq = lm_message_new_with_sub_type(from, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET); node = g_strdup_printf("%s#%s", lm_message_node_get_attribute(caps, "node"), ver); lm_message_node_set_attributes (lm_message_node_add_child(iq->node, "query", NULL), "xmlns", NS_DISCO_INFO, "node", node, NULL); g_free(node); handler = lm_message_handler_new(cb_caps, g_strdup_printf("%s,%s",ver,hash), NULL); lm_connection_send_with_reply(connection, iq, handler, NULL); lm_message_unref(iq); lm_message_handler_unref(handler); } } } handle_presence_return: g_free(bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult handle_iq(LmMessageHandler *handler, LmConnection *connection, LmMessage *m, gpointer user_data) { int i; const char *xmlns = NULL; LmMessageNode *x; LmMessageSubType mstype = lm_message_get_sub_type(m); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { display_server_error(lm_message_node_get_child(m->node, "error"), lm_message_get_from(m)); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } if (mstype == LM_MESSAGE_SUB_TYPE_RESULT) { scr_LogPrint(LPRINT_DEBUG, "Unhandled IQ result? %s", lm_message_node_to_string(m->node)); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } for (x = m->node->children; x; x=x->next) { xmlns = lm_message_node_get_attribute(x, "xmlns"); if (xmlns) for (i=0; iq_handlers[i].xmlns; ++i) if (!strcmp(iq_handlers[i].xmlns, xmlns)) return iq_handlers[i].handler(NULL, connection, m, user_data); xmlns = NULL; } if ((mstype == LM_MESSAGE_SUB_TYPE_SET) || (mstype == LM_MESSAGE_SUB_TYPE_GET)) send_iq_error(connection, m, XMPP_ERROR_NOT_IMPLEMENTED); scr_LogPrint(LPRINT_DEBUG, "Unhandled IQ: %s", lm_message_node_to_string(m->node)); scr_LogPrint(LPRINT_NORMAL, "Received unhandled IQ request from <%s>.", lm_message_get_from(m)); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult handle_s10n(LmMessageHandler *handler, LmConnection *connection, LmMessage *m, gpointer user_data) { char *r; char *buf; int newbuddy; guint hook_result; LmMessageSubType mstype = lm_message_get_sub_type(m); const char *from = lm_message_get_from(m); const char *msg = lm_message_node_get_child_value(m->node, "status"); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { display_server_error(lm_message_node_get_child(m->node, "error"), lm_message_get_from(m)); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } if (!from) { scr_LogPrint(LPRINT_DEBUG, "handle_s10n: Unexpected presence packet!"); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } r = jidtodisp(from); newbuddy = !roster_find(r, jidsearch, 0); hook_result = hk_subscription(mstype, r, msg); if (mstype == LM_MESSAGE_SUB_TYPE_SUBSCRIBE) { /* The sender wishes to subscribe to our presence */ if (hook_result) { g_free(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } buf = g_strdup_printf("<%s> wants to subscribe to your presence updates", from); scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); if (msg) { buf = g_strdup_printf("<%s> said: %s", from, msg); scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); replace_nl_with_dots(buf); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } // Create a new event item { const char *id; char *desc = g_strdup_printf("<%s> wants to subscribe to your " "presence updates", r); id = evs_new(desc, NULL, 0, evscallback_subscription, g_strdup(r), (GDestroyNotify)g_free); g_free(desc); if (id) buf = g_strdup_printf("Please use /event %s accept|reject", id); else buf = g_strdup_printf("Unable to create a new event!"); } scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } else if (mstype == LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE) { /* The sender is unsubscribing from our presence */ xmpp_send_s10n(from, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); buf = g_strdup_printf("<%s> is unsubscribing from your " "presence updates", from); scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } else if (mstype == LM_MESSAGE_SUB_TYPE_SUBSCRIBED) { /* The sender has allowed us to receive their presence */ buf = g_strdup_printf("<%s> has allowed you to receive their " "presence updates", from); scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } else if (mstype == LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED) { /* The subscription request has been denied or a previously-granted subscription has been cancelled */ roster_unsubscribed(from); update_roster = TRUE; buf = g_strdup_printf("<%s> has cancelled your subscription to " "their presence updates", from); scr_WriteIncomingMessage(r, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); } else { g_free(r); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } if (newbuddy) update_roster = TRUE; g_free(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // TODO: Use the enum of loudmouth, when it's included in the header... typedef enum { LM_LOG_LEVEL_VERBOSE = 1 << (G_LOG_LEVEL_USER_SHIFT), LM_LOG_LEVEL_NET = 1 << (G_LOG_LEVEL_USER_SHIFT + 1), LM_LOG_LEVEL_PARSER = 1 << (G_LOG_LEVEL_USER_SHIFT + 2), LM_LOG_LEVEL_SSL = 1 << (G_LOG_LEVEL_USER_SHIFT + 3), LM_LOG_LEVEL_SASL = 1 << (G_LOG_LEVEL_USER_SHIFT + 4), LM_LOG_LEVEL_ALL = (LM_LOG_LEVEL_NET | LM_LOG_LEVEL_VERBOSE | LM_LOG_LEVEL_PARSER | LM_LOG_LEVEL_SSL | LM_LOG_LEVEL_SASL) } LmLogLevelFlags; static void lm_debug_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { if (message && *message) { char *msg; int mcabber_loglevel = settings_opt_get_int("tracelog_level"); if (mcabber_loglevel < 2) return; if (message[0] == '\n') msg = g_strdup(&message[1]); else msg = g_strdup(message); if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = '\0'; if (log_level & LM_LOG_LEVEL_VERBOSE) { scr_LogPrint(LPRINT_DEBUG, "LM-VERBOSE: %s", msg); } if (log_level & LM_LOG_LEVEL_NET) { if (mcabber_loglevel > 2) scr_LogPrint(LPRINT_DEBUG, "LM-NET: %s", msg); } else if (log_level & LM_LOG_LEVEL_PARSER) { if (mcabber_loglevel > 3) scr_LogPrint(LPRINT_DEBUG, "LM-PARSER: %s", msg); } else if (log_level & LM_LOG_LEVEL_SASL) { scr_LogPrint(LPRINT_DEBUG, "LM-SASL: %s", msg); } else if (log_level & LM_LOG_LEVEL_SSL) { scr_LogPrint(LPRINT_DEBUG, "LM-SSL: %s", msg); } g_free(msg); } } // xmpp_connect() // Return a non-zero value if there's an obvious problem // (no JID, no password, etc.) gint xmpp_connect(void) { const char *userjid, *password, *resource, *servername, *ssl_fpr; char *dynresource = NULL; char fpr[16]; const char *proxy_host; const char *resource_prefix = PACKAGE_NAME; char *fjid; int ssl, tls; LmSSL *lssl; unsigned int port; unsigned int ping; LmMessageHandler *handler; GError *error = NULL; xmpp_disconnect(); servername = settings_opt_get("server"); userjid = settings_opt_get("jid"); password = settings_opt_get("password"); resource = settings_opt_get("resource"); proxy_host = settings_opt_get("proxy_host"); ssl_fpr = settings_opt_get("ssl_fingerprint"); if (!userjid) { scr_LogPrint(LPRINT_LOGNORM, "Your JID has not been specified!"); return -1; } if (!password) { scr_LogPrint(LPRINT_LOGNORM, "Your password has not been specified!"); return -1; } lconnection = lm_connection_new_with_context(NULL, main_context); g_log_set_handler("LM", LM_LOG_LEVEL_ALL, lm_debug_handler, NULL); ping = 40; if (settings_opt_get("pinginterval")) ping = (unsigned int) settings_opt_get_int("pinginterval"); lm_connection_set_keep_alive_rate(lconnection, ping); scr_LogPrint(LPRINT_DEBUG, "Ping interval established: %d secs", ping); lm_connection_set_disconnect_function(lconnection, connection_close_cb, NULL, NULL); handler = lm_message_handler_new(handle_messages, NULL, NULL); lm_connection_register_message_handler(lconnection, handler, LM_MESSAGE_TYPE_MESSAGE, LM_HANDLER_PRIORITY_NORMAL); lm_message_handler_unref(handler); handler = lm_message_handler_new(handle_iq, NULL, NULL); lm_connection_register_message_handler(lconnection, handler, LM_MESSAGE_TYPE_IQ, LM_HANDLER_PRIORITY_NORMAL); lm_message_handler_unref(handler); handler = lm_message_handler_new(handle_presence, NULL, NULL); lm_connection_register_message_handler(lconnection, handler, LM_MESSAGE_TYPE_PRESENCE, LM_HANDLER_PRIORITY_LAST); lm_message_handler_unref(handler); handler = lm_message_handler_new(handle_s10n, NULL, NULL); lm_connection_register_message_handler(lconnection, handler, LM_MESSAGE_TYPE_PRESENCE, LM_HANDLER_PRIORITY_NORMAL); lm_message_handler_unref(handler); /* Connect to server */ scr_LogPrint(LPRINT_NORMAL|LPRINT_DEBUG, "Connecting to server%s%s", servername ? ": " : "", servername ? servername : ""); if (!resource) resource = resource_prefix; // Initialize pseudo-random seed srandom(time(NULL)); if (!settings_opt_get("disable_random_resource")) { #if HAVE_ARC4RANDOM dynresource = g_strdup_printf("%s.%08x", resource, arc4random()); #else unsigned int tab[2]; tab[0] = (unsigned int) (0xffff * (random() / (RAND_MAX + 1.0))); tab[1] = (unsigned int) (0xffff * (random() / (RAND_MAX + 1.0))); dynresource = g_strdup_printf("%s.%04x%04x", resource, tab[0], tab[1]); #endif resource = dynresource; } port = (unsigned int) settings_opt_get_int("port"); if (port) scr_LogPrint(LPRINT_NORMAL|LPRINT_DEBUG, " using port %d", port); scr_LogPrint(LPRINT_NORMAL|LPRINT_DEBUG, " with resource %s", resource); if (proxy_host) { int proxy_port = settings_opt_get_int("proxy_port"); if (proxy_port <= 0 || proxy_port > 65535) { scr_LogPrint(LPRINT_NORMAL|LPRINT_DEBUG, "Invalid proxy port: %d", proxy_port); } else { const char *proxy_user, *proxy_pass; LmProxy *lproxy; proxy_user = settings_opt_get("proxy_user"); proxy_pass = settings_opt_get("proxy_pass"); // Proxy initialization lproxy = lm_proxy_new_with_server(LM_PROXY_TYPE_HTTP, proxy_host, proxy_port); lm_proxy_set_username(lproxy, proxy_user); lm_proxy_set_password(lproxy, proxy_pass); lm_connection_set_proxy(lconnection, lproxy); lm_proxy_unref(lproxy); scr_LogPrint(LPRINT_NORMAL|LPRINT_DEBUG, " using proxy %s:%d", proxy_host, proxy_port); } } fjid = compose_jid(userjid, servername, resource); lm_connection_set_jid(lconnection, fjid); if (servername) lm_connection_set_server(lconnection, servername); #if defined(HAVE_LIBOTR) otr_init(fjid); #endif g_free(fjid); g_free(dynresource); ssl = settings_opt_get_int("ssl"); tls = settings_opt_get_int("tls"); if (!lm_ssl_is_supported()) { if (ssl || tls) { scr_LogPrint(LPRINT_LOGNORM, "** Error: SSL is NOT available, " "please recompile loudmouth with SSL enabled."); return -1; } } if (ssl && tls) { scr_LogPrint(LPRINT_LOGNORM, "You can only set ssl or tls, not both."); return -1; } if (!port) port = (ssl ? LM_CONNECTION_DEFAULT_PORT_SSL : LM_CONNECTION_DEFAULT_PORT); lm_connection_set_port(lconnection, port); if (ssl_fpr && (!hex_to_fingerprint(ssl_fpr, fpr))) { scr_LogPrint(LPRINT_LOGNORM, "** Please set the fingerprint in the format " "97:5C:00:3F:1D:77:45:25:E2:C5:70:EC:83:C8:87:EE"); return -1; } lssl = lm_ssl_new((ssl_fpr ? fpr : NULL), ssl_cb, NULL, NULL); if (lssl) { lm_ssl_use_starttls(lssl, !ssl, tls); lm_connection_set_ssl(lconnection, lssl); lm_ssl_unref(lssl); } else if (ssl || tls) { scr_LogPrint(LPRINT_LOGNORM, "** Error: Couldn't create SSL struct."); return -1; } if (!lm_connection_open(lconnection, connection_open_cb, NULL, FALSE, &error)) { _try_to_reconnect(); scr_LogPrint(LPRINT_LOGNORM, "Failed to open: %s", error->message); g_error_free(error); } return 0; } // xmpp_insert_entity_capabilities(presence_stanza) // Entity Capabilities (XEP-0115) void xmpp_insert_entity_capabilities(LmMessageNode *x, enum imstatus status) { LmMessageNode *y; const char *ver = entity_version(status); y = lm_message_node_add_child(x, "c", NULL); lm_message_node_set_attribute(y, "xmlns", NS_CAPS); lm_message_node_set_attribute(y, "hash", "sha-1"); lm_message_node_set_attribute(y, "node", MCABBER_CAPS_NODE); lm_message_node_set_attribute(y, "ver", ver); } void xmpp_disconnect(void) { if (!lconnection) return; if (lm_connection_is_authenticated(lconnection)) { // Launch pre-disconnect internal hook hk_predisconnect(); // Announce it to everyone else xmpp_setstatus(offline, NULL, "", FALSE); } if (lm_connection_is_open(lconnection)) lm_connection_close(lconnection, NULL); lm_connection_unref(lconnection); lconnection = NULL; } void xmpp_setstatus(enum imstatus st, const char *recipient, const char *msg, int do_not_sign) { LmMessage *m; gboolean isonline; if (msg) { // The status message has been specified. We'll use it, unless it is // "-" which is a special case (option meaning "no status message"). if (!strcmp(msg, "-")) msg = ""; } else { // No status message specified; we'll use: // a) the default status message (if provided by the user); // b) the current status message; // c) no status message (i.e. an empty one). msg = settings_get_status_msg(st); if (!msg) { if (mystatusmsg) msg = mystatusmsg; else msg = ""; } } isonline = xmpp_is_online(); // Only send the packet if we're online. // (But we want to update internal status even when disconnected, // in order to avoid some problems during network failures) if (isonline) { #ifdef WITH_DEPRECATED_STATUS_INVISIBLE const char *s_msg = (st != invisible ? msg : NULL); #else // XXX Could be removed if/when we get rid of status invisible // completely. const char *s_msg = msg; #endif if (!recipient) { // This is a global status, send presence to chatrooms #ifdef WITH_DEPRECATED_STATUS_INVISIBLE if (st != invisible) #endif { struct T_presence room_presence; room_presence.st = st; room_presence.msg = msg; foreach_buddy(ROSTER_TYPE_ROOM, &roompresence, &room_presence); } } m = lm_message_new_presence(st, recipient, s_msg); xmpp_insert_entity_capabilities(m->node, st); // Entity Caps (XEP-0115) #ifdef HAVE_GPGME if (!do_not_sign && gpg_enabled()) { char *signature; signature = gpg_sign(s_msg ? s_msg : ""); if (signature) { LmMessageNode *y; y = lm_message_node_add_child(m->node, "x", signature); lm_message_node_set_attribute(y, "xmlns", NS_SIGNED); g_free(signature); } } #endif lm_connection_send(lconnection, m, NULL); lm_message_unref(m); } // If we didn't change our _global_ status, we are done if (recipient) return; if (isonline || !st) { // We'll have to update the roster if we switch to/from offline because // we don't know the presences of buddies when offline... if (mystatus == offline || st == offline) update_roster = TRUE; if (isonline || mystatus || st) #ifdef WITH_DEPRECATED_STATUS_INVISIBLE hk_mystatuschange(0, mystatus, st, (st != invisible ? msg : "")); #else hk_mystatuschange(0, mystatus, st, msg); #endif mystatus = st; } if (st) mywantedstatus = st; if (msg != mystatusmsg) { g_free(mystatusmsg); if (*msg) mystatusmsg = g_strdup(msg); else mystatusmsg = NULL; } if (!scr_curses_status()) return; // Called from config. file if (!Autoaway) update_last_use(); // Update status line scr_update_main_status(TRUE); } enum imstatus xmpp_getstatus(void) { return mystatus; } const char *xmpp_getstatusmsg(void) { return mystatusmsg; } // xmpp_setprevstatus() // Set previous status. This wrapper function is used after a disconnection. void xmpp_setprevstatus(void) { xmpp_setstatus(mywantedstatus, NULL, mystatusmsg, FALSE); } // send_storage(store) // Send the node "store" to update the server. // Note: the sender should check we're online. void send_storage(LmMessageNode *store) { LmMessage *iq; LmMessageHandler *handler; LmMessageNode *query; if (!rosternotes) return; iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_PRIVATE); lm_message_node_insert_childnode(query, store); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); } // xmpp_is_bookmarked(roomjid) // Return TRUE if there's a bookmark for the given jid. guint xmpp_is_bookmarked(const char *bjid) { LmMessageNode *x; if (!bookmarks) return FALSE; // Walk through the storage bookmark tags for (x = bookmarks->children ; x; x = x->next) { // If the node is a conference item, check the jid. if (x->name && !strcmp(x->name, "conference")) { const char *fjid = lm_message_node_get_attribute(x, "jid"); if (fjid && !strcasecmp(bjid, fjid)) return TRUE; } } return FALSE; } // xmpp_get_bookmark_nick(roomjid) // Return the room nickname if it is present in a bookmark. const char *xmpp_get_bookmark_nick(const char *bjid) { LmMessageNode *x; if (!bookmarks || !bjid) return NULL; // Walk through the storage bookmark tags for (x = bookmarks->children ; x; x = x->next) { // If the node is a conference item, check the jid. if (x->name && !strcmp(x->name, "conference")) { const char *fjid = lm_message_node_get_attribute(x, "jid"); if (fjid && !strcasecmp(bjid, fjid)) return lm_message_node_get_child_value(x, "nick"); } } return NULL; } int xmpp_get_bookmark_autojoin(const char *bjid) { LmMessageNode *x; if (!bookmarks || !bjid) return 0; // Walk through the storage bookmark tags for (x = bookmarks->children ; x; x = x->next) { // If the node is a conference item, check the jid. if (x->name && !strcmp(x->name, "conference")) { const char *fjid = lm_message_node_get_attribute(x, "jid"); if (fjid && !strcasecmp(bjid, fjid)) { const char *autojoin; autojoin = lm_message_node_get_attribute(x, "autojoin"); if (autojoin && (!strcmp(autojoin, "1") || !strcmp(autojoin, "true"))) return 1; return 0; } } } return 0; } // xmpp_get_all_storage_bookmarks() // Return a GSList with all storage bookmarks. // The caller should g_free the list (not the MUC jids). GSList *xmpp_get_all_storage_bookmarks(void) { LmMessageNode *x; GSList *sl_bookmarks = NULL; // If we have no bookmarks, probably the server doesn't support them. if (!bookmarks) return NULL; // Walk through the storage bookmark tags for (x = bookmarks->children ; x; x = x->next) { // If the node is a conference item, let's add the note to our list. if (x->name && !strcmp(x->name, "conference")) { struct bookmark *bm_elt; const char *autojoin, *name, *nick; const char *fjid = lm_message_node_get_attribute(x, "jid"); if (!fjid) continue; bm_elt = g_new0(struct bookmark, 1); bm_elt->roomjid = g_strdup(fjid); autojoin = lm_message_node_get_attribute(x, "autojoin"); nick = lm_message_node_get_child_value(x, "nick"); name = lm_message_node_get_attribute(x, "name"); if (autojoin && (!strcmp(autojoin, "1") || !strcmp(autojoin, "true"))) bm_elt->autojoin = 1; if (nick) bm_elt->nick = g_strdup(nick); if (name) bm_elt->name = g_strdup(name); sl_bookmarks = g_slist_append(sl_bookmarks, bm_elt); } } return sl_bookmarks; } // xmpp_set_storage_bookmark(roomid, name, nick, passwd, autojoin, // printstatus, autowhois, flagjoins, group) // Update the private storage bookmarks: add a conference room. // If name is nil, we remove the bookmark. void xmpp_set_storage_bookmark(const char *roomid, const char *name, const char *nick, const char *passwd, int autojoin, enum room_printstatus pstatus, enum room_autowhois awhois, enum room_flagjoins fjoins, const char *group) { LmMessageNode *x; bool changed = FALSE; if (!roomid) return; // If we have no bookmarks, probably the server doesn't support them. if (!bookmarks) { scr_LogPrint(LPRINT_NORMAL, "Sorry, your server doesn't seem to support private storage."); return; } // Walk through the storage tags for (x = bookmarks->children ; x; x = x->next) { // If the current node is a conference item, see if we have to replace it. if (x->name && !strcmp(x->name, "conference")) { const char *fjid = lm_message_node_get_attribute(x, "jid"); if (!fjid) continue; if (!strcmp(fjid, roomid)) { // We've found a bookmark for this room. Let's hide it and we'll // create a new one. lm_message_node_hide(x); changed = TRUE; if (!name) scr_LogPrint(LPRINT_LOGNORM, "Deleting bookmark..."); } } } // Let's create a node/bookmark for this roomid, if the name is not NULL. if (name) { x = lm_message_node_add_child(bookmarks, "conference", NULL); lm_message_node_set_attributes(x, "jid", roomid, "name", name, "autojoin", autojoin ? "1" : "0", NULL); if (nick) lm_message_node_add_child(x, "nick", nick); if (passwd) lm_message_node_add_child(x, "password", passwd); if (pstatus) lm_message_node_add_child(x, "print_status", strprintstatus[pstatus]); if (awhois) lm_message_node_set_attributes(x, "autowhois", (awhois == autowhois_on) ? "1" : "0", NULL); if (fjoins) lm_message_node_add_child(x, "flag_joins", strflagjoins[fjoins]); if (group && *group) lm_message_node_add_child(x, "group", group); changed = TRUE; scr_LogPrint(LPRINT_LOGNORM, "Updating bookmarks..."); } if (!changed) return; if (xmpp_is_online()) send_storage(bookmarks); else scr_LogPrint(LPRINT_LOGNORM, "Warning: you're not connected to the server."); } static struct annotation *parse_storage_rosternote(LmMessageNode *notenode) { const char *p; struct annotation *note = g_new0(struct annotation, 1); p = lm_message_node_get_attribute(notenode, "cdate"); if (p) note->cdate = from_iso8601(p, 1); p = lm_message_node_get_attribute(notenode, "mdate"); if (p) note->mdate = from_iso8601(p, 1); note->text = g_strdup(lm_message_node_get_value(notenode)); note->jid = g_strdup(lm_message_node_get_attribute(notenode, "jid")); return note; } // xmpp_get_all_storage_rosternotes() // Return a GSList with all storage annotations. // The caller should g_free the list and its contents. GSList *xmpp_get_all_storage_rosternotes(void) { LmMessageNode *x; GSList *sl_notes = NULL; // If we have no rosternotes, probably the server doesn't support them. if (!rosternotes) return NULL; // Walk through the storage rosternotes tags for (x = rosternotes->children ; x; x = x->next) { struct annotation *note; // We want a note item if (!x->name || strcmp(x->name, "note")) continue; // Just in case, check the jid... if (!lm_message_node_get_attribute(x, "jid")) continue; // Ok, let's add the note to our list note = parse_storage_rosternote(x); sl_notes = g_slist_append(sl_notes, note); } return sl_notes; } // xmpp_get_storage_rosternotes(barejid, silent) // Return the annotation associated with this jid. // If silent is TRUE, no warning is displayed when rosternotes is disabled // The caller should g_free the string and structure after use. struct annotation *xmpp_get_storage_rosternotes(const char *barejid, int silent) { LmMessageNode *x; if (!barejid) return NULL; // If we have no rosternotes, probably the server doesn't support them. if (!rosternotes) { if (!silent) scr_LogPrint(LPRINT_NORMAL, "Sorry, " "your server doesn't seem to support private storage."); return NULL; } // Walk through the storage rosternotes tags for (x = rosternotes->children ; x; x = x->next) { const char *fjid; // We want a note item if (!x->name || strcmp(x->name, "note")) continue; // Just in case, check the jid... fjid = lm_message_node_get_attribute(x, "jid"); if (fjid && !strcmp(fjid, barejid)) // We've found a note for this contact. return parse_storage_rosternote(x); } return NULL; // No note found } // xmpp_set_storage_rosternotes(barejid, note) // Update the private storage rosternotes: add/delete a note. // If note is nil, we remove the existing note. void xmpp_set_storage_rosternotes(const char *barejid, const char *note) { LmMessageNode *x; bool changed = FALSE; const char *cdate = NULL; if (!barejid) return; // If we have no rosternotes, probably the server doesn't support them. if (!rosternotes) { scr_LogPrint(LPRINT_NORMAL, "Sorry, your server doesn't seem to support private storage."); return; } // Walk through the storage tags for (x = rosternotes->children ; x; x = x->next) { // If the current node is a conference item, see if we have to replace it. if (x->name && !strcmp(x->name, "note")) { const char *fjid = lm_message_node_get_attribute(x, "jid"); if (!fjid) continue; if (!strcmp(fjid, barejid)) { // We've found a note for this jid. Let's hide it and we'll // create a new one. cdate = lm_message_node_get_attribute(x, "cdate"); lm_message_node_hide(x); changed = TRUE; break; } } } // Let's create a node for this jid, if the note is not NULL. if (note) { char mdate[20]; time_t now; time(&now); to_iso8601(mdate, now); if (!cdate) cdate = mdate; x = lm_message_node_add_child(rosternotes, "note", note); lm_message_node_set_attributes(x, "jid", barejid, "cdate", cdate, "mdate", mdate, NULL); changed = TRUE; } if (!changed) return; if (xmpp_is_online()) send_storage(rosternotes); else scr_LogPrint(LPRINT_LOGNORM, "Warning: you're not connected to the server."); } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp.h000066400000000000000000000057131216603513500157250ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_H__ #define __MCABBER_XMPP_H__ 1 #include #include enum iqreq_type { iqreq_none, iqreq_version, iqreq_time, iqreq_last, iqreq_vcard, iqreq_ping }; struct annotation { time_t cdate; time_t mdate; gchar *jid; gchar *text; }; struct bookmark { gchar *roomjid; gchar *name; gchar *nick; guint autojoin; /* enum room_printstatus pstatus; */ /* enum room_autowhois awhois; */ /* enum room_flagjoins fjoins; */ /* const char *group; */ }; extern LmConnection* lconnection; extern LmSSL* lssl; int xmpp_connect(void); void xmpp_disconnect(void); gboolean xmpp_is_online(void); void xmpp_room_join(const char *room, const char *nickname, const char *passwd); int xmpp_room_setattrib(const char *roomid, const char *fjid, const char *nick, struct role_affil ra, const char *reason); void xmpp_room_invite(const char *room, const char *fjid, const char *reason); void xmpp_room_unlock(const char *room); void xmpp_room_destroy(const char *room, const char *venue, const char *reason); void xmpp_addbuddy(const char *bjid, const char *name, const char *group); void xmpp_updatebuddy(const char *bjid, const char *name, const char *group); void xmpp_delbuddy(const char *bjid); void xmpp_send_msg(const char *fjid, const char *text, int type, const char *subject, gboolean otrinject, gint *encrypted, LmMessageSubType type_overwrite, gpointer *xep184); void xmpp_send_s10n(const char *bjid, LmMessageSubType type); enum imstatus xmpp_getstatus(void); const char *xmpp_getstatusmsg(void); void xmpp_setprevstatus(void); void xmpp_setstatus(enum imstatus st, const char *recipient, const char *msg, int do_not_sign); void xmpp_send_chatstate(gpointer buddy, guint chatstate); void xmpp_insert_entity_capabilities(LmMessageNode *x, enum imstatus status); GSList *xmpp_get_all_storage_bookmarks(void); GSList *xmpp_get_all_storage_rosternotes(void); void xmpp_set_storage_bookmark(const char *roomid, const char *name, const char *nick, const char *passwd, int autojoin, enum room_printstatus pstatus, enum room_autowhois awhois, enum room_flagjoins fjoins, const char *group); struct annotation *xmpp_get_storage_rosternotes(const char *barejid, int silent); void xmpp_set_storage_rosternotes(const char *barejid, const char *note); guint xmpp_is_bookmarked(const char *bjid); const char *xmpp_get_bookmark_nick(const char *bjid); int xmpp_get_bookmark_autojoin(const char *bjid); void xmpp_request(const char *fjid, enum iqreq_type reqtype); void request_vcard(const char *bjid); void xmpp_request_storage(const gchar *storage); #endif /* __MCABBER_XMPP_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_defines.h000066400000000000000000000067101216603513500174200ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_DEFINES_H__ #define __MCABBER_XMPP_DEFINES_H__ 1 #define MCABBER_CAPS_NODE "http://mcabber.com/caps" #define NS_CLIENT "jabber:client" #define NS_SERVER "jabber:server" #define NS_DIALBACK "jabber:server:dialback" #define NS_AUTH "jabber:iq:auth" #define NS_AUTH_CRYPT "jabber:iq:auth:crypt" #define NS_REGISTER "jabber:iq:register" #define NS_ROSTER "jabber:iq:roster" #define NS_OFFLINE "jabber:x:offline" #define NS_AGENT "jabber:iq:agent" #define NS_AGENTS "jabber:iq:agents" #define NS_DELAY "jabber:x:delay" #define NS_VERSION "jabber:iq:version" #define NS_TIME "jabber:iq:time" #define NS_VCARD "vcard-temp" #define NS_PRIVATE "jabber:iq:private" #define NS_SEARCH "jabber:iq:search" #define NS_OOB "jabber:iq:oob" #define NS_XOOB "jabber:x:oob" #define NS_ADMIN "jabber:iq:admin" #define NS_FILTER "jabber:iq:filter" #define NS_AUTH_0K "jabber:iq:auth:0k" #define NS_BROWSE "jabber:iq:browse" #define NS_EVENT "jabber:x:event" #define NS_CONFERENCE "jabber:iq:conference" // direct muc invitation (xep-0249) #define NS_X_CONFERENCE "jabber:x:conference" #define NS_SIGNED "jabber:x:signed" #define NS_ENCRYPTED "jabber:x:encrypted" #define NS_GATEWAY "jabber:iq:gateway" #define NS_LAST "jabber:iq:last" #define NS_ENVELOPE "jabber:x:envelope" #define NS_EXPIRE "jabber:x:expire" #define NS_XHTML "http://www.w3.org/1999/xhtml" #define NS_DISCO_INFO "http://jabber.org/protocol/disco#info" #define NS_DISCO_ITEMS "http://jabber.org/protocol/disco#items" #define NS_IQ_AUTH "http://jabber.org/features/iq-auth" #define NS_REGISTER_FEATURE "http://jabber.org/features/iq-register" #define NS_CAPS "http://jabber.org/protocol/caps" #define NS_CHATSTATES "http://jabber.org/protocol/chatstates" #define NS_COMMANDS "http://jabber.org/protocol/commands" #define NS_MUC "http://jabber.org/protocol/muc" #define NS_MUC_USER "http://jabber.org/protocol/muc#user" #define NS_MUC_ADMIN "http://jabber.org/protocol/muc#admin" #define NS_MUC_OWNER "http://jabber.org/protocol/muc#owner" #define NS_XDBGINSERT "jabber:xdb:ginsert" #define NS_XDBNSLIST "jabber:xdb:nslist" #define NS_XMPP_STANZAS "urn:ietf:params:xml:ns:xmpp-stanzas" #define NS_XMPP_TLS "urn:ietf:params:xml:ns:xmpp-tls" #define NS_XMPP_STREAMS "urn:ietf:params:xml:ns:xmpp-streams" #define NS_XMPP_DELAY "urn:xmpp:delay" #define NS_XMPP_TIME "urn:xmpp:time" #define NS_PING "urn:xmpp:ping" #define NS_RECEIPTS "urn:xmpp:receipts" #define NS_JABBERD_STOREDPRESENCE "http://jabberd.org/ns/storedpresence" #define NS_JABBERD_HISTORY "http://jabberd.org/ns/history" #define XMPP_ERROR_REDIRECT 302 #define XMPP_ERROR_BAD_REQUEST 400 #define XMPP_ERROR_NOT_AUTHORIZED 401 #define XMPP_ERROR_PAYMENT_REQUIRED 402 #define XMPP_ERROR_FORBIDDEN 403 #define XMPP_ERROR_NOT_FOUND 404 #define XMPP_ERROR_NOT_ALLOWED 405 #define XMPP_ERROR_NOT_ACCEPTABLE 406 #define XMPP_ERROR_REGISTRATION_REQUIRED 407 #define XMPP_ERROR_REQUEST_TIMEOUT 408 #define XMPP_ERROR_CONFLICT 409 #define XMPP_ERROR_INTERNAL_SERVER_ERROR 500 #define XMPP_ERROR_NOT_IMPLEMENTED 501 #define XMPP_ERROR_REMOTE_SERVER_ERROR 502 #define XMPP_ERROR_SERVICE_UNAVAILABLE 503 #define XMPP_ERROR_REMOTE_SERVER_TIMEOUT 504 #define XMPP_ERROR_DISCONNECTED 510 #endif /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_helper.c000066400000000000000000000273461216603513500172650ustar00rootroot00000000000000/* * xmpp_helper.c -- Jabber protocol helper functions * * Copyright (C) 2008-2010 Frank Zschockelt * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include // snprintf #include "xmpp_helper.h" #include "settings.h" #include "utils.h" #include "caps.h" #include "logprint.h" #include "config.h" time_t iqlast; // last message/status change time extern char *imstatus_showmap[]; struct xmpp_error xmpp_errors[] = { {XMPP_ERROR_REDIRECT, "302", "Redirect", "redirect", "modify"}, {XMPP_ERROR_BAD_REQUEST, "400", "Bad Request", "bad-request", "modify"}, {XMPP_ERROR_NOT_AUTHORIZED, "401", "Not Authorized", "not-authorized", "auth"}, {XMPP_ERROR_PAYMENT_REQUIRED, "402", "Payment Required", "payment-required", "auth"}, {XMPP_ERROR_FORBIDDEN, "403", "Forbidden", "forbidden", "auth"}, {XMPP_ERROR_NOT_FOUND, "404", "Not Found", "item-not-found", "cancel"}, {XMPP_ERROR_NOT_ALLOWED, "405", "Not Allowed", "not-allowed", "cancel"}, {XMPP_ERROR_NOT_ACCEPTABLE, "406", "Not Acceptable", "not-acceptable", "modify"}, {XMPP_ERROR_REGISTRATION_REQUIRED, "407", "Registration required", "registration-required", "auth"}, {XMPP_ERROR_REQUEST_TIMEOUT, "408", "Request Timeout", "remote-server-timeout", "wait"}, {XMPP_ERROR_CONFLICT, "409", "Conflict", "conflict", "cancel"}, {XMPP_ERROR_INTERNAL_SERVER_ERROR, "500", "Internal Server Error", "internal-server-error", "wait"}, {XMPP_ERROR_NOT_IMPLEMENTED, "501", "Not Implemented", "feature-not-implemented", "cancel"}, {XMPP_ERROR_REMOTE_SERVER_ERROR, "502", "Remote Server Error", "service-unavailable", "wait"}, {XMPP_ERROR_SERVICE_UNAVAILABLE, "503", "Service Unavailable", "service-unavailable", "cancel"}, {XMPP_ERROR_REMOTE_SERVER_TIMEOUT, "504", "Remote Server Timeout", "remote-server-timeout", "wait"}, {XMPP_ERROR_DISCONNECTED, "510", "Disconnected", "service-unavailable", "cancel"}, {0, NULL, NULL, NULL, NULL} }; #ifdef MODULES_ENABLE static GSList *xmpp_additional_features = NULL; static char *ver, *ver_notavail; void xmpp_add_feature(const char *xmlns) { if (xmlns) { ver = NULL; ver_notavail = NULL; xmpp_additional_features = g_slist_append(xmpp_additional_features, g_strdup(xmlns)); } } void xmpp_del_feature(const char *xmlns) { GSList *feature = xmpp_additional_features; while (feature) { if (!strcmp(feature->data, xmlns)) { ver = NULL; ver_notavail = NULL; g_free(feature->data); xmpp_additional_features = g_slist_delete_link(xmpp_additional_features, feature); return; } feature = g_slist_next(feature); } } #endif const gchar* lm_message_node_get_child_value(LmMessageNode *node, const gchar *child) { LmMessageNode *tmp; tmp = lm_message_node_find_child(node, child); if (tmp) { const gchar *val = lm_message_node_get_value(tmp); return (val ? val : ""); } return NULL; } static LmMessageNode *hidden = NULL; void lm_message_node_hide(LmMessageNode *node) { LmMessageNode *parent = node->parent, *prev_sibling = node->prev; if (hidden) { hidden->children = hidden->next = hidden->prev = hidden->parent = NULL; lm_message_node_unref(hidden); } if (parent->children == node) parent->children = node->next; if (prev_sibling) prev_sibling->next = node->next; if (node->next) node->next->prev = prev_sibling; } // Maybe not a good idea, because it uses internals of loudmouth... // It's used for rosternotes/bookmarks LmMessageNode *lm_message_node_new(const gchar *name, const gchar *xmlns) { LmMessageNode *node; node = g_new0 (LmMessageNode, 1); node->name = g_strdup (name); node->value = NULL; node->raw_mode = FALSE; node->attributes = NULL; node->next = NULL; node->prev = NULL; node->parent = NULL; node->children = NULL; node->ref_count = 1; lm_message_node_set_attribute(node, "xmlns", xmlns); return node; } void lm_message_node_insert_childnode(LmMessageNode *node, LmMessageNode *child) { LmMessageNode *x; lm_message_node_deep_ref(child); if (node->children == NULL) node->children = child; else { for (x = node->children; x->next; x = x->next) ; x->next = child; } } void lm_message_node_deep_ref(LmMessageNode *node) { if (node == NULL) return; lm_message_node_ref(node); lm_message_node_deep_ref(node->next); lm_message_node_deep_ref(node->children); } const gchar* lm_message_get_from(LmMessage *m) { return lm_message_node_get_attribute(m->node, "from"); } const gchar* lm_message_get_id(LmMessage *m) { return lm_message_node_get_attribute(m->node, "id"); } LmMessage *lm_message_new_iq_from_query(LmMessage *m, LmMessageSubType type) { LmMessage *new; const char *from = lm_message_node_get_attribute(m->node, "from"); const char *id = lm_message_node_get_attribute(m->node, "id"); new = lm_message_new_with_sub_type(from, LM_MESSAGE_TYPE_IQ, type); if (id) lm_message_node_set_attribute(new->node, "id", id); return new; } // entity_version(enum imstatus status) // Return a static version string for Entity Capabilities. // It should be specific to the client version, please change the id // if you alter mcabber's disco support (or add something to the version // number) so that it doesn't conflict with the official client. const char *entity_version(enum imstatus status) { #ifndef MODULES_ENABLE static char *ver, *ver_notavail; #endif if (ver && (status != notavail)) return ver; if (ver_notavail) return ver_notavail; caps_add(""); caps_set_identity("", "client", PACKAGE_STRING, "pc"); caps_add_feature("", NS_DISCO_INFO); caps_add_feature("", NS_CAPS); caps_add_feature("", NS_MUC); // advertise ChatStates only if they aren't disabled if (!settings_opt_get_int("disable_chatstates")) caps_add_feature("", NS_CHATSTATES); caps_add_feature("", NS_TIME); caps_add_feature("", NS_XMPP_TIME); caps_add_feature("", NS_VERSION); caps_add_feature("", NS_PING); caps_add_feature("", NS_COMMANDS); caps_add_feature("", NS_RECEIPTS); caps_add_feature("", NS_X_CONFERENCE); if (!settings_opt_get_int("iq_last_disable") && (!settings_opt_get_int("iq_last_disable_when_notavail") || status != notavail)) caps_add_feature("", NS_LAST); #ifdef MODULES_ENABLE { GSList *el = xmpp_additional_features; while (el) { caps_add_feature("", el->data); el = g_slist_next(el); } } #endif if (status == notavail) { ver_notavail = caps_generate(); return ver_notavail; } ver = caps_generate(); return ver; } LmMessageNode *lm_message_node_find_xmlns(LmMessageNode *node, const char *xmlns) { LmMessageNode *x; const char *p; for (x = node->children ; x; x = x->next) { if ((p = lm_message_node_get_attribute(x, "xmlns")) && !strcmp(p, xmlns)) break; } return x; } time_t lm_message_node_get_timestamp(LmMessageNode *node) { LmMessageNode *x; const char *p; x = lm_message_node_find_xmlns(node, NS_XMPP_DELAY); if (x && (!strcmp(x->name, "delay")) && (p = lm_message_node_get_attribute(x, "stamp")) != NULL) return from_iso8601(p, 1); x = lm_message_node_find_xmlns(node, NS_DELAY); if (x && (p = lm_message_node_get_attribute(x, "stamp")) != NULL) return from_iso8601(p, 1); return 0; } // lm_message_new_presence(status, recipient, message) // Create an xmlnode with default presence attributes // Note: the caller must free the node after use LmMessage *lm_message_new_presence(enum imstatus st, const char *recipient, const char *msg) { unsigned int prio; LmMessage *x = lm_message_new(recipient, LM_MESSAGE_TYPE_PRESENCE); switch(st) { case away: case notavail: case dontdisturb: case freeforchat: lm_message_node_add_child(x->node, "show", imstatus_showmap[st]); break; #ifdef WITH_DEPRECATED_STATUS_INVISIBLE case invisible: lm_message_node_set_attribute(x->node, "type", "invisible"); break; #endif case offline: lm_message_node_set_attribute(x->node, "type", "unavailable"); break; default: break; } if (st == away || st == notavail) prio = settings_opt_get_int("priority_away"); else prio = settings_opt_get_int("priority"); if (prio) { char strprio[8]; snprintf(strprio, 8, "%d", (int)prio); lm_message_node_add_child(x->node, "priority", strprio); } if (msg) lm_message_node_add_child(x->node, "status", msg); return x; } static const char *defaulterrormsg(guint code) { int i; for (i = 0; xmpp_errors[i].code; ++i) { if (xmpp_errors[i].code == code) return xmpp_errors[i].meaning; } return NULL; } // display_server_error(x) // Display the error to the user // x: error tag xmlnode pointer void display_server_error(LmMessageNode *x, const char *from) { const char *desc = NULL, *errname = NULL, *s; char *sdesc, *tmp; if (!x) return; /* RFC3920: * The element: * o MUST contain a child element corresponding to one of the defined * stanza error conditions specified below; this element MUST be * qualified by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace. */ if (x->children) errname = x->children->name; if (from) scr_LogPrint(LPRINT_LOGNORM, "Received error packet [%s] from <%s>", (errname ? errname : ""), from); else scr_LogPrint(LPRINT_LOGNORM, "Received error packet [%s]", (errname ? errname : "")); // For backward compatibility if (!errname && ((s = lm_message_node_get_attribute(x, "code")) != NULL)) { // Default message desc = defaulterrormsg(atoi(s)); } // Error tag data is better, if available s = lm_message_node_get_value(x); if (s && *s) desc = s; // And sometimes there is a text message s = lm_message_node_get_child_value(x, "text"); if (s && *s) desc = s; // If we still have no description, let's give up if (!desc || !*desc) return; // Strip trailing newlines sdesc = g_strdup(desc); for (tmp = sdesc; *tmp; tmp++) ; if (tmp > sdesc) tmp--; while (tmp >= sdesc && (*tmp == '\n' || *tmp == '\r')) *tmp-- = '\0'; if (*sdesc) scr_LogPrint(LPRINT_LOGNORM, "Error message from server: %s", sdesc); g_free(sdesc); } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_helper.h000066400000000000000000000033221216603513500172560ustar00rootroot00000000000000#ifndef __MCABBER_XMPPHELPER_H__ #define __MCABBER_XMPPHELPER_H__ 1 #include #include #include #include #include extern time_t iqlast; /* last message/status change time */ struct T_presence { enum imstatus st; const char *msg; }; struct xmpp_error { guint code; const char *code_str; const char *meaning; const char *condition; const char *type; }; #ifdef MODULES_ENABLE void xmpp_add_feature (const char *xmlns); void xmpp_del_feature (const char *xmlns); #endif LmMessageNode *lm_message_node_new(const gchar *name, const gchar *xmlns); LmMessageNode *lm_message_node_find_xmlns(LmMessageNode *node, const char *xmlns); const gchar* lm_message_node_get_child_value(LmMessageNode *node, const gchar *child); void lm_message_node_hide(LmMessageNode *node); void lm_message_node_insert_childnode(LmMessageNode *node, LmMessageNode *child); void lm_message_node_deep_ref(LmMessageNode *node); time_t lm_message_node_get_timestamp(LmMessageNode *node); LmMessage *lm_message_new_iq_from_query(LmMessage *m, LmMessageSubType type); LmMessage *lm_message_new_presence(enum imstatus st, const char *recipient, const char *msg); const gchar* lm_message_get_from(LmMessage *m); const gchar* lm_message_get_id(LmMessage *m); void display_server_error(LmMessageNode *x, const char *from); /* XEP-0115 (Entity Capabilities) node */ const char *entity_version(enum imstatus status); #endif /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_iq.c000066400000000000000000000675401216603513500164170ustar00rootroot00000000000000/* * xmpp_iq.c -- Jabber protocol IQ-related stuff * * Copyright (C) 2008-2010 Frank Zschockelt * Copyright (C) 2005-2010 Mikael Berthe * Parts come from the centericq project: * Copyright (C) 2002-2005 by Konstantin Klyagin * Some small parts come from the Pidgin project * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include "xmpp_helper.h" #include "commands.h" #include "screen.h" #include "utils.h" #include "logprint.h" #include "settings.h" #include "caps.h" #include "main.h" extern struct xmpp_error xmpp_errors[]; static LmHandlerResult handle_iq_command_set_status(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); static LmHandlerResult handle_iq_command_leave_groupchats(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); inline double seconds_since_last_use(void); struct adhoc_command { char *name; char *description; bool only_for_self; LmHandleMessageFunction callback; }; const struct adhoc_command adhoc_command_list[] = { { "http://jabber.org/protocol/rc#set-status", "Change client status", 1, &handle_iq_command_set_status }, { "http://jabber.org/protocol/rc#leave-groupchats", "Leave groupchat(s)", 1, &handle_iq_command_leave_groupchats }, { NULL, NULL, 0, NULL }, }; struct adhoc_status { char *name; // the name used by adhoc char *description; char *status; // the string, used by setstus }; // It has to match imstatus of roster.h! const struct adhoc_status adhoc_status_list[] = { {"offline", "Offline", "offline"}, {"online", "Online", "avail"}, {"chat", "Chat", "free"}, {"dnd", "Do not disturb", "dnd"}, {"xd", "Extended away", "notavail"}, {"away", "Away", "away"}, #ifdef WITH_DEPRECATED_STATUS_INVISIBLE {"invisible", "Invisible", "invisible"}, #endif {NULL, NULL, NULL}, }; static char *generate_session_id(char *prefix) { char *result; static int counter = 0; counter++; // TODO better use timestamp? result = g_strdup_printf("%s-%i", prefix, counter); return result; } static LmMessage *lm_message_new_iq_error(LmMessage *m, guint error) { LmMessage *r; LmMessageNode *err; int i; for (i = 0; xmpp_errors[i].code; ++i) if (xmpp_errors[i].code == error) break; g_return_val_if_fail(xmpp_errors[i].code > 0, NULL); r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_ERROR); err = lm_message_node_add_child(r->node, "error", NULL); lm_message_node_set_attribute(err, "code", xmpp_errors[i].code_str); lm_message_node_set_attribute(err, "type", xmpp_errors[i].type); lm_message_node_set_attribute (lm_message_node_add_child(err, xmpp_errors[i].condition, NULL), "xmlns", NS_XMPP_STANZAS); return r; } void send_iq_error(LmConnection *c, LmMessage *m, guint error) { LmMessage *r; r = lm_message_new_iq_error(m, error); lm_connection_send(c, r, NULL); lm_message_unref(r); } static void lm_message_node_add_dataform_result(LmMessageNode *node, const char *message) { LmMessageNode *x, *field; x = lm_message_node_add_child(node, "x", NULL); lm_message_node_set_attributes(x, "type", "result", "xmlns", "jabber:x:data", NULL); field = lm_message_node_add_child(x, "field", NULL); lm_message_node_set_attributes(field, "type", "text-single", "var", "message", NULL); lm_message_node_add_child(field, "value", message); } // Dummy handler to ignore IQ response LmHandlerResult handle_iq_dummy(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessageSubType mstype = lm_message_get_sub_type(m); if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { display_server_error(lm_message_node_get_child(m->node, "error"), lm_message_get_from(m)); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult handle_iq_commands_list(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *iq; LmMessageNode *query; const char *requester_jid; const struct adhoc_command *command; const char *node; gboolean from_self; iq = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_COMMANDS); node = lm_message_node_get_attribute (lm_message_node_get_child(m->node, "query"), "node"); if (node) lm_message_node_set_attribute(query, "node", node); requester_jid = lm_message_get_from(m); from_self = jid_equal(lm_connection_get_jid(c), requester_jid); for (command = adhoc_command_list ; command->name ; command++) { if (!command->only_for_self || from_self) { lm_message_node_set_attributes (lm_message_node_add_child(query, "item", NULL), "node", command->name, "name", command->description, "jid", lm_connection_get_jid(c), NULL); } } lm_connection_send(c, iq, NULL); lm_message_unref(iq); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult handle_iq_command_set_status(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { const char *action, *node; char *sessionid; LmMessage *iq; LmMessageNode *command, *x, *y; const struct adhoc_status *s; x = lm_message_node_get_child(m->node, "command"); action = lm_message_node_get_attribute(x, "action"); node = lm_message_node_get_attribute(x, "node"); sessionid = (char *)lm_message_node_get_attribute(x, "sessionid"); iq = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); command = lm_message_node_add_child(iq->node, "command", NULL); lm_message_node_set_attribute(command, "node", node); lm_message_node_set_attribute(command, "xmlns", NS_COMMANDS); if (!sessionid) { sessionid = generate_session_id("set-status"); lm_message_node_set_attribute(command, "sessionid", sessionid); g_free(sessionid); sessionid = NULL; lm_message_node_set_attribute(command, "status", "executing"); x = lm_message_node_add_child(command, "x", NULL); lm_message_node_set_attribute(x, "type", "form"); lm_message_node_set_attribute(x, "xmlns", "jabber:x:data"); lm_message_node_add_child(x, "title", "Change Status"); lm_message_node_add_child(x, "instructions", "Choose the status and status message"); // TODO see if factorisation is possible y = lm_message_node_add_child(x, "field", NULL); lm_message_node_set_attribute(y, "type", "hidden"); lm_message_node_set_attribute(y, "var", "FORM_TYPE"); lm_message_node_add_child(y, "value", "http://jabber.org/protocol/rc"); y = lm_message_node_add_child(x, "field", NULL); lm_message_node_set_attributes(y, "type", "list-single", "var", "status", "label", "Status", NULL); lm_message_node_add_child(y, "required", NULL); // XXX: ugly lm_message_node_add_child(y, "value", adhoc_status_list[xmpp_getstatus()].name); for (s = adhoc_status_list; s->name; s++) { LmMessageNode *option = lm_message_node_add_child(y, "option", NULL); lm_message_node_add_child(option, "value", s->name); lm_message_node_set_attribute(option, "label", s->description); } // TODO add priority ? // I do not think this is useful, user should not have to care of the // priority like gossip and gajim do (misc) lm_message_node_set_attributes (lm_message_node_add_child(x, "field", NULL), "type", "text-multi", "var", "status-message", "label", "Message", NULL); } else if (action && !strcmp(action, "cancel")) { lm_message_node_set_attribute(command, "status", "canceled"); } else { // (if sessionid and not canceled) y = lm_message_node_find_xmlns(x, "jabber:x:data"); //x?xmlns=jabber:x:data if (y) { const char *value=NULL, *message=NULL; LmMessageNode *fields, *field; field = fields = lm_message_node_get_child(y, "field"); //field?var=status while (field && strcmp("status", lm_message_node_get_attribute(field, "var"))) field = field->next; field = lm_message_node_get_child(field, "value"); if (field) value = lm_message_node_get_value(field); field = fields; //field?var=status-message while (field && strcmp("status-message", lm_message_node_get_attribute(field, "var"))) field = field->next; field = lm_message_node_get_child(field, "value"); if (field) message = lm_message_node_get_value(field); if (value) { for (s = adhoc_status_list; !s->name || strcmp(s->name, value); s++); if (s->name) { char *status = g_strdup_printf("%s %s", s->status, message ? message : ""); cmd_setstatus(NULL, status); g_free(status); lm_message_node_set_attribute(command, "status", "completed"); lm_message_node_add_dataform_result(command, "Status has been changed"); } } } } if (sessionid) lm_message_node_set_attribute(command, "sessionid", sessionid); lm_connection_send(c, iq, NULL); lm_message_unref(iq); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static void _callback_foreach_buddy_groupchat(gpointer rosterdata, void *param) { LmMessageNode *field, *option; const char *room_jid, *nickname; char *desc; room_jid = buddy_getjid(rosterdata); if (!room_jid) return; nickname = buddy_getnickname(rosterdata); if (!nickname) return; field = param; option = lm_message_node_add_child(field, "option", NULL); lm_message_node_add_child(option, "value", room_jid); desc = g_strdup_printf("%s on %s", nickname, room_jid); lm_message_node_set_attribute(option, "label", desc); g_free(desc); } static LmHandlerResult handle_iq_command_leave_groupchats(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { const char *action, *node; char *sessionid; LmMessage *iq; LmMessageNode *command, *x; x = lm_message_node_get_child(m->node, "command"); action = lm_message_node_get_attribute(x, "action"); node = lm_message_node_get_attribute(x, "node"); sessionid = (char*)lm_message_node_get_attribute(x, "sessionid"); iq = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); command = lm_message_node_add_child(iq->node, "command", NULL); lm_message_node_set_attributes(command, "node", node, "xmlns", NS_COMMANDS, NULL); if (!sessionid) { LmMessageNode *field; sessionid = generate_session_id("leave-groupchats"); lm_message_node_set_attribute(command, "sessionid", sessionid); g_free(sessionid); sessionid = NULL; lm_message_node_set_attribute(command, "status", "executing"); x = lm_message_node_add_child(command, "x", NULL); lm_message_node_set_attributes(x, "type", "form", "xmlns", "jabber:x:data", NULL); lm_message_node_add_child(x, "title", "Leave groupchat(s)"); lm_message_node_add_child(x, "instructions", "What groupchats do you want to leave?"); field = lm_message_node_add_child(x, "field", NULL); lm_message_node_set_attributes(field, "type", "hidden", "var", "FORM_TYPE", NULL); lm_message_node_add_child(field, "value", "http://jabber.org/protocol/rc"); field = lm_message_node_add_child(x, "field", NULL); lm_message_node_set_attributes(field, "type", "list-multi", "var", "groupchats", "label", "Groupchats: ", NULL); lm_message_node_add_child(field, "required", NULL); foreach_buddy(ROSTER_TYPE_ROOM, &_callback_foreach_buddy_groupchat, field); // TODO: return an error if we are not connected to groupchats } else if (action && !strcmp(action, "cancel")) { lm_message_node_set_attribute(command, "status", "canceled"); } else { // (if sessionid and not canceled) LmMessageNode *form = lm_message_node_find_xmlns(x, "jabber:x:data");// TODO if (form) { LmMessageNode *field; lm_message_node_set_attribute(command, "status", "completed"); // TODO: implement sth. like "field?var=groupchats" in xmlnode... field = lm_message_node_get_child(form, "field"); while (field && strcmp("groupchats", lm_message_node_get_attribute(field, "var"))) field = field->next; if (field) for (x = field->children ; x ; x = x->next) { if (!strcmp (x->name, "value")) { GList* b = buddy_search_jid(lm_message_node_get_value(x)); if (b) cmd_room_leave(b->data, "Requested by remote command"); } } lm_message_node_add_dataform_result(command, "Groupchats have been left"); } } if (sessionid) lm_message_node_set_attribute(command, "sessionid", sessionid); lm_connection_send(c, iq, NULL); lm_message_unref(iq); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_commands(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { const char *requester_jid = NULL; LmMessageNode *cmd; const struct adhoc_command *command; // mcabber has only partial XEP-0146 support... if (LM_MESSAGE_SUB_TYPE_SET != lm_message_get_sub_type(m)) return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; requester_jid = lm_message_get_from(m); cmd = lm_message_node_get_child(m->node, "command"); if (jid_equal(lm_connection_get_jid(c), requester_jid)) { const char *action, *node; action = lm_message_node_get_attribute(cmd, "action"); node = lm_message_node_get_attribute(cmd, "node"); // action can be NULL, in which case it seems to take the default, // ie execute if (!action || !strcmp(action, "execute") || !strcmp(action, "cancel") || !strcmp(action, "next") || !strcmp(action, "complete")) { for (command = adhoc_command_list; command->name; command++) { if (!strcmp(node, command->name)) command->callback(h, c, m, ud); } // "prev" action will get there, as we do not implement it, // and do not authorize it } else { LmMessage *r; LmMessageNode *err; r = lm_message_new_iq_error(m, XMPP_ERROR_BAD_REQUEST); err = lm_message_node_get_child(r->node, "error"); lm_message_node_set_attribute (lm_message_node_add_child(err, "malformed-action", NULL), "xmlns", NS_COMMANDS); lm_connection_send(c, r, NULL); lm_message_unref(r); } } else { send_iq_error(c, m, XMPP_ERROR_FORBIDDEN); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_disco_items(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessageNode *query; const char *node; query = lm_message_node_get_child(m->node, "query"); node = lm_message_node_get_attribute(query, "node"); if (node) { if (!strcmp(node, NS_COMMANDS)) { return handle_iq_commands_list(NULL, c, m, ud); } else { send_iq_error(c, m, XMPP_ERROR_NOT_IMPLEMENTED); } } else { // not sure about this one send_iq_error(c, m, XMPP_ERROR_NOT_IMPLEMENTED); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } void _disco_add_feature_helper(gpointer data, gpointer user_data) { LmMessageNode *node = user_data; lm_message_node_set_attribute (lm_message_node_add_child(node, "feature", NULL), "var", data); } // disco_info_set_caps(ansquery, entitycaps) // Add features attributes to ansquery. entitycaps should either be a // valid capabilities hash or NULL. If it is NULL, the node attribute won't // be added to the query child and Entity Capabilities will be announced // as a feature. // Please change the entity version string if you modify mcabber disco // source code, so that it doesn't conflict with the upstream client. static void disco_info_set_caps(LmMessageNode *ansquery, const char *entitycaps) { if (entitycaps) { char *eversion; eversion = g_strdup_printf("%s#%s", MCABBER_CAPS_NODE, entitycaps); lm_message_node_set_attribute(ansquery, "node", eversion); g_free(eversion); } lm_message_node_set_attributes (lm_message_node_add_child(ansquery, "identity", NULL), "category", "client", "name", PACKAGE_STRING, "type", "pc", NULL); if (entitycaps) caps_foreach_feature(entitycaps, _disco_add_feature_helper, ansquery); else caps_foreach_feature(entity_version(xmpp_getstatus()), _disco_add_feature_helper, ansquery); } LmHandlerResult handle_iq_disco_info(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; LmMessageNode *query, *tmp; const char *node = NULL; const char *param = NULL; if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_RESULT) return LM_HANDLER_RESULT_REMOVE_MESSAGE; r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(r->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_DISCO_INFO); tmp = lm_message_node_find_child(m->node, "query"); if (tmp) { node = lm_message_node_get_attribute(tmp, "node"); param = node+strlen(MCABBER_CAPS_NODE)+1; } if (node && startswith(node, MCABBER_CAPS_NODE "#", FALSE)) disco_info_set_caps(query, param); // client#version else // Basic discovery request disco_info_set_caps(query, NULL); lm_connection_send(c, r, NULL); lm_message_unref(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_roster(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessageNode *y; const char *fjid, *name, *group, *sub, *ask; char *cleanalias; enum subscr esub; int need_refresh = FALSE; guint roster_type; y = lm_message_node_find_child(lm_message_node_find_xmlns(m->node, NS_ROSTER), "item"); for ( ; y; y = y->next) { char *name_tmp = NULL; fjid = lm_message_node_get_attribute(y, "jid"); name = lm_message_node_get_attribute(y, "name"); sub = lm_message_node_get_attribute(y, "subscription"); ask = lm_message_node_get_attribute(y, "ask"); if (lm_message_node_find_child(y, "group")) group = lm_message_node_get_value(lm_message_node_find_child(y, "group")); else group = NULL; if (!fjid) continue; cleanalias = jidtodisp(fjid); esub = sub_none; if (sub) { if (!strcmp(sub, "to")) esub = sub_to; else if (!strcmp(sub, "from")) esub = sub_from; else if (!strcmp(sub, "both")) esub = sub_both; else if (!strcmp(sub, "remove")) esub = sub_remove; } if (esub == sub_remove) { roster_del_user(cleanalias); scr_LogPrint(LPRINT_LOGNORM, "Buddy <%s> has been removed " "from the roster", cleanalias); g_free(cleanalias); need_refresh = TRUE; continue; } if (ask && !strcmp(ask, "subscribe")) esub |= sub_pending; if (!name) { if (!settings_opt_get_int("roster_hide_domain")) { name = cleanalias; } else { char *p; name = name_tmp = g_strdup(cleanalias); p = strchr(name_tmp, JID_DOMAIN_SEPARATOR); if (p) *p = '\0'; } } // Tricky... :-\ My guess is that if there is no JID_DOMAIN_SEPARATOR, // this is an agent. if (strchr(cleanalias, JID_DOMAIN_SEPARATOR)) roster_type = ROSTER_TYPE_USER; else roster_type = ROSTER_TYPE_AGENT; roster_add_user(cleanalias, name, group, roster_type, esub, 1); g_free(name_tmp); g_free(cleanalias); } // Acknowledge IQ message if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_SET) { LmMessage *result; result = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); lm_connection_send(c, result, NULL); lm_message_unref(result); } buddylist_build(); update_roster = TRUE; if (need_refresh) scr_update_buddy_window(); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_ping(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); lm_connection_send(c, r, NULL); lm_message_unref(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } double seconds_since_last_use(void) { return difftime(time(NULL), iqlast); } LmHandlerResult handle_iq_last(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; LmMessageNode *query; char *seconds; if (!settings_opt_get_int("iq_hide_requests")) { scr_LogPrint(LPRINT_LOGNORM, "Received an IQ last time request from <%s>", lm_message_get_from(m)); } if (settings_opt_get_int("iq_last_disable") || (settings_opt_get_int("iq_last_disable_when_notavail") && xmpp_getstatus() == notavail)) { send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(r->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_LAST); seconds = g_strdup_printf("%.0f", seconds_since_last_use()); lm_message_node_set_attribute(query, "seconds", seconds); g_free(seconds); lm_connection_send(c, r, NULL); lm_message_unref(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_version(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; LmMessageNode *query; char *os = NULL; char *ver = mcabber_version(); if (!settings_opt_get_int("iq_hide_requests")) { scr_LogPrint(LPRINT_LOGNORM, "Received an IQ version request from <%s>", lm_message_get_from(m)); } if (!settings_opt_get_int("iq_version_hide_os")) { struct utsname osinfo; uname(&osinfo); os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, osinfo.machine); } r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(r->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_VERSION); lm_message_node_add_child(query, "name", PACKAGE_NAME); lm_message_node_add_child(query, "version", ver); if (os) { lm_message_node_add_child(query, "os", os); g_free(os); } g_free(ver); lm_connection_send(c, r, NULL); lm_message_unref(r); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // This function borrows some code from the Pidgin project LmHandlerResult handle_iq_time(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; LmMessageNode *query; char *buf, *utf8_buf; time_t now_t; struct tm *now; time(&now_t); if (!settings_opt_get_int("iq_hide_requests")) { scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", lm_message_get_from(m)); } buf = g_new0(char, 512); r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(r->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_TIME); now = gmtime(&now_t); strftime(buf, 512, "%Y%m%dT%T", now); lm_message_node_add_child(query, "utc", buf); now = localtime(&now_t); strftime(buf, 512, "%Z", now); if ((utf8_buf = to_utf8(buf))) { lm_message_node_add_child(query, "tz", utf8_buf); g_free(utf8_buf); } strftime(buf, 512, "%d %b %Y %T", now); if ((utf8_buf = to_utf8(buf))) { lm_message_node_add_child(query, "display", utf8_buf); g_free(utf8_buf); } lm_connection_send(c, r, NULL); lm_message_unref(r); g_free(buf); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // This function borrows some code from the Pidgin project LmHandlerResult handle_iq_time202(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { LmMessage *r; LmMessageNode *query; char *buf, *utf8_buf; time_t now_t; struct tm *now; char const *sign; int diff = 0; time(&now_t); if (!settings_opt_get_int("iq_hide_requests")) { scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", lm_message_get_from(m)); } buf = g_new0(char, 512); r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); query = lm_message_node_add_child(r->node, "time", NULL); lm_message_node_set_attribute(query, "xmlns", NS_XMPP_TIME); now = localtime(&now_t); if (now->tm_isdst >= 0) { #if defined HAVE_TM_GMTOFF diff = now->tm_gmtoff; #elif defined HAVE_TIMEZONE tzset(); diff = -timezone; #endif } if (diff < 0) { sign = "-"; diff = -diff; } else { sign = "+"; } diff /= 60; snprintf(buf, 512, "%c%02d:%02d", *sign, diff / 60, diff % 60); if ((utf8_buf = to_utf8(buf))) { lm_message_node_add_child(query, "tzo", utf8_buf); g_free(utf8_buf); } now = gmtime(&now_t); strftime(buf, 512, "%Y-%m-%dT%TZ", now); lm_message_node_add_child(query, "utc", buf); lm_connection_send(c, r, NULL); lm_message_unref(r); g_free(buf); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } LmHandlerResult handle_iq_vcard(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) { send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_iq.h000066400000000000000000000034631216603513500164160ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_IQ_H__ #define __MCABBER_XMPP_IQ_H__ 1 LmHandlerResult handle_iq_dummy(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_commands(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_disco_items(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_disco_info(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_roster(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_ping(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_last(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_version(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_time(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_time202(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); LmHandlerResult handle_iq_vcard(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud); void send_iq_error(LmConnection *c, LmMessage *m, guint error); #endif /* __MCABBER_XMPP_IQ_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_iqrequest.c000066400000000000000000000644101216603513500200210ustar00rootroot00000000000000/* * xmpp_iqrequest.c -- Jabber IQ request handling * * Copyright (C) 2008-2010 Frank Zschockelt * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include #include "xmpp_helper.h" #include "xmpp_iq.h" #include "screen.h" #include "utils.h" #include "settings.h" #include "hooks.h" #include "hbuf.h" extern LmMessageNode *bookmarks; extern LmMessageNode *rosternotes; static LmHandlerResult cb_roster(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static LmHandlerResult cb_version(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static LmHandlerResult cb_time(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static LmHandlerResult cb_last(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static LmHandlerResult cb_ping(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static LmHandlerResult cb_vcard(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data); static struct IqRequestHandlers { const gchar *xmlns; const gchar *querytag; LmHandleMessageFunction handler; } iq_request_handlers[] = { {NS_ROSTER, "query", &cb_roster}, {NS_VERSION, "query", &cb_version}, {NS_XMPP_TIME,"time", &cb_time}, {NS_LAST, "query", &cb_last}, {NS_PING, "ping", &cb_ping}, {NS_VCARD, "vCard", &cb_vcard}, {NULL, NULL, NULL} }; // Enum for vCard attributes enum vcard_attr { vcard_home = 1<<0, vcard_work = 1<<1, vcard_postal = 1<<2, vcard_voice = 1<<3, vcard_fax = 1<<4, vcard_cell = 1<<5, vcard_inet = 1<<6, vcard_pref = 1<<7, }; static LmHandlerResult cb_ping(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { struct timeval *timestamp = (struct timeval *)user_data; struct timeval now; time_t dsec; suseconds_t dusec; const gchar *fjid; gchar *bjid, *mesg = NULL; gettimeofday(&now, NULL); dsec = now.tv_sec - timestamp->tv_sec; if (now.tv_usec < timestamp->tv_usec) { dusec = now.tv_usec + 1000000 - timestamp->tv_usec; --dsec; } else dusec = now.tv_usec - timestamp->tv_usec; // Check IQ result sender fjid = lm_message_get_from(m); if (!fjid) fjid = lm_connection_get_jid(lconnection); // No from means our JID... if (!fjid) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:version result (no sender name)."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } bjid = jidtodisp(fjid); switch (lm_message_get_sub_type(m)) { case LM_MESSAGE_SUB_TYPE_RESULT: mesg = g_strdup_printf("Pong from <%s>: %d second%s %d ms.", fjid, (int)dsec, dsec > 1 ? "s" : "", (int)(dusec/1000L)); break; case LM_MESSAGE_SUB_TYPE_ERROR: display_server_error(lm_message_node_get_child(m->node, "error"), fjid); mesg = g_strdup_printf("Ping to <%s> failed. " "Response time: %d second%s %d ms.", fjid, (int)dsec, dsec > 1 ? "s" : "", (int)(dusec/1000L)); break; default: g_free(bjid); return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; break; } if (mesg) scr_WriteIncomingMessage(bjid, mesg, 0, HBB_PREFIX_INFO, 0); g_free(mesg); g_free(bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Warning!! xmlns has to be a namespace from iq_request_handlers[].xmlns void xmpp_iq_request(const char *fulljid, const char *xmlns) { LmMessage *iq; LmMessageNode *query; LmMessageHandler *handler; gpointer data = NULL; GDestroyNotify notifier = NULL; GError *error = NULL; int i; iq = lm_message_new_with_sub_type(fulljid, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET); for (i = 0; iq_request_handlers[i].xmlns && strcmp(iq_request_handlers[i].xmlns, xmlns) != 0 ; ++i) ; query = lm_message_node_add_child(iq->node, iq_request_handlers[i].querytag, NULL); lm_message_node_set_attribute(query, "xmlns", xmlns); if (!g_strcmp0(xmlns, NS_PING)) { // Create handler for ping queries struct timeval *now = g_new(struct timeval, 1); gettimeofday(now, NULL); data = (gpointer)now; notifier = g_free; } handler = lm_message_handler_new(iq_request_handlers[i].handler, data, notifier); lm_connection_send_with_reply(lconnection, iq, handler, &error); lm_message_handler_unref(handler); lm_message_unref(iq); if (error) { scr_LogPrint(LPRINT_LOGNORM, "Error sending IQ request: %s.", error->message); g_error_free(error); } } // This callback is reached when mcabber receives the first roster update // after the connection. static LmHandlerResult cb_roster(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *x; const char *ns; // Only execute the hook if the roster has been successfully retrieved if (lm_message_get_sub_type(m) != LM_MESSAGE_SUB_TYPE_RESULT) return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; x = lm_message_node_find_child(m->node, "query"); if (!x) return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; ns = lm_message_node_get_attribute(x, "xmlns"); if (ns && !strcmp(ns, NS_ROSTER)) handle_iq_roster(NULL, c, m, user_data); // Post-login stuff hk_postconnect(); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult cb_version(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *ansqry; const char *p, *bjid; char *buf, *tmp; // Check IQ result sender bjid = lm_message_get_from(m); if (!bjid) bjid = lm_connection_get_jid(lconnection); // No from means our JID... if (!bjid) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:version result (no sender name)."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check for error message if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { scr_LogPrint(LPRINT_LOGNORM, "Received error IQ message (%s)", bjid); display_server_error(lm_message_node_get_child(m->node, "error"), NULL); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check message contents ansqry = lm_message_node_get_child(m->node, "query"); if (!ansqry) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:version result from <%s>!", bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } buf = g_strdup_printf("Received IQ:version result from <%s>", bjid); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); // bjid should now really be the "bare JID", let's strip the resource tmp = strchr(bjid, JID_RESOURCE_SEPARATOR); if (tmp) *tmp = '\0'; scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO, 0); g_free(buf); // Get result data... p = lm_message_node_get_child_value(ansqry, "name"); if (p && *p) { buf = g_strdup_printf("Name: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } p = lm_message_node_get_child_value(ansqry, "version"); if (p && *p) { buf = g_strdup_printf("Version: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } p = lm_message_node_get_child_value(ansqry, "os"); if (p && *p) { buf = g_strdup_printf("OS: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult cb_time(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *ansqry; const char *p, *bjid; char *buf, *tmp; // Check IQ result sender bjid = lm_message_get_from(m); if (!bjid) bjid = lm_connection_get_jid(lconnection); // No from means our JID... if (!bjid) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:time result (no sender name)."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check for error message if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { scr_LogPrint(LPRINT_LOGNORM, "Received error IQ message (%s)", bjid); display_server_error(lm_message_node_get_child(m->node, "error"), NULL); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check message contents ansqry = lm_message_node_get_child(m->node, "time"); if (!ansqry) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:time result from <%s>!", bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } buf = g_strdup_printf("Received IQ:time result from <%s>", bjid); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); // bjid should now really be the "bare JID", let's strip the resource tmp = strchr(bjid, JID_RESOURCE_SEPARATOR); if (tmp) *tmp = '\0'; scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO, 0); g_free(buf); // Get result data... p = lm_message_node_get_child_value(ansqry, "utc"); if (p && *p) { buf = g_strdup_printf("UTC: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } p = lm_message_node_get_child_value(ansqry, "tzo"); if (p && *p) { buf = g_strdup_printf("TZ: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } p = lm_message_node_get_child_value(ansqry, "display"); if (p && *p) { buf = g_strdup_printf("Time: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static LmHandlerResult cb_last(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *ansqry; const char *p, *bjid; char *buf, *tmp; // Check IQ result sender bjid = lm_message_get_from(m); if (!bjid) bjid = lm_connection_get_jid(lconnection); // No from means our JID... if (!bjid) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:last result (no sender name)."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check for error message if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { scr_LogPrint(LPRINT_LOGNORM, "Received error IQ message (%s)", bjid); display_server_error(lm_message_node_get_child(m->node, "error"), NULL); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check message contents ansqry = lm_message_node_get_child(m->node, "query"); if (!ansqry) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:version result from <%s>!", bjid); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } buf = g_strdup_printf("Received IQ:last result from <%s>", bjid); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); // bjid should now really be the "bare JID", let's strip the resource tmp = strchr(bjid, JID_RESOURCE_SEPARATOR); if (tmp) *tmp = '\0'; scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO, 0); g_free(buf); // Get result data... p = lm_message_node_get_attribute(ansqry, "seconds"); if (p) { long int s; GString *sbuf; sbuf = g_string_new("Idle time: "); s = atol(p); // Days if (s > 86400L) { g_string_append_printf(sbuf, "%ldd ", s/86400L); s %= 86400L; } // hh:mm:ss g_string_append_printf(sbuf, "%02ld:", s/3600L); s %= 3600L; g_string_append_printf(sbuf, "%02ld:%02ld", s/60L, s%60L); scr_WriteIncomingMessage(bjid, sbuf->str, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_string_free(sbuf, TRUE); } else { scr_WriteIncomingMessage(bjid, "No idle time reported.", 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); } p = lm_message_node_get_value(ansqry); if (p) { buf = g_strdup_printf("Status message: %s", p); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO, 0); g_free(buf); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static void display_vcard_item(const char *bjid, const char *label, enum vcard_attr vcard_attrib, const char *text) { char *buf; if (!text || !*text || !bjid || !label) return; buf = g_strdup_printf("%s: %s%s%s%s%s%s%s%s%s%s", label, (vcard_attrib & vcard_home ? "[home]" : ""), (vcard_attrib & vcard_work ? "[work]" : ""), (vcard_attrib & vcard_postal ? "[postal]" : ""), (vcard_attrib & vcard_voice ? "[voice]" : ""), (vcard_attrib & vcard_fax ? "[fax]" : ""), (vcard_attrib & vcard_cell ? "[cell]" : ""), (vcard_attrib & vcard_inet ? "[inet]" : ""), (vcard_attrib & vcard_pref ? "[pref]" : ""), (vcard_attrib ? " " : ""), text); scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0); g_free(buf); } static void handle_vcard_node(const char *barejid, LmMessageNode *vcardnode) { LmMessageNode *x; const char *p; for (x = vcardnode->children ; x; x = x->next) { const char *data; enum vcard_attr vcard_attrib = 0; p = x->name; if (!p) continue; data = lm_message_node_get_value(x); if (!strcmp(p, "FN")) display_vcard_item(barejid, "Name", vcard_attrib, data); else if (!strcmp(p, "NICKNAME")) display_vcard_item(barejid, "Nickname", vcard_attrib, data); else if (!strcmp(p, "URL")) display_vcard_item(barejid, "URL", vcard_attrib, data); else if (!strcmp(p, "BDAY")) display_vcard_item(barejid, "Birthday", vcard_attrib, data); else if (!strcmp(p, "TZ")) display_vcard_item(barejid, "Timezone", vcard_attrib, data); else if (!strcmp(p, "TITLE")) display_vcard_item(barejid, "Title", vcard_attrib, data); else if (!strcmp(p, "ROLE")) display_vcard_item(barejid, "Role", vcard_attrib, data); else if (!strcmp(p, "DESC")) display_vcard_item(barejid, "Comment", vcard_attrib, data); else if (!strcmp(p, "N")) { data = lm_message_node_get_child_value(x, "FAMILY"); display_vcard_item(barejid, "Family Name", vcard_attrib, data); data = lm_message_node_get_child_value(x, "GIVEN"); display_vcard_item(barejid, "Given Name", vcard_attrib, data); data = lm_message_node_get_child_value(x, "MIDDLE"); display_vcard_item(barejid, "Middle Name", vcard_attrib, data); } else if (!strcmp(p, "ORG")) { data = lm_message_node_get_child_value(x, "ORGNAME"); display_vcard_item(barejid, "Organisation name", vcard_attrib, data); data = lm_message_node_get_child_value(x, "ORGUNIT"); display_vcard_item(barejid, "Organisation unit", vcard_attrib, data); } else { // The HOME, WORK and PREF attributes are common to the remaining fields // (ADR, TEL & EMAIL) if (lm_message_node_get_child(x, "HOME")) vcard_attrib |= vcard_home; if (lm_message_node_get_child(x, "WORK")) vcard_attrib |= vcard_work; if (lm_message_node_get_child(x, "PREF")) vcard_attrib |= vcard_pref; if (!strcmp(p, "ADR")) { // Address if (lm_message_node_get_child(x, "POSTAL")) vcard_attrib |= vcard_postal; data = lm_message_node_get_child_value(x, "EXTADD"); display_vcard_item(barejid, "Addr (ext)", vcard_attrib, data); data = lm_message_node_get_child_value(x, "STREET"); display_vcard_item(barejid, "Street", vcard_attrib, data); data = lm_message_node_get_child_value(x, "LOCALITY"); display_vcard_item(barejid, "Locality", vcard_attrib, data); data = lm_message_node_get_child_value(x, "REGION"); display_vcard_item(barejid, "Region", vcard_attrib, data); data = lm_message_node_get_child_value(x, "PCODE"); display_vcard_item(barejid, "Postal code", vcard_attrib, data); data = lm_message_node_get_child_value(x, "CTRY"); display_vcard_item(barejid, "Country", vcard_attrib, data); } else if (!strcmp(p, "TEL")) { // Telephone data = lm_message_node_get_child_value(x, "NUMBER"); if (data) { if (lm_message_node_get_child(x, "VOICE")) vcard_attrib |= vcard_voice; if (lm_message_node_get_child(x, "FAX")) vcard_attrib |= vcard_fax; if (lm_message_node_get_child(x, "CELL")) vcard_attrib |= vcard_cell; display_vcard_item(barejid, "Phone", vcard_attrib, data); } } else if (!strcmp(p, "EMAIL")) { // Email if (lm_message_node_get_child(x, "INTERNET")) vcard_attrib |= vcard_inet; data = lm_message_node_get_child_value(x, "USERID"); display_vcard_item(barejid, "Email", vcard_attrib, data); } } } } static LmHandlerResult cb_vcard(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *ansqry; const char *bjid; char *buf, *tmp; // Check IQ result sender bjid = lm_message_get_from(m); if (!bjid) bjid = lm_connection_get_jid(lconnection); // No from means our JID... if (!bjid) { scr_LogPrint(LPRINT_LOGNORM, "Invalid IQ:vCard result (no sender name)."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Check for error message if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { scr_LogPrint(LPRINT_LOGNORM, "Received error IQ message (%s)", bjid); display_server_error(lm_message_node_get_child(m->node, "error"), NULL); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } buf = g_strdup_printf("Received IQ:vCard result from <%s>", bjid); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); // Get the vCard node ansqry = lm_message_node_get_child(m->node, "vCard"); if (!ansqry) { scr_LogPrint(LPRINT_LOGNORM, "Empty IQ:vCard result!"); g_free(buf); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // bjid should really be the "bare JID", let's strip the resource tmp = strchr(bjid, JID_RESOURCE_SEPARATOR); if (tmp) *tmp = '\0'; scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_INFO, 0); g_free(buf); // Get result data... handle_vcard_node(bjid, ansqry); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } static void storage_bookmarks_parse_conference(LmMessageNode *node) { const char *fjid, *name, *autojoin; const char *pstatus, *awhois, *fjoins, *group; char *bjid; GSList *room_elt; fjid = lm_message_node_get_attribute(node, "jid"); if (!fjid) return; name = lm_message_node_get_attribute(node, "name"); autojoin = lm_message_node_get_attribute(node, "autojoin"); awhois = lm_message_node_get_attribute(node, "autowhois"); pstatus = lm_message_node_get_child_value(node, "print_status"); fjoins = lm_message_node_get_child_value(node, "flag_joins"); group = lm_message_node_get_child_value(node, "group"); bjid = jidtodisp(fjid); // Bare jid // Make sure this is a room (it can be a conversion user->room) room_elt = roster_find(bjid, jidsearch, 0); if (!room_elt) { room_elt = roster_add_user(bjid, name, group, ROSTER_TYPE_ROOM, sub_none, -1); } else { buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); /* // If the name is available, should we use it? // I don't think so, it would be confusing because this item is already // in the roster. if (name) buddy_setname(room_elt->data, name); // The same question for roster group. if (group) buddy_setgroup(room_elt->data, group); */ } // Set the print_status and auto_whois values if (pstatus) { enum room_printstatus i; for (i = status_none; i <= status_all; i++) if (!strcasecmp(pstatus, strprintstatus[i])) break; if (i <= status_all) buddy_setprintstatus(room_elt->data, i); } if (awhois) { enum room_autowhois i = autowhois_default; if (!strcmp(awhois, "1") || !(strcmp(awhois, "true"))) i = autowhois_on; else if (!strcmp(awhois, "0") || !(strcmp(awhois, "false"))) i = autowhois_off; if (i != autowhois_default) buddy_setautowhois(room_elt->data, i); } if (fjoins) { enum room_flagjoins i; for (i = flagjoins_none; i <= flagjoins_all; i++) if (!strcasecmp(fjoins, strflagjoins[i])) break; if (i <= flagjoins_all) buddy_setflagjoins(room_elt->data, i); } // Is autojoin set? // If it is, we'll look up for more information (nick? password?) and // try to join the room. if (autojoin && (!strcmp(autojoin, "1") || !strcmp(autojoin, "true"))) { const char *nick, *passwd; char *tmpnick = NULL; nick = lm_message_node_get_child_value(node, "nick"); passwd = lm_message_node_get_child_value(node, "password"); if (!nick || !*nick) nick = tmpnick = default_muc_nickname(NULL); // Let's join now scr_LogPrint(LPRINT_LOGNORM, "Auto-join bookmark <%s>", bjid); xmpp_room_join(bjid, nick, passwd); g_free(tmpnick); } g_free(bjid); buddylist_build(); update_roster = TRUE; } static LmHandlerResult cb_storage_bookmarks(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *x, *ansqry; char *p = NULL; if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { LmMessageNode *error = lm_message_node_get_child(m->node, "error"); // No server support, or no bookmarks? if (error && error->children) p = error->children->name; if (p && !strcmp(p, "item-not-found")) { // item-no-found means the server has Private Storage, but it's // currently empty. if (bookmarks) lm_message_node_unref(bookmarks); bookmarks = lm_message_node_new("storage", "storage:bookmarks"); // We return 0 so that the IQ error message be // not displayed, as it isn't a real error. } else scr_LogPrint(LPRINT_LOGNORM, "Server does not support bookmarks storage."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } ansqry = lm_message_node_get_child(m->node, "query"); ansqry = lm_message_node_get_child(ansqry, "storage"); if (!ansqry) { scr_LogPrint(LPRINT_LOG, "Invalid IQ:private result! (storage:bookmarks)"); return 0; } // Walk through the storage tags for (x = ansqry->children ; x; x = x->next) { // If the current node is a conference item, parse it and update the roster if (x->name && !strcmp(x->name, "conference")) storage_bookmarks_parse_conference(x); } // "Copy" the bookmarks node if (bookmarks) lm_message_node_unref(bookmarks); lm_message_node_deep_ref(ansqry); bookmarks = ansqry; return 0; } static LmHandlerResult cb_storage_rosternotes(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer user_data) { LmMessageNode *ansqry; if (lm_message_get_sub_type(m) == LM_MESSAGE_SUB_TYPE_ERROR) { const char *p = NULL; LmMessageNode *error = lm_message_node_get_child(m->node, "error"); // No server support, or no roster notes? if (error && error->children) p = error->children->name; if (p && !strcmp(p, "item-not-found")) { // item-no-found means the server has Private Storage, but it's // currently empty. if (rosternotes) lm_message_node_unref(rosternotes); rosternotes = lm_message_node_new("storage", "storage:rosternotes"); // We return 0 so that the IQ error message be // not displayed, as it isn't a real error. } else scr_LogPrint(LPRINT_LOGNORM, "Server does not support roster notes storage."); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } ansqry = lm_message_node_get_child(m->node, "query"); ansqry = lm_message_node_get_child(ansqry, "storage"); if (!ansqry) { scr_LogPrint(LPRINT_LOG, "Invalid IQ:private result! " "(storage:rosternotes)"); return LM_HANDLER_RESULT_REMOVE_MESSAGE; } // Copy the rosternotes node if (rosternotes) lm_message_node_unref(rosternotes); lm_message_node_deep_ref(ansqry); rosternotes = ansqry; return 0; } static struct IqRequestStorageHandlers { const gchar *storagens; LmHandleMessageFunction handler; } iq_request_storage_handlers[] = { {"storage:rosternotes", &cb_storage_rosternotes}, {"storage:bookmarks", &cb_storage_bookmarks}, {NULL, NULL} }; void xmpp_request_storage(const gchar *storage) { LmMessage *iq; LmMessageNode *query; LmMessageHandler *handler; int i; iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_PRIVATE); lm_message_node_set_attribute(lm_message_node_add_child (query, "storage", NULL), "xmlns", storage); for (i = 0; strcmp(iq_request_storage_handlers[i].storagens, storage) != 0; ++i) ; handler = lm_message_handler_new(iq_request_storage_handlers[i].handler, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_iqrequest.h000066400000000000000000000004011216603513500200140ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_IQREQUEST_H__ #define __MCABBER_XMPP_IQREQUEST_H__ 1 void xmpp_iq_request(const char *fulljid, const char *xmlns); #endif /* __MCABBER_XMPP_IQREQUEST_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_muc.c000066400000000000000000000751241216603513500165670ustar00rootroot00000000000000/* * xmpp_muc.c -- Jabber MUC protocol handling * * Copyright (C) 2008-2010 Frank Zschockelt * Copyright (C) 2005-2010 Mikael Berthe * Copyright (C) 2010 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include #include #include "xmpp_helper.h" #include "xmpp_iq.h" #include "xmpp_muc.h" #include "events.h" #include "hooks.h" #include "screen.h" #include "hbuf.h" #include "roster.h" #include "commands.h" #include "settings.h" #include "utils.h" #include "histolog.h" extern enum imstatus mystatus; extern gchar *mystatusmsg; static GSList *invitations = NULL; static void decline_invitation(event_muc_invitation *invitation, const char *reason) { // cut and paste from xmpp_room_invite LmMessage *m; LmMessageNode *x, *y; if (!invitation) return; if (!invitation->to || !invitation->from) return; m = lm_message_new(invitation->to, LM_MESSAGE_TYPE_MESSAGE); x = lm_message_node_add_child(m->node, "x", NULL); lm_message_node_set_attribute(x, "xmlns", NS_MUC_USER); y = lm_message_node_add_child(x, "decline", NULL); lm_message_node_set_attribute(y, "to", invitation->from); if (reason) lm_message_node_add_child(y, "reason", reason); lm_connection_send(lconnection, m, NULL); lm_message_unref(m); } void destroy_event_muc_invitation(event_muc_invitation *invitation) { invitations = g_slist_remove(invitations, invitation); g_free(invitation->to); g_free(invitation->from); g_free(invitation->passwd); g_free(invitation->reason); g_free(invitation->evid); g_free(invitation); } // invitation event handler // TODO: if event is accepted, check if other events to the same room exist and // destroy them? (need invitation registry list for that) static gboolean evscallback_invitation(guint evcontext, const char *arg, gpointer userdata) { event_muc_invitation *invitation = userdata; // Sanity check if (G_UNLIKELY(!invitation)) { // Shouldn't happen. scr_LogPrint(LPRINT_LOGNORM, "Error in evs callback."); return FALSE; } if (evcontext == EVS_CONTEXT_TIMEOUT) { scr_LogPrint(LPRINT_LOGNORM, "Invitation event %s timed out, cancelled.", invitation->to); return FALSE; } if (evcontext == EVS_CONTEXT_CANCEL) { scr_LogPrint(LPRINT_LOGNORM, "Invitation event %s cancelled.", invitation->to); return FALSE; } if (!(evcontext == EVS_CONTEXT_ACCEPT || evcontext == EVS_CONTEXT_REJECT)) return FALSE; // Ok, let's work now if (evcontext == EVS_CONTEXT_ACCEPT) { char *nickname = default_muc_nickname(invitation->to); xmpp_room_join(invitation->to, nickname, invitation->passwd); g_free(nickname); } else { scr_LogPrint(LPRINT_LOGNORM, "Invitation to %s refused.", invitation->to); if (invitation->reply) decline_invitation(invitation, arg); } return FALSE; } // Join a MUC room void xmpp_room_join(const char *room, const char *nickname, const char *passwd) { LmMessage *x; LmMessageNode *y; gchar *roomid; GSList *room_elt; if (!xmpp_is_online() || !room) return; if (!nickname) return; roomid = g_strdup_printf("%s/%s", room, nickname); if (check_jid_syntax(roomid)) { scr_LogPrint(LPRINT_NORMAL, "<%s/%s> is not a valid Jabber room", room, nickname); g_free(roomid); return; } room_elt = roster_find(room, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_ROOM); // Add room if it doesn't already exist if (!room_elt) { room_elt = roster_add_user(room, NULL, NULL, ROSTER_TYPE_ROOM, sub_none, -1); } else { // Make sure this is a room (it can be a conversion user->room) buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); } // If insideroom is TRUE, this is a nickname change and we don't care here if (!buddy_getinsideroom(room_elt->data)) { // We're trying to enter a room buddy_setnickname(room_elt->data, nickname); } // Send the XML request x = lm_message_new_presence(mystatus, roomid, mystatusmsg); xmpp_insert_entity_capabilities(x->node, mystatus); // Entity Caps (XEP-0115) y = lm_message_node_add_child(x->node, "x", NULL); lm_message_node_set_attribute(y, "xmlns", NS_MUC); if (passwd) lm_message_node_add_child(y, "password", passwd); lm_connection_send(lconnection, x, NULL); lm_message_unref(x); g_free(roomid); } // Invite a user to a MUC room // room syntax: "room@server" // reason can be null. void xmpp_room_invite(const char *room, const char *fjid, const char *reason) { LmMessage *msg; LmMessageNode *x, *y; if (!xmpp_is_online() || !room || !fjid) return; msg = lm_message_new(room, LM_MESSAGE_TYPE_MESSAGE); x = lm_message_node_add_child(msg->node, "x", NULL); lm_message_node_set_attribute(x, "xmlns", NS_MUC_USER); y = lm_message_node_add_child(x, "invite", NULL); lm_message_node_set_attribute(y, "to", fjid); if (reason) lm_message_node_add_child(y, "reason", reason); lm_connection_send(lconnection, msg, NULL); lm_message_unref(msg); } int xmpp_room_setattrib(const char *roomid, const char *fjid, const char *nick, struct role_affil ra, const char *reason) { LmMessage *iq; LmMessageHandler *handler; LmMessageNode *query, *x; if (!xmpp_is_online() || !roomid) return 1; if (!fjid && !nick) return 1; if (check_jid_syntax((char*)roomid)) { scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber id", roomid); return 1; } if (fjid && check_jid_syntax((char*)fjid)) { scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber id", fjid); return 1; } if (ra.type == type_affil && ra.val.affil == affil_outcast && !fjid) return 1; // Shouldn't happen (jid mandatory when banning) iq = lm_message_new_with_sub_type(roomid, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_MUC_ADMIN); x = lm_message_node_add_child(query, "item", NULL); if (fjid) { lm_message_node_set_attribute(x, "jid", fjid); } else { // nickname lm_message_node_set_attribute(x, "nick", nick); } if (ra.type == type_affil) lm_message_node_set_attribute(x, "affiliation", straffil[ra.val.affil]); else if (ra.type == type_role) lm_message_node_set_attribute(x, "role", strrole[ra.val.role]); if (reason) lm_message_node_add_child(x, "reason", reason); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); return 0; } // Unlock a MUC room // room syntax: "room@server" void xmpp_room_unlock(const char *room) { LmMessageNode *node; LmMessageHandler *handler; LmMessage *iq; if (!xmpp_is_online() || !room) return; iq = lm_message_new_with_sub_type(room, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); node = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(node, "xmlns", NS_MUC_OWNER); node = lm_message_node_add_child(node, "x", NULL); lm_message_node_set_attributes(node, "xmlns", "jabber:x:data", "type", "submit", NULL); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); } // Destroy a MUC room // room syntax: "room@server" void xmpp_room_destroy(const char *room, const char *venue, const char *reason) { LmMessage *iq; LmMessageHandler *handler; LmMessageNode *query, *x; if (!xmpp_is_online() || !room) return; iq = lm_message_new_with_sub_type(room, LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_SET); query = lm_message_node_add_child(iq->node, "query", NULL); lm_message_node_set_attribute(query, "xmlns", NS_MUC_OWNER); x = lm_message_node_add_child(query, "destroy", NULL); if (venue && *venue) lm_message_node_set_attribute(x, "jid", venue); if (reason) lm_message_node_add_child(x, "reason", reason); handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); lm_connection_send_with_reply(lconnection, iq, handler, NULL); lm_message_handler_unref(handler); lm_message_unref(iq); } // muc_get_item_info(...) // Get room member's information from xmlndata. // The variables must be initialized before calling this function, // because they are not touched if the relevant information is missing. static void muc_get_item_info(const char *from, LmMessageNode *xmldata, enum imrole *mbrole, enum imaffiliation *mbaffil, const char **mbjid, const char **mbnick, const char **actorjid, const char **reason) { LmMessageNode *y, *z; const char *p; y = lm_message_node_find_child(xmldata, "item"); if (!y) return; p = lm_message_node_get_attribute(y, "affiliation"); if (p) { if (!strcmp(p, "owner")) *mbaffil = affil_owner; else if (!strcmp(p, "admin")) *mbaffil = affil_admin; else if (!strcmp(p, "member")) *mbaffil = affil_member; else if (!strcmp(p, "outcast")) *mbaffil = affil_outcast; else if (!strcmp(p, "none")) *mbaffil = affil_none; else scr_LogPrint(LPRINT_LOGNORM, "<%s>: Unknown affiliation \"%s\"", from, p); } p = lm_message_node_get_attribute(y, "role"); if (p) { if (!strcmp(p, "moderator")) *mbrole = role_moderator; else if (!strcmp(p, "participant")) *mbrole = role_participant; else if (!strcmp(p, "visitor")) *mbrole = role_visitor; else if (!strcmp(p, "none")) *mbrole = role_none; else scr_LogPrint(LPRINT_LOGNORM, "<%s>: Unknown role \"%s\"", from, p); } *mbjid = lm_message_node_get_attribute(y, "jid"); *mbnick = lm_message_node_get_attribute(y, "nick"); // For kick/ban, there can be actor and reason tags *reason = lm_message_node_get_child_value(y, "reason"); if (*reason && !**reason) *reason = NULL; z = lm_message_node_find_child(y, "actor"); if (z) *actorjid = lm_message_node_get_attribute(z, "jid"); } // muc_handle_join(...) // Handle a join event in a MUC room. // This function will return the new_member value TRUE if somebody else joins // the room (and FALSE if _we_ are joining the room). static bool muc_handle_join(const GSList *room_elt, const char *rname, const char *roomjid, const char *ournick, enum room_printstatus printstatus, time_t usttime, int log_muc_conf, enum room_autowhois autowhois, const char *mbjid) { bool new_member = FALSE; // True if somebody else joins the room (not us) gchar *nickjid; gchar *mbuf; enum room_flagjoins flagjoins; char *tmp = NULL; int printjid; printjid = settings_opt_get_int("muc_print_jid"); if (mbjid && autowhois == autowhois_off && printjid) { if (printjid == 1) tmp = strchr(mbjid, JID_RESOURCE_SEPARATOR); if (tmp) *tmp = '\0'; nickjid = g_strdup_printf("%s <%s>", rname, mbjid); if (tmp) *tmp = JID_RESOURCE_SEPARATOR; } else { nickjid = g_strdup(rname); } if (!buddy_getinsideroom(room_elt->data)) { // We weren't inside the room yet. Now we are. // However, this could be a presence packet from another room member buddy_setinsideroom(room_elt->data, TRUE); // Set the message flag unless we're already in the room buffer window scr_setmsgflag_if_needed(roomjid, FALSE); // Add a message to the tracelog file mbuf = g_strdup_printf("You have joined %s as \"%s\"", roomjid, ournick); scr_LogPrint(LPRINT_LOGNORM, "%s", mbuf); g_free(mbuf); mbuf = g_strdup_printf("You have joined as \"%s\"", ournick); // The 1st presence message could be for another room member if (strcmp(ournick, rname)) { // Display current mbuf and create a new message for the member // Note: the usttime timestamp is related to the other member, // so we use 0 here. scr_WriteIncomingMessage(roomjid, mbuf, 0, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); if (log_muc_conf) hlog_write_message(roomjid, 0, -1, mbuf); g_free(mbuf); if (printstatus != status_none) mbuf = g_strdup_printf("%s has joined", nickjid); else mbuf = NULL; new_member = TRUE; } } else { mbuf = NULL; if (strcmp(ournick, rname)) { if (printstatus != status_none) mbuf = g_strdup_printf("%s has joined", nickjid); new_member = TRUE; } } g_free(nickjid); if (mbuf) { guint msgflags = HBB_PREFIX_INFO; flagjoins = buddy_getflagjoins(room_elt->data); if (flagjoins == flagjoins_default && !settings_opt_get_int("muc_flag_joins")) flagjoins = flagjoins_none; if (flagjoins == flagjoins_none) msgflags |= HBB_PREFIX_NOFLAG; scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); if (log_muc_conf) hlog_write_message(roomjid, 0, -1, mbuf); g_free(mbuf); } return new_member; } void handle_muc_presence(const char *from, LmMessageNode *xmldata, const char *roomjid, const char *rname, enum imstatus ust, const char *ustmsg, time_t usttime, char bpprio) { char *mbuf; const char *ournick; enum imrole mbrole = role_none; enum imaffiliation mbaffil = affil_none; enum room_printstatus printstatus; enum room_autowhois autowhois; enum room_flagjoins flagjoins; const char *mbjid = NULL, *mbnick = NULL; const char *actorjid = NULL, *reason = NULL; bool new_member = FALSE; // True if somebody else joins the room (not us) bool our_presence = FALSE; // True if this presence is from us (i.e. bears // code 110) guint statuscode = 0; guint nickchange = 0; GSList *room_elt; int log_muc_conf; guint msgflags; log_muc_conf = settings_opt_get_int("log_muc_conf"); room_elt = roster_find(roomjid, jidsearch, 0); if (!room_elt) { // Add room if it doesn't already exist // It shouldn't happen, there is probably something wrong (server or // network issue?) room_elt = roster_add_user(roomjid, NULL, NULL, ROSTER_TYPE_ROOM, sub_none, -1); scr_LogPrint(LPRINT_LOGNORM, "Strange MUC presence message"); } else { // Make sure this is a room (it can be a conversion user->room) buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); } // Get room member's information muc_get_item_info(from, xmldata, &mbrole, &mbaffil, &mbjid, &mbnick, &actorjid, &reason); // Get our room nickname ournick = buddy_getnickname(room_elt->data); if (!ournick) { // It shouldn't happen, probably a server issue const gchar msg[] = "Unexpected groupchat packet!"; scr_LogPrint(LPRINT_LOGNORM, msg); scr_WriteIncomingMessage(roomjid, msg, 0, HBB_PREFIX_INFO, 0); // Send back an unavailable packet xmpp_setstatus(offline, roomjid, "", TRUE); scr_draw_roster(); return; } #define SETSTATUSCODE(VALUE) \ { \ if (G_UNLIKELY(statuscode)) \ scr_LogPrint(LPRINT_DEBUG, "handle_muc_presence: WARNING: " \ "replacing status code %u with %u.", statuscode, VALUE); \ statuscode = VALUE; \ } { // Get the status code LmMessageNode *node; for (node = xmldata -> children; node; node = node -> next) { if (!g_strcmp0(node -> name, "status")) { const char *codestr = lm_message_node_get_attribute(node, "code"); if (codestr) { const char *mesg = NULL; switch (atoi(codestr)) { // initial case 100: mesg = "The room is not anonymous."; break; case 110: // It is our presence our_presence = TRUE; break; // initial case 170: mesg = "The room is logged."; break; // initial case 201: // Room created SETSTATUSCODE(201); break; // initial case 210: // Your nick change (on join) // FIXME: print nick mesg = "The room has changed your nick!"; buddy_setnickname(room_elt->data, rname); ournick = rname; break; case 301: // User banned SETSTATUSCODE(301); break; case 303: // Nick change SETSTATUSCODE(303); break; case 307: // User kicked SETSTATUSCODE(307); break; // XXX (next three) case 321: mesg = "User leaves room due to affilation change."; break; case 322: mesg = "User leaves room, as room is only for members now."; break; case 332: mesg = "User leaves room due to system shutdown."; break; default: scr_LogPrint(LPRINT_DEBUG, "handle_muc_presence: Unknown MUC status code: %s.", codestr); break; } if (mesg) { scr_WriteIncomingMessage(roomjid, mesg, usttime, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); if (log_muc_conf) hlog_write_message(roomjid, 0, -1, mesg); } } } } } #undef SETSTATUSCODE if (!our_presence) if (ournick && !strcmp(ournick, rname)) our_presence = TRUE; // Get the room's "print_status" settings printstatus = buddy_getprintstatus(room_elt->data); if (printstatus == status_default) { printstatus = (guint) settings_opt_get_int("muc_print_status"); if (printstatus > 3) printstatus = status_default; } // A new room has been created; accept MUC default config if (statuscode == 201) xmpp_room_unlock(roomjid); // Check for nickname change if (statuscode == 303 && mbnick) { mbuf = g_strdup_printf("%s is now known as %s", rname, mbnick); scr_WriteIncomingMessage(roomjid, mbuf, usttime, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); if (log_muc_conf) hlog_write_message(roomjid, 0, -1, mbuf); g_free(mbuf); buddy_resource_setname(room_elt->data, rname, mbnick); // Maybe it's _our_ nickname... if (our_presence) buddy_setnickname(room_elt->data, mbnick); nickchange = TRUE; } autowhois = buddy_getautowhois(room_elt->data); if (autowhois == autowhois_default) autowhois = (settings_opt_get_int("muc_auto_whois") ? autowhois_on : autowhois_off); // Check for departure/arrival if (statuscode != 303 && ust == offline) { // Somebody is leaving enum { leave=0, kick, ban } how = leave; if (statuscode == 307) how = kick; else if (statuscode == 301) how = ban; // If this is a leave, check if it is ourself if (our_presence) { buddy_setinsideroom(room_elt->data, FALSE); buddy_setnickname(room_elt->data, NULL); buddy_del_all_resources(room_elt->data); buddy_settopic(room_elt->data, NULL); scr_update_chat_status(FALSE); update_roster = TRUE; } // The message depends on _who_ left, and _how_ if (how) { gchar *mbuf_end; gchar *reason_msg = NULL; // Forced leave if (actorjid) { mbuf_end = g_strdup_printf("%s from %s by <%s>.", (how == ban ? "banned" : "kicked"), roomjid, actorjid); } else { mbuf_end = g_strdup_printf("%s from %s.", (how == ban ? "banned" : "kicked"), roomjid); } if (reason) reason_msg = g_strdup_printf("\nReason: %s", reason); if (our_presence) mbuf = g_strdup_printf("You have been %s%s", mbuf_end, reason_msg ? reason_msg : ""); else mbuf = g_strdup_printf("%s has been %s%s", rname, mbuf_end, reason_msg ? reason_msg : ""); g_free(reason_msg); g_free(mbuf_end); } else { // Natural leave if (our_presence) { LmMessageNode *destroynode = lm_message_node_find_child(xmldata, "destroy"); if (destroynode) { reason = lm_message_node_get_child_value(destroynode, "reason"); if (reason && *reason) { mbuf = g_strdup_printf("You have left %s, " "the room has been destroyed: %s", roomjid, reason); } else { mbuf = g_strdup_printf("You have left %s, " "the room has been destroyed", roomjid); } } else { mbuf = g_strdup_printf("You have left %s", roomjid); } } else { if (ust != offline) { // This can happen when a network failure occurs, // this isn't an official leave but the user isn't there anymore. mbuf = g_strdup_printf("%s has disappeared!", rname); ust = offline; } else { if (ustmsg) mbuf = g_strdup_printf("%s has left: %s", rname, ustmsg); else mbuf = g_strdup_printf("%s has left", rname); } } } // Display the mbuf message if we're concerned // or if the print_status isn't set to none. if (our_presence || printstatus != status_none) { msgflags = HBB_PREFIX_INFO; flagjoins = buddy_getflagjoins(room_elt->data); if (flagjoins == flagjoins_default && settings_opt_get_int("muc_flag_joins") == 2) flagjoins = flagjoins_all; if (!our_presence && flagjoins != flagjoins_all) msgflags |= HBB_PREFIX_NOFLAG; //silent message if someone else joins, and we care about noone scr_WriteIncomingMessage(roomjid, mbuf, usttime, msgflags, 0); } if (log_muc_conf) hlog_write_message(roomjid, 0, -1, mbuf); if (our_presence) { scr_LogPrint(LPRINT_LOGNORM, "%s", mbuf); g_free(mbuf); return; } g_free(mbuf); } else { enum imstatus old_ust = buddy_getstatus(room_elt->data, rname); if (old_ust == offline && ust != offline) { // Somebody is joining new_member = muc_handle_join(room_elt, rname, roomjid, ournick, printstatus, usttime, log_muc_conf, autowhois, mbjid); } else { // This is a simple member status change if (printstatus == status_all && !nickchange) { const char *old_ustmsg = buddy_getstatusmsg(room_elt->data, rname); if (old_ust != ust || g_strcmp0(old_ustmsg, ustmsg)) { mbuf = g_strdup_printf("Member status has changed: %s [%c] %s", rname, imstatus2char[ust], ((ustmsg) ? ustmsg : "")); scr_WriteIncomingMessage(roomjid, mbuf, usttime, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); g_free(mbuf); } } } } // Sanity check, shouldn't happen... if (!rname) return; // Update room member status roster_setstatus(roomjid, rname, bpprio, ust, ustmsg, usttime, mbrole, mbaffil, mbjid); if (new_member && autowhois == autowhois_on) { cmd_room_whois(room_elt->data, rname, FALSE); } scr_draw_roster(); } void roompresence(gpointer room, void *presencedata) { const char *bjid; const char *nickname; char *to; struct T_presence *pres = presencedata; if (!buddy_getinsideroom(room)) return; bjid = buddy_getjid(room); if (!bjid) return; nickname = buddy_getnickname(room); if (!nickname) return; to = g_strdup_printf("%s/%s", bjid, nickname); xmpp_setstatus(pres->st, to, pres->msg, TRUE); g_free(to); } // got_invite(from, to, reason, passwd, reply) // This function should be called when receiving an invitation from user // "from", to enter the room "to". Optional reason and room password can // be provided. void got_invite(const char* from, const char *to, const char* reason, const char* passwd, gboolean reply) { GString *sbuf; char *barejid; GSList *room_elt; sbuf = g_string_new(""); if (reason && reason[0]) { g_string_printf(sbuf, "Received an invitation to <%s>, from <%s>, reason: %s", to, from, reason); } else { g_string_printf(sbuf, "Received an invitation to <%s>, from <%s>", to, from); } barejid = jidtodisp(from); scr_WriteIncomingMessage(barejid, sbuf->str, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", sbuf->str); { // remove any equal older invites GSList *iel = invitations; while (iel) { event_muc_invitation *invitation = iel->data; iel = iel -> next; if (!g_strcmp0(to, invitation->to) && !g_strcmp0(passwd, invitation->passwd)) { // found a previous invitation // We keep the old one, unless the current one is better and allows us // to send a reply. if (!reply || invitation->reply) { g_free(barejid); return; } scr_LogPrint(LPRINT_DEBUG, "Destroying previous invitation event %s.", invitation->evid); evs_del(invitation->evid); } } } { // create event const char *id; char *desc = g_strdup_printf("<%s> invites you to %s", from, to); event_muc_invitation *invitation; invitation = g_new(event_muc_invitation, 1); invitation->to = g_strdup(to); invitation->from = g_strdup(from); invitation->passwd = g_strdup(passwd); invitation->reason = g_strdup(reason); invitation->reply = reply; invitation->evid = NULL; invitations = g_slist_append(invitations, invitation); id = evs_new(desc, NULL, 0, evscallback_invitation, invitation, (GDestroyNotify)destroy_event_muc_invitation); g_free(desc); if (id) { invitation->evid = g_strdup(id); g_string_printf(sbuf, "Please use /event %s accept|reject", id); } else g_string_printf(sbuf, "Unable to create a new event!"); } scr_WriteIncomingMessage(barejid, sbuf->str, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", sbuf->str); g_string_free(sbuf, TRUE); g_free(barejid); // Make sure the MUC room barejid is a room in the roster barejid = jidtodisp(to); room_elt = roster_find(barejid, jidsearch, 0); if (room_elt) buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); g_free(barejid); } // Specific MUC message handling (for example invitation processing) void got_muc_message(const char *from, LmMessageNode *x, time_t timestamp) { LmMessageNode *node; // invitation node = lm_message_node_get_child(x, "invite"); if (node) { const char *invite_from; const char *reason = NULL; const char *password = NULL; invite_from = lm_message_node_get_attribute(node, "from"); reason = lm_message_node_get_child_value(node, "reason"); password = lm_message_node_get_child_value(node, "password"); if (invite_from) got_invite(invite_from, from, reason, password, TRUE); } // declined invitation node = lm_message_node_get_child(x, "decline"); if (node) { const char *decline_from = lm_message_node_get_attribute(node, "from"); const char *reason = lm_message_node_get_child_value(node, "reason"); if (decline_from) { if (reason && reason[0]) scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation: %s.", from, reason); else scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation.", from); } } // status codes for (node = x -> children; node; node = node -> next) { if (!g_strcmp0(node -> name, "status")) { const char *codestr = lm_message_node_get_attribute(node, "code"); if (codestr) { const char *mesg = NULL; switch (atoi(codestr)) { // initial case 100: mesg = "The room is not anonymous."; break; case 101: mesg = "Your affilation has changed while absent."; break; case 102: mesg = "The room shows unavailable members."; break; case 103: mesg = "The room does not show unavailable members."; break; case 104: mesg = "The room configuration has changed."; break; case 170: mesg = "The room is logged."; break; case 171: mesg = "The room is not logged."; break; case 172: mesg = "The room is not anonymous."; break; case 173: mesg = "The room is semi-anonymous."; break; case 174: mesg = "The room is anonymous."; break; default: scr_LogPrint(LPRINT_DEBUG, "got_muc_message: Unknown MUC status code: %s.", codestr); break; } if (mesg) { scr_WriteIncomingMessage(from, mesg, timestamp, HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); if (settings_opt_get_int("log_muc_conf")) hlog_write_message(from, 0, -1, mesg); } } } } } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_muc.h000066400000000000000000000016101216603513500165610ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_MUC_H__ #define __MCABBER_XMPP_MUC_H__ 1 typedef struct { char *to; char *from; char *passwd; char *reason; char *evid; gboolean reply; } event_muc_invitation; void destroy_event_muc_invitation(event_muc_invitation *invitation); void roompresence(gpointer room, void *presencedata); void got_invite(const char* from, const char *to, const char* reason, const char* passwd, gboolean reply); void got_muc_message(const char *from, LmMessageNode *x, time_t timestamp); void handle_muc_presence(const char *from, LmMessageNode * xmldata, const char *roomjid, const char *rname, enum imstatus ust, const char *ustmsg, time_t usttime, char bpprio); #endif /* __MCABBER_XMPP_MUC_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_s10n.c000066400000000000000000000057621216603513500165650ustar00rootroot00000000000000/* * xmpp_s10n.c -- Jabber presence subscription handling * * Copyright (C) 2008-2009 Frank Zschockelt * Copyright (C) 2005-2009 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include "xmpp_helper.h" #include "events.h" #include "screen.h" #include "hbuf.h" #include "settings.h" // xmpp_send_s10n(jid, subtype) // Send a s10n message with the passed subtype void xmpp_send_s10n(const char *bjid, LmMessageSubType type) { LmMessage *x = lm_message_new_with_sub_type(bjid, LM_MESSAGE_TYPE_PRESENCE, type); lm_connection_send(lconnection, x, NULL); lm_message_unref(x); } gboolean evscallback_subscription(guint evcontext, const char *arg, gpointer userdata) { char *barejid = userdata; char *buf; // Sanity check if (G_UNLIKELY(!barejid)) { // Shouldn't happen, data should be set to the barejid. scr_LogPrint(LPRINT_LOGNORM, "Error in evs callback."); return FALSE; } if (evcontext == EVS_CONTEXT_TIMEOUT) { scr_LogPrint(LPRINT_LOGNORM, "Subscription event for %s timed out, cancelled.", barejid); return FALSE; } if (evcontext == EVS_CONTEXT_CANCEL) { scr_LogPrint(LPRINT_LOGNORM, "Subscription event for %s cancelled.", barejid); return FALSE; } if (!(evcontext == EVS_CONTEXT_REJECT || evcontext == EVS_CONTEXT_ACCEPT)) return FALSE; // Ok, let's work now. if (evcontext == EVS_CONTEXT_ACCEPT) { // Accept subscription request xmpp_send_s10n(barejid, LM_MESSAGE_SUB_TYPE_SUBSCRIBED); buf = g_strdup_printf("<%s> is allowed to receive your presence updates", barejid); } else { // Reject subscription request xmpp_send_s10n(barejid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); buf = g_strdup_printf("<%s> won't receive your presence updates", barejid); if (settings_opt_get_int("delete_on_reject")) { // Remove the buddy from the roster if there is no current subscription if (roster_getsubscription(barejid) == sub_none) xmpp_delbuddy(barejid); } } scr_WriteIncomingMessage(barejid, buf, 0, HBB_PREFIX_INFO, 0); scr_LogPrint(LPRINT_LOGNORM, "%s", buf); g_free(buf); return FALSE; } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabber/xmpp_s10n.h000066400000000000000000000004511216603513500165600ustar00rootroot00000000000000#ifndef __MCABBER_XMPP_S10N_H__ #define __MCABBER_XMPP_S10N_H__ 1 #include gboolean evscallback_subscription(guint evcontext, const char *arg, gpointer userdata); #endif /* __MCABBER_XMPP_S10N_H__ */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/mcabberrc.example000066400000000000000000000525661216603513500165020ustar00rootroot00000000000000# Sample ~/.mcabber/mcabberrc file # Note about this file syntax: # - Leading and trailing spaces are ignored. # - Empty lines and lines beginning with a '#' are ignored. # Please provide your Jabber (XMPP) identifier: set jid = yourusername@domain # If password is not given, it will be interactively asked for. # Note: if the password contains leading or trailing spaces, you must # enclose it with quotes: set password = " example password " #set password = yourpassword # You can provide a server name if you want mcabber to connect # to a specific server. #set server = your.jabber.server # To automatically append the server to the JID in say_to, use this option: #set default_server = jabber.org # If port is not given, mcabber will try to find it out. #set port = 5222 # If you don't know what a resource is, do not set it. # Set disable_random_resource to 1 if you don't want mcabber to add a random # suffix to the resource name. #set resource = mcabber #set disable_random_resource = 0 #set priority = 3 #set priority_away = 0 # Set 'ignore_self_presence' to 1 if you do not want to see your own # presence in your roster (default: 0). set ignore_self_presence = 1 # SSL/TLS options: # TLS is now regarded as the default encryption for connecting to jabber. # You can require TLS by setting tls to 1. If your jabber server # still doesn't support TLS, you can use the old-style SSL by setting # ssl to 1. It's not possible to use old-style SSL and TLS together. #set ssl = 0 set tls = 1 # Moreover, it's possible to check whether the fingerprint of the # ssl certificate matches ssl_fingerprint. # You can get the fingerprint of your server either with gnutls or openssl: # 1. gnutls-cli -p 5223 $your_server # 2. openssl s_client -connect $your_server:5223 | \ # openssl x509 -fingerprint -md5 -noout #set ssl_fingerprint = 97:5C:00:3F:1D:77:45:25:E2:C5:70:EC:83:C8:87:EE # Set ssl_ignore_checks to 1 to disable all certificate checks except the # fingerprint check. #set ssl_ignore_checks = 0 # PGP support # Set pgp to 1 to enable OpenPGP. # To sign outgoing messages, select your private key id with # the pgp_private_key option. You cannot change these options once # mcabber is running. # Note: you can get the Key Id with gpg: "gpg --list-keys --keyid-format long" #set pgp = 0 #set pgp_private_key = "C9940A9BB0B92210" # # You can set your PGP passhrase here, although it's NOT advised. #set pgp_passphrase = "PGPpassword" # # If you don't like the default number of passphrase retries (2), you # can change it here. If this number is < 0, mcabber will keep asking # until the passphrase is good. #set pgp_passphrase_retries = 2 # Conference nickname # This nickname is used when joining a room, when no nick is explicitly # specified by the user. Note that when the nickname option is not set, # the jid variable can be used. #set nickname = Abitbol # Proxy # mcabber can use a proxy if it supports the CONNECT method # The proxy_user/proxy_pass variables are optional. #set proxy_host = "proxy-hostname" #set proxy_port = 3128 #set proxy_user = "username" #set proxy_pass = "password" # Keepalive # If you need a ping/keepalive to leave your connection open, you # can use the pinginterval. Setting this option to 0 disables the ping. # Default value is 40 seconds. #set pinginterval = 40 # Language # Help files have been translated into a few languages. # You can set lang to a semicolon separated list of the following # values: en, cs, de, fr, it, nl, pl, ru, uk. If you omit this, # mcabber will try to autodetect it from your locale, with fallback # to en. # You also can specify a list of directories, where help is located, # for example, if your mcabber is installed with another prefix than # your modules. # This may be convenient to print help not into the status buffer, but into # currently opened buffer. For that set help_to_current option. #set lang = en #set help_dirs = "/usr/share/mcabber/help;~/share/mcabber/help" #set help_to_current = 0 # Aspell # If your mcabber has been built with Aspell support, you can enable spell # checking with the following options (you can't change them once mcabber is # running). #set spell_enable = 1 #set spell_lang = en_US #set spell_encoding = iso8859-1 #set spell_encoding = UTF-8 # History # Number of lines to remember for the command line history # (default: 0, unlimited). set cmdhistory_lines = 250 # You can set up a mask to filter buddies and display them according to # their status. The mask should contain the shortcut letters of the # status you want to see ([o]nline, [f]ree_for_chat, [d]o_not_disturb, # [n]ot_available, [a]way, [_]offline). # For example, to display everybody the filter should be "ofdna_" (default). # To display only the connected buddies, use "ofdna". # Please note that this option is only used at startup (once mcabber is # running you can use "/roster display"). #set roster_display_filter = ofdna_ # By default, mcabber adds a leading space before each buddy in the roster. You # can remove it to gain a little space. #set roster_no_leading_space = 0 # By default command line completion is case-sensitive; this can be changed # by setting the option 'completion_ignore_case' to 1. #set completion_ignore_case = 0 # Typing notifications, Chat States, Events (XEP-22/85) # Set disable_chatstates to 1 if you don't want to use typing notifications. # Note: changing this option once mcabber is running has no effect. #set disable_chatstates = 0 # History logging # You can save the messages history: set logging = 1 # Set 'logging_ignore_status' to 1 if you do not want to save status changes # (and status messages) to the log files (default: 0). # You can load (read) the messages history: set load_logs = 1 # If you enable load_logs, you can use the 'max_history_age' setting below. # Default logging directory (logging_dir) is $HOME/.mcabber/histo/ # Defaults for logging, load_logs are 0 (disabled) # Note: the logging directory must exist if you enable logging, mcabber # will not create it. # Note: these options, except 'max_history_age' and 'max_history_blocks', # are used at startup time. #set logging = 1 #set load_logs = 1 #set logging_dir = ~/.mcabber/histo/ #set logging_ignore_status = 1 # Set log_muc_conf to 1 to enable MUC chatrooms logging (default = 0) #set log_muc_conf = 1 # Set load_muc_logs to 1 to read MUC chatrooms logs (default = 0). These # logs will be displayed in the buffer window _before_ any history received # from the server. #set load_muc_logs = 0 # When load_logs (or load_muc_logs) is enabled, you can specify a maximum # number of history days to load into memory with max_history_age. # Default = 0 (disabled -- everything is loaded) # Note: this option is only used when reading history files, not later. #set max_history_age = 0 # mcabber can store the list of unread messages in a state file, # so that the message flags are set back at next startup. # Note that 'logging' must be enabled for this feature to work. #set statefile = ~/.mcabber/mcabber.state # You can specify a maximum number of data blocks per buffer (1 block contains # about 8kB). The default is 0 (unlimited). If set, this value must be > 2. set max_history_blocks = 8 # IQ settings # Set iq_version_hide_os to 1 if you do not want to allow people to retrieve # your OS version. #set iq_version_hide_os = 0 # # Set iq_last_disable to 1 if you want to disable response to jabber:iq:last # queries (XEP-0012). Set iq_last_disable_when_notavail to 1 if you want # to disable Last Activity reports only when the not-available status is set. # (Default is 0 for both options) #set iq_last_disable = 0 #set iq_last_disable_when_notavail = 1 # # Set iq_hide_requests to 1 if you don't want received IQ requests to be # displayed in the status window (default: 0). #set iq_hide_requests = 1 # Modules # If mcabber is built with modules support, you can specify the path # to the directory where your modules reside. Though, default compiled-in # value should be appropriate. #set modules_dir = /usr/lib/mcabber/ # Beep # Set beep_on_message to 1 if you want mcabber to beep when receiving # a new message (except in chatrooms). If you want a more sophisticated # system (e.g. play a sound), have a look at 'events_command' below. #set beep_on_message = 0 # External command for events # You can specify a script or process to be launched when an event occurs. # Set 'events_ignore_active_window' to 1 if you don't want the script to # be run for a message to the current active window (default: 0). # # If 'event_log_files' is set, a file is created and contains the body of # the message (incoming messages only); the file name is the last parameter. # If you enable this, you can specify the directory mcabber will use to # create these messages with the 'event_log_dir' variable (default is the # system temp dir, or MCABBERTMPDIR environment variable). Please note # that mcabber won't delete these files, it's your script's job. # # The command is called the following way: # $events_command MSG IN jabber@id [file] (when receiving a message) # $events_command MSG OUT jabber@id (when sending a message) # $events_command MSG MUC room_id [file] (when receiving a MUC message) # $events_command STATUS X jabber@id (new buddy status is X) # $events_command UNREAD "N x y z" (number of unread buddy buffers) # (x=attention y=muc unread buffers z=muc unread buffers with attention sign) # See sample script in contrib/ directory. #set events_command = ~/.mcabber/eventcmd # #set events_ignore_active_window = 0 # #set event_log_files = 0 #set event_log_dir = ~/.mcabber/event_files # If you set 'eventcmd_use_nickname' to 1, mcabber will pass the nickname # (if it is defined) to the event script instead of the JID (default: 0). #set eventcmd_use_nickname = 0 # External command status check # You can request mcabber to inspect exit status value after each # events_command. If this option is set, mcabber will beep if the # exit value is 2. #set eventcmd_checkstatus = 0 # Internal hooks # You can ask mcabber to execute an internal command when a special event # occurs (for example when it connects to the server). # # 'hook-post-connect' is executed when mcabber has connected to the server # and the roster has been received. #set hook-post-connect = status dnd # # 'hook-pre-disconnect' is executed just before mcabber disconnects from # the server. #set hook-pre-disconnect = say_to foo@bar Goodbye! # FIFO # mcabber can create a FIFO named pipe and listen to this pipe for commands. # Don't forget to load the FIFO module if you plan to use this feature! # Default: disabled. # Set 'fifo_hide_commands' to 1 if you don't want to see the FIFO commands # in the log window (they will still be written to the tracelog file). # When FIFO is configured, you can turn it off and on in real time with # the 'fifo_ignore' option (default: 0). When set to 1, the FIFO input is # still read but it is discarded. #set fifo_name = ~/.mcabber/mcabber.fifo #set fifo_hide_commands = 0 #set fifo_ignore = 0 # #module load fifo # URL extractor # Set 'url_regex' to a regular expression matching urls. If it matches an # url in an incoming messages, it'll print it to the log window. # Don't forget to load the urlregex module if you plan to use this feature! #set url_regex = "(((https?|ftps?|nntp)://)|www[.][-a-z0-9.]+|(mailto:|news:))(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#[:alnum:]])+" # #module load urlregex # Traces logging # If you want advanced traces, please specify a file and a level here. # There are currently 4 tracelog levels: # lvl 1: most events of the log window are written to the file # lvl 2: Loudmouth verbose logging # lvl 3: debug logging (XML, etc.) # lvl 4: noisy debug logging (Loudmouth parser...) # Default is level 0, no trace logging #set tracelog_level = 1 #set tracelog_file = ~/.mcabber/mcabber.log # Set the auto-away timeout, in seconds. If set to a value >0, # mcabber will change your status to away if no real activity is detected # (command, message, move in the buddylist...). Note: auto-away only changes # the status when it is "available" (online) or "free_for_chat". # See 'message_autoaway' below. #set autoaway = 0 # Message blocking # Set 'block_unsubscribed' to 1 if you want to block (drop) incoming # messages from people you haven't authorized. (default: 0) #set block_unsubscribed = 0 # # Set 'delete_on_reject' to 1 if you want to delete buddies from your # roster when you reject their subscription request. (default: 0) # (See documentation for /event) # The buddy is actually deleted only if there is no other subscription, # so for example if you are subscribed to this buddy's presence updates it # won't be deleted. #set delete_on_reject = 0 # MUC # Set 'muc_flag_joins' to 1 if you want the MUC rooms to be flagged in # the roster when somebody joins a room. Set it to 2 if you want a flag # for leaves too. #set muc_flag_joins = 0 # Set 'muc_print_status' to see status changes in MUC rooms: # 1: (none) do not display joining/leaving members # 2: (in_and_out) display joining/leaving members # 3: (all) display joining/leaving members and member status changes # (default: in_and_out) #set muc_print_status = 2 # Set 'muc_auto_whois' to 1 if you want to call /room whois each time # somebody joins a room. (default: 0) #set muc_auto_whois = 0 # Set 'muc_print_jid' to see real jid in non-anonynmous room when somebody # joins. This setting will be ignored when auto_whois is enabled. # 0: only nick (don't print jid even if available) # 1: nick and bare jid # 2: nick and full jid with resource #set muc_print_jid = 1 # # Set 'muc_disable_nick_hl' to 1 if you don't want mcabber to color lines # containing your nickname in a MUC room. #set muc_disable_nick_hl = 0 # # Set 'muc_completion_suffix' if you want mcabber to append a string to # suggested nicknames (only at the beginning of a line), like ":" or ",". # (Default: none) #set muc_completion_suffix = ": " # # Set 'muc_bookmark_autoupdate' to 1 if you want changes made to room options # be stored automatically on server. Otherwise you'll have to manually use # command /room bookmark, or changes will not be permanent (for session only). # This setting will not add any bookmark, only update already existing ones. #set muc_bookmark_autoupdate = 0 # Status messages # The 'message' value will override all others, take care! #set message = Unique message status #set message_avail = I'm available #set message_free = I'm free for chat #set message_dnd = Please do not disturb #set message_notavail = I'm not available #set message_away = I'm away # # The auto-away message is only used when 'autoaway' is set. The previous # message will be restored when leaving auto-away status. If this message # isn't defined, the status message will stay unchanged. set message_autoaway = Auto-away (idle) # Escape timeout delay (ESCDELAY) # The ESCDELAY variable specifies the time, in milliseconds, for which # the ncurses interface will await a character sequence. # The default is 1000 (1 second). # If you want mcabber to react faster after hitting Escape, you can lower # this value by setting the ESCDELAY environment variable or setting the # 'escdelay' option. set escdelay = 50 # Colors # Colors are: black, red, green, yellow, blue, magenta, cyan, white # For text colors (i.e. not background and bg* colors) you can also use # the "bright" prefix to get a bright/bold color. Example: brightblue # You can use the "default" color, too (i.e. for transparent background). # If your terminal supports 256 colors, you can use the color number # directly (16-255). # # Have a look at the contrib/themes/ directory to see some sample # color settings. # # background: background color of the chat window and the log window # general: text color in the chat window and the log window # info: text color in the chat window for info messages # msgin: text color in the chat window for incoming messages # msgout: text color in the chat window for outgoing messages # msghl: text color in the chat window for highlighted messages (MUC) # bgstatus: background color of the status lines # status: text color of the status lines # log: text color in the log window # roster: text color of the roster (buddylist) normal items # bgrostersel: background color of the selected roster item # rostersel: text color of the selected roster item # rosterselmsg:text color of the selected roster item, if there is a new msg # rosternewmsg: text color of items with unread messages # #set color_background = black #set color_general = white #set color_info = white #set color_msgin = white #set color_msgout = cyan #set color_msghl = yellow #set color_bgstatus = blue #set color_status = white #set color_log = white #set color_roster = green #set color_bgrostersel = cyan #set color_rostersel = blue #set color_rosterselmsg = red #set color_rosternewmsg = red #set color_readmark = red # You can color roster items by their status and JID. For example, to have # all roster items white, just all contacts from jabber.org that are away, # not available or do not disturb yellow, you do this: # #color roster * * white #color roster adn *@jabber.org yellow # You can let mcabber color nicks in MUC. # These colors will by used automatically: #set nick_colors = red green blue # This turns coloring of all mucs on: #color muc * on # # If you want someone's nick to be the same all the time: #color mucnick my_friend yellow # Style # Note: the 'log_win_height' and 'roster_width' values below can be set # in real time when mcabber is running. Refresh the screen (Ctrl-l) to # use the new values. # # Log window height (minimum 1, default 5) #set log_win_height = 5 # Buddylist window width (minimum 2, default 24) #set roster_width=24 # # The options 'log_win_on_top' and 'roster_win_on_right' can change the # position of the log window (top/bottom) and the position of the roster # (left/right). #set log_win_on_top = 0 #set roster_win_on_right = 0 # # By default, the displayed name of a contact in the roster window will # be the JID if no name has been specified. You can use the following # option if you only want to see the username part. #set roster_hide_domain = 0 # # Buddy name format (in status window): # - 0: (default) "" # - 1: "name " (name is omitted if same as the JID) # - 2: "name/resource" (if the name is the same as the JID, use ) # - 3: "name" (if the name is the same as the JID, use ) #set buddy_format = 2 # # Time format: # - 0: (default) Date and time # - 1: Time only # - 2: None #set time_prefix = 0 # # When a contact sends "/me ", mcabber displays "*user ", where user # is the local part of the contact's JID. # If you want mcabber to display the complete bare JID (user@server.com), # set 'buddy_me_fulljid' to 1 (default: 0) #set buddy_me_fulljid = 1 # # Display the status changes in the log window (default: 0, never) # Set 'log_display_presence' to 1 to enable. #set log_display_presence = 0 # # Display the status changes in the chat buffers (default: 0, never) # Values: 0: never 1: only connect/disconnect 2: all #set show_status_in_buffer = 1 # # Set 'log_display_sender' to 1 to display the message sender's JID in the # log window (default: 0, no) #set log_display_sender = 0 # # Set 'info' to anything you'd like to see in your lower status line. #set info = woot # # Automatic locking on buddy resource that messages are coming from. # Useful when your buddies are chatting from their non-highest priority # resources, forcing you to use /say_to command. #set roster_autolock_resource = 1 # Contacts PGP information # You can provide a PGP key to be used for a given Jabber user, or # disable PGP on a per-account basis. # If you provide a KeyId for a contact, it will be compared to the key the # contact uses to sign their presence/messages and it will be used for # all outgoing encrypted messages (that is, the contact signature key will # be ignored). # Please note that the key must match exactly the id seen with /info. #pgp disable foo@bar.org #pgp setkey bar@foo.net C9940A9BB0B92210 # OTR (Off-The-Record messaging) support # (Only available if mcabber is built with OTR support) # Set otr to 1 to enable OTR support. # You cannot change this option once mcabber is running. #set otr = 0 # # OTR directory # You can specify the OTR directory with the otr_dir option # (default = ~/.mcabber/otr/). #set otr_dir = "~/.mcabber/otr/" # # You can set OTR policies from the configuration file (use /help otrpolicy # for the details). #otrpolicy default manual # Entity Caps cache # You can provide a directory where mcabber will store an offline cache # of other clients' capabilities. This will likely reduce network overhead # on start of new session. #set caps_directory = "~/.mcabber/caps" # Aliases alias me = say /me alias online = status online alias away = status away alias dnd = status dnd alias notavail = status notavail #alias names = room names #alias topic = room topic # Set use_mouse to 1 to map mouse buttons like keycodes. #set use_mouse = 1 # Key bindings # Ctrl-q (17) bound to /roster unread_next bind 17 = roster unread_next # Ctrl-x (24) bound to /roster alternate bind 24 = roster alternate # F5 (269) bound to /roster toggle_offline (centericq-like, IIRC) bind 269 = roster toggle_offline # F12 (276) bound to /roster toggle bind 276 = roster toggle # Ctrl-Up/Ctrl-Down bound to /buffer up/down (like Ctrl-p/Ctrl-n) bind 521 = buffer up bind 514 = buffer down # Sample alias to join mcabber channel with "/jmc" #alias jmc = room join mcabber@conf.lilotux.net mcabber-0.10.2/missing000077500000000000000000000241521216603513500145720ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, 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 run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mcabber-0.10.2/modules/000077500000000000000000000000001216603513500146375ustar00rootroot00000000000000mcabber-0.10.2/modules/Makefile.am000066400000000000000000000000451216603513500166720ustar00rootroot00000000000000SUBDIRS = beep xttitle fifo urlregex mcabber-0.10.2/modules/Makefile.in000066400000000000000000000440601216603513500167100ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = modules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = beep xttitle fifo urlregex all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcabber-0.10.2/modules/beep/000077500000000000000000000000001216603513500155525ustar00rootroot00000000000000mcabber-0.10.2/modules/beep/Makefile.am000066400000000000000000000005641216603513500176130ustar00rootroot00000000000000 if INSTALL_HEADERS pkglib_LTLIBRARIES = libbeep.la libbeep_la_SOURCES = beep.c libbeep_la_LDFLAGS = -module -avoid-version -shared LDADD = $(GLIB_LIBS) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ $(ENCHANT_CFLAGS) endif mcabber-0.10.2/modules/beep/Makefile.in000066400000000000000000000453611216603513500176300ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = modules/beep DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libbeep_la_LIBADD = am__libbeep_la_SOURCES_DIST = beep.c @INSTALL_HEADERS_TRUE@am_libbeep_la_OBJECTS = beep.lo libbeep_la_OBJECTS = $(am_libbeep_la_OBJECTS) libbeep_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libbeep_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_HEADERS_TRUE@am_libbeep_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/mcabber -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libbeep_la_SOURCES) DIST_SOURCES = $(am__libbeep_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @INSTALL_HEADERS_TRUE@pkglib_LTLIBRARIES = libbeep.la @INSTALL_HEADERS_TRUE@libbeep_la_SOURCES = beep.c @INSTALL_HEADERS_TRUE@libbeep_la_LDFLAGS = -module -avoid-version -shared @INSTALL_HEADERS_TRUE@LDADD = $(GLIB_LIBS) @INSTALL_HEADERS_TRUE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ @INSTALL_HEADERS_TRUE@ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(ENCHANT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/beep/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/beep/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libbeep.la: $(libbeep_la_OBJECTS) $(libbeep_la_DEPENDENCIES) $(EXTRA_libbeep_la_DEPENDENCIES) $(libbeep_la_LINK) $(am_libbeep_la_rpath) $(libbeep_la_OBJECTS) $(libbeep_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/beep.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: mcabber-0.10.2/modules/beep/beep.c000066400000000000000000000073601216603513500166370ustar00rootroot00000000000000/* * Module "beep" -- Beep on all incoming messages * * Copyright 2009 Myhailo Danylenko * This file is part of mcabber module writing howto examples. * * This module is free software; you can redistribute it and/or modify * it under the terms of the 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 . */ #include #include #include #include #include #include #include #include #include static void beep_init (void); static void beep_uninit (void); /* Module description */ module_info_t info_beep = { .branch = MCABBER_BRANCH, .api = MCABBER_API_VERSION, .version = MCABBER_VERSION, .description = "Simple beeper module\n" " Recognizes option beep_enable\n" " Provides command /beep", .requires = NULL, .init = beep_init, .uninit = beep_uninit, .next = NULL, }; static guint beep_cid = 0; /* Command completion category id */ static gpointer beep_cmid = 0; /* Command id */ static guint beep_hid = 0; /* Hook handler id */ /* Event handler */ static guint beep_hh(const gchar *hookname, hk_arg_t *args, gpointer userdata) { /* Check if beeping is enabled */ if (settings_opt_get_int("beep_enable")) scr_beep(); /* *BEEP*! */ /* We're done, let the other handlers do their job! */ return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } /* beep command handler */ static void do_beep(char *args) { /* Check arguments, and if recognized, * set mcabber option accordingly */ if (!strcmp(args, "enable") || !strcmp(args, "on") || !strcmp(args, "yes") || !strcmp(args, "1")) settings_set(SETTINGS_TYPE_OPTION, "beep_enable", "1"); else if (!strcmp(args, "disable") || !strcmp(args, "off") || !strcmp(args, "no") || !strcmp(args, "0")) settings_set(SETTINGS_TYPE_OPTION, "beep_enable", "0"); /* Output current state, either if state is * changed or if argument is not recognized */ if (settings_opt_get_int("beep_enable")) scr_log_print(LPRINT_NORMAL, "Beep on messages is enabled"); else scr_log_print(LPRINT_NORMAL, "Beep on messages is disabled"); } /* Initialization */ static void beep_init(void) { /* Create completions */ beep_cid = compl_new_category(COMPL_FLAGS_SORT); if (beep_cid) { compl_add_category_word(beep_cid, "enable"); compl_add_category_word(beep_cid, "disable"); } /* Add command */ beep_cmid = cmd_add("beep", "", beep_cid, 0, do_beep, NULL); /* Add handler * We are only interested in incoming message events */ beep_hid = hk_add_handler(beep_hh, HOOK_POST_MESSAGE_IN, G_PRIORITY_DEFAULT_IDLE, NULL); } /* Uninitialization */ static void beep_uninit(void) { /* Unregister event handler */ hk_del_handler(HOOK_POST_MESSAGE_IN, beep_hid); /* Unregister command */ cmd_del(beep_cmid); /* Give back completion handle */ if (beep_cid) compl_del_category(beep_cid); } /* The End */ /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/modules/fifo/000077500000000000000000000000001216603513500155625ustar00rootroot00000000000000mcabber-0.10.2/modules/fifo/Makefile.am000066400000000000000000000005721216603513500176220ustar00rootroot00000000000000 if INSTALL_HEADERS pkglib_LTLIBRARIES = libfifo.la libfifo_la_SOURCES = fifo_module.c $(top_srcdir)/mcabber/fifo.c $(top_srcdir)/mcabber/fifo.h libfifo_la_LDFLAGS = -module -avoid-version -shared LDADD = $(GLIB_LIBS) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ $(ENCHANT_CFLAGS) endif mcabber-0.10.2/modules/fifo/Makefile.in000066400000000000000000000475121216603513500176400ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = modules/fifo DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libfifo_la_LIBADD = am__libfifo_la_SOURCES_DIST = fifo_module.c \ $(top_srcdir)/mcabber/fifo.c $(top_srcdir)/mcabber/fifo.h @INSTALL_HEADERS_TRUE@am_libfifo_la_OBJECTS = fifo_module.lo fifo.lo libfifo_la_OBJECTS = $(am_libfifo_la_OBJECTS) libfifo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libfifo_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_HEADERS_TRUE@am_libfifo_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/mcabber -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libfifo_la_SOURCES) DIST_SOURCES = $(am__libfifo_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @INSTALL_HEADERS_TRUE@pkglib_LTLIBRARIES = libfifo.la @INSTALL_HEADERS_TRUE@libfifo_la_SOURCES = fifo_module.c $(top_srcdir)/mcabber/fifo.c $(top_srcdir)/mcabber/fifo.h @INSTALL_HEADERS_TRUE@libfifo_la_LDFLAGS = -module -avoid-version -shared @INSTALL_HEADERS_TRUE@LDADD = $(GLIB_LIBS) @INSTALL_HEADERS_TRUE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ @INSTALL_HEADERS_TRUE@ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(ENCHANT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/fifo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/fifo/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfifo.la: $(libfifo_la_OBJECTS) $(libfifo_la_DEPENDENCIES) $(EXTRA_libfifo_la_DEPENDENCIES) $(libfifo_la_LINK) $(am_libfifo_la_rpath) $(libfifo_la_OBJECTS) $(libfifo_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifo_module.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< fifo.lo: $(top_srcdir)/mcabber/fifo.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fifo.lo -MD -MP -MF $(DEPDIR)/fifo.Tpo -c -o fifo.lo `test -f '$(top_srcdir)/mcabber/fifo.c' || echo '$(srcdir)/'`$(top_srcdir)/mcabber/fifo.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fifo.Tpo $(DEPDIR)/fifo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/mcabber/fifo.c' object='fifo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fifo.lo `test -f '$(top_srcdir)/mcabber/fifo.c' || echo '$(srcdir)/'`$(top_srcdir)/mcabber/fifo.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: mcabber-0.10.2/modules/fifo/fifo_module.c000066400000000000000000000027751216603513500202310ustar00rootroot00000000000000 /* Copyright 2009,2010 Myhailo Danylenko * * This file is part of mcabber * * mcabber is free software: you can redistribute it and/or modify * it under the terms of the 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 . */ #include #include #include #include #include module_info_t info_fifo = { .branch = MCABBER_BRANCH, .api = MCABBER_API_VERSION, .version = MCABBER_VERSION, .requires = NULL, .init = NULL, .uninit = NULL, .description = "Reads and executes command from FIFO pipe\n" "Recognizes options fifo_name (required), fifo_hide_commands and fifo_ignore.", .next = NULL, }; gchar *g_module_check_init(GModule *module) { if (fifo_init() == -1) return "FIFO initialization failed"; else return NULL; } void g_module_unload(GModule *module) { fifo_deinit(); } /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ mcabber-0.10.2/modules/urlregex/000077500000000000000000000000001216603513500164745ustar00rootroot00000000000000mcabber-0.10.2/modules/urlregex/Makefile.am000066400000000000000000000006041216603513500205300ustar00rootroot00000000000000 if INSTALL_HEADERS pkglib_LTLIBRARIES = liburlregex.la liburlregex_la_SOURCES = urlregex.c liburlregex_la_LDFLAGS = -module -avoid-version -shared LDADD = $(GLIB_LIBS) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ $(ENCHANT_CFLAGS) endif mcabber-0.10.2/modules/urlregex/Makefile.in000066400000000000000000000455411216603513500205520ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = modules/urlregex DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) liburlregex_la_LIBADD = am__liburlregex_la_SOURCES_DIST = urlregex.c @INSTALL_HEADERS_TRUE@am_liburlregex_la_OBJECTS = urlregex.lo liburlregex_la_OBJECTS = $(am_liburlregex_la_OBJECTS) liburlregex_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(liburlregex_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_HEADERS_TRUE@am_liburlregex_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/mcabber -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(liburlregex_la_SOURCES) DIST_SOURCES = $(am__liburlregex_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @INSTALL_HEADERS_TRUE@pkglib_LTLIBRARIES = liburlregex.la @INSTALL_HEADERS_TRUE@liburlregex_la_SOURCES = urlregex.c @INSTALL_HEADERS_TRUE@liburlregex_la_LDFLAGS = -module -avoid-version -shared @INSTALL_HEADERS_TRUE@LDADD = $(GLIB_LIBS) @INSTALL_HEADERS_TRUE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ @INSTALL_HEADERS_TRUE@ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(ENCHANT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/urlregex/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/urlregex/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done liburlregex.la: $(liburlregex_la_OBJECTS) $(liburlregex_la_DEPENDENCIES) $(EXTRA_liburlregex_la_DEPENDENCIES) $(liburlregex_la_LINK) $(am_liburlregex_la_rpath) $(liburlregex_la_OBJECTS) $(liburlregex_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlregex.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: mcabber-0.10.2/modules/urlregex/urlregex.c000066400000000000000000000070141216603513500204770ustar00rootroot00000000000000/* * Module "urlregex" -- Display received URL in the log window * * Copyright 2011 Mikael Berthe * Copyright 2008 Frank Zschockelt * * This module is free software; you can redistribute it and/or modify * it under the terms of the 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 . */ #include #include #include #include #include #include #include #include #include static void urlregex_init (void); static void urlregex_uninit (void); /* Module description */ module_info_t info_urlregex = { .branch = MCABBER_BRANCH, .api = MCABBER_API_VERSION, .version = MCABBER_VERSION, .description = "Simple URL extractor\n" " Displays URL in the log window.", .requires = NULL, .init = urlregex_init, .uninit = urlregex_uninit, .next = NULL, }; static guint urlregex_hid = 0; /* Hook handler id */ #ifdef HAVE_GLIB_REGEX static GRegex *url_regex = NULL; #endif /* Helper function */ #ifdef HAVE_GLIB_REGEX static inline void scr_log_urls(const gchar *string) { GMatchInfo *match_info; g_regex_match_full(url_regex, string, -1, 0, 0, &match_info, NULL); while (g_match_info_matches(match_info)) { gchar *url = g_match_info_fetch(match_info, 0); scr_print_logwindow(url); g_free(url); g_match_info_next(match_info, NULL); } g_match_info_free(match_info); } #endif /* Event handler */ static guint urlregex_hh(const gchar *hookname, hk_arg_t *args, gpointer userdata) { #ifdef HAVE_GLIB_REGEX if (url_regex) { int i; const char *msg = NULL; for (i = 0; args[i].name; i++) { if (!strcmp(args[i].name, "message")) { msg = args[i].value; break; } } if (msg) scr_log_urls(msg); } #endif /* We're done, let the other handlers do their job! */ return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } /* Initialization */ static void urlregex_init(void) { if (settings_opt_get("url_regex")) { #ifdef HAVE_GLIB_REGEX url_regex = g_regex_new(settings_opt_get("url_regex"), G_REGEX_OPTIMIZE, 0, NULL); /* Add handler * We are only interested in incoming message events */ urlregex_hid = hk_add_handler(urlregex_hh, HOOK_POST_MESSAGE_IN, G_PRIORITY_DEFAULT_IDLE, NULL); #else scr_log_print(LPRINT_LOGNORM, "ERROR: Your glib version is too old, " "cannot use url_regex."); #endif // HAVE_GLIB_REGEX } } /* Uninitialization */ static void urlregex_uninit(void) { /* Unregister event handler */ hk_del_handler(HOOK_POST_MESSAGE_IN, urlregex_hid); #ifdef HAVE_GLIB_REGEX if (url_regex) { g_regex_unref(url_regex); url_regex = NULL; } #endif } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ mcabber-0.10.2/modules/xttitle/000077500000000000000000000000001216603513500163345ustar00rootroot00000000000000mcabber-0.10.2/modules/xttitle/Makefile.am000066400000000000000000000005241216603513500203710ustar00rootroot00000000000000 if INSTALL_HEADERS pkglib_LTLIBRARIES = libxttitle.la libxttitle_la_SOURCES = xttitle.c libxttitle_la_LDFLAGS = -module -avoid-version -shared LDADD = $(GLIB_LIBS) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) $(ENCHANT_CFLAGS) endif mcabber-0.10.2/modules/xttitle/Makefile.in000066400000000000000000000454041216603513500204100ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = modules/xttitle DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/curslib.m4 \ $(top_srcdir)/macros/define_dir.m4 \ $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/timezone.m4 \ $(top_srcdir)/macros/tm-gmtoff.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/mcabber/config.h \ $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libxttitle_la_LIBADD = am__libxttitle_la_SOURCES_DIST = xttitle.c @INSTALL_HEADERS_TRUE@am_libxttitle_la_OBJECTS = xttitle.lo libxttitle_la_OBJECTS = $(am_libxttitle_la_OBJECTS) libxttitle_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libxttitle_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_HEADERS_TRUE@am_libxttitle_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/mcabber -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libxttitle_la_SOURCES) DIST_SOURCES = $(am__libxttitle_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATA_DIR = @DATA_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@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ 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@ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@ LIBIDN_LIBS = @LIBIDN_LIBS@ LIBOBJS = @LIBOBJS@ LIBOTR_CFLAGS = @LIBOTR_CFLAGS@ LIBOTR_LIBS = @LIBOTR_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOUDMOUTH_CFLAGS = @LOUDMOUTH_CFLAGS@ LOUDMOUTH_LIBS = @LOUDMOUTH_LIBS@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKGLIB_DIR = @PKGLIB_DIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @INSTALL_HEADERS_TRUE@pkglib_LTLIBRARIES = libxttitle.la @INSTALL_HEADERS_TRUE@libxttitle_la_SOURCES = xttitle.c @INSTALL_HEADERS_TRUE@libxttitle_la_LDFLAGS = -module -avoid-version -shared @INSTALL_HEADERS_TRUE@LDADD = $(GLIB_LIBS) @INSTALL_HEADERS_TRUE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \ @INSTALL_HEADERS_TRUE@ $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \ @INSTALL_HEADERS_TRUE@ $(GPGME_CFLAGS) $(LIBOTR_CFLAGS) $(ENCHANT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/xttitle/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/xttitle/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libxttitle.la: $(libxttitle_la_OBJECTS) $(libxttitle_la_DEPENDENCIES) $(EXTRA_libxttitle_la_DEPENDENCIES) $(libxttitle_la_LINK) $(am_libxttitle_la_rpath) $(libxttitle_la_OBJECTS) $(libxttitle_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xttitle.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: mcabber-0.10.2/modules/xttitle/xttitle.c000066400000000000000000000076171216603513500202100ustar00rootroot00000000000000/* * Module "xttitle" -- Update X terminal title * * Copyright (C) 2010 Mikael Berthe * * The option 'xttitle_short_format' can be set to 1 to use a very * short terminal title. * * This module is free software; you can redistribute it and/or modify * it under the terms of the 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 . */ #include #include #include #include #include #include static void xttitle_init(void); static void xttitle_uninit(void); /* Module description */ module_info_t info_xttitle = { .branch = MCABBER_BRANCH, .api = MCABBER_API_VERSION, .version = MCABBER_VERSION, .description = "Show unread message count in X terminal title", .requires = NULL, .init = xttitle_init, .uninit = xttitle_uninit, .next = NULL, }; // Hook handler id static guint unread_list_hid; // Event handler for HOOK_UNREAD_LIST_CHANGE events static guint unread_list_hh(const gchar *hookname, hk_arg_t *args, gpointer userdata) { guint all_unread = 0; guint muc_unread = 0; guint muc_attention = 0; guint unread; // private message count static gchar buf[128]; // Note: We can add "attention" string later, but it isn't used // yet in mcabber... for ( ; args->name; args++) { if (!g_strcmp0(args->name, "unread")) { all_unread = atoi(args->value); } else if (!g_strcmp0(args->name, "muc_unread")) { muc_unread = atoi(args->value); } else if (!g_strcmp0(args->name, "muc_attention")) { muc_attention = atoi(args->value); } } // Let's not count the MUC unread buffers that don't have the attention // flag (that is, MUC buffer that have no highlighted messages). unread = all_unread - (muc_unread - muc_attention); // TODO: let the user use a format string, instead of hard-coded defaults... if (settings_opt_get_int("xttitle_short_format") == 1) { // Short title message if (!all_unread) snprintf(buf, sizeof(buf), "MCabber"); else if (unread == all_unread) snprintf(buf, sizeof(buf), "MCabber (%u)", unread); else snprintf(buf, sizeof(buf), "MCabber (%u/%u)", unread, all_unread); } else { // Long title message if (muc_unread) { snprintf(buf, sizeof(buf), "MCabber -- %u message%c (total:%u / MUC:%u)", unread, (unread > 1 ? 's' : ' '), all_unread, muc_unread); } else { if (unread) snprintf(buf, sizeof(buf), "MCabber -- %u message%c", unread, (unread > 1 ? 's' : ' ')); else snprintf(buf, sizeof(buf), "MCabber -- No message"); } } // Update the terminal title printf("\033]0;%s\007", buf); return HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } // Initialization static void xttitle_init(void) { // Add hook handler for unread message data unread_list_hid = hk_add_handler(unread_list_hh, HOOK_UNREAD_LIST_CHANGE, G_PRIORITY_DEFAULT_IDLE, NULL); // Default title printf("\033]0;MCabber\007"); } // Uninitialization static void xttitle_uninit(void) { // Unregister handler hk_del_handler(HOOK_UNREAD_LIST_CHANGE, unread_list_hid); // Reset title printf("\033]0;MCabber\007"); } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */